update DHC task (Constantin Loizides <cloizides@lbl.gov>)
[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"
10#include "THn.h"
11
be8a5cdb 12class TFormula;
48a61f36 13class TH1;
14class TH2;
beb13b6c 15class TH3;
d688e049 16class TAxis;
48a61f36 17class TObjArray;
be8a5cdb 18class TObject;
19class TProfile2D;
48a61f36 20class AliAODEvent;
be8a5cdb 21class AliESDEvent;
48a61f36 22class AliESDtrackCuts;
beb13b6c 23class AliESDMuonTrack;
b673a083 24class AliAODTrack;
be8a5cdb 25class AliEvtPoolManager;
48a61f36 26
48a61f36 27
28class AliDhcTask : public AliAnalysisTaskSE {
29 public:
beb13b6c 30 AliDhcTask();
48a61f36 31 AliDhcTask(const char *name);
b673a083 32 virtual ~AliDhcTask();
48a61f36 33
d688e049 34 void SetCentBins(TAxis *bins) { fBCent=bins; }
35 void SetCentMethod(const char *name) { fCentMethod = name; }
36 void SetCentMixBins(TAxis *bins) { fMixBCent=bins; }
37 void SetDEtaDPhiBins(Int_t nbe, Int_t nbp) { fNBdeta=nbe; fNBdphi=nbp; }
38 void SetDoWeights(Bool_t b) { fDoWeights = b; }
beb13b6c 39 void SetFillMuons(Bool_t b) { fFillMuons = b; }
d688e049 40 void SetEtaMax(Double_t eta) { fEtaMax = eta; }
41 void SetPoolSize(Int_t p) { fPoolSize = p; }
42 void SetPtABins(TAxis *bins) { fBPtA=bins; }
43 void SetPtRange(Double_t min, Double_t max) { fPtMin=min; fPtMax=max; }
44 void SetPtTBins(TAxis *bins) { fBPtT=bins; }
45 void SetTrackDepth(Int_t t) { fTrackDepth = t; }
46 void SetTracksName(const char *n) { fTracksName = n; }
47 void SetVerbosity(Int_t v) { fVerbosity = v; }
48 void SetZVtxBins(TAxis *bins) { fBZvtx=bins; }
49 void SetZVtxMixBins(TAxis *bins) { fMixBZvtx=bins; }
50 void SetZvtx(Double_t zvtx) { fZVtxMax = zvtx; }
beb13b6c 51 void SetHEffT(THnF *h) { fHEffT=h; }
52 void SetHEffA(THnF *h) { fHEffA=h; }
53 void SetAnaMode(Int_t iAna);
54 enum eAnaMode {kHH, kMuH, kHMu, kMuMu, kPSide, kASide};
48a61f36 55
56 protected:
48a61f36 57 enum ePairingScheme {kSameEvt, kDiffEvt};
be8a5cdb 58 enum eDataType {kESD, kAOD};
48a61f36 59
be8a5cdb 60 void BookHistos();
61 void InitEventMixer();
f6701c6e 62 void GetESDTracks(MiniEvent*);
63 void GetAODTracks(MiniEvent*);
be8a5cdb 64 Bool_t VertexOk(TObject* obj) const;
beb13b6c 65 Bool_t IsGoodMUONtrack(AliESDMuonTrack &track);
b673a083 66 Bool_t IsGoodMUONtrack(AliAODTrack &track);
beb13b6c 67 Double_t DeltaPhi(Double_t phia, Double_t phib,
be8a5cdb 68 Double_t rangeMin = -TMath::Pi()/2,
69 Double_t rangeMax = 3*TMath::Pi()/2) const;
d688e049 70 Int_t Correlate(const MiniEvent &arr1, const MiniEvent &arr2, Int_t pairing = kSameEvt);
be8a5cdb 71 void UserCreateOutputObjects();
72 void UserExec(Option_t *option);
73 void Terminate(Option_t *);
48a61f36 74
75 private:
8a9d3e12 76 Int_t fVerbosity; // 0 = silence
beb13b6c 77 Double_t fEtaMax; // Max |eta| cut for standard ESD or AOD analysis
8a9d3e12 78 Double_t fZVtxMax; // Max |z| cut (cm)
79 Double_t fPtMin; // Min pt cut
80 Double_t fPtMax; // Max pt cut
81 Int_t fTrackDepth; // #tracks to fill pool
82 Int_t fPoolSize; // Maximum number of events
83 TString fTracksName; // name of track collection
beb13b6c 84 Bool_t fDoWeights; // if true weight with 1/N per event
85 Bool_t fFillMuons; // fill the muon tracks into the mini event
86 Double_t fEtaTLo; // Min eta for triggers
87 Double_t fEtaTHi; // Max eta for triggers
88 Double_t fEtaALo; // Min eta for associated
89 Double_t fEtaAHi; // Max eta for associated
8a9d3e12 90 AliESDEvent *fESD; //! ESD object
91 AliAODEvent *fAOD; //! AOD object
92 TList *fOutputList; //! Output list
93 TH2 *fHEvt; //! Cent vs vtx.
94 TH2 *fHTrk; //! Phi vs Eta
95 TH1 *fHPtAss; //! Pt ass
96 TH1 *fHPtTrg; //! Pt trg
beb13b6c 97 TH1 *fHPtTrgEvt; //! Pt trg per event for weighting
98 TH3 *fHPtTrgNorm1S; //! Pt trg same events in cent. and zvtx bins, method 1
99 TH3 *fHPtTrgNorm1M; //! Pt trg mixed events in cent. and zvtx bins, method 1
100 TH3 *fHPtTrgNorm2S; //! Pt trg same events in cent. and zvtx bins, method 2
101 TH3 *fHPtTrgNorm2M; //! Pt trg mixed events in cent. and zvtx bins, method 2
8a9d3e12 102 TH1 *fHCent; //! Centrality
103 TH1 *fHZvtx; //! Zvertex
104 Int_t fNbins; //! Number of histogram bins
105 TH2 **fHSs; //! Same-evt correlations
106 TH2 **fHMs; //! Diff-evt correlations
107 TH1 **fHPts; //! Pt distributions
108 TFormula *fIndex; //! Index for histograms
109 Double_t fCentrality; //! V0M for now
110 Double_t fZVertex; //! Of current event
111 AliESDtrackCuts *fEsdTPCOnly; //! Track cuts
112 AliEvtPoolManager *fPoolMgr; //! Event mixer
113 TString fCentMethod; // centrality selection method
114 Int_t fNBdeta; // no. deta bins
115 Int_t fNBdphi; // no. dphi bins
116 TAxis *fBPtT; // ptt binning
117 TAxis *fBPtA; // pta binning
118 TAxis *fBCent; // centrality binning
119 TAxis *fBZvtx; // zvtx binning
120 TAxis *fMixBCent; // centrality binning for mixing
121 TAxis *fMixBZvtx; // zvtx binning for mixing
beb13b6c 122 THnF *fHEffT; // efficiency for trigger particles
123 THnF *fHEffA; // efficiency for associate particles
48a61f36 124
125 AliDhcTask(const AliDhcTask&); // not implemented
126 AliDhcTask &operator=(const AliDhcTask&); // not implemented
127
8a9d3e12 128 ClassDef(AliDhcTask, 3);
48a61f36 129};
130
131#endif