]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/SPECTRA/AliAnalysisTaskSEITSsaSpectra.h
Removing deprecated linearization and MC rescaling (now part of the centrality framework)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliAnalysisTaskSEITSsaSpectra.h
1 #ifndef ALIANALYSISTASKSEITSSASPECTRA_H
2 #define ALIANALYSISTASKSEITSSASPECTRA_H
3
4 ///////////////////////////////////////////////////////////////////////////
5 // AliAnalysisTaskSE for the extraction of the various histograms to
6 // study the pt spectra of identified hadrons:
7 // - log(dEdx)-log(dEdxBB) distributions for pions, kaons and protons in pt bins
8 // - Pt distributions of pions, kaons and protons with nSigma PID
9 // Authors: 
10 // E. Biolcati, biolcati@to.infn.it
11 // L. Milano, milano@to.infn.it
12 // F. Prino, prino@to.infn.it
13 ///////////////////////////////////////////////////////////////////////////
14
15 /* $Id$ */
16
17 class TString;
18 class TTree;
19 class TH1F;
20 class TH2F;
21 class TRandom3;
22 class AliESDEvent;
23 class TNtuple;
24 class AliESDtrackCuts;
25 #include "AliAnalysisTaskSE.h"
26
27 class AliAnalysisTaskSEITSsaSpectra : public AliAnalysisTaskSE {
28  public:
29   AliAnalysisTaskSEITSsaSpectra();
30   virtual ~AliAnalysisTaskSEITSsaSpectra();
31
32   virtual void   UserCreateOutputObjects();
33   virtual void   UserExec(Option_t *);
34   virtual void   Terminate(Option_t *);
35
36   void SetMaxChi2Clu(Double_t chi=2.5){
37     fMaxChi2Clu=chi;
38   }
39   void SetRapidityRange(Double_t dy=0.5){
40     fMaxY=dy;
41   }
42   void SetMinNSigma(Double_t ns=1.5){
43     fMinNSigma=ns;
44   }
45   void SetMindEdx(Double_t mind=0.){
46     fMindEdx=mind;
47   }
48   void SetMinSPDPoints(Int_t np=1){
49     fMinSPDPts=np;
50   }
51   void SetMinNdEdxSamples(Int_t np=3){
52     fMinNdEdxSamples=np;
53   }
54   void SetDCACuts(Double_t nsxy=7., Double_t nsz=7.){
55     fNSigmaDCAxy=nsxy;
56     fNSigmaDCAz=nsz; 
57   }
58   void SetMultBin(Int_t LowBin=-1,Int_t UpBin=-1){
59     fLowMult=LowBin;
60     fUpMult=UpBin;
61   }
62   void SetEtaMax(Double_t maxeta){
63     fEtaRange=maxeta;
64   }
65
66   void SetYear(Int_t year);
67   void SetReadMC(Bool_t flag = kTRUE) {fMC = flag;}
68   void SetFillNtuple(Bool_t fill=kTRUE) {fFillNtuple=fill;}
69   void SetSmearMC(Double_t smearp, Double_t smeardedx){
70     fSmearMC=kTRUE;
71     fSmearP=smearp;
72     fSmeardEdx=smeardedx;
73   }
74   Double_t BetheBloch(Double_t bg,Bool_t optMC) const;
75   Double_t CookdEdx(Double_t *s) const; 
76   Double_t Eta2y(Double_t pt, Double_t m, Double_t eta) const;
77   Bool_t DCAcut(Double_t impactXY, Double_t impactZ, Double_t pt, Bool_t optMC) const;
78
79  private:
80   AliAnalysisTaskSEITSsaSpectra(const AliAnalysisTaskSEITSsaSpectra &source); 
81   AliAnalysisTaskSEITSsaSpectra& operator=(const AliAnalysisTaskSEITSsaSpectra &source);
82
83   enum {kNbins=22};
84   
85   AliESDEvent *fESD; //ESD object
86   AliESDtrackCuts *fesdTrackCutsMult;//cuts for multiplicity 
87   
88   
89   TList *fOutput; //! tlist with output
90   TH1F *fHistNEvents; //! histo with number of events
91   TH1F *fHistMult; //! histo with multiplicity of the events
92   TH1F *fHistNTracks; //! histo with number of tracks
93   TH1F *fHistNTracksPos; //! histo with number of tracks
94   TH1F *fHistNTracksNeg; //! histo with number of tracks
95   
96   TH2F *fHistDEDX; //! histo with dedx versus momentum
97   TH2F *fHistDEDXdouble; //! histo with dedx versus signed momentum
98   
99   TH1F *fHistBeforeEvSel; //! histo with pt distribution before my event selection
100   TH1F *fHistAfterEvSel; //! histo with pt distribution after my event selection
101   
102   TH1F *fHistPrimMCpos[3]; //! histo with spectra of primaries from the MC truth (positive)
103   TH1F *fHistPrimMCneg[3]; //! histo with spectra of primaries from the MC truth (negative)
104   TH1F *fHistSecStrMCpos[3]; //! histo with spectra of strange decays from the MC truth (positive)
105   TH1F *fHistSecStrMCneg[3]; //! histo with spectra of strange decays from the MC truth (negative)
106   TH1F *fHistSecMatMCpos[3]; //! histo with spectra of sec. from material from the MC truth (positive)
107   TH1F *fHistSecMatMCneg[3]; //! histo with spectra of sec. from material from the MC truth (negative)
108   TH1F *fHistPrimMCposBefEvSel[3]; //! histo with spectra of primaries from the MC truth (positive)
109   TH1F *fHistPrimMCnegBefEvSel[3]; //! histo with spectra of primaries from the MC truth (negative)
110   TH1F *fHistSecStrMCposBefEvSel[3]; //! histo with spectra of strange decays from the MC truth (positive)
111   TH1F *fHistSecStrMCnegBefEvSel[3]; //! histo with spectra of strange decays from the MC truth (negative)
112   TH1F *fHistSecMatMCposBefEvSel[3]; //! histo with spectra of sec. from material from the MC truth (positive)
113   TH1F *fHistSecMatMCnegBefEvSel[3]; //! histo with spectra of sec. from material from the MC truth (negative)
114   TH1F *fHistPrimMCposReco[3]; //! histo with spectra of primaries from the MC truth (positive)
115   TH1F *fHistPrimMCnegReco[3]; //! histo with spectra of primaries from the MC truth (negative)
116   TH1F *fHistSecStrMCposReco[3]; //! histo with spectra of strange decays from the MC truth (positive)
117   TH1F *fHistSecStrMCnegReco[3]; //! histo with spectra of strange decays from the MC truth (negative)
118   TH1F *fHistSecMatMCposReco[3]; //! histo with spectra of sec. from material from the MC truth (positive)
119   TH1F *fHistSecMatMCnegReco[3]; //! histo with spectra of sec. from material from the MC truth (negative)
120   
121   TH1F *fHistCharge[4]; //! histo with charge distribution to check the calibration 
122   
123   TH1F *fHistPosPi[kNbins]; //! histo with dedx distibution in the pions hypotesis (positive)
124   TH1F *fHistPosK[kNbins]; //! histo with dedx distibution in the kaons hypotesis (positive)
125   TH1F *fHistPosP[kNbins]; //! histo with dedx distibution in the protons hypotesis (positive)
126   TH1F *fHistNegPi[kNbins]; //! histo with dedx distibution in the pions hypotesis (negative)
127   TH1F *fHistNegK[kNbins]; //! histo with dedx distibution in the kaons hypotesis (negative)
128   TH1F *fHistNegP[kNbins]; //! histo with dedx distibution in the protons hypotesis (negative)
129   
130   TH1F *fHistDCAPosPi[kNbins]; //! histo with DCA distibution in the kaons hypotesis (positive)
131   TH1F *fHistDCAPosK[kNbins]; //! histo with DCA distibution in the kaons hypotesis (positive)
132   TH1F *fHistDCAPosP[kNbins]; //! histo with DCA distibution in the protons hypotesis (positive)
133   TH1F *fHistDCANegPi[kNbins]; //! histo with DCA distibution in the pions hypotesis (negative)
134   TH1F *fHistDCANegK[kNbins]; //! histo with DCA distibution in the kaons hypotesis (negative)
135   TH1F *fHistDCANegP[kNbins]; //! histo with DCA distibution in the protons hypotesis (negative)
136   
137   TH1F *fHistMCPrimDCAPosPi[kNbins]; //! histo with DCA distibution, MC truth 
138   TH1F *fHistMCPrimDCAPosK[kNbins]; //! histo with DCA distibution, MC truth 
139   TH1F *fHistMCPrimDCAPosP[kNbins]; //! histo with DCA distibution, MC truth 
140   TH1F *fHistMCPrimDCANegPi[kNbins]; //! histo with DCA distibution, MC truth 
141   TH1F *fHistMCPrimDCANegK[kNbins]; //! histo with DCA distibution, MC truth 
142   TH1F *fHistMCPrimDCANegP[kNbins]; //! histo with DCA distibution, MC truth
143   
144   TH1F *fHistMCSecStDCAPosPi[kNbins]; //! histo with DCA distibution, MC truth 
145   TH1F *fHistMCSecStDCAPosK[kNbins]; //! histo with DCA distibution, MC truth 
146   TH1F *fHistMCSecStDCAPosP[kNbins]; //! histo with DCA distibution, MC truth 
147   TH1F *fHistMCSecStDCANegPi[kNbins]; //! histo with DCA distibution, MC truth 
148   TH1F *fHistMCSecStDCANegK[kNbins]; //! histo with DCA distibution, MC truth 
149   TH1F *fHistMCSecStDCANegP[kNbins]; //! histo with DCA distibution, MC truth
150   
151   TH1F *fHistMCSecMatDCAPosPi[kNbins]; //! histo with DCA distibution, MC truth 
152   TH1F *fHistMCSecMatDCAPosK[kNbins]; //! histo with DCA distibution, MC truth 
153   TH1F *fHistMCSecMatDCAPosP[kNbins]; //! histo with DCA distibution, MC truth 
154   TH1F *fHistMCSecMatDCANegPi[kNbins]; //! histo with DCA distibution, MC truth 
155   TH1F *fHistMCSecMatDCANegK[kNbins]; //! histo with DCA distibution, MC truth 
156   TH1F *fHistMCSecMatDCANegP[kNbins]; //! histo with DCA distibution, MC truth
157  
158   TH1F *fHistMCPosPi[kNbins]; //! histo with dedx using the MC truth in the pions hypotesis (positive)
159   TH1F *fHistMCPosK[kNbins]; //! histo with dedx  using the MC truth in the kaons hypotesis (positive)
160   TH1F *fHistMCPosP[kNbins]; //! histo with dedx  using the MC truth in the protons hypotesis (positive)
161   TH1F *fHistMCNegPi[kNbins]; //! histo with dedx using the MC truth in the pions hypotesis (negative)
162   TH1F *fHistMCNegK[kNbins]; //! histo with dedx  using the MC truth in the kaons hypotesis (negative)
163   TH1F *fHistMCNegP[kNbins]; //! histo with dedx  using the MC truth in the protons hypotesis (negative)
164   
165   TH1F *fHistPosNSigmaMean[3];       //! NSigma histos for 6 species
166   TH1F *fHistPosNSigmaMCMean[3];       //! NSigma histos for 6 species
167   TH1F *fHistPosNSigmaPrimMean[3];   //! NSigma histos for 6 species
168   TH1F *fHistPosNSigmaPrimMCMean[3]; //! NSigma histos for 6 species
169   TH1F *fHistNegNSigmaMean[3];       //! NSigma histos for 6 species
170   TH1F *fHistNegNSigmaMCMean[3];       //! NSigma histos for 6 species
171   TH1F *fHistNegNSigmaPrimMean[3];   //! NSigma histos for 6 species
172   TH1F *fHistNegNSigmaPrimMCMean[3]; //! NSigma histos for 6 species
173
174   TH1F *fHistPosNSigma[3];       //! NSigma histos for 6 species
175   TH1F *fHistPosNSigmaMC[3];       //! NSigma histos for 6 species
176   TH1F *fHistPosNSigmaPrim[3];   //! NSigma histos for 6 species
177   TH1F *fHistPosNSigmaPrimMC[3]; //! NSigma histos for 6 species
178   TH1F *fHistNegNSigma[3];       //! NSigma histos for 6 species
179   TH1F *fHistNegNSigmaMC[3];       //! NSigma histos for 6 species
180   TH1F *fHistNegNSigmaPrim[3];   //! NSigma histos for 6 species
181   TH1F *fHistNegNSigmaPrimMC[3]; //! NSigma histos for 6 species
182
183   Double_t fPtBinLimits[kNbins+1]; // limits of Pt Bins
184   Int_t    fMinSPDPts;       // minimum number of SPD Points
185   Int_t    fMinNdEdxSamples; // minimum number of SDD+SSD points
186   Double_t fMindEdx;         // minimum dE/dx value in a layer (to cut noise)
187   Double_t fMinNSigma;       // minimum number of sigmas
188   Double_t fMaxY;            // maximum rapidity
189   Double_t fMaxChi2Clu;      // maximum cluster
190   Double_t fNSigmaDCAxy;     // DCA cut in bend. plane
191   Double_t fNSigmaDCAz;      // DCA cut along z
192   Double_t fEtaRange;        // limits in pseudorap
193   Int_t fLowMult;      // Multiplicity bin
194   Int_t fUpMult;      // Multiplicity bin
195   Int_t fYear;        // Year (2009, 2010)
196   Bool_t   fMC;        //flag to switch on the MC analysis for the efficiency estimation
197   Bool_t   fSmearMC;   // flag to apply extra smearing on MC 
198   Double_t fSmearP;    // extra relative smearing on simulated momentum
199   Double_t fSmeardEdx; // extra relative smearing on simulated dE/dx
200   TRandom3* fRandGener;    // generator for smearing
201   Bool_t       fFillNtuple;      // fill ntuple  
202   TNtuple     *fNtupleNSigma;//! output ntuple
203   TNtuple     *fNtupleMC;//! output MC ntuple
204   
205   ClassDef(AliAnalysisTaskSEITSsaSpectra, 4);
206 };
207
208 #endif