]>
Commit | Line | Data |
---|---|---|
23536a91 | 1 | #include "TH1.h" |
2 | #include "TH2.h" | |
3 | #include "TH3.h" | |
4 | ||
5 | #include "AliLog.h" | |
6 | ||
7 | #include "AliAnalysisTaskSE.h" | |
8 | ||
9 | #define ID(x) x, #x | |
10 | #define LAB(x) x + 1, #x | |
11 | ||
12 | class TList; | |
13 | class TClonesArray; | |
14 | class AliVParticle; | |
15 | class AliVTrack; | |
16 | class AliPIDResponse; | |
17 | class AliEventPoolManager; | |
18 | class AliEventPool; | |
19 | class AliESDtrackCuts; | |
20 | ||
21 | class AliAnalysisTaskJetProtonCorr : | |
22 | public AliAnalysisTaskSE | |
23 | { | |
24 | public: | |
25 | AliAnalysisTaskJetProtonCorr(const char *name = "jets_trg_trd"); | |
26 | ~AliAnalysisTaskJetProtonCorr(); | |
27 | ||
28 | // analysis operations | |
29 | virtual void UserCreateOutputObjects(); | |
30 | virtual Bool_t Notify(); | |
31 | virtual void UserExec(Option_t *option); | |
32 | virtual void Terminate(const Option_t *option); | |
33 | ||
34 | // task configuration | |
35 | void SetJetBranchName(const char* const branchName) { strncpy(fJetBranchName, branchName, fgkStringLength); } | |
36 | const char* GetJetBranchName() const { return fJetBranchName; } | |
37 | ||
38 | void SetPtThrPart(Float_t minPt, Float_t maxPt) { fTrgPartPtMin = minPt; fTrgPartPtMax = maxPt; } | |
39 | Float_t GetPtMinPart() const { return fTrgPartPtMin; } | |
40 | Float_t GetPtMaxPart() const { return fTrgPartPtMax; } | |
41 | void SetPtThrJet(Float_t minPt, Float_t maxPt) { fTrgJetPtMin = minPt; fTrgJetPtMax = maxPt; } | |
42 | Float_t GetPtMinJet() const { return fTrgJetPtMin; } | |
43 | Float_t GetPtMaxJet() const { return fTrgJetPtMax; } | |
44 | void SetPtThrAss(Float_t minPt, Float_t maxPt) { fAssPartPtMin = minPt; fAssPartPtMax = maxPt; } | |
45 | Float_t GetPtMinAss() const { return fAssPartPtMin; } | |
46 | Float_t GetPtMaxAss() const { return fAssPartPtMax; } | |
47 | ||
48 | // histograms | |
49 | enum Hist_t { | |
50 | kHistStat = 0, | |
51 | kHistCentrality, | |
52 | kHistCentralityUsed, | |
53 | kHistCentralityCheck, | |
54 | kHistCentralityCheckUsed, | |
55 | kHistNsigmaTPCTOF, | |
56 | kHistEvPlane, | |
57 | kHistEvPlaneUsed, | |
58 | kHistJetPt, | |
59 | kHistEtaPhiTrgHad, | |
60 | kHistEtaPhiTrgJet, | |
61 | kHistEtaPhiAssHad, | |
62 | kHistEtaPhiAssProt, | |
63 | kHistLast | |
64 | }; | |
65 | ||
66 | // statistics | |
67 | enum Stat_t { | |
68 | kStatSeen = 1, | |
69 | kStatTrg, | |
70 | kStatUsed, | |
71 | kStatCent, | |
72 | kStatEvPlane, | |
73 | kStatPID, | |
74 | kStatEvCuts, | |
75 | kStatLast | |
76 | }; | |
77 | ||
78 | // trigger conditions | |
79 | enum Trigger_t { | |
80 | kTriggerMB = 0, | |
81 | kTriggerInt, | |
82 | kTriggerLast | |
83 | }; | |
84 | ||
85 | // classification | |
86 | enum CorrType_t { | |
87 | kCorrHadHad = 0, | |
88 | kCorrHadProt, | |
89 | kCorrJetHad, | |
90 | kCorrJetProt, | |
91 | kCorrLast | |
92 | }; | |
93 | ||
94 | enum Class_t { | |
95 | kClCentral = 0, | |
96 | kClSemiCentral, | |
97 | kClDijet, | |
98 | kClLast | |
99 | }; | |
100 | ||
101 | enum Trg_t { | |
102 | kTrgHad = 0, | |
103 | kTrgJet, | |
104 | kTrgLast | |
105 | }; | |
106 | ||
107 | enum Ass_t { | |
108 | kAssHad, | |
109 | kAssProt, | |
110 | kAssLast | |
111 | }; | |
112 | ||
113 | enum Ev_t { | |
114 | kEvSame = 0, | |
115 | kEvMix, | |
116 | kEvLast | |
117 | }; | |
118 | ||
119 | class AliHistCorr : public TNamed { | |
120 | public: | |
121 | AliHistCorr(TString name, TList *outputList = 0x0); | |
122 | ~AliHistCorr(); | |
123 | ||
124 | void Trigger(Float_t weight = 1.) { fHistStat->Fill(1., weight); } | |
125 | void Fill(AliVParticle *trgPart, AliVParticle *assPart, Float_t weight = 1.); | |
126 | ||
127 | protected: | |
128 | TList *fOutputList; | |
129 | ||
130 | TH1F *fHistStat; | |
131 | ||
132 | TH1F *fHistCorrPhi; | |
133 | TH2F *fHistCorrPhi2; | |
134 | TH2F *fHistCorrEtaPhi; | |
135 | ||
136 | AliHistCorr(const AliHistCorr &rhs); | |
137 | AliHistCorr& operator=(const AliHistCorr &rhs); | |
138 | ||
139 | ClassDef(AliHistCorr, 1); | |
140 | }; | |
141 | ||
142 | AliHistCorr*& GetHistCorr(CorrType_t corr, Class_t cl, Ev_t ev) { return fHistCorr[kEvLast*(kClLast*corr + cl) + ev]; } | |
143 | AliEventPoolManager*& GetPoolMgr(Trg_t trg, Ass_t ass) { return fPoolMgr[kTrgLast * ass + trg]; } | |
144 | AliEventPool*& GetPool(Class_t cls, Trg_t trg, Ass_t ass) { return fPool[kClLast * (kTrgLast * ass + trg) + cls]; } | |
145 | ||
146 | protected: | |
147 | AliMCEvent *fMCEvent; //! | |
148 | AliESDEvent *fESDEvent; //! | |
149 | AliAODEvent *fAODEvent; //! | |
150 | ||
151 | UInt_t fTriggerMask; //! internal representation of trigger conditions | |
152 | UInt_t fClassMask; //! internal representation of event classes | |
153 | Float_t fCentrality; //! | |
154 | Float_t fCentralityCheck; //! | |
155 | Float_t fZvtx; //! | |
156 | AliPIDResponse *fPIDResponse; //! | |
157 | Float_t fEventPlane; //! | |
158 | TObjArray *fPrimTrackArray; //! | |
159 | TClonesArray *fJetArray; //! | |
160 | ||
161 | AliEventPoolManager *fPoolMgr[kTrgLast * kAssLast]; //! | |
162 | AliEventPool *fPool[kClLast * kTrgLast * kAssLast]; //! | |
163 | ||
164 | AliHistCorr **fHistCorr; //! [kCorrLast*kEvLast*kClLast]; //! | |
165 | ||
166 | Bool_t DetectTriggers(); | |
167 | void MarkTrigger(Trigger_t trg) { fTriggerMask |= (1 << trg); } | |
168 | Bool_t IsTrigger(Trigger_t trg) const { return (fTriggerMask & (1 << trg)); } | |
169 | ||
170 | Bool_t DetectClasses(); | |
171 | void MarkClass(Class_t cl) { fClassMask |= (1 << cl); } | |
172 | Bool_t IsClass(Class_t cl) const { return (fClassMask & (1 << cl)); } | |
173 | ||
174 | Bool_t PrepareEvent(); | |
175 | Bool_t CleanUpEvent(); | |
176 | ||
177 | Float_t GetCentrality() const { return fCentrality; } | |
178 | Float_t GetEventPlane() const { return fEventPlane; } | |
179 | AliPIDResponse* GetPID() const { return fPIDResponse; } | |
180 | Bool_t IsCentral() { return ((fCentrality >= 0.) && (fCentrality <= 10.)); } | |
181 | Bool_t IsSemiCentral() { return ((fCentrality >= 30.) && (fCentrality <= 50.)); } | |
182 | ||
183 | Bool_t AcceptTrigger(AliVTrack *trg); | |
184 | Bool_t AcceptTrigger(AliAODJet *trg); | |
185 | Bool_t AcceptAssoc(AliVTrack *ass); | |
186 | Bool_t IsProton(AliVTrack *trk); | |
187 | ||
188 | TObjArray* CloneTracks(TObjArray *tracks) const; | |
189 | ||
190 | Bool_t Correlate(CorrType_t corr, Class_t cl, Ev_t ev, | |
191 | TCollection *trgArray, TCollection *assArray, Float_t weight = 1.); | |
192 | ||
193 | Bool_t Correlate(Trg_t trg, Ass_t ass, Class_t cl, Ev_t ev, | |
194 | TCollection *trgArray, TCollection *assArray, Float_t weight = 1.); | |
195 | ||
196 | // output objects | |
197 | TList *fOutputList; //! list of output objects | |
198 | ||
199 | // histogram management | |
200 | TH1 *fHist[kHistLast]; //! pointers to histogram | |
201 | const char *fShortTaskId; //! short identifier for the task | |
202 | ||
203 | TH1*& GetHistogram(Hist_t hist, const Int_t idx = 0) { return fHist[hist + idx]; } | |
204 | ||
205 | TH1* AddHistogram(Hist_t hist, const char *hid, TString title, | |
206 | Int_t xbins, Float_t xmin, Float_t xmax, Int_t binType = 1); | |
207 | TH2* AddHistogram(Hist_t hist, const char *hid, TString title, | |
208 | Int_t xbins, Float_t xmin, Float_t xmax, | |
209 | Int_t ybins, Float_t ymin, Float_t ymax, Int_t binType = 1); | |
210 | TH3* AddHistogram(Hist_t hist, const char *hid, TString title, | |
211 | Int_t xbins, Float_t xmin, Float_t xmax, | |
212 | Int_t ybins, Float_t ymin, Float_t ymax, | |
213 | Int_t zbins, Float_t zmin, Float_t zmax, Int_t binType = 1); | |
214 | ||
215 | void FillH1(Hist_t hist, Float_t x, Float_t weight = 1., Int_t idx = 0) | |
216 | { GetHistogram(hist, idx)->Fill(x, weight); } | |
217 | void FillH2(Hist_t hist, Float_t x, Float_t y, Float_t weight = 1., Int_t idx = 0) | |
218 | { ((TH2*) GetHistogram(hist, idx))->Fill(x, y, weight); } | |
219 | void FillH3(Hist_t hist, Float_t x, Float_t y, Float_t z, Float_t weight = 1., Int_t idx = 0) | |
220 | { ((TH3*) GetHistogram(hist, idx))->Fill(x, y, z, weight); } | |
221 | ||
222 | const char* fkCorrTypeName[kCorrLast]; //! | |
223 | const char* fkClassName[kClLast]; //! | |
224 | const char* fkEvName[kEvLast]; //! | |
225 | ||
226 | // task configuration | |
227 | static const Int_t fgkStringLength = 100; // max length for the jet branch name | |
228 | char fJetBranchName[fgkStringLength]; // jet branch name | |
229 | ||
230 | AliESDtrackCuts *fCutsPrim; // track cuts for primary particles | |
231 | ||
232 | Float_t fTrgPartPtMin; | |
233 | Float_t fTrgPartPtMax; | |
234 | Float_t fTrgJetPtMin; | |
235 | Float_t fTrgJetPtMax; | |
236 | Float_t fAssPartPtMin; | |
237 | Float_t fAssPartPtMax; | |
238 | ||
239 | // not implemented | |
240 | AliAnalysisTaskJetProtonCorr(const AliAnalysisTaskJetProtonCorr &rhs); | |
241 | AliAnalysisTaskJetProtonCorr& operator=(const AliAnalysisTaskJetProtonCorr &rhs); | |
242 | ||
243 | ClassDef(AliAnalysisTaskJetProtonCorr, 1); | |
244 | }; |