]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/totEt/AliAnalysisEt.h
Updating macros for running ET code
[u/mrichter/AliRoot.git] / PWGLF / totEt / AliAnalysisEt.h
1 #ifndef ALIANALYSISET_H
2 #define ALIANALYSISET_H
3 //_________________________________________________________________________
4 //  Utility Class for transverse energy studies
5 //  Base class for ESD & MC analysis
6 //  - reconstruction and MonteCarlo output
7 //
8 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
9 //_________________________________________________________________________
10
11 #include "AliAnalysisEtCommon.h"
12 #include "THnSparse.h"
13 #include "AliESDCaloCluster.h"
14 #include "AliAnalysisEtCuts.h"
15 #include "AliAnalysisEtTrackMatchCorrections.h"
16 #include <vector>
17 #include "Rtypes.h"
18 #include "AliAnalysisEtSelector.h"
19 #include "AliAnalysisEtSelectorEmcal.h"
20 #include "AliAnalysisEtSelectorPhos.h"
21
22 class AliAnalysisEtRecEffCorrection;
23 class AliAnalysisEtTrackMatchCorrections;
24 class AliAnalysisEtSelector;
25 class AliCentrality;
26 class TString;
27 class TTree;
28 class TH2F;
29 class TH1F;
30 class TH1I;
31 class AliVEvent;
32 class TList;
33 class TString;
34 class AliESDtrackCuts;
35 class AliAnalysisEtCuts;
36 class AliESDCaloCluster;
37 //class THnSparseD;
38 class AliPIDResponse;
39
40 class AliAnalysisEt : public AliAnalysisEtCommon
41 {
42 public:
43
44     AliAnalysisEt();
45     virtual ~AliAnalysisEt();
46
47 public:
48
49     /** Analyse the event! */
50
51     virtual Int_t AnalyseEvent(AliVEvent *event);
52
53     /** Fill the objects you want to output, classes which add new histograms should overload this. */
54     virtual void FillOutputList(TList* list);
55
56     /** Initialise the analysis, must be overloaded. */
57     virtual void Init();
58
59     /**
60     * Creates the histograms, must be overloaded if you want to add your own.
61     * Uses the fHistogramNameSuffix to create proper histogram names
62     */
63     virtual void CreateHistograms();
64     virtual void CreateTrees();
65     TH2F* CreateEtaEHisto2D(TString name, TString title, TString ztitle);
66     TH2F* CreateEtaPtHisto2D(TString name, TString title, TString ztitle);
67     TH2F* CreateEtaEtHisto2D(TString name, TString title, TString ztitle);
68     TH2F* CreateResEHisto2D(TString name, TString title, TString ztitle);
69     TH2F* CreateResPtHisto2D(TString name, TString title, TString ztitle);
70     THnSparseF* CreateClusterHistoSparse(TString name, TString title);
71     THnSparseF* CreateNeutralPartHistoSparse(TString name, TString title);
72     THnSparseF* CreateChargedPartHistoSparse(TString name, TString title);
73
74     /** Fills the histograms, must be overloaded if you want to add your own */
75     virtual void FillHistograms();
76
77     /** Reset event specific values (Et etc.) */
78     virtual void ResetEventValues();
79
80     /** Total Et in the event (without acceptance cuts) */
81     Double_t GetTotEt() const {
82         return fTotEt;
83     }
84
85     /** Total neutral Et in the event (without acceptance cuts) */
86     Double_t GetTotNeutralEt() const {
87         return fTotNeutralEt;
88     }
89
90     /** Total charged Et in the event (without acceptance cuts) */
91     Double_t GetTotChargedEt() const {
92         return fTotChargedEt;
93     }
94
95     void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts) {
96         fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;
97     }
98
99     /** Set the centrality object */
100     void SetCentralityObject(AliCentrality *cent) {
101         fCentrality = cent;
102     }
103
104     /** Get contribution from non-removed charged particles */
105     Double_t GetChargedContribution(Int_t clusterMultiplicity) {
106         return fTmCorrections->ChargedContr(clusterMultiplicity);
107     }
108
109     /** Get contribution from non-removed neutral particles */
110     Double_t GetNeutralContribution(Int_t clusterMultiplicity) {
111         return fTmCorrections->NeutralContr(clusterMultiplicity);
112     }
113
114     /** Get contribution from removed gammas */
115     Double_t GetGammaContribution(Int_t clusterMultiplicity) {
116         return fTmCorrections->GammaContr(clusterMultiplicity);
117     }
118
119     /** Get contribution from secondaries */
120     Double_t GetSecondaryContribution(Int_t clusterMultiplicity) {
121         return fTmCorrections->SecondaryContr(clusterMultiplicity);
122     }
123
124     void MakeSparseHistograms() {
125         fMakeSparse=kTRUE;
126     }
127     
128     AliAnalysisEtCuts * GetCuts() const { return fCuts; }
129     
130
131     // Read in corrections
132     Int_t ReadCorrections(TString filename);  // Read in corrections
133     
134
135 protected:
136
137     //AliAnalysisEtCuts *fCuts; // keeper of basic cuts
138     
139     // Return corrected cluster E_T
140     Double_t CorrectForReconstructionEfficiency(const AliESDCaloCluster &cluster,Int_t cent = 0);
141     
142     // Track matching (hadrdonic contamination) corrections
143     AliAnalysisEtTrackMatchCorrections *fTmCorrections;
144     
145     // Reconstruction efficiency corrections
146     AliAnalysisEtRecEffCorrection *fReCorrections;
147     
148     TTree *fEventSummaryTree; // Contains event level information
149
150     TTree *fAcceptedTree; // Tree for information about accepted particles
151     
152     TTree *fDepositTree; // optional TTree for energy deposit measurements
153     
154     Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */
155
156     Double_t fTotEtAcc;/** Total Et in the event (without acceptance cuts) */
157
158     Double_t fTotNeutralEt;/** Total neutral Et in the event */
159
160     Double_t fTotNeutralEtAcc;/** Total neutral Et in the event */
161
162     Double_t fTotChargedEt;/** Total charged Et in the event */
163
164     Double_t fTotChargedEtAcc;/** Total charged Et in the event */
165
166     Int_t fMultiplicity;/** Multiplicity of particles in the event */
167     Int_t fChargedMultiplicity;/** Multiplicity of charged particles in the event */
168     Int_t fNeutralMultiplicity; /** Multiplicity of neutral particles in the event */
169
170     Double_t fProtonEt; /** Et of identified protons */
171     Double_t fAntiProtonEt; /** Et of identified protons */
172
173     Double_t fNeutronEt; /** Et of neutrons (MC only for now) */
174     Double_t fAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
175     
176     Double_t fPi0Et; // Et of identified pi0
177     Double_t fPiPlusEt; // Et of identified pi+
178     Double_t fPiMinusEt; // Et of identified pi-
179     
180     Double_t fKPlusEt; // Et of identified K+ 
181     Double_t fKMinusEt; // Et of identified K- 
182     Double_t fK0sEt; // Et of identified K0 short
183     Double_t fK0lEt; // Et of identified K0 long
184     
185     Double_t fMuMinusEt; // Et of identified mu- 
186     Double_t fMuPlusEt; // Et of identified mu+ 
187
188     Double_t fEMinusEt; // Et of identified e-
189     Double_t fEPlusEt; // Et of identified e+
190     
191     Double_t fGammaEt; /** Et of identified electrons (MC only for now) */
192
193     Double_t fProtonRemovedEt; /** Et of identified protons */
194     Double_t fAntiProtonRemovedEt; /** Et of identified protons */
195
196     Double_t fNeutronRemovedEt; /** Et of neutrons (MC only for now) */
197     Double_t fAntiNeutronRemovedEt; /** Et of anti-neutrons (MC only for now) */
198     
199     Double_t fPi0RemovedEt; // Removed Et of identified pi0
200     Double_t fPiPlusRemovedEt; // Removed Et of identified pi+
201     Double_t fPiMinusRemovedEt; // Removed Et of identified pi-
202
203     Double_t fKPlusRemovedEt; // Removed Et of identified K+ 
204     Double_t fKMinusRemovedEt; // Removed Et of identified K- 
205     Double_t fK0sRemovedEt; // Removed Et of identified K0 short
206     Double_t fK0lRemovedEt; // Removed Et of identified K0 long
207     
208     Double_t fMuMinusRemovedEt; // Removed Et of identified mu- 
209     Double_t fMuPlusRemovedEt; // Removed Et of identified mu+ 
210     
211     Double_t fEMinusRemovedEt; // Removed Et of identified e-
212     Double_t fEPlusRemovedEt; // Removed Et of identified e+
213     
214     Double_t fGammaRemovedEt; /** Removed Et of identified electrons (MC only for now) */
215
216     Double_t fProtonMult; /** Mult of identified protons */
217     Double_t fAntiProtonMult; /** Mult of identified protons */
218
219     Double_t fNeutronMult; /** Mult of neutrons (MC only for now) */
220     Double_t fAntiNeutronMult; /** Mult of anti-neutrons (MC only for now) */
221     
222     Double_t fPi0Mult; // Mult of identified pi0
223     Double_t fPiPlusMult; // Mult of identified pi+
224     Double_t fPiMinusMult; // Mult of identified pi-
225     
226     Double_t fKPlusMult; // Mult of identified K+ 
227     Double_t fKMinusMult; // Mult of identified K- 
228     Double_t fK0sMult; // Mult of identified K0 short
229     Double_t fK0lMult; // Mult of identified K0 long
230     
231     Double_t fMuMinusMult; // Mult of identified mu- 
232     Double_t fMuPlusMult; // Mult of identified mu+ 
233
234     Double_t fEMinusMult; // Mult of identified e-
235     Double_t fEPlusMult; // Mult of identified e+
236     
237     Double_t fGammaMult; /** Mult of identified electrons (MC only for now) */
238
239     Double_t fProtonRemovedMult; /** Mult of identified protons */
240     Double_t fAntiProtonRemovedMult; /** Mult of identified protons */
241
242     Double_t fNeutronRemovedMult; /** Mult of neutrons (MC only for now) */
243     Double_t fAntiNeutronRemovedMult; /** Mult of anti-neutrons (MC only for now) */
244     
245     Double_t fPi0RemovedMult; // Removed Mult of identified pi0
246     Double_t fPiPlusRemovedMult; // Removed Mult of identified pi+
247     Double_t fPiMinusRemovedMult; // Removed Mult of identified pi-
248
249     Double_t fKPlusRemovedMult; // Removed Mult of identified K+ 
250     Double_t fKMinusRemovedMult; // Removed Mult of identified K- 
251     Double_t fK0sRemovedMult; // Removed Mult of identified K0 short
252     Double_t fK0lRemovedMult; // Removed Mult of identified K0 long
253     
254     Double_t fMuMinusRemovedMult; // Removed Mult of identified mu- 
255     Double_t fMuPlusRemovedMult; // Removed Mult of identified mu+ 
256     
257     Double_t fEMinusRemovedMult; // Removed Mult of identified e-
258     Double_t fEPlusRemovedMult; // Removed Mult of identified e+
259     
260     Double_t fGammaRemovedMult; /** Removed Mult of identified electrons (MC only for now) */
261
262     Float_t fEnergyDeposited; /** Energy deposited in calorimeter */
263     Float_t fMomentumTPC; /** Momentum measured in TPC */
264     Short_t fCharge; /** Charge of the particle */
265     Short_t fParticlePid; /** Particle PID */
266     Float_t fPidProb; /** Probability of PID */
267     Bool_t fTrackPassedCut; /** The track is accepted by ESDTrackCuts */
268
269     Int_t fCentClass; // centrality class
270
271     /** Detector radius */
272     Double_t fDetectorRadius; // Detector radius
273
274     /** Minimum energy to cut on single cell cluster */
275     Double_t fSingleCellEnergyCut;  // Minimum energy to cut on single cell cluster
276
277     Double_t fChargedEnergyRemoved; // Charged energy removed
278     Double_t fNeutralEnergyRemoved; // Neutral energy removed
279     Double_t fGammaEnergyAdded; // gamma energy added
280
281     // Declare the histograms
282
283     /** The EM Et spectrum measured */
284     TH1F *fHistEt; //Et spectrum
285
286     /** Multiplicity of neutral particles in the events */
287     TH1F *fHistNeutralMult; //Multiplicity
288
289     // Acceptance plots 
290     TH2F *fHistPhivsPtPos; //phi vs pT plot for positive tracks
291     TH2F *fHistPhivsPtNeg; //phi vs pT plot for negative tracks
292
293     /* Auxiliary Histogram variables */
294     static Float_t fgEtaAxis[17];//bins for eta axis of histograms
295     static Int_t fgnumOfEtaBins;//number of eta bins
296     static Float_t fgPtAxis[117];//bins for pt axis of histograms
297     static Int_t fgNumOfPtBins;//number of pt bins
298     static Float_t fgEAxis[79];//bins for pt axis of histograms
299     static Int_t fgNumOfEBins;//number of pt bins
300     static Float_t fgRAxis[48];//bins for R axis
301     static Int_t fgNumOfRBins;//number of R bins
302
303     /** Centrality object */
304     AliCentrality *fCentrality; //Centrality object
305
306     Bool_t fMakeSparse;//Boolean for whether or not to make sparse histograms
307
308     TH1I *fCutFlow; // Cut flow
309     
310     AliAnalysisEtSelector *fSelector; // Selector class
311
312     AliPIDResponse *fPIDResponse;
313
314
315 private:
316    
317   
318     
319     //Declare private to avoid compilation warning
320     AliAnalysisEt & operator = (const AliAnalysisEt & g) ;//cpy assignment
321     AliAnalysisEt(const AliAnalysisEt & g) ; // cpy ctor
322
323     ClassDef(AliAnalysisEt, 3);
324 };
325
326 #endif // ALIANALYSISET_H