]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/totEt/AliAnalysisEt.h
Cleanup
[u/mrichter/AliRoot.git] / PWG4 / totEt / AliAnalysisEt.h
1 //_________________________________________________________________________
2 //  Utility Class for transverse energy studies
3 //  Base class for ESD & MC analysis
4 //  - reconstruction and MonteCarlo output
5 //
6 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
7 //_________________________________________________________________________
8
9 #ifndef ALIANALYSISET_H
10 #define ALIANALYSISET_H
11
12 class AliCentrality;
13 #include "AliAnalysisEtCommon.h"
14 #include "THnSparse.h"
15
16 class TString;
17 class TTree;
18 class TH2F;
19 class TH1F;
20 class AliVEvent;
21 class TList;
22 class TString;
23 class AliESDtrackCuts;
24 class AliAnalysisEtCuts;
25 class AliESDCaloCluster;
26 //class THnSparseD;
27
28 class AliAnalysisEt : public AliAnalysisEtCommon
29 {
30 public:
31    
32     AliAnalysisEt();
33     virtual ~AliAnalysisEt();
34   
35 public:
36   
37     /** Analyse the event! */
38
39     virtual Int_t AnalyseEvent(AliVEvent *event);
40
41     /** Fill the objects you want to output, classes which add new histograms should overload this. */
42     virtual void FillOutputList(TList* list);
43
44     /** Initialise the analysis, must be overloaded. */
45     virtual void Init();
46
47     /** 
48     * Creates the histograms, must be overloaded if you want to add your own. 
49     * Uses the fHistogramNameSuffix to create proper histogram names
50     */
51     virtual void CreateHistograms();
52     virtual void CreateTrees();
53     TH2F* CreateEtaEHisto2D(TString name, TString title, TString ztitle);
54         TH2F* CreateEtaPtHisto2D(TString name, TString title, TString ztitle);
55         TH2F* CreateEtaEtHisto2D(TString name, TString title, TString ztitle);
56         TH2F* CreateResEHisto2D(TString name, TString title, TString ztitle);
57         TH2F* CreateResPtHisto2D(TString name, TString title, TString ztitle);
58     THnSparseD* CreateClusterHistoSparse(TString name, TString title);
59     THnSparseD* CreateNeutralPartHistoSparse(TString name, TString title);
60     THnSparseD* CreateChargedPartHistoSparse(TString name, TString title);
61         
62     /** Fills the histograms, must be overloaded if you want to add your own */
63     virtual void FillHistograms();
64
65     /** Reset event specific values (Et etc.) */
66     virtual void ResetEventValues();
67
68     /** Total Et in the event (without acceptance cuts) */
69     Double_t GetTotEt() const { return fTotEt; }
70
71     /** Total Et in the event within the acceptance cuts */
72     Double_t GetTotEtAcc() const { return fTotEtAcc; }
73
74    /** Total neutral Et in the event (without acceptance cuts) */
75     Double_t GetTotNeutralEt() const { return fTotNeutralEt; }
76
77     /** Total neutral Et in the event within the acceptance cuts */
78     Double_t GetTotNeutralEtAcc() const { return fTotNeutralEtAcc; }
79     
80     /** Total charged Et in the event (without acceptance cuts) */
81     Double_t GetTotChargedEt() const { return fTotChargedEt; }
82
83     /** Total charged Et in the event within the acceptance cuts */
84     Double_t GetTotChargedEtAcc() const { return fTotChargedEtAcc; }
85
86     void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
87     
88     /** Set the centrality object */
89     void SetCentralityObject(AliCentrality *cent) { fCentrality = cent; }
90     
91     /** Get contribution from non-removed charged particles */
92     virtual Double_t GetChargedContribution(Int_t /*clusterMultiplicity*/) {return 0;}
93
94     /** Get contribution from non-removed neutral particles */
95     virtual Double_t GetNeutralContribution(Int_t /*clusterMultiplicity*/) {return 0;}
96     
97     /** Get contribution from removed gammas */
98     virtual Double_t GetGammaContribution(Int_t /*clusterMultiplicity*/) {return 0;}
99
100 protected:
101
102     //AliAnalysisEtCuts *fCuts; // keeper of basic cuts
103     Double_t CalculateTransverseEnergy(AliESDCaloCluster *cluster);
104
105     Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */    
106     Double_t fTotEtAcc;/** Total Et in the event within the acceptance cuts */
107     
108     Double_t fTotNeutralEt;/** Total neutral Et in the event */    
109     Double_t fTotNeutralEtAcc;/** Total neutral Et in the event within the acceptance cuts */    
110     Double_t fTotChargedEt;/** Total charged Et in the event */    
111     Double_t fTotChargedEtAcc;/** Total charged Et in the event within the acceptance cuts */
112
113     Int_t fMultiplicity;/** Multiplicity of particles in the event */    
114     Int_t fChargedMultiplicity;/** Multiplicity of charged particles in the event */    
115     Int_t fNeutralMultiplicity; /** Multiplicity of neutral particles in the event */
116     
117     Double_t fBaryonEt;     /** Et of identified baryons; calo based (Rec only for now) */    
118     Double_t fAntiBaryonEt; /** Et of identified anti-baryons; calo based (Rec only for now) */
119     Double_t fMesonEt;     /** Et of identified mesons; calo based (Rec only for now) */
120
121     Double_t fProtonEt; /** Et of identified protons */
122     Double_t fPionEt; /** Et of identified pions */
123     Double_t fChargedKaonEt; /** Et of identified charged kaons */
124     Double_t fMuonEt; /** Et of identified muons */
125     Double_t fElectronEt; /** Et of identified electrons */
126     Double_t fNeutronEt; /** Et of neutrons (MC only for now) */
127     Double_t fAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
128     Double_t fGammaEt; /** Et of identified electrons (MC only for now) */
129    
130     Double_t fProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
131     Double_t fPionEtAcc; /** Et of identified pions in calorimeter acceptance */    
132     Double_t fChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
133     Double_t fMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
134     Double_t fElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
135     
136     Float_t fEnergyDeposited; /** Energy deposited in calorimeter */
137     Float_t fEnergyTPC; /** Energy measured in TPC */
138     Short_t fCharge; /** Charge of the particle */
139     Short_t fParticlePid; /** Particle PID */
140     Float_t fPidProb; /** Probability of PID */
141     Bool_t fTrackPassedCut; /** The track is accepted by ESDTrackCuts */
142
143     Int_t fCentClass; // centrality class
144         
145     Double_t fEtaCut;/** Cut in eta (standard |eta| < 0.5 )*/
146
147     /** Eta cut for our acceptance */
148     Double_t fEtaCutAcc; // Eta cut for our acceptance
149     
150     /** Min phi cut for our acceptance in radians */    
151     Double_t fPhiCutAccMin; // Min phi cut for our acceptance in radians     
152     
153     /** Max phi cut for our acceptance in radians */
154     Double_t fPhiCutAccMax; // Max phi cut for our acceptance in radians 
155     
156     /** Detector radius */
157     Double_t fDetectorRadius; // Detector radius 
158     
159     /** Cut on the cluster energy */    
160     Double_t fClusterEnergyCut; // Cut on the cluster energy 
161     
162     /** Minimum energy to cut on single cell cluster */
163     Double_t fSingleCellEnergyCut;  // Minimum energy to cut on single cell cluster
164     
165     Double_t fTrackDistanceCut; // cut on track distance    
166     
167     Double_t fTrackDxCut; // cut on track distance in x
168     
169     Double_t fTrackDzCut; // cut on track distance in z
170     
171
172     // Declare the histograms
173
174     /** The full Et spectrum measured */
175     TH1F *fHistEt; //Et spectrum
176
177     /** The full charged Et spectrum measured */
178     TH1F *fHistChargedEt; //Charged Et spectrum 
179
180     /** The full neutral Et spectrum measured */
181     TH1F *fHistNeutralEt; //Neutral Et spectrum
182
183     /** The Et spectrum within the calorimeter acceptance */
184     TH1F *fHistEtAcc; //Et in acceptance
185
186     /** The charged Et spectrum within the calorimeter acceptance */
187     TH1F *fHistChargedEtAcc; //Charged Et in acceptance
188
189     /** The neutral Et spectrum within the calorimeter acceptance */
190     TH1F *fHistNeutralEtAcc; //Et in acceptance
191
192     /** Multiplicity of particles in the events */
193     TH1F *fHistMult; //Multiplicity
194
195     /** Charged multiplicity of particles in the events */
196     TH1F *fHistChargedMult; //Charged multiplicity
197
198     /** Neutral multiplicity of particles in the events */
199     TH1F *fHistNeutralMult; //Neutral multiplicity
200
201     /* Acceptance plots */
202     TH2F *fHistPhivsPtPos; //phi vs pT plot for positive tracks
203     TH2F *fHistPhivsPtNeg; //phi vs pT plot for negative tracks
204
205     /* PID plots */
206     TH1F *fHistBaryonEt; /** Et of identified baryons */    
207     TH1F *fHistAntiBaryonEt; /** Et of identified anti-baryons */
208     TH1F *fHistMesonEt; /** Et of identified mesons */
209
210     TH1F *fHistProtonEt; /** Et of identified protons */
211     TH1F *fHistPionEt; /** Et of identified protons */
212     TH1F *fHistChargedKaonEt; /** Et of identified charged kaons */
213     TH1F *fHistMuonEt; /** Et of identified muons */
214     TH1F *fHistElectronEt; /** Et of identified electrons */
215     TH1F *fHistNeutronEt; /** Et of neutrons (MC only for now) */
216     TH1F *fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
217     TH1F *fHistGammaEt; /** Et of gammas (MC only for now) */
218     
219     TH1F *fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
220     TH1F *fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */    
221     TH1F *fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
222     TH1F *fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
223     TH1F *fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
224     
225     /* Correction plots */
226     TH1F *fHistTMDeltaR; /* Track matching plots; Rec only for now */
227     TH2F *fHistTMDxDz; /* Track matching plots; Rec only for now */
228   
229     /* Auxiliary Histogram variables */
230     static Float_t fgEtaAxis[17];//bins for eta axis of histograms
231     static Int_t fgnumOfEtaBins;//number of eta bins
232     static Float_t fgPtAxis[117];//bins for pt axis of histograms
233     static Int_t fgNumOfPtBins;//number of pt bins
234     static Float_t fgEAxis[79];//bins for pt axis of histograms
235     static Int_t fgNumOfEBins;//number of pt bins
236     static Float_t fgRAxis[48];//bins for R axis
237     static Int_t fgNumOfRBins;//number of R bins
238         
239         
240     TTree *fTree; // optional TTree
241     TTree *fTreeDeposit; // optional TTree for energy deposit measurements
242
243    /** Centrality object */
244     AliCentrality *fCentrality; //Centrality object
245     
246     Short_t fDetector;     /** Which detector? (-1 -> PHOS, 1 -> EMCAL)*/
247     
248     THnSparseD *fSparseHistTracks;     /** THnSparse histograms */
249     
250     THnSparseD *fSparseHistClusters;     /** THnSparse histograms */
251     
252     /** ET sparse valuses */
253     THnSparseD *fSparseHistEt; //!
254        
255     /** Values for sparse hists */
256     Double_t *fSparseTracks; //!
257     
258     /** Values for sparse hists */
259     Double_t *fSparseClusters; //!
260     
261     /** ET sparse valuses */
262     Double_t *fSparseEt; //!
263     
264     
265     
266
267 private:
268     //Declare private to avoid compilation warning
269     AliAnalysisEt & operator = (const AliAnalysisEt & g) ;//cpy assignment
270     AliAnalysisEt(const AliAnalysisEt & g) ; // cpy ctor
271
272     ClassDef(AliAnalysisEt, 1);
273 };
274
275 #endif // ALIANALYSISET_H