]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/DPhi/FourierDecomposition/AliDhcTask.h
Add option to only run on events that have a muon, also a few fixes
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / FourierDecomposition / AliDhcTask.h
CommitLineData
48a61f36 1// Dihadron correlations task - simple task to read ESD or AOD input,
2// calculate same- and mixed-event correlations, and fill THnSparse
be8a5cdb 3// output. -A. Adare, Apr 2011, updated Mar 2012
48a61f36 4
5#ifndef AliDhcTask_cxx
6#define AliDhcTask_cxx
7
beb13b6c 8#include "AliAnalysisTaskSE.h"
9#include "AliPool.h"
beb13b6c 10
be8a5cdb 11class TFormula;
48a61f36 12class TH1;
13class TH2;
beb13b6c 14class TH3;
b3b66a56 15class THn;
d688e049 16class TAxis;
48a61f36 17class TObjArray;
be8a5cdb 18class TObject;
19class TProfile2D;
48a61f36 20class AliAODEvent;
b3b66a56 21class AliAODTrack;
22class AliAnalysisUtils;
be8a5cdb 23class AliESDEvent;
beb13b6c 24class AliESDMuonTrack;
b3b66a56 25class AliESDtrackCuts;
be8a5cdb 26class AliEvtPoolManager;
48a61f36 27
48a61f36 28class AliDhcTask : public AliAnalysisTaskSE {
29 public:
beb13b6c 30 AliDhcTask();
eee08176 31 AliDhcTask(const char *name, Bool_t def=kFALSE);
b673a083 32 virtual ~AliDhcTask();
48a61f36 33
5a6df06d 34 void SetAllTAHists(Bool_t b) { fAllTAHists = b; }
35 void SetAnaMode(Int_t iAna);
d688e049 36 void SetCentBins(TAxis *bins) { fBCent=bins; }
37 void SetCentMethod(const char *name) { fCentMethod = name; }
38 void SetCentMixBins(TAxis *bins) { fMixBCent=bins; }
5a6df06d 39 void SetClassName(const char *n) { fClassName = n; }
d688e049 40 void SetDEtaDPhiBins(Int_t nbe, Int_t nbp) { fNBdeta=nbe; fNBdphi=nbp; }
eee08176 41 void SetDoFillSame(Bool_t b) { fDoFillSame = b; }
98880cdf 42 void SetDoMassCut(Bool_t b) { fDoMassCut = b; }
ceeaa699 43 void SetCheckVertex(Bool_t b) { fCheckVertex = b; }
d688e049 44 void SetDoWeights(Bool_t b) { fDoWeights = b; }
45 void SetEtaMax(Double_t eta) { fEtaMax = eta; }
15b0d1bb 46 void SetEtaTRange(Double_t eL, Double_t eH) { fEtaTLo=eL; fEtaTHi=eH; }
a2dc255f 47 void SetEtaARange(Double_t eL, Double_t eH) { fEtaALo=eL; fEtaAHi=eH; }
5a6df06d 48 void SetFillMuons(Bool_t b) { fFillMuons = b; }
88f09b54 49 void SetRequireMuon(Bool_t b, Double_t l=0.5, Double_t h=4.0) {
50 fRequireMuon = b;
51 fReqPtLo = l;
52 fReqPtHi = h;
53 }
5a6df06d 54 void SetHEffA(THnF *h) { fHEffA=h; }
55 void SetHEffT(THnF *h) { fHEffT=h; }
56 void SetMixInEtaT(Bool_t b) { fMixInEtaT = b; }
b3b66a56 57 void SetOmitFirstEv(Bool_t b) { fOmitFirstEv = b; }
d688e049 58 void SetPoolSize(Int_t p) { fPoolSize = p; }
59 void SetPtABins(TAxis *bins) { fBPtA=bins; }
60 void SetPtRange(Double_t min, Double_t max) { fPtMin=min; fPtMax=max; }
5a6df06d 61 void SetPtTACrit(Bool_t b) { fPtTACrit = b; }
d688e049 62 void SetPtTBins(TAxis *bins) { fBPtT=bins; }
63 void SetTrackDepth(Int_t t) { fTrackDepth = t; }
64 void SetTracksName(const char *n) { fTracksName = n; }
f901a713 65 void SetTriggerMatch(Bool_t b) { fTriggerMatch = b; }
d688e049 66 void SetVerbosity(Int_t v) { fVerbosity = v; }
67 void SetZVtxBins(TAxis *bins) { fBZvtx=bins; }
68 void SetZVtxMixBins(TAxis *bins) { fMixBZvtx=bins; }
69 void SetZvtx(Double_t zvtx) { fZVtxMax = zvtx; }
d7149d30 70 void PrintDhcSettings();
b3b66a56 71
eee08176 72 enum eAnaMode {kHH=1, kMuH, kHMu, kMuMu, kPSide, kASide};
48a61f36 73
74 protected:
48a61f36 75 enum ePairingScheme {kSameEvt, kDiffEvt};
be8a5cdb 76 enum eDataType {kESD, kAOD};
48a61f36 77
be8a5cdb 78 void BookHistos();
79 void InitEventMixer();
f6701c6e 80 void GetESDTracks(MiniEvent*);
81 void GetAODTracks(MiniEvent*);
b3b66a56 82 Bool_t VertexOk() const;
beb13b6c 83 Bool_t IsGoodMUONtrack(AliESDMuonTrack &track);
b673a083 84 Bool_t IsGoodMUONtrack(AliAODTrack &track);
49e33473 85 Bool_t IsTrigger(Double_t eta, Double_t pt);
86 Bool_t IsAssociated(Double_t eta, Double_t pt);
beb13b6c 87 Double_t DeltaPhi(Double_t phia, Double_t phib,
be8a5cdb 88 Double_t rangeMin = -TMath::Pi()/2,
89 Double_t rangeMax = 3*TMath::Pi()/2) const;
d688e049 90 Int_t Correlate(const MiniEvent &arr1, const MiniEvent &arr2, Int_t pairing = kSameEvt);
be8a5cdb 91 void UserCreateOutputObjects();
92 void UserExec(Option_t *option);
93 void Terminate(Option_t *);
48a61f36 94
95 private:
8a9d3e12 96 Int_t fVerbosity; // 0 = silence
beb13b6c 97 Double_t fEtaMax; // Max |eta| cut for standard ESD or AOD analysis
8a9d3e12 98 Double_t fZVtxMax; // Max |z| cut (cm)
99 Double_t fPtMin; // Min pt cut
100 Double_t fPtMax; // Max pt cut
101 Int_t fTrackDepth; // #tracks to fill pool
102 Int_t fPoolSize; // Maximum number of events
103 TString fTracksName; // name of track collection
beb13b6c 104 Bool_t fDoWeights; // if true weight with 1/N per event
105 Bool_t fFillMuons; // fill the muon tracks into the mini event
88f09b54 106 Bool_t fRequireMuon; // only run on events with a muon track
107 Double_t fReqPtLo; // require a muon above this pt
108 Double_t fReqPtHi; // and below this pt
b422cf0d 109 Bool_t fPtTACrit; // use the pTT > pTA criterion?
e47b8f11 110 Bool_t fAllTAHists; // create all pTT,pTA combination hists, even t<a?
d7149d30 111 Bool_t fMixInEtaT; // mix in bins of eta_T instead of z_vertex
beb13b6c 112 Double_t fEtaTLo; // Min eta for triggers
113 Double_t fEtaTHi; // Max eta for triggers
114 Double_t fEtaALo; // Min eta for associated
115 Double_t fEtaAHi; // Max eta for associated
b3b66a56 116 Bool_t fOmitFirstEv; // if true skip first event in chunk
eee08176 117 Bool_t fDoFillSame; // If true fill same event immediately (not waiting for pool)
98880cdf 118 Bool_t fDoMassCut; // If true cut on invariant mass
ceeaa699 119 Bool_t fCheckVertex; // switch to flase for MC generator-level analysis
5a6df06d 120 TString fClassName; // If not null only process events with given class
f901a713 121 TString fCentMethod; // centrality selection method
122 Int_t fNBdeta; // no. deta bins
123 Int_t fNBdphi; // no. dphi bins
88f09b54 124 Bool_t fTriggerMatch; // muon trigger match
f901a713 125 TAxis *fBPtT; // ptt binning
126 TAxis *fBPtA; // pta binning
127 TAxis *fBCent; // centrality binning
128 TAxis *fBZvtx; // zvtx binning
129 TAxis *fMixBCent; // centrality binning for mixing
130 TAxis *fMixBZvtx; // zvtx binning for mixing
131 THnF *fHEffT; // efficiency for trigger particles
132 THnF *fHEffA; // efficiency for associate particles
8a9d3e12 133 AliESDEvent *fESD; //! ESD object
134 AliAODEvent *fAOD; //! AOD object
135 TList *fOutputList; //! Output list
136 TH2 *fHEvt; //! Cent vs vtx.
88f09b54 137 TH2 *fHEvtWTr; //! Cent vs vtx. for events with at least one track
8a9d3e12 138 TH2 *fHTrk; //! Phi vs Eta
7040ed98 139 TH2 *fHPoolReady; //! Check how many Jobs start mixing
140 TH1 *fHPtAss; //! Pt ass
8a9d3e12 141 TH1 *fHPtTrg; //! Pt trg
beb13b6c 142 TH1 *fHPtTrgEvt; //! Pt trg per event for weighting
143 TH3 *fHPtTrgNorm1S; //! Pt trg same events in cent. and zvtx bins, method 1
144 TH3 *fHPtTrgNorm1M; //! Pt trg mixed events in cent. and zvtx bins, method 1
145 TH3 *fHPtTrgNorm2S; //! Pt trg same events in cent. and zvtx bins, method 2
146 TH3 *fHPtTrgNorm2M; //! Pt trg mixed events in cent. and zvtx bins, method 2
8a9d3e12 147 TH1 *fHCent; //! Centrality
148 TH1 *fHZvtx; //! Zvertex
149 Int_t fNbins; //! Number of histogram bins
150 TH2 **fHSs; //! Same-evt correlations
151 TH2 **fHMs; //! Diff-evt correlations
380fb711 152 TH1 **fHPts; //! Pt distributions
98880cdf 153 TH1 **fHSMass; //! Mass distributions same
154 TH1 **fHMMass; //! Mass distributions mixed
21852ae0 155 TH3 *fHQATp; //! positive trigger particle distribution for QA
156 TH3 *fHQAAp; //! associated particle distribution for QA
157 TH3 *fHQATpCorr; //! correction applied trigger distribution
158 TH3 *fHQAApCorr; //! correction applied associated distribution
159 TH3 *fHQATm; //! the same for negative particles
160 TH3 *fHQAAm; //!
161 TH3 *fHQATmCorr; //!
162 TH3 *fHQAAmCorr; //!
d7149d30 163 TH2 *fHPtCentT; //! trigger pT vs centrality
164 TH2 *fHPtCentA; //! associated pT vs centrality
f901a713 165 TFormula *fIndex; //! index for histograms
166 Double_t fCentrality; //! centrality of current event
167 Double_t fZVertex; //! z vertex of current event
168 AliESDtrackCuts *fEsdTPCOnly; //! track cuts
169 AliEvtPoolManager *fPoolMgr; //! event mixer
170 AliAnalysisUtils *fUtils; //! analysis utils
48a61f36 171
172 AliDhcTask(const AliDhcTask&); // not implemented
173 AliDhcTask &operator=(const AliDhcTask&); // not implemented
174
f901a713 175 ClassDef(AliDhcTask, 9)
48a61f36 176};
177
178#endif