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