]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/DPhi/FourierDecomposition/AliDhcTask.h
update from Constantin
[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 class TFormula;
9 class TH1;
10 class TH2;
11 class TAxis;
12 class TObjArray;
13 class TObject;
14 class TProfile2D;
15 class AliAODEvent;
16 class AliESDEvent;
17 class AliESDtrackCuts;
18 class AliEvtPoolManager;
19
20 #include "AliAnalysisTaskSE.h"
21 #include "AliPool.h"
22
23 class AliDhcTask : public AliAnalysisTaskSE {
24  public:
25   AliDhcTask() : 
26     AliAnalysisTaskSE(), fVerbosity(0), fEtaMax(1), fZVtxMax(10), fPtMin(0.25), fPtMax(15),
27     fTrackDepth(0), fPoolSize(0), fTracksName(), fDoWeights(0),
28     fESD(0), fAOD(0), fOutputList(0), fHistPt(0), fHEvt(0), fHTrk(0), fHPtAss(0), 
29     fHPtTrg(0), fHPtTrg_Evt(0), fHCent(0), fHZvtx(0), fNbins(0), fHSs(0), fHMs(0), fIndex(0), 
30     fMeanPtTrg(0), fMeanPtAss(0), fMean2PtTrg(0), fMean2PtAss(0), 
31     fCentrality(99), fZVertex(99), fEsdTrackCutsTPCOnly(0), fPoolMgr(0),
32     fCentMethod("V0M"), fNBdeta(20), fNBdphi(36),
33     fBPtT(0x0), fBPtA(0x0), fBCent(0x0), fBZvtx(0x0),
34     fMixBCent(0x0), fMixBZvtx(0x0) {}
35
36   AliDhcTask(const char *name);
37   virtual ~AliDhcTask() {}
38   
39   void         SetCentBins(TAxis *bins)               { fBCent=bins;              }
40   void         SetCentMethod(const char *name)        { fCentMethod = name;       }
41   void         SetCentMixBins(TAxis *bins)            { fMixBCent=bins;           }
42   void         SetDEtaDPhiBins(Int_t nbe, Int_t nbp)  { fNBdeta=nbe; fNBdphi=nbp; }
43   void         SetDoWeights(Bool_t b)                 { fDoWeights = b;           }
44   void         SetEtaMax(Double_t eta)                { fEtaMax = eta;            }
45   void         SetPoolSize(Int_t p)                   { fPoolSize = p;            }
46   void         SetPtABins(TAxis *bins)                { fBPtA=bins;               }
47   void         SetPtRange(Double_t min, Double_t max) { fPtMin=min; fPtMax=max;   }
48   void         SetPtTBins(TAxis *bins)                { fBPtT=bins;               }
49   void         SetTrackDepth(Int_t t)                 { fTrackDepth = t;          }
50   void         SetTracksName(const char *n)           { fTracksName = n;          }
51   void         SetVerbosity(Int_t v)                  { fVerbosity = v;           }
52   void         SetZVtxBins(TAxis *bins)               { fBZvtx=bins;              }
53   void         SetZVtxMixBins(TAxis *bins)            { fMixBZvtx=bins;           }
54   void         SetZvtx(Double_t zvtx)                 { fZVtxMax = zvtx;          }
55
56  protected:
57   enum ePairingScheme {kSameEvt, kDiffEvt};
58   enum eDataType      {kESD, kAOD};
59
60   void         BookHistos();
61   void         InitEventMixer();
62   void         GetESDTracks(MiniEvent*);
63   void         GetAODTracks(MiniEvent*);
64   Bool_t       VertexOk(TObject* obj) const;
65   Double_t     DeltaPhi(Double_t phia, Double_t phib, 
66                         Double_t rangeMin = -TMath::Pi()/2, 
67                         Double_t rangeMax = 3*TMath::Pi()/2) const;
68   Int_t        Correlate(const MiniEvent &arr1, const MiniEvent &arr2, Int_t pairing = kSameEvt);
69   void         UserCreateOutputObjects();
70   void         UserExec(Option_t *option);
71   void         Terminate(Option_t *);
72
73  private:
74   Int_t        fVerbosity;       //  0 = silence
75   Double_t     fEtaMax;          //  Max |eta| cut (cm)
76   Double_t     fZVtxMax;         //  Max |z| cut (cm)
77   Double_t     fPtMin;           //  Min pt cut
78   Double_t     fPtMax;           //  Max pt cut
79   Int_t        fTrackDepth;      //  #tracks to fill pool
80   Int_t        fPoolSize;        //  Maximum number of events
81   TString      fTracksName;      //  name of track collection
82   Bool_t       fDoWeights;       //  if true weight with 1/N per event 
83   AliESDEvent *fESD;             //! ESD object
84   AliAODEvent *fAOD;             //! AOD object
85   TList       *fOutputList;      //! Output list
86   TH1F        *fHistPt;          //! Pt spectrum
87   TH2         *fHEvt;            //! Cent, vtx, etc.
88   TH2         *fHTrk;            //! Phi, Eta, etc.
89   TH1         *fHPtAss;          //! Pt ass 
90   TH1         *fHPtTrg;          //! Pt trg
91   TH1         *fHPtTrg_Evt;      //! Pt trg per event for weighting
92   TH1         *fHCent;           //! Centrality
93   TH1         *fHZvtx;           //! Zvertex
94   Int_t        fNbins;           //! Number of histogram bins
95   TH2        **fHSs;             //! Same-evt correlations
96   TH2        **fHMs;             //! Diff-evt correlations
97   TFormula    *fIndex;           //! Index for histograms
98   TProfile2D **fMeanPtTrg;       //! Mean pt trig 
99   TProfile2D **fMeanPtAss;       //! Mean pt ass
100   TProfile2D **fMean2PtTrg;      //! RMS pt trig 
101   TProfile2D **fMean2PtAss;      //! RMS pt ass
102   Double_t     fCentrality;      //! V0M for now
103   Double_t     fZVertex;         //! Of current event
104   AliESDtrackCuts   *fEsdTrackCutsTPCOnly; //! Track cuts
105   AliEvtPoolManager *fPoolMgr;             //! Event mixer
106   TString      fCentMethod;      //  centrality selection method
107   Int_t        fNBdeta;          //  no. deta bins
108   Int_t        fNBdphi;          //  no. dphi bins
109   TAxis       *fBPtT;            //  ptt binning
110   TAxis       *fBPtA;            //  pta binning
111   TAxis       *fBCent;           //  centrality binning
112   TAxis       *fBZvtx;           //  zvtx binning
113   TAxis       *fMixBCent;        //  centrality binning for mixing
114   TAxis       *fMixBZvtx;        //  zvtx binning for mixing
115
116   AliDhcTask(const AliDhcTask&);            // not implemented
117   AliDhcTask &operator=(const AliDhcTask&); // not implemented
118
119   ClassDef(AliDhcTask, 2);
120 };
121
122 #endif