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

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 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.
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).
DetectorType::Detector_t GetDetectorType (const MomNavigator &mom)
 Returns the type of detector associated with the data in the given Mom.
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.
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 }

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

Definition at line 65 of file GetRawBlock.h.

References v.

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 }


Generated on Thu Nov 1 15:58:50 2007 for loon by  doxygen 1.3.9.1