]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/DPhi/FourierDecomposition/AliDhcTask.h
dhc update from tim to use isassociated and istrigger function and to check before...
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / FourierDecomposition / AliDhcTask.h
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
4
5 #ifndef AliDhcTask_cxx
6 #define AliDhcTask_cxx
7
8 #include "AliAnalysisTaskSE.h"
9 #include "AliPool.h"
10
11 class TFormula;
12 class TH1;
13 class TH2;
14 class TH3;
15 class THn;
16 class TAxis;
17 class TObjArray;
18 class TObject;
19 class TProfile2D;
20 class AliAODEvent;
21 class AliAODTrack;
22 class AliAnalysisUtils;
23 class AliESDEvent;
24 class AliESDMuonTrack;
25 class AliESDtrackCuts;
26 class AliEvtPoolManager;
27
28 class AliDhcTask : public AliAnalysisTaskSE {
29  public:
30   AliDhcTask();
31   AliDhcTask(const char *name, Bool_t def=kFALSE);
32   virtual ~AliDhcTask();
33   
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         SetDoWeights(Bool_t b)                 { fDoWeights = b;           }
44   void         SetEtaMax(Double_t eta)                { fEtaMax = eta;            }
45   void         SetEtaTRange(Double_t eL, Double_t eH) { fEtaTLo=eL; fEtaTHi=eH;   }
46   void         SetFillMuons(Bool_t b)                 { fFillMuons = b;           }
47   void         SetHEffA(THnF *h)                      { fHEffA=h;                 }
48   void         SetHEffT(THnF *h)                      { fHEffT=h;                 }
49   void         SetMixInEtaT(Bool_t b)                 { fMixInEtaT = b;           }
50   void         SetOmitFirstEv(Bool_t b)               { fOmitFirstEv = b;         }
51   void         SetPoolSize(Int_t p)                   { fPoolSize = p;            }
52   void         SetPtABins(TAxis *bins)                { fBPtA=bins;               }
53   void         SetPtRange(Double_t min, Double_t max) { fPtMin=min; fPtMax=max;   }
54   void         SetPtTACrit(Bool_t b)                  { fPtTACrit = b;            }
55   void         SetPtTBins(TAxis *bins)                { fBPtT=bins;               }
56   void         SetTrackDepth(Int_t t)                 { fTrackDepth = t;          }
57   void         SetTracksName(const char *n)           { fTracksName = n;          }
58   void         SetVerbosity(Int_t v)                  { fVerbosity = v;           }
59   void         SetZVtxBins(TAxis *bins)               { fBZvtx=bins;              }
60   void         SetZVtxMixBins(TAxis *bins)            { fMixBZvtx=bins;           }
61   void         SetZvtx(Double_t zvtx)                 { fZVtxMax = zvtx;          }
62   void         PrintDhcSettings();
63
64   enum eAnaMode       {kHH=1, kMuH, kHMu, kMuMu, kPSide, kASide};
65
66  protected:
67   enum ePairingScheme {kSameEvt, kDiffEvt};
68   enum eDataType      {kESD, kAOD};
69
70   void         BookHistos();
71   void         InitEventMixer();
72   void         GetESDTracks(MiniEvent*);
73   void         GetAODTracks(MiniEvent*);
74   Bool_t       VertexOk() const;
75   Bool_t       IsGoodMUONtrack(AliESDMuonTrack &track);
76   Bool_t       IsGoodMUONtrack(AliAODTrack &track);
77   Bool_t       IsTrigger(Double_t eta, Double_t pt);
78   Bool_t       IsAssociated(Double_t eta, Double_t pt);
79   Double_t     DeltaPhi(Double_t phia, Double_t phib,
80                         Double_t rangeMin = -TMath::Pi()/2, 
81                         Double_t rangeMax = 3*TMath::Pi()/2) const;
82   Int_t        Correlate(const MiniEvent &arr1, const MiniEvent &arr2, Int_t pairing = kSameEvt);
83   void         UserCreateOutputObjects();
84   void         UserExec(Option_t *option);
85   void         Terminate(Option_t *);
86
87  private:
88   Int_t              fVerbosity;       //  0 = silence
89   Double_t           fEtaMax;          //  Max |eta| cut for standard ESD or AOD analysis
90   Double_t           fZVtxMax;         //  Max |z| cut (cm)
91   Double_t           fPtMin;           //  Min pt cut
92   Double_t           fPtMax;           //  Max pt cut
93   Int_t              fTrackDepth;      //  #tracks to fill pool
94   Int_t              fPoolSize;        //  Maximum number of events
95   TString            fTracksName;      //  name of track collection
96   Bool_t             fDoWeights;       //  if true weight with 1/N per event
97   Bool_t             fFillMuons;       //  fill the muon tracks into the mini event
98   Bool_t             fPtTACrit;        //  use the pTT > pTA criterion?
99   Bool_t             fAllTAHists;      //  create all pTT,pTA combination hists, even t<a?
100   Bool_t             fMixInEtaT;       //  mix in bins of eta_T instead of z_vertex
101   Double_t           fEtaTLo;          //  Min eta for triggers
102   Double_t           fEtaTHi;          //  Max eta for triggers
103   Double_t           fEtaALo;          //  Min eta for associated
104   Double_t           fEtaAHi;          //  Max eta for associated
105   Bool_t             fOmitFirstEv;     //  if true skip first event in chunk
106   Bool_t             fDoFillSame;      //  If true fill same event immediately (not waiting for pool)
107   Bool_t             fDoMassCut;       //  If true cut on invariant mass
108   TString            fClassName;       //  If not null only process events with given class
109   AliESDEvent       *fESD;             //! ESD object
110   AliAODEvent       *fAOD;             //! AOD object
111   TList             *fOutputList;      //! Output list
112   TH2               *fHEvt;            //! Cent vs vtx.
113   TH2               *fHTrk;            //! Phi vs Eta
114   TH1               *fHPtAss;          //! Pt ass 
115   TH1               *fHPtTrg;          //! Pt trg
116   TH1               *fHPtTrgEvt;       //! Pt trg per event for weighting
117   TH3               *fHPtTrgNorm1S;    //! Pt trg same events in cent. and zvtx bins, method 1
118   TH3               *fHPtTrgNorm1M;    //! Pt trg mixed events in cent. and zvtx bins, method 1
119   TH3               *fHPtTrgNorm2S;    //! Pt trg same events in cent. and zvtx bins, method 2
120   TH3               *fHPtTrgNorm2M;    //! Pt trg mixed events in cent. and zvtx bins, method 2
121   TH1               *fHCent;           //! Centrality
122   TH1               *fHZvtx;           //! Zvertex
123   Int_t              fNbins;           //! Number of histogram bins
124   TH2              **fHSs;             //! Same-evt correlations
125   TH2              **fHMs;             //! Diff-evt correlations
126   TH1              **fHPts;            //! Pt distributions
127   TH1              **fHSMass;          //! Mass distributions same
128   TH1              **fHMMass;          //! Mass distributions mixed
129   TH3               *fHQATp;           //! positive trigger particle distribution for QA
130   TH3               *fHQAAp;           //! associated particle distribution for QA
131   TH3               *fHQATpCorr;       //! correction applied trigger distribution
132   TH3               *fHQAApCorr;       //! correction applied associated distribution
133   TH3               *fHQATm;           //! the same for negative particles
134   TH3               *fHQAAm;           //!
135   TH3               *fHQATmCorr;       //!
136   TH3               *fHQAAmCorr;       //!
137   TH2               *fHPtCentT;        //! trigger pT vs centrality
138   TH2               *fHPtCentA;        //! associated pT vs centrality
139   TFormula          *fIndex;           //! Index for histograms
140   Double_t           fCentrality;      //! V0M for now
141   Double_t           fZVertex;         //! Of current event
142   AliESDtrackCuts   *fEsdTPCOnly;      //! Track cuts
143   AliEvtPoolManager *fPoolMgr;         //! Event mixer
144   TString            fCentMethod;      //  centrality selection method
145   Int_t              fNBdeta;          //  no. deta bins
146   Int_t              fNBdphi;          //  no. dphi bins
147   TAxis             *fBPtT;            //  ptt binning
148   TAxis             *fBPtA;            //  pta binning
149   TAxis             *fBCent;           //  centrality binning
150   TAxis             *fBZvtx;           //  zvtx binning
151   TAxis             *fMixBCent;        //  centrality binning for mixing
152   TAxis             *fMixBZvtx;        //  zvtx binning for mixing
153   THnF              *fHEffT;           //  efficiency for trigger particles
154   THnF              *fHEffA;           //  efficiency for associate particles
155   AliAnalysisUtils  *fUtils;           //  analysis utils
156
157   AliDhcTask(const AliDhcTask&);            // not implemented
158   AliDhcTask &operator=(const AliDhcTask&); // not implemented
159
160   ClassDef(AliDhcTask, 8)
161 };
162
163 #endif