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-1); }
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; }
48 void PrintTask(Option_t *option, Int_t indent) const;
50 static Double_t TOFsignal(Double_t *x, Double_t *par)
52 Double_t norm = par[0];
53 Double_t mean = par[1];
54 Double_t sigma = par[2];
55 Double_t tail = par[3];
57 if (x[0] <= (tail + mean))
58 return norm * TMath::Gaus(x[0], mean, sigma);
60 return norm * TMath::Gaus(tail + mean, mean, sigma) * TMath::Exp(-tail * (x[0] - tail - mean) / (sigma * sigma));
69 kHistCentralityCheckUsed,
83 kHistExpSigmaTOFeSemi,
84 kHistExpSigmaTOFmuSemi,
85 kHistExpSigmaTOFpiSemi,
86 kHistExpSigmaTOFkSemi,
87 kHistExpSigmaTOFpSemi,
88 kHistExpSigmaTOFdSemi,
95 kHistCmpSigmaTOFeSemi,
96 kHistCmpSigmaTOFmuSemi,
97 kHistCmpSigmaTOFpiSemi,
98 kHistCmpSigmaTOFkSemi,
99 kHistCmpSigmaTOFpSemi,
100 kHistCmpSigmaTOFdSemi,
114 kHistNsigmaTOFmismatch,
115 kHistNsigmaTOFmismatch2,
123 kHistNsigmaTPCmuSemi,
124 kHistNsigmaTPCpiSemi,
128 kHistNsigmaTPCe_eSemi,
130 kHistNsigmaTOFmuSemi,
131 kHistNsigmaTOFpiSemi,
135 kHistNsigmaTOFmismatchSemi,
136 kHistNsigmaTOFmismatch2Semi,
145 kHistNsigmaTPCTOFUsed,
146 kHistNsigmaTPCTOFUsedCentral,
147 kHistNsigmaTPCTOFUsedSemiCentral,
148 kHistNsigmaTPCTOFUsedPt,
149 kHistNsigmaTPCTOFUsedPtCentral,
150 kHistNsigmaTPCTOFUsedPtSemiCentral,
154 kHistEvPlaneCheckUsed,
179 // trigger conditions
220 class AliHistCorr : public TNamed {
222 AliHistCorr(TString name, TList *outputList = 0x0);
225 void Trigger(Float_t weight = 1.) { fHistStat->Fill(1., weight); }
226 void Fill(AliVParticle *trgPart, AliVParticle *assPart, Float_t weight = 1.);
235 TH2F *fHistCorrEtaPhi;
237 AliHistCorr(const AliHistCorr &rhs);
238 AliHistCorr& operator=(const AliHistCorr &rhs);
240 ClassDef(AliHistCorr, 1);
243 AliHistCorr*& GetHistCorr(CorrType_t corr, Class_t cl, Ev_t ev) { return fHistCorr[kEvLast*(kClLast*corr + cl) + ev]; }
244 AliEventPoolManager*& GetPoolMgr(Trg_t trg, Ass_t ass) { return fPoolMgr[kTrgLast * ass + trg]; }
245 AliEventPool*& GetPool(Class_t cls, Trg_t trg, Ass_t ass) { return fPool[kClLast * (kTrgLast * ass + trg) + cls]; }
248 AliMCEvent *fMCEvent; //!
249 AliESDEvent *fESDEvent; //!
250 AliAODEvent *fAODEvent; //!
252 UInt_t fTriggerMask; //! internal representation of trigger conditions
253 UInt_t fClassMask; //! internal representation of event classes
254 Float_t fCentrality; //!
255 Float_t fCentralityCheck; //!
257 AliPIDResponse *fPIDResponse; //!
258 Float_t fEventPlane; //!
259 Float_t fEventPlaneCheck; //!
260 TObjArray *fPrimTrackArray; //!
261 TClonesArray *fJetArray; //!
263 AliEventPoolManager *fPoolMgr[kTrgLast * kAssLast]; //!
264 AliEventPool *fPool[kClLast * kTrgLast * kAssLast]; //!
266 AliHistCorr **fHistCorr; //! [kCorrLast*kEvLast*kClLast]; //!
268 Bool_t DetectTriggers();
269 void MarkTrigger(Trigger_t trg) { fTriggerMask |= (1 << trg); }
270 Bool_t IsTrigger(Trigger_t trg) const { return (fTriggerMask & (1 << trg)); }
272 Bool_t DetectClasses();
273 void MarkClass(Class_t cl) { fClassMask |= (1 << cl); }
274 Bool_t IsClass(Class_t cl) const { return (fClassMask & (1 << cl)); }
276 Bool_t PrepareEvent();
277 Bool_t CleanUpEvent();
279 Float_t GetCentrality() const { return fCentrality; }
280 Float_t GetEventPlane() const { return fEventPlane; }
281 AliPIDResponse* GetPID() const { return fPIDResponse; }
282 Bool_t IsCentral() { return ((fCentrality >= 0.) && (fCentrality <= 10.)); }
283 Bool_t IsSemiCentral() { return ((fCentrality >= 30.) && (fCentrality <= 50.)); }
285 AliVTrack* GetLeadingTrack(AliAODJet *jet) const;
287 Float_t GetDPhiStar(Float_t phi1, Float_t pt1, Float_t charge1,
288 Float_t phi2, Float_t pt2, Float_t charge2,
289 Float_t radius, Float_t bSign);
291 Bool_t AcceptTrigger(AliVTrack *trg);
292 Bool_t AcceptTrigger(AliAODJet *trg);
293 Bool_t AcceptAssoc(AliVTrack *trk);
294 Bool_t IsProton(AliVTrack *trk);
295 Bool_t AcceptAngleToEvPlane(Float_t phi, Float_t psi);
296 Bool_t AcceptTwoTracks(AliVParticle *trgPart, AliVParticle *assPart);
298 TObjArray* CloneTracks(TObjArray *tracks) const;
300 Bool_t Correlate(CorrType_t corr, Class_t cl, Ev_t ev,
301 TCollection *trgArray, TCollection *assArray, Float_t weight = 1.);
303 Bool_t Correlate(Trg_t trg, Ass_t ass, Class_t cl, Ev_t ev,
304 TCollection *trgArray, TCollection *assArray, Float_t weight = 1.);
307 TList *fOutputList; //! list of output objects
309 // histogram management
310 TH1 *fHist[kHistLast]; //! pointers to histogram
311 const char *fShortTaskId; //! short identifier for the task
313 TH1*& GetHistogram(Hist_t hist, const Int_t idx = 0) { return fHist[hist + idx]; }
315 TH1* AddHistogram(Hist_t hist, const char *hid, TString title,
316 Int_t xbins, Float_t xmin, Float_t xmax, Int_t binType = 1);
317 TH2* AddHistogram(Hist_t hist, const char *hid, TString title,
318 Int_t xbins, Float_t xmin, Float_t xmax,
319 Int_t ybins, Float_t ymin, Float_t ymax, Int_t binType = 1);
320 TH3* AddHistogram(Hist_t hist, const char *hid, TString title,
321 Int_t xbins, Float_t xmin, Float_t xmax,
322 Int_t ybins, Float_t ymin, Float_t ymax,
323 Int_t zbins, Float_t zmin, Float_t zmax, Int_t binType = 1);
325 void FillH1(Hist_t hist, Float_t x, Float_t weight = 1., Int_t idx = 0)
326 { GetHistogram(hist, idx)->Fill(x, weight); }
327 void FillH2(Hist_t hist, Float_t x, Float_t y, Float_t weight = 1., Int_t idx = 0)
328 { ((TH2*) GetHistogram(hist, idx))->Fill(x, y, weight); }
329 void FillH3(Hist_t hist, Float_t x, Float_t y, Float_t z, Float_t weight = 1., Int_t idx = 0)
330 { ((TH3*) GetHistogram(hist, idx))->Fill(x, y, z, weight); }
332 const char* fkCorrTypeName[kCorrLast]; //!
333 const char* fkClassName[kClLast]; //!
334 const char* fkEvName[kEvLast]; //!
336 // task configuration
337 static const Int_t fgkStringLength = 100; // max length for the jet branch name
338 char fJetBranchName[fgkStringLength]; // jet branch name
340 Bool_t fUseStandardCuts;
342 AliESDtrackCuts *fCutsPrim; // track cuts for primary particles
343 Float_t fCutsTwoTrackEff;
345 Float_t fTrgPartPtMin;
346 Float_t fTrgPartPtMax;
347 Float_t fTrgJetPtMin;
348 Float_t fTrgJetPtMax;
349 Float_t fTrgJetLeadTrkPtMin;
350 Float_t fAssPartPtMin;
351 Float_t fAssPartPtMax;
352 Float_t fTrgAngleToEvPlane;
355 AliAnalysisTaskJetProtonCorr(const AliAnalysisTaskJetProtonCorr &rhs);
356 AliAnalysisTaskJetProtonCorr& operator=(const AliAnalysisTaskJetProtonCorr &rhs);
358 ClassDef(AliAnalysisTaskJetProtonCorr, 1);