1 // Dihadron correlations task - simple task to read ESD or AOD input,
2 // calculate same- and mixed-event correlations, and fill THnSparse
3 // output. -A. Adare, Apr 2011, updated Mar 2012
8 #include "AliAnalysisTaskSE.h"
22 class AliAnalysisUtils;
24 class AliESDMuonTrack;
25 class AliESDtrackCuts;
26 class AliEvtPoolManager;
28 class AliDhcTask : public AliAnalysisTaskSE {
31 AliDhcTask(const char *name, Bool_t def=kFALSE);
32 virtual ~AliDhcTask();
34 void SetAllTAHists(Bool_t b) { fAllTAHists = b; }
35 void SetAnaMode(Int_t iAna);
36 void SetCentBins(TAxis *bins) { fBCent=bins; }
37 void SetCentMethod(const char *name) { fCentMethod = name; }
38 void SetCentMixBins(TAxis *bins) { fMixBCent=bins; }
39 void SetClassName(const char *n) { fClassName = n; }
40 void SetDEtaDPhiBins(Int_t nbe, Int_t nbp) { fNBdeta=nbe; fNBdphi=nbp; }
41 void SetDoFillSame(Bool_t b) { fDoFillSame = b; }
42 void SetDoMassCut(Bool_t b) { fDoMassCut = b; }
43 void SetCheckVertex(Bool_t b) { fCheckVertex = b; }
44 void SetDoWeights(Bool_t b) { fDoWeights = b; }
45 void SetEtaMax(Double_t eta) { fEtaMax = eta; }
46 void SetEtaTRange(Double_t eL, Double_t eH) { fEtaTLo=eL; fEtaTHi=eH; }
47 void SetEtaARange(Double_t eL, Double_t eH) { fEtaALo=eL; fEtaAHi=eH; }
48 void SetFillMuons(Bool_t b) { fFillMuons = b; }
49 void SetHEffA(THnF *h) { fHEffA=h; }
50 void SetHEffT(THnF *h) { fHEffT=h; }
51 void SetMixInEtaT(Bool_t b) { fMixInEtaT = b; }
52 void SetOmitFirstEv(Bool_t b) { fOmitFirstEv = b; }
53 void SetPoolSize(Int_t p) { fPoolSize = p; }
54 void SetPtABins(TAxis *bins) { fBPtA=bins; }
55 void SetPtRange(Double_t min, Double_t max) { fPtMin=min; fPtMax=max; }
56 void SetPtTACrit(Bool_t b) { fPtTACrit = b; }
57 void SetPtTBins(TAxis *bins) { fBPtT=bins; }
58 void SetTrackDepth(Int_t t) { fTrackDepth = t; }
59 void SetTracksName(const char *n) { fTracksName = n; }
60 void SetTriggerMatch(Bool_t b) { fTriggerMatch = b; }
61 void SetVerbosity(Int_t v) { fVerbosity = v; }
62 void SetZVtxBins(TAxis *bins) { fBZvtx=bins; }
63 void SetZVtxMixBins(TAxis *bins) { fMixBZvtx=bins; }
64 void SetZvtx(Double_t zvtx) { fZVtxMax = zvtx; }
65 void PrintDhcSettings();
67 enum eAnaMode {kHH=1, kMuH, kHMu, kMuMu, kPSide, kASide};
70 enum ePairingScheme {kSameEvt, kDiffEvt};
71 enum eDataType {kESD, kAOD};
74 void InitEventMixer();
75 void GetESDTracks(MiniEvent*);
76 void GetAODTracks(MiniEvent*);
77 Bool_t VertexOk() const;
78 Bool_t IsGoodMUONtrack(AliESDMuonTrack &track);
79 Bool_t IsGoodMUONtrack(AliAODTrack &track);
80 Bool_t IsTrigger(Double_t eta, Double_t pt);
81 Bool_t IsAssociated(Double_t eta, Double_t pt);
82 Double_t DeltaPhi(Double_t phia, Double_t phib,
83 Double_t rangeMin = -TMath::Pi()/2,
84 Double_t rangeMax = 3*TMath::Pi()/2) const;
85 Int_t Correlate(const MiniEvent &arr1, const MiniEvent &arr2, Int_t pairing = kSameEvt);
86 void UserCreateOutputObjects();
87 void UserExec(Option_t *option);
88 void Terminate(Option_t *);
91 Int_t fVerbosity; // 0 = silence
92 Double_t fEtaMax; // Max |eta| cut for standard ESD or AOD analysis
93 Double_t fZVtxMax; // Max |z| cut (cm)
94 Double_t fPtMin; // Min pt cut
95 Double_t fPtMax; // Max pt cut
96 Int_t fTrackDepth; // #tracks to fill pool
97 Int_t fPoolSize; // Maximum number of events
98 TString fTracksName; // name of track collection
99 Bool_t fDoWeights; // if true weight with 1/N per event
100 Bool_t fFillMuons; // fill the muon tracks into the mini event
101 Bool_t fPtTACrit; // use the pTT > pTA criterion?
102 Bool_t fAllTAHists; // create all pTT,pTA combination hists, even t<a?
103 Bool_t fMixInEtaT; // mix in bins of eta_T instead of z_vertex
104 Double_t fEtaTLo; // Min eta for triggers
105 Double_t fEtaTHi; // Max eta for triggers
106 Double_t fEtaALo; // Min eta for associated
107 Double_t fEtaAHi; // Max eta for associated
108 Bool_t fOmitFirstEv; // if true skip first event in chunk
109 Bool_t fDoFillSame; // If true fill same event immediately (not waiting for pool)
110 Bool_t fDoMassCut; // If true cut on invariant mass
111 Bool_t fCheckVertex; // switch to flase for MC generator-level analysis
112 TString fClassName; // If not null only process events with given class
113 TString fCentMethod; // centrality selection method
114 Int_t fNBdeta; // no. deta bins
115 Int_t fNBdphi; // no. dphi bins
116 Bool_t fTriggerMatch; // muon trigger match
117 TAxis *fBPtT; // ptt binning
118 TAxis *fBPtA; // pta binning
119 TAxis *fBCent; // centrality binning
120 TAxis *fBZvtx; // zvtx binning
121 TAxis *fMixBCent; // centrality binning for mixing
122 TAxis *fMixBZvtx; // zvtx binning for mixing
123 THnF *fHEffT; // efficiency for trigger particles
124 THnF *fHEffA; // efficiency for associate particles
125 AliESDEvent *fESD; //! ESD object
126 AliAODEvent *fAOD; //! AOD object
127 TList *fOutputList; //! Output list
128 TH2 *fHEvt; //! Cent vs vtx.
129 TH2 *fHTrk; //! Phi vs Eta
130 TH2 *fHPoolReady; //! Check how many Jobs start mixing
131 TH1 *fHPtAss; //! Pt ass
132 TH1 *fHPtTrg; //! Pt trg
133 TH1 *fHPtTrgEvt; //! Pt trg per event for weighting
134 TH3 *fHPtTrgNorm1S; //! Pt trg same events in cent. and zvtx bins, method 1
135 TH3 *fHPtTrgNorm1M; //! Pt trg mixed events in cent. and zvtx bins, method 1
136 TH3 *fHPtTrgNorm2S; //! Pt trg same events in cent. and zvtx bins, method 2
137 TH3 *fHPtTrgNorm2M; //! Pt trg mixed events in cent. and zvtx bins, method 2
138 TH1 *fHCent; //! Centrality
139 TH1 *fHZvtx; //! Zvertex
140 Int_t fNbins; //! Number of histogram bins
141 TH2 **fHSs; //! Same-evt correlations
142 TH2 **fHMs; //! Diff-evt correlations
143 TH1 **fHPts; //! Pt distributions
144 TH1 **fHSMass; //! Mass distributions same
145 TH1 **fHMMass; //! Mass distributions mixed
146 TH3 *fHQATp; //! positive trigger particle distribution for QA
147 TH3 *fHQAAp; //! associated particle distribution for QA
148 TH3 *fHQATpCorr; //! correction applied trigger distribution
149 TH3 *fHQAApCorr; //! correction applied associated distribution
150 TH3 *fHQATm; //! the same for negative particles
154 TH2 *fHPtCentT; //! trigger pT vs centrality
155 TH2 *fHPtCentA; //! associated pT vs centrality
156 TFormula *fIndex; //! index for histograms
157 Double_t fCentrality; //! centrality of current event
158 Double_t fZVertex; //! z vertex of current event
159 AliESDtrackCuts *fEsdTPCOnly; //! track cuts
160 AliEvtPoolManager *fPoolMgr; //! event mixer
161 AliAnalysisUtils *fUtils; //! analysis utils
163 AliDhcTask(const AliDhcTask&); // not implemented
164 AliDhcTask &operator=(const AliDhcTask&); // not implemented
166 ClassDef(AliDhcTask, 9)