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