BmnRoot
Loading...
Searching...
No Matches
BmnTriggerEfficiencyRun8.h
Go to the documentation of this file.
1#ifndef BMNTRIGEFFRUN8_H
2#define BMNTRIGEFFRUN8_H 1
3
4#include "BmnTrigInfoDst.h"
5#include "CbmVertex.h"
6
7#include <TChain.h>
8#include <TFile.h>
9#include <TH2D.h>
10#include <TNamed.h>
11#include <TString.h>
12#include <TTree.h>
13
14using namespace std;
15
16class BmnTriggerEfficiencyRun8 : public TNamed
17{
18 public:
20 BmnTriggerEfficiencyRun8(TString dstFileName);
21 BmnTriggerEfficiencyRun8(Int_t runId, BmnTrigInfoDst* trigInfo, CbmVertex* primaryVertex);
22
23 Bool_t IsValid() { return isValid; }
24 Int_t GetNBd() { return fNBd; }
25
26 Double_t GetBDEfficiency(Int_t runId, Int_t ntrPV);
27 Double_t GetFDEfficiency(Int_t runId, Int_t ntrPV);
28 Double_t GetTriggerEfficiency(Int_t runId, Int_t ntrPV);
29
30 // Input: ntrPV = PrimaryVertex.GetNTracks() from dst
31 // Returns true on success, false - error
32 // Returns efficiency and errors via arguments:
33 // eff - efficiency of BD*FD, statErr - statistical error,
34 // systErr - systematic error, errSystErr - error of systematic error
35 //
36 // See use example in macro/physics/trigger/CheckTriggerEfficiencyInterfaceRun8.C
38 Int_t ntrPV,
39 Double_t& eff,
40 Double_t& statErr,
41 Double_t& systErr,
42 Double_t& errSystErr);
43 Bool_t GetTriggerEfficiencyWithErrors(Double_t& eff, Double_t& statErr, Double_t& systErr, Double_t& errSystErr);
44
45 // Returns true on success, false - error
46 // Returns flux rejection factor due pile up (BC2) cut and its error via arguments
47 //
48 // See use example in macro/physics/trigger/CheckTriggerEfficiencyInterfaceRun8.C
49 Bool_t GetFluxRejectionFactorWithError(Int_t runId, Double_t& factor, Double_t& err);
50 Bool_t GetFluxRejectionFactorWithError(Double_t& factor, Double_t& err);
52 Bool_t IsEventAnalysable(Int_t evId);
53
55 {
56 if (fEffFile1)
57 delete fEffFile1;
58 if (fEffFile2)
59 delete fEffFile2;
60 if (fEffFile3)
61 delete fEffFile3;
62 if (fDstFile)
63 delete fDstFile;
64 }
65
66 private:
67 const Int_t FDTrigWindow = 4;
68
69 Bool_t isValid;
70 Int_t fNBd;
71 TFile* fEffFile1;
72 TFile* fEffFile2;
73 TFile* fEffFile3;
74 TH2D* fHBd;
75 TH2D* fHFd;
76 TH2D* fHCctSyst;
77 TH1D* fHFrf;
78
79 TFile* fDstFile;
80 TTree* fDstTree;
81 BmnTrigInfoDst* fBTrigInfo;
82 CbmVertex* fBPrimaryVertex;
83
84 Int_t fRunId;
85 Double_t fBC2IntCut;
86 Int_t fFDTrigWindowLeftEdge;
87 Int_t fFDPeakLimit;
88
89 Double_t GetEfficiencyOrError(TH2D* hist, Int_t runId, Int_t ntrPV, Bool_t isEff);
90 void InitEfficiencyInput();
91 void SetBC2IntCutByRun(Int_t runId);
92 void SetFDTrigWindowLeftEdgeByRun(Int_t runId);
93 void SetFDPeakLimitByRun(Int_t runId);
94 Int_t GetBC2Int(Int_t leftEl, Int_t rightEl);
95 Bool_t IsBDTriggered();
96 Bool_t IsFDTriggered();
97
98 ClassDef(BmnTriggerEfficiencyRun8, 3)
99};
100
101#endif
Bool_t GetFluxRejectionFactorWithError(Double_t &factor, Double_t &err)
Bool_t IsEventAnalysable(Int_t evId)
Double_t GetFDEfficiency(Int_t runId, Int_t ntrPV)
BmnTriggerEfficiencyRun8(TString dstFileName)
Bool_t GetTriggerEfficiencyWithErrors(Double_t &eff, Double_t &statErr, Double_t &systErr, Double_t &errSystErr)
BmnTriggerEfficiencyRun8(Int_t runId, BmnTrigInfoDst *trigInfo, CbmVertex *primaryVertex)
Double_t GetTriggerEfficiency(Int_t runId, Int_t ntrPV)
Bool_t GetFluxRejectionFactorWithError(Int_t runId, Double_t &factor, Double_t &err)
Bool_t GetTriggerEfficiencyWithErrors(Int_t runId, Int_t ntrPV, Double_t &eff, Double_t &statErr, Double_t &systErr, Double_t &errSystErr)
Double_t GetBDEfficiency(Int_t runId, Int_t ntrPV)
STL namespace.