00001
00002
00004 #ifndef __Coinc__
00005 #define __Coinc__
00006
00007 #include "ReadTriggers.h"
00008 #include "TimeSlides.h"
00009 #include "Ntuple.h"
00010
00011 using namespace std;
00012
00026 class Coinc : public TimeSlides {
00027
00028 public:
00029
00043 Coinc(const int aNstreams, const int aAlgoMode=0, const int aVerbose=0);
00044
00048 virtual ~Coinc(void);
00059 bool SetParameters(vector <double> aDt, vector <double> aAf);
00060
00066 bool SetDt(const double aDt);
00067
00073 bool SetAf(const double aAf);
00074
00087 bool SetTriggers(const int aS, ReadTriggers *aTriggers);
00088
00095 bool SetSegments(Segments *aSeg);
00096
00106 bool MakeCoinc(const bool aUniq=false);
00107
00115 bool SaveCoinc(const string aCoincFileName);
00116
00120 inline int GetNCoinc(void){ return CoincTree->GetEntries(); };
00121
00128 vector <int> GetCoincEvents(const int aS, const int aNetID=-1);
00129
00130 protected:
00131
00132
00133 vector <double> cdt;
00134 vector <double> caf;
00135
00136
00137 ReadTriggers **InputTriggers;
00138
00139
00140 TTree *CoincTree;
00141 int CoType,
00142 CoNet,
00143 CoLagID;
00144 int *CoCluster;
00145
00146 private:
00147
00148 bool status_OK;
00149 int ftype;
00150
00151
00152 int Npairs;
00153
00154
00155 Segments *extseg;
00156
00157
00158 bool MakeCoinc0(const bool aUniq);
00159 void SaveCoinc0(const int aLagID);
00160 Ntuple *ntuple;
00161 int *PairMap[2];
00162
00163
00164 bool MakeCoinc1(void);
00165 inline bool NextPerm(const int aN, int *aComb, int *aNcombmax);
00166
00167 ClassDef(Coinc,0)
00168 };
00169
00170 #endif
00171
00172