00001 00002 // Author : florent robinet (LAL - Orsay): robinet@lal.in2p3.fr 00004 #ifndef __ReadTriggerSegments__ 00005 #define __ReadTriggerSegments__ 00006 00007 #include "Chain.h" 00008 #include "Segments.h" 00009 00010 using namespace std; 00011 00021 class ReadTriggerSegments{ 00022 00023 public: 00024 00038 ReadTriggerSegments(const string aPattern, const string aDirectory="", const int aVerbose=0); 00039 00043 virtual ~ReadTriggerSegments(void); 00052 inline Segments* GetSegments(void){return Seg;}; 00053 00057 inline double GetTimeMin(void){return Seg->GetStart(0);}; 00058 00062 inline double GetTimeMax(void){return Seg->GetEnd(Seg->GetNsegments()-1);}; 00063 00071 string GetTriggerFiles(const double aTimeMin, const double aTimeMax); 00072 00079 string GetTriggerFiles(Segments *aSegSelect); 00080 00084 inline int GetNTrees(void){ return (int)triggerfilename.size(); }; 00085 00089 inline int GetNFiles(void){ return (int)triggerfilename.size(); }; 00090 00095 inline double* GetFileStarts(void){ return Tstart; }; 00096 00101 inline double* GetFileStops(void){ return Tstop; }; 00102 00107 inline double* GetTreeStarts(void){ return Tstart; }; 00108 00113 inline double* GetTreeStops(void){ return Tstop; }; 00114 00119 inline void SetVerbose(const int aVerbose){ Verbose=aVerbose; }; 00120 00126 bool SetNewPattern(const string aPattern); 00127 00131 inline bool GetStatus(void){ return status_OK; }; 00132 00136 inline int GetTriggerID(void){ return randid; }; 00137 00141 inline string GetTriggerStringID(void){ return srandid; }; 00142 00143 protected: 00144 00145 // PARAMETERS 00146 bool status_OK; 00147 int Verbose; 00148 string Pattern; 00149 string Dir; 00150 int randid; 00151 string srandid; 00152 00153 // SEGMENTS 00154 Segments *Seg; 00155 double *Tstart; 00156 double *Tstop; 00157 vector <string> triggerfilename; 00158 00159 private: 00160 bool GetInputSegments(void); 00161 00162 ClassDef(ReadTriggerSegments,0) 00163 }; 00164 00165 #endif 00166 00167