]>
Commit | Line | Data |
---|---|---|
7032c043 | 1 | #include "TH1.h" |
2 | #include "TH2.h" | |
3 | #include "TH3.h" | |
4 | ||
5 | #include "AliLog.h" | |
6 | ||
7 | #include "AliAnalysisTaskSE.h" | |
ebdf1dbb | 8 | #include "AliTRDTriggerAnalysis.h" |
7032c043 | 9 | |
e7808ddf | 10 | #define ID(x) x, #x |
7032c043 | 11 | |
12 | class TList; | |
13 | ||
14 | class AliAnalysisTaskJetsTriggerTRD : | |
15 | public AliAnalysisTaskSE | |
16 | { | |
17 | public: | |
18 | AliAnalysisTaskJetsTriggerTRD(const char *name = "jets_trg_trd"); | |
19 | ~AliAnalysisTaskJetsTriggerTRD(); | |
20 | ||
21 | // analysis operations | |
22 | virtual void UserCreateOutputObjects(); | |
23 | virtual Bool_t Notify(); | |
24 | virtual void UserExec(Option_t *option); | |
25 | virtual void Terminate(const Option_t *option); | |
26 | ||
27 | // task configuration | |
28 | void SetNumberOfJetPtBins(Int_t n) { fNoJetPtBins = n; } | |
29 | Int_t GetNumberOfJetPtBins() const { return fNoJetPtBins; } | |
30 | ||
31 | void SetJetPtBinMax(Float_t ptmax) { fJetPtBinMax = ptmax; } | |
32 | Float_t GetJetPtBinMax() const { return fJetPtBinMax; } | |
33 | ||
ebdf1dbb | 34 | void SetJetBranchName(const char* const branchName) { strncpy(fJetBranchName, branchName, fgkStringLength-1); } |
7032c043 | 35 | const char* GetJetBranchName() const { return fJetBranchName; } |
36 | ||
ebdf1dbb | 37 | Bool_t HasMC() const { return fMCEventHandler != 0; } |
38 | Bool_t AcceptTrackMC(Int_t track) const; | |
39 | ||
e7808ddf | 40 | // histograms |
41 | enum Hist_t { | |
42 | kHistStat = 0, | |
ebdf1dbb | 43 | kHistXsection, |
44 | kHistPtHard, | |
a26539a7 | 45 | kHistJetPtMC, |
ebdf1dbb | 46 | kHistJetEtaAvg, |
e7808ddf | 47 | kHistNoJets, |
48 | kHistTrackGTU, | |
ebdf1dbb | 49 | kHistTrackEffGTU, |
50 | kHistTrackEffMC, | |
a26539a7 | 51 | kHistNPtMin, |
52 | kHistLeadJetPt, | |
ebdf1dbb | 53 | kHistLeadJetPtEta, |
54 | kHistLeadJetPtPhi, | |
55 | kHistLeadJetEtaPhi, | |
56 | kHistLeadJetPtTrackPt, | |
57 | kHistLeadJetPtZ, | |
58 | kHistLeadJetPtXi, | |
a26539a7 | 59 | kHistJetPt, |
ebdf1dbb | 60 | kHistJetPtEta, |
61 | kHistJetPtPhi, | |
62 | kHistJetEtaPhi, | |
a26539a7 | 63 | kHistJetPtITS, |
64 | kHistJetPt3x3, | |
ebdf1dbb | 65 | kHistJetPtTrackPt, |
66 | kHistJetPtZ, | |
67 | kHistJetPtXi, | |
e7808ddf | 68 | kHistJetPtNoTracks3, |
69 | kHistLast | |
70 | }; | |
71 | ||
72 | // statistics | |
73 | enum Stat_t { | |
74 | kStatSeen = 1, | |
a26539a7 | 75 | kStatTrg, |
e7808ddf | 76 | kStatUsed, |
a26539a7 | 77 | kStatEvCuts, |
e7808ddf | 78 | kStatLast |
79 | }; | |
80 | ||
81 | // trigger conditions | |
a26539a7 | 82 | enum Trigger_t { |
83 | // untriggered | |
84 | kTrgMinBias = 1, // CINT1 | |
85 | kTrgInt7, | |
86 | kTrgInt8, | |
87 | kTrgEMC7, | |
88 | kTrgEMC8, | |
89 | // TRD jet trigger (HJT) | |
90 | kTrgInt7WUHJT, | |
91 | kTrgInt8WUHJT, | |
92 | kTrgEMC7WUHJT, | |
93 | kTrgEMC8WUHJT, | |
6883db3e | 94 | kTrgEMCEJE, |
95 | kTrgEMCEGA, | |
ebdf1dbb | 96 | // analysis-level combinations |
97 | kTrgInt7_WU, | |
98 | kTrgInt7_WUHJT, | |
99 | kTrgEMCEJE_WU, | |
100 | kTrgEMCEJE_WUHJT, | |
101 | // PbPb | |
102 | kTrgPbPb, | |
103 | kTrgCentral, | |
104 | kTrgSemiCentral, | |
a26539a7 | 105 | // |
106 | kTrgLast | |
e7808ddf | 107 | }; |
7032c043 | 108 | |
ebdf1dbb | 109 | enum TriggerMC_t { |
110 | kTrgMC3x3Vtx = kTrgLast, | |
111 | kTrgMC3x3TRD, | |
112 | kTrgMC3x3TRDeff, | |
113 | kTrgMC3x3TRDeffmap, | |
114 | kTrgMCLast | |
115 | }; | |
116 | ||
7032c043 | 117 | protected: |
e7808ddf | 118 | UInt_t fTriggerMask; // internal representation of trigger conditions |
ebdf1dbb | 119 | AliTRDTriggerAnalysis fTrdTrg; //! TRD trigger analysis |
e7808ddf | 120 | |
121 | Bool_t DetectTriggers(); | |
ebdf1dbb | 122 | Bool_t DetectMCTriggers(); |
e7808ddf | 123 | void MarkTrigger(Trigger_t trg) { fTriggerMask |= (1 << trg); } |
ebdf1dbb | 124 | void MarkTrigger(TriggerMC_t trg) { fTriggerMask |= (1 << trg); } |
e7808ddf | 125 | Bool_t IsTrigger(Trigger_t trg) const { return (fTriggerMask & (1 << trg)); } |
126 | ||
ebdf1dbb | 127 | Float_t GetEfficiencyTRD(Float_t /* pt */, Float_t /* eta */, Float_t /* phi */) { return 0.7; } |
128 | ||
e7808ddf | 129 | // output objects |
7032c043 | 130 | TList *fOutputList; // list of output objects |
131 | ||
132 | // histogram management | |
133 | TH1 *fHist[kHistLast]; //! pointers to histogram | |
134 | const char *fShortTaskId; //! short identifier for the task | |
135 | ||
ebdf1dbb | 136 | Int_t fNoTriggers; // numbers of triggers used in histograms |
137 | ||
34e8fe1d | 138 | TH1*& GetHistogram(Hist_t hist, Int_t idx = 0) { return fHist[hist + idx]; } |
7032c043 | 139 | |
140 | TH1* AddHistogram(Hist_t hist, const char *hid, TString title, | |
141 | Int_t xbins, Float_t xmin, Float_t xmax, Int_t binType = 1); | |
142 | TH2* AddHistogram(Hist_t hist, const char *hid, TString title, | |
143 | Int_t xbins, Float_t xmin, Float_t xmax, | |
144 | Int_t ybins, Float_t ymin, Float_t ymax, Int_t binType = 1); | |
145 | TH3* AddHistogram(Hist_t hist, const char *hid, TString title, | |
146 | Int_t xbins, Float_t xmin, Float_t xmax, | |
147 | Int_t ybins, Float_t ymin, Float_t ymax, | |
148 | Int_t zbins, Float_t zmin, Float_t zmax, Int_t binType = 1); | |
149 | ||
150 | void FillH1(Hist_t hist, Float_t x, Float_t weight = 1., Int_t idx = 0) | |
151 | { GetHistogram(hist, idx)->Fill(x, weight); } | |
152 | void FillH2(Hist_t hist, Float_t x, Float_t y, Float_t weight = 1., Int_t idx = 0) | |
153 | { ((TH2*) GetHistogram(hist, idx))->Fill(x, y, weight); } | |
154 | void FillH3(Hist_t hist, Float_t x, Float_t y, Float_t z, Float_t weight = 1., Int_t idx = 0) | |
155 | { ((TH3*) GetHistogram(hist, idx))->Fill(x, y, z, weight); } | |
156 | ||
157 | // task configuration | |
158 | Int_t fNoJetPtBins; // number of bins for jet pt | |
159 | Float_t fJetPtBinMax; // max jet pt (GeV) in histograms | |
160 | ||
ebdf1dbb | 161 | Float_t fAvgXsection; // x-section from PYTHIA |
a26539a7 | 162 | Float_t fAvgTrials; // ratio of PYTHIA events |
163 | // over accepted events | |
164 | Float_t fPtHard; // pt hard | |
ebdf1dbb | 165 | Int_t fNTrials; // total number of trials |
166 | ||
167 | Float_t fGlobalEfficiencyGTU; // global efficiency used trigger emulation on MC | |
a26539a7 | 168 | |
7032c043 | 169 | static const Int_t fgkStringLength = 100; // max length for the jet branch name |
170 | char fJetBranchName[fgkStringLength]; // jet branch name | |
171 | ||
ebdf1dbb | 172 | const Int_t fGtuLabel; // constrain to tracks with given label |
173 | ||
7032c043 | 174 | // not implemented |
175 | AliAnalysisTaskJetsTriggerTRD(const AliAnalysisTaskJetsTriggerTRD &rhs); | |
176 | AliAnalysisTaskJetsTriggerTRD& operator=(const AliAnalysisTaskJetsTriggerTRD &rhs); | |
177 | ||
178 | ClassDef(AliAnalysisTaskJetsTriggerTRD, 1); | |
179 | }; |