7 #include "AliAnalysisTaskSE.h"
10 #define LAB(x) x + 1, #x
17 class AliEventPoolManager;
19 class AliESDtrackCuts;
21 class AliAnalysisTaskJetProtonCorr :
22 public AliAnalysisTaskSE
25 AliAnalysisTaskJetProtonCorr(const char *name = "jets_trg_trd");
26 ~AliAnalysisTaskJetProtonCorr();
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);
35 void SetJetBranchName(const char* const branchName) { strncpy(fJetBranchName, branchName, fgkStringLength); }
36 const char* GetJetBranchName() const { return fJetBranchName; }
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; }
54 kHistCentralityCheckUsed,
119 class AliHistCorr : public TNamed {
121 AliHistCorr(TString name, TList *outputList = 0x0);
124 void Trigger(Float_t weight = 1.) { fHistStat->Fill(1., weight); }
125 void Fill(AliVParticle *trgPart, AliVParticle *assPart, Float_t weight = 1.);
134 TH2F *fHistCorrEtaPhi;
136 AliHistCorr(const AliHistCorr &rhs);
137 AliHistCorr& operator=(const AliHistCorr &rhs);
139 ClassDef(AliHistCorr, 1);
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]; }
147 AliMCEvent *fMCEvent; //!
148 AliESDEvent *fESDEvent; //!
149 AliAODEvent *fAODEvent; //!
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; //!
156 AliPIDResponse *fPIDResponse; //!
157 Float_t fEventPlane; //!
158 TObjArray *fPrimTrackArray; //!
159 TClonesArray *fJetArray; //!
161 AliEventPoolManager *fPoolMgr[kTrgLast * kAssLast]; //!
162 AliEventPool *fPool[kClLast * kTrgLast * kAssLast]; //!
164 AliHistCorr **fHistCorr; //! [kCorrLast*kEvLast*kClLast]; //!
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)); }
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)); }
174 Bool_t PrepareEvent();
175 Bool_t CleanUpEvent();
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.)); }
183 Bool_t AcceptTrigger(AliVTrack *trg);
184 Bool_t AcceptTrigger(AliAODJet *trg);
185 Bool_t AcceptAssoc(AliVTrack *ass);
186 Bool_t IsProton(AliVTrack *trk);
188 TObjArray* CloneTracks(TObjArray *tracks) const;
190 Bool_t Correlate(CorrType_t corr, Class_t cl, Ev_t ev,
191 TCollection *trgArray, TCollection *assArray, Float_t weight = 1.);
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.);
197 TList *fOutputList; //! list of output objects
199 // histogram management
200 TH1 *fHist[kHistLast]; //! pointers to histogram
201 const char *fShortTaskId; //! short identifier for the task
203 TH1*& GetHistogram(Hist_t hist, const Int_t idx = 0) { return fHist[hist + idx]; }
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);
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); }
222 const char* fkCorrTypeName[kCorrLast]; //!
223 const char* fkClassName[kClLast]; //!
224 const char* fkEvName[kEvLast]; //!
226 // task configuration
227 static const Int_t fgkStringLength = 100; // max length for the jet branch name
228 char fJetBranchName[fgkStringLength]; // jet branch name
230 AliESDtrackCuts *fCutsPrim; // track cuts for primary particles
232 Float_t fTrgPartPtMin;
233 Float_t fTrgPartPtMax;
234 Float_t fTrgJetPtMin;
235 Float_t fTrgJetPtMax;
236 Float_t fAssPartPtMin;
237 Float_t fAssPartPtMax;
240 AliAnalysisTaskJetProtonCorr(const AliAnalysisTaskJetProtonCorr &rhs);
241 AliAnalysisTaskJetProtonCorr& operator=(const AliAnalysisTaskJetProtonCorr &rhs);
243 ClassDef(AliAnalysisTaskJetProtonCorr, 1);