1 // ----------------------------------------------------------------------------
2 // AliAnalysisTaskDiHadronPID.h
3 // ----------------------------------------------------------------------------
4 // Author: Misha Veldhoen (misha.veldhoen@cern.ch)
5 // Last Rev.: May 2nd 2012. (v 8.00)
6 // ----------------------------------------------------------------------------
8 #ifndef ALIANALYSISTASKDIHADRONPID_H
9 #define ALIANALYSISTASKDIHADRONPID_H
12 #include "AliAnalysisTaskSE.h"
13 #include "THnSparse.h"
32 class AliAnalysisTaskDiHadronPID: public AliAnalysisTaskSE {
35 // Required functions.
36 AliAnalysisTaskDiHadronPID();
37 AliAnalysisTaskDiHadronPID(const char *name);
38 virtual ~AliAnalysisTaskDiHadronPID();
40 virtual void UserCreateOutputObjects();
41 virtual void UserExec(Option_t *option);
42 virtual void Terminate(Option_t *);
45 void SetVerbose(Int_t verbose) {fVerbose=verbose;}
46 void SetPrintBufferSize(Bool_t printbuffersize=kTRUE) {fPrintBufferSize=printbuffersize;}
47 void SetCalculateMixedEvents(Bool_t mixedevents=kTRUE) {fCalculateMixedEvents=mixedevents;}
48 void SetMC(Bool_t mc=kTRUE) {fMC = mc;}
49 void SetBeamType(TString beamtype) {
50 if ((beamtype!="pp")&&(beamtype!="PbPb")) {
51 cout<<"SetBeamType -> Beamtype must be pp or PbPb"<<endl;
57 void SetMaxEta(Double_t maxeta) {
58 if (TMath::Abs(maxeta)>0.9) {
59 cout<<"SetMaxEta -> |eta| must be < 0.9"<<endl;
65 void SetMaxRapidityInInclusiveSpectra(Double_t maxrap) {fMaxRap=maxrap;}
67 void SetMaxPlotEta(Double_t maxploteta) {
68 if (TMath::Abs(maxploteta)>1.0) {
69 cout<<"SetMaxPlotEta -> |eta| must be < 1.0"<<endl;
72 fMaxPlotEta = maxploteta;
75 void SetMaxPt(Double_t maxpt) {
77 cout<<"SetMaxPt -> Maximum pT must be > 5.0 GeV/c."<<endl;
83 void SetNEtaBins(Int_t netabins) {
84 if (netabins<1||netabins>72) {
85 cout<<"SetNEtaBins -> Number of bins must be between 1 and 72"<<endl;
91 void SetNPhiBins(Int_t nphibins) {
92 if (nphibins<1||nphibins>72) {
93 cout<<"SetNPhiBins -> Number of bins must be between 1 and 72"<<endl;
100 void SetVertexZMixedEvents(Double_t vertexzmixedevents) {
101 if (vertexzmixedevents<0.||vertexzmixedevents>10.) {
102 cout<<"SetVertexZMixedEvents -> must be 0 < z < 10"<<endl;
105 fVertexZMixedEvents=vertexzmixedevents;
108 void SetZoomed(Bool_t zoomed=kTRUE) {fZoomed=zoomed;}
109 void SetDoDCACut(Bool_t dodcacut=kTRUE) {fDoDCACut=dodcacut;}
110 void SetDoITSCut(Bool_t doitscut=kTRUE) {fDoITSCut=doitscut;}
111 void SetDemandNoMismatch(Bool_t demandnomismatch=kTRUE) {fDemandNoMismatch=demandnomismatch;}
112 void SetTrigBufferMaxSize(Int_t trigbuffermaxsize) {
113 if (trigbuffermaxsize<10||trigbuffermaxsize>25000) {
114 cout<<"SetTrigBufferMaxSize -> Max buffer size must be between 10 and 25000."<<endl;
117 fTrigBufferMaxSize=trigbuffermaxsize;
120 void SetCentralityCut(Double_t centralitycutmax, Double_t centralitycutmin) {
121 if (centralitycutmax<0.) {
122 cout<<"SetCentralityCut -> Centrality cannot be lower than 0."<<endl;
125 if (centralitycutmin<centralitycutmax) {
126 cout<<"SetCentralityCut -> Maximum centrality needs to be smaller than the minimum centrality. (It's confusing I know)"<<endl;
129 if (centralitycutmin>100.) {
130 cout<<"SetCentralityCut -> Minimum centrality cannot exceed 100%."<<endl;
133 fCentralityCutMax=centralitycutmax;
134 fCentralityCutMin=centralitycutmin;
139 Bool_t GetVerbose() {return fVerbose;}
140 Bool_t GetPrintBufferSize() {return fPrintBufferSize;}
141 Bool_t GetCalculateMixedEvents() {return fCalculateMixedEvents;}
142 TString GetBeamType() {return fBeamType;}
143 Double_t GetMaxEta() {return fMaxEta;}
144 Double_t GetMaxPlotEta() {return fMaxPlotEta;}
145 Double_t GetMaxPt() {return fMaxPt;}
146 Int_t GetNEtaBins() {return fNEtaBins;}
147 Int_t GetNPhiBins() {return fNPhiBins;}
148 Double_t GetVertexZMixedEvents() {return fVertexZMixedEvents;}
149 Bool_t GetZoomed() {return fZoomed;}
150 Bool_t GetDoDCACut() {return fDoDCACut;}
151 Bool_t GetDoITSCut() {return fDoITSCut;}
152 Bool_t GetDemandNoMismatch() {return fDemandNoMismatch;}
153 Int_t GetTrigBufferMaxSize() {return fTrigBufferMaxSize;}
154 Double_t GetCentralityCutMax() {return fCentralityCutMax;}
155 Double_t GetCentralityCutMin() {return fCentralityCutMin;}
158 // Private Functions.
159 AliAnalysisTaskDiHadronPID(const AliAnalysisTaskDiHadronPID&); // NOT IMPLEMENTED.
160 AliAnalysisTaskDiHadronPID& operator=(const AliAnalysisTaskDiHadronPID&); // NOT IMPLEMENTED.
162 void FillGlobalTracksArray();
163 AliAODTrack* GetGlobalTrack(AliAODTrack* track);
165 Bool_t SelectEvent(AliAODVertex *vertex);
166 Int_t ClassifyTrack(AliAODTrack* track);
168 Double_t PhiRange(Double_t DPhi);
169 Int_t ConvertPdgCode(Int_t pdgcode);
173 AliPIDResponse *fPIDResponse; //! PID Response Handler.
175 // Event and Track related objects.
176 AliAODEvent *fAODEvent; //! The AOD Event.
177 AliAODHeader *fAODHeader; //! The AOD Header.
178 AliAODVertex *fAODVertex; //! The AOD Vertex.
180 AliAODTrack *fAODTrack; //! Current AOD Track.
182 TObjArray *fGlobalTracks; //! Partner Tracks.
183 TClonesArray *fMCTracks; //! MC tracks, indexed by their track label.
188 TH1F *fCentrality; //! Centrality Histogram.
189 TH1F *fVertexZ; //! Vertex Z position.
192 TH2F *fDCA; //! DCA XY vs Z before DCA cut.
193 TH2F *fDCAZoomed; //!
194 TH2F *fDCAZoomedTwice; //!
195 TH2F *fDCACut; //! DCA XY vs Z after DCA cut (if performed!).
196 TH2F *fDCAZoomedCut; //!
197 TH2F *fDCAZoomedTwiceCut; //!
199 TH1F *fITSHits; //! 3 bins, [no hits in first 2 layers, 1 hit, 2 hits]
201 TH1F *fTrackCutsCount; //! Counts of used tracks after cuts
202 TH2F *fTrackCutsPt; //! pT spectrum after cuts.
203 TH2F *fTrackCutsEta; //! eta spectrum after cuts.
204 TH2F *fTrackCutsPhi; //! phi spectrum after cuts.
206 TH1F *fEtaSpectrumTrig; //! eta spectrum of triggers (pT > 5.0 tracks, trigger track cuts.)
207 TH2F *fEtaSpectrumAssoc; //! eta spectrum of associateds as a function of pT
208 TH2F *fPhiSpectrumAssoc; //! phi spectrum of associateds as a function of pT
211 TH2F *fTPCnSigmaProton; //! TPC nSigma plot for Protons.
212 TH2F *fTOFnSigmaProton; //! TOF nSigma plot for Protons.
213 TH2F *fTPCnSigmaPion; //! TPC nSigma plot for Pions.
214 TH2F *fTOFnSigmaPion; //! TOF nSigma plot for Pions.
215 TH2F *fTPCnSigmaKaon; //! TPC nSigma plot for Kaons.
216 TH2F *fTOFnSigmaKaon; //! TOF nSigma plot for Kaons.
218 TH3F *fTPCSignal; //! TPC signal (pt,eta).
219 TH3F *fTOFSignal; //! TOF signal (pt,eta).
220 TH3F *fInclusiveTPCTOF[3][10]; //! inclusive TPC-TOF histogram as a function of pT (and eta)
221 TH3F *fInclusiveTPCTOFRap[3][10];//! inclusive TPC-TOF histogram as a function of pT and rapidity, with additional rapidity cut.
223 // Efficiency Plots (Monte Carlo)
224 TH2F *fPtEtaDistrDataPrim[6]; //! pT distribution of physical primaries [species: pi+,pi-,K+,K-,p,pbar].
225 TH2F *fPtEtaDistrDataSec[6]; //!
227 TH2F *fPtRapDistrDataPrimRapCut[6];//! pT distribution of physical primaries [species: pi+,pi-,K+,K-,p,pbar].
228 TH2F *fPtRapDistrDataSecRapCut[6];//! with an additional rapidity cut.
230 TH2F *fPtEtaDistrMCPrim[6]; //! pT distribution of MCParticles. [species: pi+,pi-,K+,K-,p,pbar].
231 TH2F *fPtEtaDistrMCSec[6]; //!
233 TH2F *fPtRapDistrMCPrimRapCut[6];//! pT distribution of MCParticles. [species: pi+,pi-,K+,K-,p,pbar].
234 TH2F *fPtRapDistrMCSecRapCut[6]; //! with an additional rapidity cut.
236 TH3F *fDiHadronMC[6]; //! DPhiDEta Plot per species [species]
238 // Di-Hadron Correlations.
239 TH3F *fDiHadron; //! regular di-hadron correlation, accepting all associateds.
240 THnSparseF *fDiHadronTPCTOF[3][10]; //! Di-Hadron correlations with both TPC and TOF signal.
243 TH3F *fMixedEvents; //! Mixed Events, associated track cuts.
244 //TH3F *fMixedEventsTPCTOFCut[3]; //! For every species seperately we keep track of mixed events.
245 THnSparseF *fMixedEventsTPCTOF[3][10]; //!
247 // List of Histograms.
248 TList *fHistoList; //! List of Histograms.
250 // Analysis Task Configuration Variables.
251 Bool_t fCalculateMixedEvents; //
252 TString fBeamType; // pp or PbPb
253 Bool_t fMC; // runs over MC.
254 Double_t fMaxEta; // Q: Do we need to take extra care of the binning?
255 Double_t fMaxPlotEta; //
256 Double_t fMaxRap; // Max rapidity, applied to the inclusive spectra.
258 Int_t fNEtaBins; // Number of bins in eta
259 Int_t fNPhiBins; // Number of bins in phi
260 Double_t fVertexZMixedEvents; // Events with a vertex z difference smaller than
261 // this number (standard 2cm) will be mixed.
263 Double_t fCentralityCutMax; // Maximum centrality (standard 0%)
264 Double_t fCentralityCutMin; // Minimum centrality (standard 10%)
266 Bool_t fDoITSCut; // Cut the tracks with not at least one SPD hit.
267 Bool_t fDoDCACut; // Perform a DCA cut to get rid of secondaries.
268 Bool_t fDemandNoMismatch; //
270 Int_t fTrackCutLabelNumbers[8]; // Track Cut labels.
272 // Level of verbal output.
274 // 1 -> Only error messages.
275 // 2 -> Information about output creation (beginning of the job)
276 // 3 -> Event information.
277 // 4 -> Track information.
279 Bool_t fPrintBufferSize; //
282 Double_t fTrigBuffer[25000][4]; //!
283 Int_t fTrigBufferIndex; //!
284 Int_t fTrigBufferSize; //!
285 Int_t fTrigBufferMaxSize; //!
288 ClassDef(AliAnalysisTaskDiHadronPID,1);