Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DataUtil Namespace Reference
[DataUtil]


Functions

template<class OutputIterator, class CandDaughterType>
OutputIterator CDL2STL (const CandHandle &handle, OutputIterator result)
 Base function to convert a candidate daughter list to an STL container of CandHandles.
template<class CandDaughterType>
std::vector< const CandDaughterType * > CDL2STLvector (const CandHandle &handle)
 Convert a Candidate's Daughter list to an STL vector of pointers to given candidate handle type.
template<class CandDaughterType>
std::vector< CandDaughterType * > CDL2STLvector (CandHandle &handle)
 non const
template<class CandDaughterType>
std::list< const CandDaughterType * > CDL2STLlist (const CandHandle &handle)
 Convert a Candidate's Daughter list to an STL list of pointers to given candidate handle type.
template<class CandDaughterType>
std::list< CandDaughterType * > CDL2STLlist (CandHandle &handle)
 nonconst version:
Bool_t IsGoodData (const NtpStRecord *st)
Bool_t IsGoodData (const VldContext &cx)
Bool_t IsGoodDataRUN (const VldContext &cx)
Bool_t IsGoodDataHV (const VldContext &cx)
Bool_t IsGoodDataCOIL (const VldContext &cx)
Bool_t IsGoodDataGPS (const VldContext &cx)
Bool_t IsGoodFDData (const NtpStRecord *st)
Bool_t IsGoodFDData (const VldContext &cx)
Bool_t IsGoodFDDataRUN (const VldContext &cx)
Bool_t IsGoodFDDataHV (const VldContext &cx)
Bool_t IsGoodFDDataCOIL (const VldContext &cx)
Bool_t IsGoodFDDataGPS (const VldContext &cx)
Bool_t IsGoodNDData (const NtpStRecord *st)
Bool_t IsGoodNDData (const VldContext &cx)
Bool_t IsGoodNDDataRUN (const VldContext &cx)
Bool_t IsGoodNDDataCOIL (const VldContext &cx)
bool dump_mom (const MomNavigator *, std::ostream &os)
 Dump the contents of mom ot give ostream.
bool dump_cand (const CandHandle *ch, std::ostream &os, std::string prefix="", int recurse_depth=1, int max_daughters=5)
const CandHeaderGetCandHeader (const MomNavigator *mom)
 Return the CandHeader from mom.
template<class CandType>
CandType * GetCandidate (const MomNavigator *mom, const char *cand_type=0, const char *cand_name=0)
 Pull candidate of given name and type out of mom. Return 0 if fail.
Detector::Detector_t GetDetector (const MomNavigator &mom)
 Returns the type of detector associated with the data in the given Mom.
Detector::Detector_t GetDetectorType (const MomNavigator &mom)
 old interface
void GetDetectorBinsZ (UgliGeomHandle ugh, int &nbins, double &min, double &max)
 Return number of bins and min/max in z to let one create integral binning based on z position of scintilator planes.
void GetDetectorBinsUV (UgliGeomHandle ugh, PlaneView::EPlaneView view, int &nbins, double &min, double &max)
 Return number of bins and min/max in U or V to let one create integral binning based on z position of scintilator strips. In general the two views give different results (NearDet).
template<class BlockType>
std::vector< const BlockType * > GetRawBlocks (const MomNavigator *mom)
 Pull RawData blocks out of Mom.
template<class BlockType>
const BlockType * GetRawBlock (const MomNavigator *mom)
template<class HeaderType>
const HeaderType * GetRawHeader (const MomNavigator *mom)
 Pull out the RawHeader from Mom.
template<class RecordType>
std::vector< RecordType * > GetRecords (MomNavigator *mom)
 Pull out records from Mom.
template<class RecordType>
std::vector< RecordType * > GetRecords (const MomNavigator *mom)
bool GetRunSnarlEvent (const MomNavigator *mom, int &run, int &snarl, int &event)
 Return run, snarl and event.
const RegistryGetTempTags (const TObject *record)
 Return a temptags Registry for a MINOS record without requiring the user to handle the two disparate inheritance hierarchies.
std::string GetTempTagString (const TObject *record, std::string key)
 Return a string value from a MINOS record temptags Registry; if the key doesn't exist return nonsense value. Works only for string type keys.
UgliGeomHandle GetUgliGeomHandle (const MomNavigator *mom)
 Try to produce an UgliGeomHandle from data in mom.
std::vector< VldContextGetVldContext (const MomNavigator *mom, const char *filter=0)
 Return a vector of unique VldContexts from the records in mom. Optional character string holds a comma separated list of class names to use to filter from what records the VldContexts are taken. The string either lists an inclusive set, or if the first character is a '!', and exclusive set. If not set, all records will be considered.


Function Documentation

template<class CandDaughterType>
std::list<CandDaughterType*> CDL2STLlist CandHandle handle  ) 
 

nonconst version:

Definition at line 160 of file CDL2STL.h.

00161 {
00162     typedef std::list<CandDaughterType*> dvec_t;
00163     dvec_t dv;
00164     typedef std::back_insert_iterator<dvec_t> dv_inserter;
00165     dv_inserter dvi(dv);
00166     DataUtil::CDL2STL<dv_inserter, CandDaughterType>(handle,dvi);
00167     return dv;
00168 }

template<class CandDaughterType>
std::vector<CandDaughterType*> CDL2STLvector CandHandle handle  ) 
 

non const

Definition at line 127 of file CDL2STL.h.

00128 {
00129     typedef std::vector<CandDaughterType*> dvec_t;
00130     dvec_t dv;
00131     typedef std::back_insert_iterator<dvec_t> dv_inserter;
00132 
00133     dv_inserter dvi(dv);
00134     DataUtil::CDL2STL<dv_inserter, CandDaughterType>(handle,dvi);
00135     return dv;
00136 }

bool DataUtil::dump_cand const CandHandle ch,
std::ostream &  os,
std::string  prefix = "",
int  recurse_depth = 1,
int  max_daughters = 5
 

Definition at line 22 of file DumpMom.cxx.

References Form(), CandHandle::GetDaughterIterator(), CandHandle::GetName(), CandHandle::GetNDaughters(), and CandHandle::GetTitle().

Referenced by dump_mom().

00027 {
00028   // Add name and title if it's a CandHandle.
00029   if(ch) {
00030     os << prefix 
00031        << Form("%s \t\"%s\" %s",ch->ClassName(),ch->GetName(), ch->GetTitle()) 
00032        << std::endl;
00033     int n = ch->GetNDaughters();
00034     if( max_daughters < n ) n = max_daughters;
00035     if( recurse_depth <=0) n = 0;
00036     if(n > 0) {
00037       TIter iter = ch->GetDaughterIterator();
00038       for(int i=0;i<n;i++) {
00039         const CandHandle* next = dynamic_cast<const CandHandle*>(iter.Next());
00040         if(next)
00041           if(! next->InheritsFrom("CandDigitHandle") )
00042             dump_cand(next,
00043                       os,
00044                       prefix+"  ",
00045                       recurse_depth-1,
00046                       max_daughters);
00047         
00048       } 
00049     }
00050     if(ch->GetNDaughters() > 0) {
00051       os << prefix << ".. Total daughters:" <<  ch->GetNDaughters() << endl;
00052     }
00053     
00054     return true;
00055   }
00056   return false;
00057 }

Detector::Detector_t GetDetectorType const MomNavigator mom  )  [inline]
 

old interface

Definition at line 36 of file GetDetector.h.

References GetDetector().

00037     { return GetDetector(mom); }

template<class BlockType>
const BlockType* GetRawBlock const MomNavigator mom  )  [inline]
 

Definition at line 65 of file GetRawBlock.h.

00066 {
00067   std::vector<const BlockType*> v = GetRawBlocks<BlockType>(mom);
00068   if(v.size()>0) return v[0];
00069   else return NULL;
00070 }

template<class RecordType>
std::vector<RecordType*> GetRecords const MomNavigator mom  )  [inline]
 

Definition at line 53 of file GetRecords.h.

00054 {
00055     return GetRecords<RecordType>(const_cast<MomNavigator*>(mom));
00056 }

Bool_t DataUtil::IsGoodData const VldContext cx  ) 
 

Definition at line 31 of file DataQualDB.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), IsGoodDataCOIL(), IsGoodDataGPS(), IsGoodDataHV(), and IsGoodDataRUN().

00032 {   
00033   // If it's not real data, return kOK
00034   // =================================
00035   if( cx.GetSimFlag() != SimFlag::kData ){
00036     return 1;
00037   }
00038 
00039   // Far Detector Data Selection
00040   // ===========================
00041   if( cx.GetDetector() == Detector::kFar ) { 
00042   
00043     // requirements for good far detector data: 
00044     //  (i)   good run - IsGoodDataRUN(cx)
00045     //  (ii)  good hv - IsGoodDataHV(cx)
00046     //  (iii) good coil - IsGoodDataCOIL(cx)
00047     //  (iv)  good gps error - IsGoodDataGPS(cx)
00048 
00049     if( IsGoodDataRUN(cx) && IsGoodDataHV(cx)
00050      && IsGoodDataCOIL(cx) && IsGoodDataGPS(cx) ) return 1;
00051     else return 0;
00052   }
00053   
00054   // Near Detector Data Selection
00055   // ============================
00056   if( cx.GetDetector() == Detector::kNear ) { 
00057   
00058     // requirements for good near detector data: 
00059     //  (i)  good run - IsGoodDataRUN(cx)
00060     //  (ii) good coil - IsGoodDataCOIL(cx)
00061 
00062     if( IsGoodDataRUN(cx) 
00063      && IsGoodDataCOIL(cx) ) return 1;
00064     else return 0;
00065   }
00066 
00067   return 1;
00068 }

Bool_t DataUtil::IsGoodData const NtpStRecord st  ) 
 

Definition at line 10 of file DataQualDB.cxx.

References RecRecordImp< T >::GetHeader(), and RecHeader::GetVldContext().

Referenced by EventQualAna::Analyze(), NuExtraction::ExtractDataQuality(), ANtpInfoObjectFiller::FillHeaderInformation(), IsGoodFDData(), IsGoodNDData(), MiniMakerPID::RunMiniMakerPID(), and Trimmer::RunTrimmer().

00010                                                  {
00011 
00012   // far detector data quality
00013   // =========================
00014   // number of crates enabled
00015   // (superseded by DbuFarRunQuality table)
00016   
00017   // Int_t cratemask = 0;
00018   // const NtpSRDataQuality *ntpDataQual;
00019   // ntpDataQual = &(st->dataquality);
00020   // cratemask = ntpDataQual->cratemask;
00021   // if( cratemask!=16 ) return 0;
00022  
00023   // get validity context
00024   // ====================
00025   const RecCandHeader* Header = &(st->GetHeader());
00026   VldContext cx = Header->GetVldContext();
00027 
00028   return IsGoodData(cx);
00029 }

Bool_t DataUtil::IsGoodDataCOIL const VldContext cx  ) 
 

Definition at line 121 of file DataQualDB.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), and CoilTools::IsOK().

Referenced by NuExtraction::ExtractDataQuality(), IsGoodData(), IsGoodFDDataCOIL(), and IsGoodNDDataCOIL().

00122 {
00123   // If it's not real data, return kOK
00124   // =================================
00125   if( cx.GetSimFlag() != SimFlag::kData ){
00126     return 1;
00127   }
00128 
00129   // Far Detector Data - Check Coil Status
00130   // =====================================
00131   if( cx.GetDetector() == Detector::kFar ) {
00132     return CoilTools::IsOK(cx);     
00133   }
00134   
00135   // Near Detector Data - Check Coil Status
00136   // ======================================
00137   if( cx.GetDetector() == Detector::kNear ) {
00138     return CoilTools::IsOK(cx);     
00139   }
00140 
00141   return 1;
00142 }

Bool_t DataUtil::IsGoodDataGPS const VldContext cx  ) 
 

Definition at line 144 of file DataQualDB.cxx.

References abs(), VldContext::GetDetector(), SpillServerMonFinder::GetNearestSpill(), VldTimeStamp::GetSec(), VldContext::GetSimFlag(), SpillServerMon::GetSpillTime(), SpillServerMon::GetSpillTimeError(), SpillServerMon::GetSpillType(), VldContext::GetTimeStamp(), and SpillServerMonFinder::Instance().

Referenced by NuExtraction::ExtractDataQuality(), IsGoodData(), and IsGoodFDDataGPS().

00145 {
00146   // If it's not real data, return kOK
00147   // =================================
00148   if( cx.GetSimFlag() != SimFlag::kData ){
00149     return 1;
00150   }
00151 
00152   // Far Detector Data - Check GPS Status
00153   // ====================================
00154   // get spillserver monitoring block for this snarl,
00155   // get GPS worst case uncertainty (nsec)
00156   // spill must be real and within 5 minutes
00157   if( cx.GetDetector() == Detector::kFar ) {
00158   
00159     SpillServerMonFinder& smon = SpillServerMonFinder::Instance();
00160     const SpillServerMon& spill_near = smon.GetNearestSpill(cx);
00161     VldTimeStamp dt = spill_near.GetSpillTime()-cx.GetTimeStamp();
00162 
00163     Int_t dt_sec = abs(dt.GetSec());
00164     Int_t gps_error = spill_near.GetSpillTimeError();
00165     Int_t spill_type = spill_near.GetSpillType();
00166 
00167     if( spill_type==1 && dt_sec<360 && gps_error>1000 ) return 0;
00168     else return 1;
00169   }
00170 
00171   return 1;
00172 }  

Bool_t DataUtil::IsGoodDataHV const VldContext cx  ) 
 

Definition at line 93 of file DataQualDB.cxx.

References VldContext::GetDetector(), HvStatusFinder::GetHvStatus(), VldContext::GetSimFlag(), HvStatus::Good(), and HvStatusFinder::Instance().

Referenced by NuExtraction::ExtractDataQuality(), IsGoodData(), and IsGoodFDDataHV().

00094 {
00095   // If it's not real data, return kOK
00096   // =================================
00097   if( cx.GetSimFlag() != SimFlag::kData ){
00098     return 1;
00099   }
00100 
00101   // Far Detector Data - Check HV Status
00102   // ===================================
00103   // check HV status within 60 secs of snarl
00104   // (N.B: arguments given to HvStatusFinder: 
00105   //   validity context, time window, task number)
00106   if( cx.GetDetector() == Detector::kFar ) {
00107     HvStatus::HvStatus_t hv_ok = 
00108       HvStatusFinder::Instance().GetHvStatus(cx,60,1);
00109     return HvStatus::Good(hv_ok);
00110   }
00111 
00112   // Near Detector Data, return kOK
00113   // ==============================
00114   if( cx.GetDetector() == Detector::kNear ) {
00115     return 1;
00116   }
00117 
00118   return 1;
00119 }

Bool_t DataUtil::IsGoodDataRUN const VldContext cx  ) 
 

Definition at line 70 of file DataQualDB.cxx.

References VldContext::GetDetector(), VldContext::GetSimFlag(), RunQualityFinder::Instance(), and RunQualityFinder::IsOK().

Referenced by NuExtraction::ExtractDataQuality(), IsGoodData(), IsGoodFDDataRUN(), and IsGoodNDDataRUN().

00071 {
00072   // If it's not real data, return kOK
00073   // =================================
00074   if( cx.GetSimFlag() != SimFlag::kData ){
00075     return 1;
00076   }
00077 
00078   // Far Detector Data - Check Run Status
00079   // ====================================
00080   if( cx.GetDetector() == Detector::kFar ) {
00081     return RunQualityFinder::Instance().IsOK(cx);
00082   }
00083 
00084   // Near Detector Data - Check Run Status
00085   // =====================================
00086   if( cx.GetDetector() == Detector::kNear ) {
00087     return RunQualityFinder::Instance().IsOK(cx);
00088   }
00089 
00090   return 1;
00091 }

Bool_t DataUtil::IsGoodFDData const VldContext cx  ) 
 

Definition at line 179 of file DataQualDB.cxx.

References IsGoodData().

00180 { 
00181   return IsGoodData(cx); 
00182 }

Bool_t DataUtil::IsGoodFDData const NtpStRecord st  ) 
 

Definition at line 174 of file DataQualDB.cxx.

References IsGoodData().

Referenced by ANtpEventInfoAna::Analyze(), MadTVAnalysis::CreatePAN(), MadPIDAnalysis::CreatePAN(), and Anp::FillHeader::Run().

00175 { 
00176   return IsGoodData(st); 
00177 }

Bool_t DataUtil::IsGoodFDDataCOIL const VldContext cx  ) 
 

Definition at line 194 of file DataQualDB.cxx.

References IsGoodDataCOIL().

00195 { 
00196   return IsGoodDataCOIL(cx); 
00197 }

Bool_t DataUtil::IsGoodFDDataGPS const VldContext cx  ) 
 

Definition at line 199 of file DataQualDB.cxx.

References IsGoodDataGPS().

00200 { 
00201   return IsGoodDataGPS(cx); 
00202 }

Bool_t DataUtil::IsGoodFDDataHV const VldContext cx  ) 
 

Definition at line 189 of file DataQualDB.cxx.

References IsGoodDataHV().

00190 { 
00191   return IsGoodDataHV(cx); 
00192 }

Bool_t DataUtil::IsGoodFDDataRUN const VldContext cx  ) 
 

Definition at line 184 of file DataQualDB.cxx.

References IsGoodDataRUN().

00185 { 
00186   return IsGoodDataRUN(cx); 
00187 }

Bool_t DataUtil::IsGoodNDData const VldContext cx  ) 
 

Definition at line 209 of file DataQualDB.cxx.

References IsGoodData().

00210 { 
00211   return IsGoodData(cx); 
00212 }

Bool_t DataUtil::IsGoodNDData const NtpStRecord st  ) 
 

Definition at line 204 of file DataQualDB.cxx.

References IsGoodData().

00205 { 
00206   return IsGoodData(st); 
00207 }

Bool_t DataUtil::IsGoodNDDataCOIL const VldContext cx  ) 
 

Definition at line 219 of file DataQualDB.cxx.

References IsGoodDataCOIL().

00220 { 
00221   return IsGoodDataCOIL(cx); 
00222 }

Bool_t DataUtil::IsGoodNDDataRUN const VldContext cx  ) 
 

Definition at line 214 of file DataQualDB.cxx.

References IsGoodDataRUN().

00215 { 
00216   return IsGoodDataRUN(cx); 
00217 }


Generated on Mon Nov 23 05:33:43 2009 for loon by  doxygen 1.3.9.1