]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/totEt/AliAnalysisEt.h
Changing sparse histos from doubles to floats and adding switch to turn sparse histos...
[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     THnSparseF* CreateClusterHistoSparse(TString name, TString title);
59     THnSparseF* CreateNeutralPartHistoSparse(TString name, TString title);
60     THnSparseF* 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     void MakeSparseHistograms(){fMakeSparse=kTRUE;}
101
102 protected:
103
104     //AliAnalysisEtCuts *fCuts; // keeper of basic cuts
105     Double_t CalculateTransverseEnergy(AliESDCaloCluster *cluster);
106
107     Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */    
108     Double_t fTotEtAcc;/** Total Et in the event within the acceptance cuts */
109     
110     Double_t fTotNeutralEt;/** Total neutral Et in the event */    
111     Double_t fTotNeutralEtAcc;/** Total neutral Et in the event within the acceptance cuts */    
112     Double_t fTotChargedEt;/** Total charged Et in the event */    
113     Double_t fTotChargedEtAcc;/** Total charged Et in the event within the acceptance cuts */
114
115     Int_t fMultiplicity;/** Multiplicity of particles in the event */    
116     Int_t fChargedMultiplicity;/** Multiplicity of charged particles in the event */    
117     Int_t fNeutralMultiplicity; /** Multiplicity of neutral particles in the event */
118     
119     Double_t fBaryonEt;     /** Et of identified baryons; calo based (Rec only for now) */    
120     Double_t fAntiBaryonEt; /** Et of identified anti-baryons; calo based (Rec only for now) */
121     Double_t fMesonEt;     /** Et of identified mesons; calo based (Rec only for now) */
122
123     Double_t fProtonEt; /** Et of identified protons */
124     Double_t fPionEt; /** Et of identified pions */
125     Double_t fChargedKaonEt; /** Et of identified charged kaons */
126     Double_t fMuonEt; /** Et of identified muons */
127     Double_t fElectronEt; /** Et of identified electrons */
128     Double_t fNeutronEt; /** Et of neutrons (MC only for now) */
129     Double_t fAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
130     Double_t fGammaEt; /** Et of identified electrons (MC only for now) */
131    
132     Double_t fProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
133     Double_t fPionEtAcc; /** Et of identified pions in calorimeter acceptance */    
134     Double_t fChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
135     Double_t fMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
136     Double_t fElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
137     
138     Float_t fEnergyDeposited; /** Energy deposited in calorimeter */
139     Float_t fEnergyTPC; /** Energy measured in TPC */
140     Short_t fCharge; /** Charge of the particle */
141     Short_t fParticlePid; /** Particle PID */
142     Float_t fPidProb; /** Probability of PID */
143     Bool_t fTrackPassedCut; /** The track is accepted by ESDTrackCuts */
144
145     Int_t fCentClass; // centrality class
146         
147     Double_t fEtaCut;/** Cut in eta (standard |eta| < 0.5 )*/
148
149     /** Eta cut for our acceptance */
150     Double_t fEtaCutAcc; // Eta cut for our acceptance
151     
152     /** Min phi cut for our acceptance in radians */    
153     Double_t fPhiCutAccMin; // Min phi cut for our acceptance in radians     
154     
155     /** Max phi cut for our acceptance in radians */
156     Double_t fPhiCutAccMax; // Max phi cut for our acceptance in radians 
157     
158     /** Detector radius */
159     Double_t fDetectorRadius; // Detector radius 
160     
161     /** Cut on the cluster energy */    
162     Double_t fClusterEnergyCut; // Cut on the cluster energy 
163     
164     /** Minimum energy to cut on single cell cluster */
165     Double_t fSingleCellEnergyCut;  // Minimum energy to cut on single cell cluster
166     
167     Double_t fTrackDistanceCut; // cut on track distance    
168     
169     Double_t fTrackDxCut; // cut on track distance in x
170     
171     Double_t fTrackDzCut; // cut on track distance in z
172     
173
174     // Declare the histograms
175
176     /** The full Et spectrum measured */
177     TH1F *fHistEt; //Et spectrum
178
179     /** The full charged Et spectrum measured */
180     TH1F *fHistChargedEt; //Charged Et spectrum 
181
182     /** The full neutral Et spectrum measured */
183     TH1F *fHistNeutralEt; //Neutral Et spectrum
184
185     /** The Et spectrum within the calorimeter acceptance */
186     TH1F *fHistEtAcc; //Et in acceptance
187
188     /** The charged Et spectrum within the calorimeter acceptance */
189     TH1F *fHistChargedEtAcc; //Charged Et in acceptance
190
191     /** The neutral Et spectrum within the calorimeter acceptance */
192     TH1F *fHistNeutralEtAcc; //Et in acceptance
193
194     /** Multiplicity of particles in the events */
195     TH1F *fHistMult; //Multiplicity
196
197     /** Charged multiplicity of particles in the events */
198     TH1F *fHistChargedMult; //Charged multiplicity
199
200     /** Neutral multiplicity of particles in the events */
201     TH1F *fHistNeutralMult; //Neutral multiplicity
202
203     /* Acceptance plots */
204     TH2F *fHistPhivsPtPos; //phi vs pT plot for positive tracks
205     TH2F *fHistPhivsPtNeg; //phi vs pT plot for negative tracks
206
207     /* PID plots */
208     TH1F *fHistBaryonEt; /** Et of identified baryons */    
209     TH1F *fHistAntiBaryonEt; /** Et of identified anti-baryons */
210     TH1F *fHistMesonEt; /** Et of identified mesons */
211
212     TH1F *fHistProtonEt; /** Et of identified protons */
213     TH1F *fHistPionEt; /** Et of identified protons */
214     TH1F *fHistChargedKaonEt; /** Et of identified charged kaons */
215     TH1F *fHistMuonEt; /** Et of identified muons */
216     TH1F *fHistElectronEt; /** Et of identified electrons */
217     TH1F *fHistNeutronEt; /** Et of neutrons (MC only for now) */
218     TH1F *fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
219     TH1F *fHistGammaEt; /** Et of gammas (MC only for now) */
220     
221     TH1F *fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
222     TH1F *fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */    
223     TH1F *fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
224     TH1F *fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
225     TH1F *fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
226     
227     /* Correction plots */
228     TH1F *fHistTMDeltaR; /* Track matching plots; Rec only for now */
229     TH2F *fHistTMDxDz; /* Track matching plots; Rec only for now */
230   
231     /* Auxiliary Histogram variables */
232     static Float_t fgEtaAxis[17];//bins for eta axis of histograms
233     static Int_t fgnumOfEtaBins;//number of eta bins
234     static Float_t fgPtAxis[117];//bins for pt axis of histograms
235     static Int_t fgNumOfPtBins;//number of pt bins
236     static Float_t fgEAxis[79];//bins for pt axis of histograms
237     static Int_t fgNumOfEBins;//number of pt bins
238     static Float_t fgRAxis[48];//bins for R axis
239     static Int_t fgNumOfRBins;//number of R bins
240         
241         
242     TTree *fTree; // optional TTree
243     TTree *fTreeDeposit; // optional TTree for energy deposit measurements
244
245    /** Centrality object */
246     AliCentrality *fCentrality; //Centrality object
247     
248     Short_t fDetector;     /** Which detector? (-1 -> PHOS, 1 -> EMCAL)*/
249
250     Bool_t fMakeSparse;//Boolean for whether or not to make sparse histograms
251     
252     THnSparseF *fSparseHistTracks;     /** THnSparse histograms */
253     
254     THnSparseF *fSparseHistClusters;     /** THnSparse histograms */
255     
256     /** ET sparse valuses */
257     THnSparseF *fSparseHistEt; //!
258        
259     /** Values for sparse hists */
260     Double_t *fSparseTracks; //!
261     
262     /** Values for sparse hists */
263     Double_t *fSparseClusters; //!
264     
265     /** ET sparse valuses */
266     Double_t *fSparseEt; //!
267     
268     
269     
270
271 private:
272     //Declare private to avoid compilation warning
273     AliAnalysisEt & operator = (const AliAnalysisEt & g) ;//cpy assignment
274     AliAnalysisEt(const AliAnalysisEt & g) ; // cpy ctor
275
276     ClassDef(AliAnalysisEt, 1);
277 };
278
279 #endif // ALIANALYSISET_H