e3c96392f4dd433fa304eee25b79c0ec22490a2c
[u/mrichter/AliRoot.git] / PWG4 / CorrelationsDPhi / AliAnalysisTaskPhiCorrelations.h
1 #ifndef AliAnalysisTaskPhiCorrelations_H
2 #define AliAnalysisTaskPhiCorrelations_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ////////////////////////////////////////////////////////////////////////
8 //
9 // Analysis class for Underlying Event studies w.r.t. leading track
10 //
11 // Look for correlations on the tranverse regions w.r.t
12 // the leading track in the event
13 //
14 // This class needs input AODs.
15 // The output is a list of analysis-specific containers.
16 //
17 // The AOD can be either connected to the InputEventHandler  
18 // for a chain of AOD files 
19 // or 
20 // to the OutputEventHandler
21 // for a chain of ESD files,
22 // in this case the class should be in the train after the jet-finder
23 //
24 //    Authors:
25 //    Arian Abrahantes Quintana 
26 //    Jan Fiete Grosse-Oetringhaus
27 //    Ernesto Lopez Torres
28 //    Sara Vallero
29 // 
30 ////////////////////////////////////////////////////////////////////////
31
32 #include "AliAnalysisTask.h"
33 #include "AliUEHist.h"
34 #include "TString.h"
35 #include "AliVParticle.h"
36 #include "AliLog.h"
37
38 class AliAODEvent;
39 class AliAnalyseLeadingTrackUE;
40 class AliInputEventHandler;
41 class AliMCEvent;
42 class AliMCEventHandler;
43 class AliUEHistograms;
44 class AliVParticle;
45 class TH1D;
46 class TObjArray;
47 class AliEventPoolManager;
48 class AliESDEvent;
49
50 class  AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
51   {
52   public:
53     AliAnalysisTaskPhiCorrelations(const char* name="AliAnalysisTaskPhiCorrelations");
54     virtual           ~AliAnalysisTaskPhiCorrelations();
55        
56       
57     // Implementation of interace methods
58     virtual     void   ConnectInputData(Option_t *);
59     virtual     void   CreateOutputObjects();
60     virtual     void   Exec(Option_t *option);
61
62     // Setters/Getters
63     // general configuration
64     virtual     void    SetDebugLevel( Int_t level )  { fDebug = level; }
65     virtual     void    SetMode(Int_t mode)           { fMode  = mode;  }
66     virtual     void    SetReduceMemoryFootprint(Bool_t flag) { fReduceMemoryFootprint = flag; }
67     virtual     void    SetEventMixing(Bool_t flag) { fFillMixed = flag; }
68     virtual     void    SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
69     virtual     void    SetCompareCentralities(Bool_t flag) { fCompareCentralities = flag; }
70     virtual     void    SetTwoTrackEfficiencyStudy(Bool_t flag) { fTwoTrackEfficiencyStudy = flag; }
71     virtual     void    SetUseVtxAxis(Bool_t flag) { fUseVtxAxis = flag; }
72     
73     // histogram settings
74     void SetTrackingEfficiency( const TH1D* hist) { fkTrackingEfficiency = hist; }
75
76     // for event QA
77     void   SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
78     void   SetZVertex( Double_t val )    { fZVertex = val; }
79     
80     // track cuts
81     void   SetTrackEtaCut( Double_t val )    { fTrackEtaCut = val; }
82     void   SetPtMin(Double_t val)            { fPtMin = val; }
83     void   SetFilterBit( UInt_t val )        { fFilterBit = val;  }
84     
85     void   SetEventSelectionBit( UInt_t val )        { fSelectBit = val;  }
86     void   SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
87     void   SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
88     void   SetCentralityMethod(const char* method) { fCentralityMethod = method; }
89     void   SetFillpT(Bool_t flag) { fFillpT = flag; }
90
91     
92   private:
93     AliAnalysisTaskPhiCorrelations(const  AliAnalysisTaskPhiCorrelations &det);
94     AliAnalysisTaskPhiCorrelations&   operator=(const  AliAnalysisTaskPhiCorrelations &det);
95     void            AddSettingsTree();                                  // add list of settings to output list
96     // Analysis methods
97     void            AnalyseCorrectionMode();                            // main algorithm to get correction maps
98     void            AnalyseDataMode();                                  // main algorithm to get raw distributions
99     void            Initialize();                                       // initialize some common pointer
100
101
102
103     // General configuration
104     Int_t               fDebug;           //  Debug flag
105     Int_t               fMode;            //  fMode = 0: data-like analysis 
106                                           //  fMode = 1: corrections analysis   
107     Bool_t              fReduceMemoryFootprint; // reduce memory consumption by writing less debug histograms
108     Bool_t              fFillMixed;             // enable event mixing (default: ON)
109     Int_t               fMixingTracks;          // size of track buffer for event mixing
110     Bool_t              fCompareCentralities;   // use the z vtx axis for a centrality comparison
111     Bool_t              fTwoTrackEfficiencyStudy; // two-track efficiency study on
112     Bool_t              fUseVtxAxis;              // use z vtx as axis (needs 7 times more memory!)
113     
114     // Pointers to external UE classes
115     AliAnalyseLeadingTrackUE*     fAnalyseUE;      //! points to class containing common analysis algorithms
116     AliUEHistograms*  fHistos;       //! points to class to handle histograms/containers  
117     AliUEHistograms*  fHistosMixed;       //! points to class to handle mixed histograms/containers  
118     
119     const TH1D* fkTrackingEfficiency;       // used for study of bias by tracking 
120
121     // Handlers and events
122     AliAODEvent*             fAOD;             //! AOD Event 
123     AliESDEvent*             fESD;             //! ESD Event 
124     TClonesArray*            fArrayMC;         //! Array of MC particles 
125     AliInputEventHandler*    fInputHandler;    //! Generic InputEventHandler 
126     AliMCEvent*              fMcEvent;         //! MC event
127     AliMCEventHandler*       fMcHandler;       //! MCEventHandler 
128     AliEventPoolManager*     fPoolMgr;         //! event pool manager
129     
130     // Histogram settings
131     TList*              fListOfHistos;    //  Output list of containers 
132     
133     // Event QA cuts
134     Int_t               fnTracksVertex;        // QA tracks pointing to principal vertex
135     Double_t            fZVertex;              // Position of Vertex in Z direction
136     TString             fCentralityMethod;     // Method to determine centrality
137     
138     // Track cuts
139     Double_t            fTrackEtaCut;          // Eta cut on particles
140     Double_t            fPtMin;                // Min pT to start correlations
141     UInt_t              fFilterBit;            // Select tracks from an specific track cut (default 0xFF all track selected)
142     UInt_t              fSelectBit;            // Select events according to AliAnalysisTaskJetServices bit maps 
143     Bool_t              fUseChargeHadrons;     // Only use charge hadrons
144     
145     Int_t fSelectCharge;           // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
146     Bool_t fFillpT;                // fill sum pT instead of number density
147     
148     ClassDef( AliAnalysisTaskPhiCorrelations, 3); // Analysis task for Underlying Event analysis w.r.t. leading track
149   };
150
151 class AliDPhiBasicParticle : public AliVParticle
152 {
153   public:
154     AliDPhiBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
155       : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)
156     {
157     }
158     ~AliDPhiBasicParticle() {}
159     
160     // kinematics
161     virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }
162     virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }
163     virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }
164     virtual Double_t Pt() const { return fpT; }
165     virtual Double_t P() const { AliFatal("Not implemented"); return 0; }
166     virtual Bool_t   PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
167
168     virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }
169     virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }
170     virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }
171     virtual Bool_t   XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
172
173     virtual Double_t OneOverPt()  const { AliFatal("Not implemented"); return 0; }
174     virtual Double_t Phi()        const { return fPhi; }
175     virtual Double_t Theta()      const { AliFatal("Not implemented"); return 0; }
176
177
178     virtual Double_t E()          const { AliFatal("Not implemented"); return 0; }
179     virtual Double_t M()          const { AliFatal("Not implemented"); return 0; }
180     
181     virtual Double_t Eta()        const { return fEta; }
182     virtual Double_t Y()          const { AliFatal("Not implemented"); return 0; }
183     
184     virtual Short_t Charge()      const { return fCharge; }
185     virtual Int_t   GetLabel()    const { AliFatal("Not implemented"); return 0; }
186     // PID
187     virtual Int_t   PdgCode()     const { AliFatal("Not implemented"); return 0; }      
188     virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
189     
190   private:
191     Float_t fEta;      // eta
192     Float_t fPhi;      // phi
193     Float_t fpT;       // pT
194     Short_t fCharge;   // charge
195     
196     ClassDef( AliDPhiBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing
197 };
198   
199 #endif
200
201