#include <VldRange.h>
Public Member Functions | |
| VldRange () | |
| VldRange (const Int_t detMask, const Int_t simMask, const VldTimeStamp &tstart, const VldTimeStamp &tend, const TString &source) | |
| virtual | ~VldRange () |
| const char * | AsString (Option_t *option="") const |
| Bool_t | IsCompatible (const VldContext &vldc) const |
| Bool_t | IsCompatible (const VldContext *vldc) const |
| Int_t | GetDetectorMask () const |
| Int_t | GetSimMask () const |
| VldTimeStamp | GetTimeStart () const |
| VldTimeStamp | GetTimeEnd () const |
| TString | GetDataSource () const |
| void | Print (Option_t *option="") const |
| Print to stdout. See AsString() for options. | |
| void | TrimTo (const VldRange &vldr) |
| void | SetTimeStart (const VldTimeStamp &tstart) |
| void | SetTimeEnd (const VldTimeStamp &tend) |
Protected Attributes | |
| Int_t | fDetectorMask |
| Int_t | fSimMask |
| or's of Detector::Detector_t | |
| VldTimeStamp | fTimeStart |
| or's of data/mc conditions | |
| VldTimeStamp | fTimeEnd |
| TString | fDataSource |
Created on: 2000.05.03
Definition at line 37 of file VldRange.h.
|
|
Definition at line 28 of file VldRange.cxx. 00029 : fDetectorMask(0), fSimMask(0), 00030 fTimeStart(), fTimeEnd(), fDataSource("unknown") 00031 { 00032 // Default constructor 00033 }
|
|
||||||||||||||||||||||||
|
Definition at line 35 of file VldRange.cxx. 00039 : fDetectorMask(detMask), fSimMask(simMask), 00040 fTimeStart(tstart), fTimeEnd(tend), fDataSource(source) 00041 { 00042 // normal constructor 00043 }
|
|
|
Definition at line 46 of file VldRange.cxx. 00047 {
00048 // delete all the owned sub-objects
00049
00050 }
|
|
|
Return the VldRange as a string Result is a pointer to a statically allocated string. User should copy this into their own buffer before calling this method again. option "a": give detector/simflag masks as alpha chars option "c": compact (single line) option "s": drop nsec part of times option "1": include only "start time" option "-": don't include "source" info Definition at line 53 of file VldRange.cxx. References VldTimeStamp::AsString(), fDetectorMask, fSimMask, fTimeEnd, fTimeStart, SimFlag::MaskToString(), and Detector::MaskToString(). Referenced by UgliGeometry::BuildAll(), CoilTools::CoilCurrentLimits(), DbiValidityRec::Fill(), Fill_MBSpill(), SpillServerMonFinder::FindClosestEntries(), UgliGeometry::GetZExtent(), DbiValidityRec::IsCompatible(), CoilTools::LocalQuery(), lootSpillFile(), LIPlexMaps::MakeCalAdcToPe(), LIPlexMaps::MakeCalMIPCalibration(), LIPlexMaps::MakeCalStripAtten(), LIPlexMaps::MakeCalStripToStrip(), Print(), UgliGeometry::Print(), Plexus::Print(), GeoGeometry::PrintHeader(), UgliGeometry::SetFrozen(), and NDSgateTimeLooter::Write(). 00054 {
00055 // Return the VldRange as a string
00056 //
00057 // Result is a pointer to a statically allocated string.
00058 // User should copy this into their own buffer before calling
00059 // this method again.
00060 //
00061 // option "a": give detector/simflag masks as alpha chars
00062 // option "c": compact (single line)
00063 // option "s": drop nsec part of times
00064 // option "1": include only "start time"
00065 // option "-": don't include "source" info
00066
00067 static char newstring[255] = " ";
00068
00069 TString opt = option;
00070 opt.ToLower();
00071
00072 Bool_t opt_a = opt.Contains("a");
00073 Bool_t opt_c = opt.Contains("c");
00074
00075 TString detbits;
00076 if (opt_a) {
00077 detbits = Detector::MaskToString(fDetectorMask);
00078 }
00079 else {
00080 sprintf(newstring,"det %#4.4x",fDetectorMask);
00081 detbits = newstring;
00082 }
00083
00084 TString simbits;
00085 if (opt_a) {
00086 simbits = SimFlag::MaskToString(fSimMask);
00087 }
00088 else {
00089 sprintf(newstring,"sim %#4.4x",fSimMask);
00090 simbits = newstring;
00091 }
00092
00093 // VldTimeStamp::AsString returns pointer to statically allocated string
00094 // one needs to copy this before calling it again in same function call
00095 static char timeopt[4] = "c ";
00096 timeopt[0] = (opt.Contains("s")?'s':'c');
00097 TString start_str = fTimeStart.AsString(timeopt);
00098 TString end_str;
00099 if ( ! opt.Contains("1")) {
00100 end_str = fTimeEnd.AsString(timeopt);
00101 if ( !opt_c ) end_str.Prepend("\n\t ");
00102 else end_str.Prepend(" ");
00103 }
00104 if ( ! opt_c ) start_str.Prepend("\n\t ");
00105
00106 TString source;
00107 if ( ! opt.Contains("-")) {
00108 source += (opt_c) ? " '" : "\n\t from source: ";
00109 source += fDataSource;
00110 source += (opt_c) ? "'" : "";
00111 }
00112
00113 sprintf(newstring,
00114 "|%s|%s|%s%s%s",
00115 (const char*)detbits,
00116 (const char*)simbits,
00117 (const char*)start_str,
00118 (const char*)end_str,
00119 (const char*)source);
00120
00121 return newstring;
00122 }
|
|
|
Definition at line 72 of file VldRange.h. Referenced by DbiBinaryFile::operator<<(), and DbiValidityRec::SetTimeWindow(). 00072 { return fDataSource; }
|
|
|
|
|
|
|
Compare VldContext with this VldRange to see if the the tagged set is compatible. Definition at line 151 of file VldRange.cxx. References IsCompatible(). 00152 {
00153 // compare VldContext with this VldRange to see if the
00154 // the tagged set is compatible
00155
00156 return IsCompatible(*vldc);
00157 }
|
|
|
Compare VldContext with this VldRange to see if the the tagged set is compatible. Definition at line 125 of file VldRange.cxx. References fDetectorMask, fSimMask, VldContext::GetDetector(), VldContext::GetSimFlag(), and VldContext::GetTimeStamp(). Referenced by BfldLoanPool::GetCache(), CoilTools::GetCoilState(), CoilTools::GetMagNear(), MCApplication::InitSnarl(), IsCompatible(), UgliGeometry::IsCompatible(), Plexus::IsCompatible(), GeoGeometry::IsCompatible(), DbiValidityRec::IsCompatible(), CoilTools::LocalQuery(), main(), ShieldGeom::Reinitialize(), and LISummarySorter::SetPlexHandle(). 00126 {
00127 // compare VldContext with this VldRange to see if the
00128 // the tagged set is compatible
00129
00130 Int_t detector = (Int_t)vldc.GetDetector();
00131 Int_t simflag = (Int_t)vldc.GetSimFlag();
00132
00133 // account for case where both VldContext and VldRange
00134 // are using "kUnknown" which has no bits set
00135 if ( ! (detector & fDetectorMask) &&
00136 (detector != Detector::kUnknown ||
00137 fDetectorMask != Detector::kUnknown ) ) return kFALSE;
00138 if ( ! (simflag & fSimMask) &&
00139 (simflag != SimFlag::kUnknown ||
00140 fSimMask != SimFlag::kUnknown ) ) return kFALSE;
00141
00142 // the start time is taken as inclusive, but the end time is exclusive
00143
00144 if ( vldc.GetTimeStamp() < fTimeStart ) return kFALSE;
00145 if ( vldc.GetTimeStamp() >= fTimeEnd ) return kFALSE;
00146
00147 return kTRUE;
00148 }
|
|
|
Print to stdout. See AsString() for options.
Definition at line 160 of file VldRange.cxx. References AsString(), and option. Referenced by PlexusReroot::BuildPinDiodeMap(), PlexusReroot::BuildPixelMaps(), PlexusReroot::BuildReadoutMap(), GeoGeometry::ls(), LIPlexMaps::MakePlexStripEndToLed(), and VldValidate::TestRange(). 00161 {
00162 // Print this object
00163
00164 printf("%s\n",AsString(option));
00165 }
|
|
|
Definition at line 81 of file VldRange.h. References fTimeEnd. Referenced by UgliGeometry::BuildNodes(), CoilTools::LocalQuery(), PulserGainFit::RunNearFarFits(), PulserGainFit::RunPinFits(), and BDSwicPedAccessor::SetSpillTime(). 00081 { fTimeEnd = tend; }
|
|
|
Definition at line 80 of file VldRange.h. References fTimeStart. Referenced by CoilTools::LocalQuery(), PulserGainFit::RunNearFarFits(), PulserGainFit::RunPinFits(), and BDSwicPedAccessor::SetSpillTime(). 00080 { fTimeStart = tstart; }
|
|
|
Trim this range to the intersection (ie. more restricted) limits of it's initial value and that of the argument Definition at line 168 of file VldRange.cxx. References fDataSource, fDetectorMask, fSimMask, fTimeEnd, and fTimeStart. Referenced by BfldCache::BfldCache(), CoilTools::LocalQuery(), BField::ResetVldContext(), UgliGeometry::TrimVldRange(), Plexus::TrimVldRange(), and GeoGeometry::TrimVldRange(). 00169 {
00170 // Trim this range to the intersection (ie. more restricted)
00171 // limits of it's initial value and that of the argument
00172
00173 fDetectorMask &= vldr.fDetectorMask;
00174 fSimMask &= vldr.fSimMask;
00175 if (fTimeStart < vldr.fTimeStart) fTimeStart = vldr.fTimeStart;
00176 if (fTimeEnd > vldr.fTimeEnd ) fTimeEnd = vldr.fTimeEnd;
00177 if (!fDataSource.Contains(vldr.fDataSource)) {
00178 fDataSource += ", ";
00179 fDataSource += vldr.fDataSource;
00180 }
00181 }
|
|
|
Definition at line 89 of file VldRange.h. Referenced by TrimTo(). |
|
|
Definition at line 85 of file VldRange.h. Referenced by AsString(), IsCompatible(), and TrimTo(). |
|
|
or's of Detector::Detector_t
Definition at line 86 of file VldRange.h. Referenced by AsString(), IsCompatible(), and TrimTo(). |
|
|
Definition at line 88 of file VldRange.h. Referenced by AsString(), SetTimeEnd(), and TrimTo(). |
|
|
or's of data/mc conditions
Definition at line 87 of file VldRange.h. Referenced by AsString(), SetTimeStart(), and TrimTo(). |
1.3.9.1