00001
00002
00004 #ifndef __GlitchVeto__
00005 #define __GlitchVeto__
00006
00007 #include "Coinc.h"
00008 #include "TH2.h"
00009 #include "TGraph.h"
00010
00011 using namespace std;
00012
00034 class GlitchVeto{
00035
00036 public:
00037
00050 GlitchVeto(const int averbose=0);
00051
00055 virtual ~GlitchVeto(void);
00065 bool SetMainTriggers(ReadTriggers *Amaintriggers);
00066
00072 bool SetAuxTriggers(ReadTriggers *Aauxtriggers);
00073
00080 bool SetSegments(Segments *aNewSeg);
00081
00092 bool ProcessGlitch2Glitch(void);
00093
00107 bool SetThreshold(const string aVariableName, const double aThreshold);
00108
00116 bool MakeVeto(void);
00117
00150 bool WriteReport(const string aRootFileName="./myreport.root");
00151
00165 TH1* GetMonitor(const string MonitorName);
00166
00170 double GetFullDeadTime(void);
00171
00177 double GetVetoEfficiency(const bool normalized=true);
00178
00182 double GetVetoDeadTime(void);
00183
00187 double GetVetoUsePercentage(void);
00188
00193 inline Segments* GetVetoSegments(void){ return VetoSeg; };
00194
00195
00201 inline void SetFixBins(const int nfixbins=0){ nfix=nfixbins; };
00202
00203 private:
00204
00205 int fverbose;
00206 bool status_OK;
00207
00208
00209 bool MakeBinning(const int nfixbins=0);
00210 double *tbins;
00211 double *fauxbins;
00212 double *fmainbins;
00213 double *sauxbins;
00214 double *smainbins;
00215 int nfix;
00216 int ntbins;
00217 int nfauxbins;
00218 int nfmainbins;
00219 int nsauxbins;
00220 int nsmainbins;
00221
00222
00223 ReadTriggers *MainTriggers;
00224 ReadTriggers *AuxTriggers;
00225 Coinc *coinc;
00226 vector <int> MainIndexes;
00227 vector <int> AuxIndexes;
00228 Segments *Seg;
00229
00230
00231 bool ResetParameterSpace(void);
00232 bool CreateParameterSpace(void);
00233 bool FillParameterSpace(void);
00234
00235
00236 int nmaintrig;
00237 TH2D *h_Mstat, *h_Mstat_cum;
00238 TH1D *h_mr;
00239 TGraph *g_Msnrtime;
00240
00241
00242 TH2D *h_Astat, *h_Astat_cum,
00243 *h_dead, *h_dead_cum, *h_d;
00244 TH1D *h_ar;
00245 TGraph *g_snrsnr;
00246 TH2D *h_ff;
00247
00248
00249 TH2D *h_nveto, *h_nveto_cum,
00250 *h_use, *h_use_cum,
00251 *h_up, *h_e, *h_ed;
00252
00253
00254 TH1D *h_thr;
00255 TH1I *h_thr_bin;
00256
00257
00258 TH1D *h_Me;
00259 TH1D *h_Ause;
00260 TH1D *h_vr;
00261 TGraph *g_snrsnr_veto;
00262 TGraph *g_ff_veto;
00263 TH2D *h_ff_veto;
00264 TGraph *g_Msnrtime_veto;
00265
00266
00267 double GetUPthr(const double scalefactor=2);
00268 double UPthr;
00269 double EDthr;
00270 double Dthr;
00271 double NVthr;
00272 double NUthr;
00273
00274
00275 Segments *VetoSeg;
00276 TTree *Tfom;
00277 double fom_dt, fom_eff, fom_up;
00278
00279 ClassDef(GlitchVeto,0)
00280 };
00281
00282 #endif
00283
00284