Delimits and identifies the allowed "context" values associated with the associated DBI returned information. More...
#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 |
Delimits and identifies the allowed "context" values associated with the associated DBI returned information.
Contact: R. Hatcher
Created on: 2000.05.03
Definition at line 37 of file VldRange.h.
VldRange::VldRange | ( | ) |
Definition at line 28 of file VldRange.cxx.
00029 : fDetectorMask(0), fSimMask(0), 00030 fTimeStart(), fTimeEnd(), fDataSource("unknown") 00031 { 00032 // Default constructor 00033 }
VldRange::VldRange | ( | const Int_t | detMask, | |
const Int_t | simMask, | |||
const VldTimeStamp & | tstart, | |||
const VldTimeStamp & | tend, | |||
const TString & | source | |||
) |
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 }
VldRange::~VldRange | ( | ) | [virtual] |
Definition at line 46 of file VldRange.cxx.
const char * VldRange::AsString | ( | Option_t * | option = "" |
) | const |
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(), fDataSource, fDetectorMask, fSimMask, fTimeEnd, fTimeStart, and Detector::MaskToString().
Referenced by UgliGeometry::BuildAll(), CoilTools::CoilCurrentLimits(), DbiValidityRec::Fill(), Fill_MBSpill(), UgliGeometry::GetZExtent(), DbiValidityRec::IsCompatible(), CoilTools::LocalQuery(), lootSpillFile(), 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 }
TString VldRange::GetDataSource | ( | ) | const [inline] |
Definition at line 72 of file VldRange.h.
References fDataSource.
Referenced by DbiBinaryFile::operator<<(), and DbiValidityRec::SetTimeWindow().
00072 { return fDataSource; }
Int_t VldRange::GetDetectorMask | ( | ) | const [inline] |
Definition at line 68 of file VldRange.h.
References fDetectorMask.
Referenced by UgliStripNode::BackConstructVldContext(), UgliGeometryReroot::BuildShapes(), DbiWriter< T >::CompleteOpen(), PlexVetoShieldHack::ConvertRangeToContext(), PulserTimePlotter::CreateGraph(), LIPlexMaps::DriftWithTime(), DbiLogEntry::Fill(), FabSteelPlate::Fill(), PulserRefDriftPin::Fill(), DbuVaChipSpars::Fill(), FabPlnInstall::Fill(), PlexPixelSpotToStripEnd::Fill(), PulserRawGainPin::Fill(), UgliDbiStripStruct::Fill(), PlexPinDiodeToLed::Fill(), PlexVetoShieldMuxToMdl::Fill(), BfldDbiPlaneMap::Fill(), UgliDbiSteelPln::Fill(), PlexStripEndToLed::Fill(), PlexRawChannelReadoutType::Fill(), PlexRawChannelToPinDiode::Fill(), UgliDbiScintPln::Fill(), DbuRunSummary::Fill(), UgliDbiScintMdlStruct::Fill(), UgliDbiStrip::Fill(), DbuDaqFileSummary::Fill(), PulserDriftPin::Fill(), PulserGainPin::Fill(), UgliDbiScintMdl::Fill(), DbuVaChipPeds::Fill(), PlexPixelToRawChannel::Fill(), UgliDbiScintPlnStruct::Fill(), DbuSubRunSummary::Fill(), PulserRawDriftPin::Fill(), BfieldCoilCurrent::Fill(), UgliGeomHandle::GetDetector(), DataUtil::GetDetectorBinsUV(), DataUtil::GetDetectorBinsZ(), UgliGeometry::GetTransverseExtent(), GeoGeometry::GetTransverseExtent(), UgliGeometry::GetZExtent(), DbiValidityRec::HasExpired(), DbmModule::LogEntry(), UgliGeometryReroot::MakeTempDbiGeometry(), DbiBinaryFile::operator<<(), SimPmtM64CrosstalkTable::Reset(), PhotonLookupTable::Reset(), RangeLookupTable::Reset(), DbiResultPtr< T >::SetContext(), DbiValidityRec::SetTimeWindow(), DbiValidityRec::Store(), and WriteTableToCSVFile().
00068 { return fDetectorMask; }
Int_t VldRange::GetSimMask | ( | ) | const [inline] |
Definition at line 69 of file VldRange.h.
References fSimMask.
Referenced by UgliStripNode::BackConstructVldContext(), UgliStripNode::ClearFiber(), DbiWriter< T >::CompleteOpen(), PlexVetoShieldHack::ConvertRangeToContext(), PulserTimePlotter::CreateGraph(), LIPlexMaps::DriftWithTime(), DbiLogEntry::Fill(), DbuRunSummary::Fill(), DbiValidityRec::HasExpired(), DbmModule::LogEntry(), DbiBinaryFile::operator<<(), SimPmtM64CrosstalkTable::Reset(), PhotonLookupTable::Reset(), RangeLookupTable::Reset(), DbiResultPtr< T >::SetContext(), DbiValidityRec::SetTimeWindow(), DbiValidityRec::Store(), UgliSteelPlnNode::UgliSteelPlnNode(), UgliStripNode::WlsPigtail(), and WriteTableToCSVFile().
00069 { return fSimMask; }
VldTimeStamp VldRange::GetTimeEnd | ( | ) | const [inline] |
Definition at line 71 of file VldRange.h.
References fTimeEnd.
Referenced by CountPot::Ana(), DbiValidityRec::AndTimeWindow(), UgliGeometry::BuildNodes(), CheckGC::checklin(), PulserTimePlotter::CreateGraph(), SpillServerMonFinder::DataIsAvailable(), DbiResultAgg::DbiResultAgg(), DbiValidityRecBuilder::DbiValidityRecBuilder(), MuonDriftCalScheme::DoReset(), LIPlexMaps::DriftWithTime(), CountPot::EndJob(), HvStatusFinder::ExtendedQuery(), CountPot::FillMBPOT(), SpillServerMonFinder::FindClosestEntries(), SpillTimeFinder::FindClosestEntries(), CoilTools::GetLast(), DbiValidityRec::HasExpired(), HvStatusFinder::LocalQuery(), CoilTools::LocalQuery(), main(), PlotAllPeds::Next(), PlotPeds::Next(), FabPlnInstallLookup::NextInstall(), DbiResultPtr< T >::NextQuery(), DbiBinaryFile::operator<<(), LIPlexMaps::ReadDbGainAverage(), SimPmtM64CrosstalkTable::Reset(), PhotonLookupTable::Reset(), RangeLookupTable::Reset(), MBSpillAccessor::SeekClosest(), BDSpillAccessor::SeekClosest(), LISummarySorter::SetPlexHandle(), BDSwicPedAccessor::SetSpillTime(), DbiValidityRec::Store(), DbiValidityRec::Trim(), and WriteTableToCSVFile().
00071 { return fTimeEnd; }
VldTimeStamp VldRange::GetTimeStart | ( | ) | const [inline] |
Definition at line 70 of file VldRange.h.
References fTimeStart.
Referenced by CountPot::Ana(), DbiValidityRec::AndTimeWindow(), UgliStripNode::BackConstructVldContext(), CheckGC::checklin(), PlexVetoShieldHack::ConvertRangeToContext(), PulserTimePlotter::CreateGraph(), SpillServerMonFinder::DataIsAvailable(), DbiResultAgg::DbiResultAgg(), DbiValidityRecBuilder::DbiValidityRecBuilder(), PhotonStatSummarizer::DoesTableExist(), MuonDriftCalScheme::DoReset(), LIPlexMaps::DriftWithTime(), CountPot::EndJob(), HvStatusFinder::ExtendedQuery(), DbiLogEntry::Fill(), CountPot::FillMBPOT(), SpillServerMonFinder::FindClosestEntries(), SpillTimeFinder::FindClosestEntries(), Summarizer::FindNextContext(), DbiValidityRec::HasExpired(), HvStatusFinder::LocalQuery(), CoilTools::LocalQuery(), main(), FabPlnInstallLookup::NextInstall(), DbiResultPtr< T >::NextQuery(), DbiBinaryFile::operator<<(), PlotAllPeds::Prev(), LIPlexMaps::ReadDbGainAverage(), SimPmtM64CrosstalkTable::Reset(), PhotonLookupTable::Reset(), RangeLookupTable::Reset(), PulserGainFit::RunNearFarFits(), PulserGainFit::RunPinFits(), MBSpillAccessor::SeekClosest(), BDSpillAccessor::SeekClosest(), LISummarySorter::SetPlexHandle(), BDSwicPedAccessor::SetSpillTime(), DbiValidityRec::Store(), DbiValidityRec::Trim(), WriteTableToCSVFile(), and PulserDBModule::WriteTempGC().
00070 { return fTimeStart; }
Bool_t VldRange::IsCompatible | ( | const VldContext * | vldc | ) | const |
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 }
Bool_t VldRange::IsCompatible | ( | const VldContext & | vldc | ) | const |
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, fTimeEnd, fTimeStart, VldContext::GetDetector(), VldContext::GetSimFlag(), VldContext::GetTimeStamp(), SimFlag::kUnknown, and Detector::kUnknown.
Referenced by BfldLoanPool::GetCache(), CoilTools::GetCoilState(), FarTimingFidFinder::GetFarTimingFid(), CoilTools::GetMagNear(), MCApplication::InitSnarl(), GeoGeometry::IsCompatible(), Plexus::IsCompatible(), UgliGeometry::IsCompatible(), DbiValidityRec::IsCompatible(), 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 }
void VldRange::Print | ( | Option_t * | option = "" |
) | const |
Print to stdout. See AsString() for options.
Definition at line 160 of file VldRange.cxx.
References AsString().
Referenced by PlexusReroot::BuildPinDiodeMap(), PlexusReroot::BuildPixelMaps(), PlexusReroot::BuildReadoutMap(), LIPlexMaps::MakePlexStripEndToLed(), and VldValidate::TestRange().
void VldRange::SetTimeEnd | ( | const VldTimeStamp & | tend | ) | [inline] |
Definition at line 81 of file VldRange.h.
References fTimeEnd.
Referenced by UgliGeometry::BuildNodes(), PulserGainFit::RunNearFarFits(), PulserGainFit::RunPinFits(), and BDSwicPedAccessor::SetSpillTime().
00081 { fTimeEnd = tend; }
void VldRange::SetTimeStart | ( | const VldTimeStamp & | tstart | ) | [inline] |
Definition at line 80 of file VldRange.h.
References fTimeStart.
Referenced by PulserGainFit::RunNearFarFits(), PulserGainFit::RunPinFits(), and BDSwicPedAccessor::SetSpillTime().
00080 { fTimeStart = tstart; }
void VldRange::TrimTo | ( | const VldRange & | vldr | ) |
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(), GeoGeometry::TrimVldRange(), Plexus::TrimVldRange(), and UgliGeometry::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 }
TString VldRange::fDataSource [protected] |
Definition at line 89 of file VldRange.h.
Referenced by AsString(), GetDataSource(), and TrimTo().
Int_t VldRange::fDetectorMask [protected] |
Definition at line 85 of file VldRange.h.
Referenced by AsString(), GetDetectorMask(), IsCompatible(), and TrimTo().
Int_t VldRange::fSimMask [protected] |
or's of Detector::Detector_t
Definition at line 86 of file VldRange.h.
Referenced by AsString(), GetSimMask(), IsCompatible(), and TrimTo().
VldTimeStamp VldRange::fTimeEnd [protected] |
Definition at line 88 of file VldRange.h.
Referenced by AsString(), GetTimeEnd(), IsCompatible(), SetTimeEnd(), and TrimTo().
VldTimeStamp VldRange::fTimeStart [protected] |
or's of data/mc conditions
Definition at line 87 of file VldRange.h.
Referenced by AsString(), GetTimeStart(), IsCompatible(), SetTimeStart(), and TrimTo().