00001
00002
00004 #ifndef __ReadTriggers__
00005 #define __ReadTriggers__
00006
00007 #include "ReadTriggerMetaData.h"
00008 #include "TMath.h"
00009
00010 using namespace std;
00011
00017 class ReadTriggers: public ReadTriggerMetaData {
00018
00019 public:
00020
00033 ReadTriggers(const string apattern, const string adirectory="", const int averbose=0);
00034
00038 virtual ~ReadTriggers(void);
00048 bool SetNewPattern(const string apattern);
00049
00057 bool SetTriggerBranchStatus(const char* bname, bool status = true);
00058
00089 bool Clusterize(void);
00090
00096 bool SetDeltaT(const double adeltat);
00097
00103 bool SetClusterSNRthr(const double asnrthr);
00104
00112 bool SetClusterStatus(const int aclst, const int anewstatus);
00113
00120 bool WriteClusters(TFile *atfile, const string adirectory="");
00121
00129 bool SetClusterBranchStatus(const char* bname, bool status = true);
00130
00131
00135 inline int GetNTrig(void){return Ttree->GetEntries();};
00139 inline int GetNtrig(void){return Ttree->GetEntries();};
00143 inline int GetNtriggers(void){return Ttree->GetEntries();};
00147 inline int GetNTriggers(void){return Ttree->GetEntries();};
00148
00154 double GetTriggerTime(const int atrig);
00155
00161 double GetTriggerTimeStart(const int atrig);
00162
00168 double GetTriggerTimeEnd(const int atrig);
00169
00175 double GetTriggerFrequency(const int atrig);
00176
00182 double GetTriggerFrequencyStart(const int atrig);
00183
00189 double GetTriggerFrequencyEnd(const int atrig);
00190
00196 double GetTriggerDuration(const int atrig);
00197
00203 double GetTriggerBandWidth(const int atrig);
00204
00210 double GetTriggerQ(const int atrig);
00211
00217 double GetTriggerSNR(const int atrig);
00218
00224 double GetTriggerAmplitude(const int atrig);
00225
00231 string GetTriggerFile(const int atrig);
00232
00238 string GetTriggerFile(const double atime);
00239
00244 inline double GetFrequencyMin(void){return fFreqMin;};
00245
00250 inline double GetFrequencyMax(void){return fFreqMax;};
00251
00256 inline double GetSNRMin(void){return fSNRMin;};
00257
00262 inline double GetSNRMax(void){return fSNRMax;};
00263
00267 inline double GetTimeMin(void){return fTimeMin;};
00268
00272 inline double GetTimeMax(void){return fTimeMax;};
00273
00277 inline int GetNCluster(void){return Ctree->GetEntries();};
00281 inline int GetNcluster(void){return Ctree->GetEntries();};
00282
00286 inline double GetDeltaT(void){return Cdelta_t;};
00287
00293 double GetClusterTime(const int aclst);
00294
00300 double GetClusterFrequency(const int aclst);
00301
00307 double GetClusterSNR(const int aclst);
00308
00314 double GetClusterAmplitude(const int aclst);
00315
00321 double GetClusterQ(const int aclst);
00322
00328 double GetClusterTimeStart(const int aclst);
00329
00335 double GetClusterTimeEnd(const int aclst);
00336
00342 double GetClusterDuration(const int aclst);
00343
00349 double GetClusterFrequencyStart(const int aclst);
00350
00356 double GetClusterFrequencyEnd(const int aclst);
00357
00363 double GetClusterBandWidth(const int aclst);
00364
00370 double GetClusterTheta(const int aclst);
00371
00377 int GetClusterSize(const int aclst);
00378
00384 int GetClusterNumber(const double atime);
00385
00391 int GetClusterStatus(const int aclst);
00392
00396 inline double GetClusterMeanDuration(void){ return Cmeandur; };
00397
00398 protected:
00399
00400
00401 Chain *Ttree;
00402 Long64_t *offsets;
00403 double Ttime,
00404 Tfreq,
00405 Tq,
00406 Tsnr,
00407 Tamp,
00408 Ttstart,
00409 Ttend,
00410 Tfstart,
00411 Tfend;
00412 double fFreqMin;
00413 double fFreqMax;
00414 double fSNRMin;
00415 double fSNRMax;
00416
00417
00418 TTree *Ctree;
00419 double Ctime,
00420 Ctstart,
00421 Ctend,
00422 Cfreq,
00423 Cfstart,
00424 Cfend,
00425 Csnr,
00426 Camp,
00427 Cq;
00428 Long64_t Cfirstentry,
00429 Csize;
00430 double Cdelta_t;
00431 double Cmeandur;
00432 int *cl_status;
00433 double cl_snr_thr;
00434
00435 private:
00436 bool GetInputTree(void);
00437
00438
00439 ClassDef(ReadTriggers,0)
00440 };
00441
00442 #endif
00443
00444