AliPhysics  vAN-20150427 (e6e7aad)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnaChargedParticles.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include "TParticle.h"
18 #include "TH2F.h"
19 #include "TDatabasePDG.h"
20 
21 //---- AliRoot system ----
22 #include "AliAnaChargedParticles.h"
23 #include "AliCaloTrackReader.h"
24 #include "AliAODPWG4Particle.h"
25 #include "AliStack.h"
26 #include "AliFiducialCut.h"
27 #include "AliVTrack.h"
28 #include "AliAODMCParticle.h"
29 #include "AliAODTrack.h"
30 #include "AliAODEvent.h"
31 #include "AliESDEvent.h"
32 
36 
37 //__________________________________________________
39 //__________________________________________________
42 fFillTrackBCHistograms(0), fFillVertexBC0Histograms(0),
43 fMomentum(),
44 // Histograms
45 fhNtracks(0), fhPt(0), fhPtNoCut(0),
46 fhPtCutDCA(0), fhPtCutDCABCOK(0),
47 fhPtNotPrimary(), fhPtNotSharedClusterCut(0),
48 fhPhiNeg(0), fhEtaNeg(0),
49 fhPhiPos(0), fhEtaPos(0),
50 fhEtaPhiPos(0), fhEtaPhiNeg(0),
51 fhPtVtxOutBC0(0), fhEtaPhiVtxOutBC0(0),
52 fhPtVtxInBC0(0), fhEtaPhiVtxInBC0(0),
53 fhPtSPDRefit(0), fhPtNoSPDRefit(0), fhPtNoSPDNoRefit(0),
54 fhEtaPhiSPDRefitPt02(0), fhEtaPhiNoSPDRefitPt02(0), fhEtaPhiNoSPDNoRefitPt02(0),
55 fhEtaPhiSPDRefitPt3(0), fhEtaPhiNoSPDRefitPt3(0), fhEtaPhiNoSPDNoRefitPt3(0),
56 // TOF
57 fhTOFSignal(0), fhTOFSignalPtCut(0), fhTOFSignalBCOK(0),
58 fhPtTOFSignal(0), fhPtTOFSignalDCACut(0),
59 fhPtTOFSignalVtxOutBC0(0), fhPtTOFSignalVtxInBC0(0),
60 fhPtTOFStatus0(0), fhEtaPhiTOFStatus0(0),
61 fhEtaPhiTOFBC0(0), fhEtaPhiTOFBCPlus(0), fhEtaPhiTOFBCMinus(0),
62 fhEtaPhiTOFBC0PileUpSPD(0),
63 fhEtaPhiTOFBCPlusPileUpSPD(0),
64 fhEtaPhiTOFBCMinusPileUpSPD(0),
65 fhProductionVertexBC(0),
66 fhPtNPileUpSPDVtx(0), fhPtNPileUpTrkVtx(0),
67 fhPtNPileUpSPDVtxBC0(0), fhPtNPileUpTrkVtxBC0(0)
68 {
69  for(Int_t i = 0; i < 7; i++)
70  {
71  fhPtPileUp [i] = 0;
72  fhPtTOFSignalPileUp[i] = 0;
76  }
77 
78  for(Int_t i = 0; i < 3; i++)
79  {
80  fhPtDCA [i] = 0 ;
81 
82  fhPtDCASPDRefit [i] = 0 ;
83  fhPtDCANoSPDRefit [i] = 0 ;
84  fhPtDCANoSPDNoRefit [i] = 0 ;
85 
86  fhPtDCAPileUp [i] = 0 ;
87  fhPtDCATOFBC0 [i] = 0 ;
88  fhPtDCATOFBCOut [i] = 0 ;
89  fhPtDCAPileUpTOFBC0 [i] = 0 ;
90  fhPtDCANoTOFHit [i] = 0 ;
91  fhPtDCAPileUpNoTOFHit [i] = 0 ;
92 
93  fhPtDCAVtxOutBC0 [i] = 0 ;
94  fhPtDCAVtxInBC0 [i] = 0 ;
95  fhPtDCAVtxOutBC0PileUp[i] = 0 ;
96  fhPtDCAVtxInBC0PileUp [i] = 0 ;
98  fhPtDCAVtxInBC0NoTOFHit [i] = 0 ;
101  }
102 
103  // MC
104  for(Int_t imcPart = 0; imcPart < 6; imcPart++)
105  {
106  fhPtMCPart [imcPart] = 0;
107  fhPtMCPrimPart [imcPart] = 0;
108  fhPhiMCPart [imcPart] = 0;
109  fhPhiMCPrimPart[imcPart] = 0;
110  fhEtaMCPart [imcPart] = 0;
111  fhEtaMCPrimPart[imcPart] = 0;
112  }
113 
114  //Initialize parameters
115  InitParameters();
116 }
117 
118 //__________________________________________________
120 //__________________________________________________
122 {
123  Int_t pdg = 0 ;
124  Int_t nprim = 0 ;
125 
126  TParticle * primStack = 0;
127  AliAODMCParticle * primAOD = 0;
128 
129  // Get the ESD MC particles container
130  AliStack * stack = 0;
131  if( GetReader()->ReadStack() )
132  {
133  stack = GetMCStack();
134  if(!stack ) return;
135  nprim = stack->GetNtrack();
136  }
137 
138  // Get the AOD MC particles container
139  TClonesArray * mcparticles = 0;
140  if( GetReader()->ReadAODMCParticles() )
141  {
142  mcparticles = GetReader()->GetAODMCParticles();
143  if( !mcparticles ) return;
144  nprim = mcparticles->GetEntriesFast();
145  }
146 
147  for(Int_t i=0 ; i < nprim; i++)
148  {
149  if(GetReader()->AcceptOnlyHIJINGLabels() && !GetReader()->IsHIJINGLabel(i)) continue ;
150 
151  if(GetReader()->ReadStack())
152  {
153  primStack = stack->Particle(i) ;
154  if(!primStack)
155  {
156  AliWarning("ESD primaries pointer not available!!");
157  continue;
158  }
159 
160  if( primStack->GetStatusCode() != 1 ) continue;
161 
162  Int_t charge = (Int_t )TDatabasePDG::Instance()->GetParticle(primStack->GetPdgCode())->Charge();
163  if( TMath::Abs(charge) == 0 ) continue;
164 
165  pdg = TMath::Abs(primStack->GetPdgCode());
166 
167  if(primStack->Energy() == TMath::Abs(primStack->Pz())) continue ; //Protection against floating point exception
168 
169  //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
170  // prim->GetName(), prim->GetPdgCode());
171 
172  //Charged kinematics
173  primStack->Momentum(fMomentum);
174  }
175  else
176  {
177  primAOD = (AliAODMCParticle *) mcparticles->At(i);
178  if(!primAOD)
179  {
180  AliWarning("AOD primaries pointer not available!!");
181  continue;
182  }
183 
184  if( primAOD->GetStatus() != 1 ) continue;
185 
186  if(TMath::Abs(primAOD->Charge()) == 0 ) continue;
187 
188  pdg = TMath::Abs(primAOD->GetPdgCode());
189 
190  if(primAOD->E() == TMath::Abs(primAOD->Pz())) continue ; //Protection against floating point exception
191 
192  //Charged kinematics
193  fMomentum.SetPxPyPzE(primAOD->Px(),primAOD->Py(),primAOD->Pz(),primAOD->E());
194  }
195 
196  Int_t mcType = kmcUnknown;
197  if (pdg==211 ) mcType = kmcPion;
198  else if(pdg==2212) mcType = kmcProton;
199  else if(pdg==321 ) mcType = kmcKaon;
200  else if(pdg==11 ) mcType = kmcElectron;
201  else if(pdg==13 ) mcType = kmcMuon;
202 
203  //printf("pdg %d, charge %f, mctype %d\n",pdg, charge, mcType);
204 
205  Float_t ptPrim = fMomentum.Pt();
206  Float_t etaPrim = fMomentum.Eta();
207  Float_t phiPrim = fMomentum.Phi();
208  if(phiPrim < 0) phiPrim+=TMath::TwoPi();
209 
210  Bool_t in = GetFiducialCut()->IsInFiducialCut(etaPrim,phiPrim,kCTS) ;
211 
212  if(in)
213  fhPtMCPrimPart[mcType]->Fill(ptPrim, GetEventWeight());
214 
215  fhEtaMCPrimPart [mcType]->Fill(ptPrim, etaPrim, GetEventWeight());
216  fhPhiMCPrimPart [mcType]->Fill(ptPrim, phiPrim, GetEventWeight());
217  }
218 }
219 
220 //_______________________________________________________
223 //_______________________________________________________
225 {
226  TList * outputContainer = new TList() ;
227  outputContainer->SetName("ChargedParticleHistos") ;
228 
229  Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Int_t netabins = GetHistogramRanges()->GetHistoEtaBins();
230  Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax();
231  Float_t ptmin = GetHistogramRanges()->GetHistoPtMin(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
232 
233  fhNtracks = new TH1F ("hNtracks","# of tracks", 1000,0,1000);
234  fhNtracks->SetXTitle("# of tracks");
235  outputContainer->Add(fhNtracks);
236 
237  fhPt = new TH1F ("hPt","#it{p}_{T} distribution", nptbins,ptmin,ptmax);
238  fhPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
239  outputContainer->Add(fhPt);
240 
241  fhPtNoCut = new TH1F ("hPtNoCut","#it{p}_{T} distribution, raw tracks", nptbins,ptmin,ptmax);
242  fhPtNoCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
243  outputContainer->Add(fhPtNoCut);
244 
245  if(!GetReader()->IsDCACutOn())
246  {
247  fhPtCutDCA = new TH1F ("hPtCutDCA","#it{p}_{T} distribution, cut DCA", nptbins,ptmin,ptmax);
248  fhPtCutDCA->SetXTitle("#it{p}_{T} (GeV/#it{c})");
249  outputContainer->Add(fhPtCutDCA);
250  }
251 
252  if(fFillVertexBC0Histograms && !GetReader()->IsDCACutOn())
253  {
254  fhPtCutDCABCOK = new TH1F ("hPtCutDCABCOK","#it{p}_{T} distribution, DCA cut, track BC=0 or -100", nptbins,ptmin,ptmax);
255  fhPtCutDCABCOK->SetXTitle("#it{p}_{T} (GeV/#it{c})");
256  outputContainer->Add(fhPtCutDCABCOK);
257  }
258 
259  fhPtNotPrimary = new TH1F ("hPtNotPrimary","#it{p}_{T} distribution, not primary", nptbins,ptmin,ptmax);
260  fhPtNotPrimary->SetXTitle("#it{p}_{T} (GeV/#it{c})");
261  outputContainer->Add(fhPtNotPrimary);
262 
263  fhPtNotSharedClusterCut = new TH1F ("hPtNotSharedClusterCut","#it{p}_{T} distribution, shared clusters cut out", nptbins,ptmin,ptmax);
264  fhPtNotSharedClusterCut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
265  outputContainer->Add(fhPtNotSharedClusterCut);
266 
267  fhPhiNeg = new TH2F ("hPhiNegative","#phi of negative charges distribution",
268  nptbins,ptmin,ptmax, nphibins,phimin,phimax);
269  fhPhiNeg->SetYTitle("#phi (rad)");
270  fhPhiNeg->SetXTitle("#it{p}_{T} (GeV/#it{c})");
271  outputContainer->Add(fhPhiNeg);
272 
273  fhEtaNeg = new TH2F ("hEtaNegative","#eta of negative charges distribution",
274  nptbins,ptmin,ptmax, netabins,etamin,etamax);
275  fhEtaNeg->SetYTitle("#eta ");
276  fhEtaNeg->SetXTitle("#it{p}_{T} (GeV/#it{c})");
277  outputContainer->Add(fhEtaNeg);
278 
279  fhPhiPos = new TH2F ("hPhiPositive","#phi of positive charges distribution",
280  nptbins,ptmin,ptmax, nphibins,phimin,phimax);
281  fhPhiPos->SetYTitle("#phi (rad)");
282  fhPhiPos->SetXTitle("#it{p}_{T} (GeV/#it{c})");
283  outputContainer->Add(fhPhiPos);
284 
285  fhEtaPos = new TH2F ("hEtaPositive","#eta of positive charges distribution",
286  nptbins,ptmin,ptmax, netabins,etamin,etamax);
287  fhEtaPos->SetYTitle("#eta ");
288  fhEtaPos->SetXTitle("#it{p}_{T} (GeV/#it{c})");
289  outputContainer->Add(fhEtaPos);
290 
291  fhEtaPhiPos = new TH2F ("hEtaPhiPositive","pt/eta/phi of positive charge",netabins,etamin,etamax, nphibins,phimin,phimax);
292  fhEtaPhiPos->SetXTitle("#eta ");
293  fhEtaPhiPos->SetYTitle("#phi (rad)");
294  outputContainer->Add(fhEtaPhiPos);
295 
296  fhEtaPhiNeg = new TH2F ("hEtaPhiNegative","#eta vs #phi of negative charge",netabins,etamin,etamax, nphibins,phimin,phimax);
297  fhEtaPhiNeg->SetXTitle("#eta ");
298  fhEtaPhiNeg->SetYTitle("#phi (rad)");
299  outputContainer->Add(fhEtaPhiNeg);
300 
302  {
303  fhPtVtxOutBC0 = new TH1F ("hPtVtxOutBC0","#it{p}_{T} distribution, vertex in BC=0", nptbins,ptmin,ptmax);
304  fhPtVtxOutBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
305  outputContainer->Add(fhPtVtxOutBC0);
306 
307  fhEtaPhiVtxOutBC0 = new TH2F ("hEtaPhiVtxOutBC0","#eta vs #phi of all charges with vertex in BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
308  fhEtaPhiVtxOutBC0->SetXTitle("#eta ");
309  fhEtaPhiVtxOutBC0->SetYTitle("#phi (rad)");
310  outputContainer->Add(fhEtaPhiVtxOutBC0);
311 
312  fhPtVtxInBC0 = new TH1F ("hPtVtxInBC0","#it{p}_{T} distribution, vertex in BC=0", nptbins,ptmin,ptmax);
313  fhPtVtxInBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
314  outputContainer->Add(fhPtVtxInBC0);
315 
316  fhEtaPhiVtxInBC0 = new TH2F ("hEtaPhiVtxInBC0","#eta vs #phi of all charges with vertex in BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
317  fhEtaPhiVtxInBC0->SetXTitle("#eta ");
318  fhEtaPhiVtxInBC0->SetYTitle("#phi (rad)");
319  outputContainer->Add(fhEtaPhiVtxInBC0);
320  }
321 
322  fhPtSPDRefit = new TH1F ("hPtSPDRefit","#it{p}_{T} distribution of tracks with SPD and ITS refit", nptbins,ptmin,ptmax);
323  fhPtSPDRefit->SetXTitle("#it{p}_{T} (GeV/#it{c})");
324  outputContainer->Add(fhPtSPDRefit);
325 
326  fhEtaPhiSPDRefitPt02 = new TH2F ("hEtaPhiSPDRefitPt02","#eta vs #phi of tracks with SPD and ITS refit, #it{p}_{T}< 2 GeV/#it{c}",
327  netabins,etamin,etamax, nphibins,phimin,phimax);
328  fhEtaPhiSPDRefitPt02->SetXTitle("#eta ");
329  fhEtaPhiSPDRefitPt02->SetYTitle("#phi (rad)");
330  outputContainer->Add(fhEtaPhiSPDRefitPt02);
331 
332  fhEtaPhiSPDRefitPt3 = new TH2F ("hEtaPhiSPDRefitPt3","#eta vs #phi of tracks with SPD and ITS refit, #it{p}_{T}> 3 GeV/#it{c}",
333  netabins,etamin,etamax, nphibins,phimin,phimax);
334  fhEtaPhiSPDRefitPt3->SetXTitle("#eta ");
335  fhEtaPhiSPDRefitPt3->SetYTitle("#phi (rad)");
336  outputContainer->Add(fhEtaPhiSPDRefitPt3);
337 
338  fhPtNoSPDRefit = new TH1F ("hPtNoSPDRefit","#it{p}_{T} distribution of constrained tracks no SPD and with ITSRefit",
339  nptbins,ptmin,ptmax);
340  fhPtNoSPDRefit->SetXTitle("#it{p}_{T} (GeV/#it{c})");
341  outputContainer->Add(fhPtNoSPDRefit);
342 
343  fhEtaPhiNoSPDRefitPt02 = new TH2F ("hEtaPhiNoSPDRefitPt02","#eta vs #phi of constrained tracks no SPD and with ITSRefit, #it{p}_{T}< 2 GeV/#it{c}",
344  netabins,etamin,etamax, nphibins,phimin,phimax);
345  fhEtaPhiNoSPDRefitPt02->SetXTitle("#eta ");
346  fhEtaPhiNoSPDRefitPt02->SetYTitle("#phi (rad)");
347  outputContainer->Add(fhEtaPhiNoSPDRefitPt02);
348 
349  fhEtaPhiNoSPDRefitPt3 = new TH2F ("hEtaPhiNoSPDRefitPt3","#eta vs #phi of of constrained tracks no SPD and with ITSRefit, #it{p}_{T}> 3 GeV/#it{c}",
350  netabins,etamin,etamax, nphibins,phimin,phimax);
351  fhEtaPhiNoSPDRefitPt3->SetXTitle("#eta ");
352  fhEtaPhiNoSPDRefitPt3->SetYTitle("#phi (rad)");
353  outputContainer->Add(fhEtaPhiNoSPDRefitPt3);
354 
355  fhPtNoSPDNoRefit = new TH1F ("hPtNoSPDNoRefit","#it{p}_{T} distribution of constrained tracks with no SPD requierement and without ITSRefit",
356  nptbins,ptmin,ptmax);
357  fhPtNoSPDNoRefit->SetXTitle("#it{p}_{T} (GeV/#it{c})");
358  outputContainer->Add(fhPtNoSPDNoRefit);
359 
360  fhEtaPhiNoSPDNoRefitPt02 = new TH2F ("hEtaPhiNoSPDNoRefitPt02",
361  "#eta vs #phi of constrained tracks with no SPD requierement and without ITSRefit, #it{p}_{T}< 2 GeV/#it{c}",
362  netabins,etamin,etamax, nphibins,phimin,phimax);
363  fhEtaPhiNoSPDNoRefitPt02->SetXTitle("#eta ");
364  fhEtaPhiNoSPDNoRefitPt02->SetYTitle("#phi (rad)");
365  outputContainer->Add(fhEtaPhiNoSPDNoRefitPt02);
366 
367  fhEtaPhiNoSPDNoRefitPt3 = new TH2F ("hEtaPhiNoSPDNoRefitPt3",
368  "#eta vs #phi of constrained tracks with no SPD requierement and without ITSRefit, #it{p}_{T}> 3 GeV/#it{c}",
369  netabins,etamin,etamax, nphibins,phimin,phimax);
370  fhEtaPhiNoSPDNoRefitPt3->SetXTitle("#eta ");
371  fhEtaPhiNoSPDNoRefitPt3->SetYTitle("#phi (rad)");
372  outputContainer->Add(fhEtaPhiNoSPDNoRefitPt3);
373 
375  {
376  fhProductionVertexBC = new TH1F("hProductionVertexBC", "tracks production vertex bunch crossing ", 41 , -20 , 20 ) ;
377  fhProductionVertexBC->SetYTitle("# tracks");
378  fhProductionVertexBC->SetXTitle("Bunch crossing");
379  outputContainer->Add(fhProductionVertexBC);
380  }
381 
382  Int_t ntofbins = 1000;
383  Int_t mintof = -500;
384  Int_t maxtof = 500;
385 
386  fhTOFSignal = new TH1F ("hTOFSignal","TOF signal", ntofbins,mintof,maxtof);
387  fhTOFSignal->SetXTitle("TOF signal (ns)");
388  outputContainer->Add(fhTOFSignal);
389 
391  {
392  fhTOFSignalBCOK = new TH1F ("hTOFSignalBCOK","TOF signal", ntofbins,mintof,maxtof);
393  fhTOFSignalBCOK->SetXTitle("TOF signal (ns)");
394  outputContainer->Add(fhTOFSignalBCOK);
395  }
396 
397  fhTOFSignalPtCut = new TH1F ("hTOFSignalPtCut","TOF signal", ntofbins,mintof,maxtof);
398  fhTOFSignalPtCut->SetXTitle("TOF signal (ns)");
399  outputContainer->Add(fhTOFSignalPtCut);
400 
401  fhPtTOFSignal = new TH2F ("hPtTOFSignal","TOF signal", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
402  fhPtTOFSignal->SetYTitle("TOF signal (ns)");
403  fhPtTOFSignal->SetXTitle("#it{p}_{T} (GeV/#it{c})");
404  outputContainer->Add(fhPtTOFSignal);
405 
406  if(!GetReader()->IsDCACutOn())
407  {
408  fhPtTOFSignalDCACut = new TH2F ("hPtTOFSignalDCACut","TOF signal after DCA cut", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
409  fhPtTOFSignalDCACut->SetYTitle("TOF signal (ns)");
410  fhPtTOFSignalDCACut->SetXTitle("#it{p}_{T} (GeV/#it{c})");
411  outputContainer->Add(fhPtTOFSignalDCACut);
412  }
413 
415  {
416  fhPtTOFSignalVtxOutBC0 = new TH2F ("hPtTOFSignalVtxOutBC0","TOF signal, vtx BC!=0", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
417  fhPtTOFSignalVtxOutBC0->SetYTitle("TOF signal (ns)");
418  fhPtTOFSignalVtxOutBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
419  outputContainer->Add(fhPtTOFSignalVtxOutBC0);
420 
421  fhPtTOFSignalVtxInBC0 = new TH2F ("hPtTOFSignalVtxInBC0","TOF signal, vtx BC=0", nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
422  fhPtTOFSignalVtxInBC0->SetYTitle("TOF signal (ns)");
423  fhPtTOFSignalVtxInBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
424  outputContainer->Add(fhPtTOFSignalVtxInBC0);
425  }
426 
427  if(IsPileUpAnalysisOn())
428  {
429  TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
430 
431  for(Int_t i = 0 ; i < 7 ; i++)
432  {
433  fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
434  Form("Track #it{p}_{T}distribution, %s Pile-Up event",pileUpName[i].Data()),
435  nptbins,ptmin,ptmax);
436  fhPtPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
437  outputContainer->Add(fhPtPileUp[i]);
438 
439  fhPtTOFSignalPileUp[i] = new TH2F(Form("hPtTOFSignalPileUp%s",pileUpName[i].Data()),
440  Form("Track TOF vs #it{p}_{T}distribution, %s Pile-Up event",pileUpName[i].Data()),
441  nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
442  fhPtTOFSignalPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
443  fhPtTOFSignalPileUp[i]->SetXTitle("TOF signal (ns)");
444  outputContainer->Add(fhPtTOFSignalPileUp[i]);
445 
447  {
448  fhPtTOFSignalVtxOutBC0PileUp[i] = new TH2F(Form("hPtTOFSignalVtxOutBC0PileUp%s",pileUpName[i].Data()),
449  Form("Track TOF vs #it{p}_{T}distribution, %s Pile-Up event, vtx BC!=0",pileUpName[i].Data()),
450  nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
451  fhPtTOFSignalVtxOutBC0PileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
452  fhPtTOFSignalVtxOutBC0PileUp[i]->SetXTitle("TOF signal (ns)");
453  outputContainer->Add(fhPtTOFSignalVtxOutBC0PileUp[i]);
454 
455  fhPtTOFSignalVtxInBC0PileUp[i] = new TH2F(Form("hPtTOFSignalVtxInBC0PileUp%s",pileUpName[i].Data()),
456  Form("Track TOF vs #it{p}_{T}distribution, %s Pile-Up event, vtx BC=0",pileUpName[i].Data()),
457  nptbins,ptmin,ptmax,ntofbins,mintof,maxtof);
458  fhPtTOFSignalVtxInBC0PileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
459  fhPtTOFSignalVtxInBC0PileUp[i]->SetXTitle("TOF signal (ns)");
460  outputContainer->Add(fhPtTOFSignalVtxInBC0PileUp[i]);
461  }
462 
464  {
465  fhProductionVertexBCPileUp[i] = new TH1F(Form("hProductionVertexBCPileUp%s",pileUpName[i].Data()),
466  Form("tracks production vertex bunch crossing, %s Pile-Up event",pileUpName[i].Data()),
467  41 , -20 , 20 ) ;
468  fhProductionVertexBCPileUp[i]->SetYTitle("# tracks");
469  fhProductionVertexBCPileUp[i]->SetXTitle("Bunch crossing");
470  outputContainer->Add(fhProductionVertexBCPileUp[i]);
471  }
472  }
473 
475  {
476  fhEtaPhiTOFBC0 = new TH2F ("hEtaPhiTOFBC0","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
477  fhEtaPhiTOFBC0->SetXTitle("#eta ");
478  fhEtaPhiTOFBC0->SetYTitle("#phi (rad)");
479  outputContainer->Add(fhEtaPhiTOFBC0);
480 
481  fhEtaPhiTOFBCPlus = new TH2F ("hEtaPhiTOFBCPlus","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
482  fhEtaPhiTOFBCPlus->SetXTitle("#eta ");
483  fhEtaPhiTOFBCPlus->SetYTitle("#phi (rad)");
484  outputContainer->Add(fhEtaPhiTOFBCPlus);
485 
486  fhEtaPhiTOFBCMinus = new TH2F ("hEtaPhiTOFBCMinus","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
487  fhEtaPhiTOFBCMinus->SetXTitle("#eta ");
488  fhEtaPhiTOFBCMinus->SetYTitle("#phi (rad)");
489  outputContainer->Add(fhEtaPhiTOFBCMinus);
490 
491  if(IsPileUpAnalysisOn())
492  {
493  fhEtaPhiTOFBC0PileUpSPD = new TH2F ("hEtaPhiTOFBC0PileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
494  fhEtaPhiTOFBC0PileUpSPD->SetXTitle("#eta ");
495  fhEtaPhiTOFBC0PileUpSPD->SetYTitle("#phi (rad)");
496  outputContainer->Add(fhEtaPhiTOFBC0PileUpSPD);
497 
498  fhEtaPhiTOFBCPlusPileUpSPD = new TH2F ("hEtaPhiTOFBCPlusPileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
499  fhEtaPhiTOFBCPlusPileUpSPD->SetXTitle("#eta ");
500  fhEtaPhiTOFBCPlusPileUpSPD->SetYTitle("#phi (rad)");
501  outputContainer->Add(fhEtaPhiTOFBCPlusPileUpSPD);
502 
503  fhEtaPhiTOFBCMinusPileUpSPD = new TH2F ("hEtaPhiTOFBCMinusPileUpSPD","eta-phi for tracks with hit on TOF, and tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
504  fhEtaPhiTOFBCMinusPileUpSPD->SetXTitle("#eta ");
505  fhEtaPhiTOFBCMinusPileUpSPD->SetYTitle("#phi (rad)");
506  outputContainer->Add(fhEtaPhiTOFBCMinusPileUpSPD);
507  }
508  }
509  }
510 
511  fhPtTOFStatus0 = new TH1F ("hPtTOFStatus0","#it{p}_{T} distribution of tracks not hitting TOF", nptbins,ptmin,ptmax);
512  fhPtTOFStatus0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
513  outputContainer->Add(fhPtTOFStatus0);
514 
515 
516  fhEtaPhiTOFStatus0 = new TH2F ("hEtaPhiTOFStatus0","eta-phi for tracks without hit on TOF",netabins,etamin,etamax, nphibins,phimin,phimax);
517  fhEtaPhiTOFStatus0->SetXTitle("#eta ");
518  fhEtaPhiTOFStatus0->SetYTitle("#phi (rad)");
519  outputContainer->Add(fhEtaPhiTOFStatus0);
520 
521  TString dcaName[] = {"xy","z","Cons"} ;
522  Int_t ndcabins = 800;
523  Int_t mindca = -4;
524  Int_t maxdca = 4;
525 
526  for(Int_t i = 0 ; i < 3 ; i++)
527  {
528  fhPtDCA[i] = new TH2F(Form("hPtDCA%s",dcaName[i].Data()),
529  Form("Track DCA%s vs #it{p}_{T}distribution",dcaName[i].Data()),
530  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
531  fhPtDCA[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
532  fhPtDCA[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
533  outputContainer->Add(fhPtDCA[i]);
534 
535  fhPtDCASPDRefit[i] = new TH2F(Form("hPtDCA%sSPDRefit",dcaName[i].Data()),
536  Form("Track DCA%s vs #it{p}_{T}distribution of tracks with SPD and ITS refit",dcaName[i].Data()),
537  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
538  fhPtDCASPDRefit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
539  fhPtDCASPDRefit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
540  outputContainer->Add(fhPtDCASPDRefit[i]);
541 
542  fhPtDCANoSPDRefit[i] = new TH2F(Form("hPtDCA%sNoSPDRefit",dcaName[i].Data()),
543  Form("Track DCA%s vs #it{p}_{T}distributionof constrained tracks no SPD and with ITSRefit",dcaName[i].Data()),
544  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
545  fhPtDCANoSPDRefit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
546  fhPtDCANoSPDRefit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
547  outputContainer->Add(fhPtDCANoSPDRefit[i]);
548 
549  fhPtDCANoSPDNoRefit[i] = new TH2F(Form("hPtDCA%sNoSPDNoRefit",dcaName[i].Data()),
550  Form("Track DCA%s vs #it{p}_{T}distribution, constrained tracks with no SPD requierement and without ITSRefit",dcaName[i].Data()),
551  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
552  fhPtDCANoSPDNoRefit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
553  fhPtDCANoSPDNoRefit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
554  outputContainer->Add(fhPtDCANoSPDNoRefit[i]);
555 
557  {
558  fhPtDCATOFBC0[i] = new TH2F(Form("hPtDCA%sTOFBC0",dcaName[i].Data()),
559  Form("Track DCA%s vs #it{p}_{T}distribution, BC=0",dcaName[i].Data()),
560  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
561  fhPtDCATOFBC0[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
562  fhPtDCATOFBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
563  outputContainer->Add(fhPtDCATOFBC0[i]);
564 
565  fhPtDCATOFBCOut[i] = new TH2F(Form("hPtDCA%sTOFBCOut",dcaName[i].Data()),
566  Form("Track DCA%s vs #it{p}_{T}distribution, BC!=0",dcaName[i].Data()),
567  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
568  fhPtDCATOFBCOut[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
569  fhPtDCATOFBCOut[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
570  outputContainer->Add(fhPtDCATOFBCOut[i]);
571  }
572 
573  fhPtDCANoTOFHit[i] = new TH2F(Form("hPtDCA%sNoTOFHit",dcaName[i].Data()),
574  Form("Track (no TOF hit) DCA%s vs #it{p}_{T}distribution",dcaName[i].Data()),
575  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
576  fhPtDCANoTOFHit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
577  fhPtDCANoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
578  outputContainer->Add(fhPtDCANoTOFHit[i]);
579 
581  {
582  fhPtDCAVtxOutBC0[i] = new TH2F(Form("hPtDCA%sVtxOutBC0",dcaName[i].Data()),
583  Form("Track DCA%s vs #it{p}_{T}distribution, vertex with BC!=0",dcaName[i].Data()),
584  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
585  fhPtDCAVtxOutBC0[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
586  fhPtDCAVtxOutBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
587  outputContainer->Add(fhPtDCAVtxOutBC0[i]);
588 
589  fhPtDCAVtxOutBC0NoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxOutBC0NoTOFHit",dcaName[i].Data()),
590  Form("Track (no TOF hit) DCA%s vs #it{p}_{T}distribution, vertex with BC!=0",dcaName[i].Data()),
591  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
592  fhPtDCAVtxOutBC0NoTOFHit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
593  fhPtDCAVtxOutBC0NoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
594  outputContainer->Add(fhPtDCAVtxOutBC0NoTOFHit[i]);
595 
596  fhPtDCAVtxInBC0[i] = new TH2F(Form("hPtDCA%sVtxInBC0",dcaName[i].Data()),
597  Form("Track DCA%s vs #it{p}_{T}distribution, vertex with BC==0",dcaName[i].Data()),
598  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
599  fhPtDCAVtxInBC0[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
600  fhPtDCAVtxInBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
601  outputContainer->Add(fhPtDCAVtxInBC0[i]);
602 
603  fhPtDCAVtxInBC0NoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxInBC0NoTOFHit",dcaName[i].Data()),
604  Form("Track (no TOF hit) DCA%s vs #it{p}_{T}distribution, vertex with BC==0",dcaName[i].Data()),
605  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
606  fhPtDCAVtxInBC0NoTOFHit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
607  fhPtDCAVtxInBC0NoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
608  outputContainer->Add(fhPtDCAVtxInBC0NoTOFHit[i]);
609  }
610 
611  if(IsPileUpAnalysisOn())
612  {
613  fhPtDCAPileUp[i] = new TH2F(Form("hPtDCA%sPileUp",dcaName[i].Data()),
614  Form("Track DCA%s vs #it{p}_{T}distribution, SPD Pile-Up",dcaName[i].Data()),
615  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
616  fhPtDCAPileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
617  fhPtDCAPileUp[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
618  outputContainer->Add(fhPtDCAPileUp[i]);
619 
621  {
622  fhPtDCAPileUpTOFBC0[i] = new TH2F(Form("hPtDCA%sPileUpTOFBC0",dcaName[i].Data()),
623  Form("Track DCA%s vs #it{p}_{T}distribution",dcaName[i].Data()),
624  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
625  fhPtDCAPileUpTOFBC0[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
626  fhPtDCAPileUpTOFBC0[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
627  outputContainer->Add(fhPtDCAPileUpTOFBC0[i]);
628  }
629 
630  fhPtDCAPileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sPileUpNoTOFHit",dcaName[i].Data()),
631  Form("Track (no TOF hit) DCA%s vs #it{p}_{T}distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()),
632  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
633  fhPtDCAPileUpNoTOFHit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
634  fhPtDCAPileUpNoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
635  outputContainer->Add(fhPtDCAPileUpNoTOFHit[i]);
636 
638  {
639  fhPtDCAVtxOutBC0PileUp[i] = new TH2F(Form("hPtDCA%sPileUpVtxOutBC0",dcaName[i].Data()),
640  Form("Track DCA%s vs #it{p}_{T}distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()),
641  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
642  fhPtDCAVtxOutBC0PileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
643  fhPtDCAVtxOutBC0PileUp[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
644  outputContainer->Add(fhPtDCAVtxOutBC0PileUp[i]);
645 
646  fhPtDCAVtxOutBC0PileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxOutBC0PileUpNoTOFHit",dcaName[i].Data()),
647  Form("Track (no TOF hit) DCA%s vs #it{p}_{T}distribution, SPD Pile-Up, vertex with BC!=0",dcaName[i].Data()),
648  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
649  fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
650  fhPtDCAVtxOutBC0PileUpNoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
651  outputContainer->Add(fhPtDCAVtxOutBC0PileUpNoTOFHit[i]);
652 
653  fhPtDCAVtxInBC0PileUp[i] = new TH2F(Form("hPtDCA%sPileUpVtxInBC0",dcaName[i].Data()),
654  Form("Track DCA%s vs #it{p}_{T}distribution, SPD Pile-Up,vertex with BC==0",dcaName[i].Data()),
655  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
656  fhPtDCAVtxInBC0PileUp[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
657  fhPtDCAVtxInBC0PileUp[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
658  outputContainer->Add(fhPtDCAVtxInBC0PileUp[i]);
659 
660  fhPtDCAVtxInBC0PileUpNoTOFHit[i] = new TH2F(Form("hPtDCA%sVtxInBC0PileUpNoTOFHit",dcaName[i].Data()),
661  Form("Track (no TOF hit) DCA%s vs #it{p}_{T}distribution, SPD Pile-Up, vertex with BC==0",dcaName[i].Data()),
662  nptbins,ptmin,ptmax,ndcabins,mindca,maxdca);
663  fhPtDCAVtxInBC0PileUpNoTOFHit[i]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
664  fhPtDCAVtxInBC0PileUpNoTOFHit[i]->SetYTitle(Form("DCA_{%s}",dcaName[i].Data()));
665  outputContainer->Add(fhPtDCAVtxInBC0PileUpNoTOFHit[i]);
666  }
667  }
668  }
669 
670  if(IsDataMC())
671  {
672  //enum mvType{kmcPion = 0, kmcProton = 1, kmcKaon = 2, kmcMuon = 3, kmcElectron = 4, kmcUnknown = 4 };
673 
674  TString histoName[] = {"Pion","Proton","Kaon","Muon","Electron","Unknown"};
675  TString titleName[] = {"#pi^{#pm}","p^{#pm}","K^{#pm}","#mu^{#pm}","e^{#pm}","x^{#pm}"};
676 
677  for(Int_t imcPart = 0; imcPart < 6; imcPart++)
678  {
679  fhPtMCPart[imcPart] = new TH1F (Form("hPtMC%s",histoName[imcPart].Data()),
680  Form("reconstructed #it{p}_{T} distribution from %s",titleName[imcPart].Data()),
681  nptbins,ptmin,ptmax);
682  fhPtMCPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
683  outputContainer->Add(fhPtMCPart[imcPart]);
684 
685  fhPhiMCPart[imcPart] = new TH2F (Form("hPhiMC%s",histoName[imcPart].Data()),
686  Form("reconstructed #phi vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()),
687  nptbins,ptmin,ptmax, nphibins,phimin,phimax);
688  fhPhiMCPart[imcPart]->SetYTitle("#phi (rad)");
689  fhPhiMCPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
690  outputContainer->Add(fhPhiMCPart[imcPart]);
691 
692  fhEtaMCPart[imcPart] = new TH2F (Form("hEtaMC%s",histoName[imcPart].Data()),
693  Form("reconstructed #eta vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()),
694  nptbins,ptmin,ptmax, netabins,etamin,etamax);
695  fhEtaMCPart[imcPart]->SetYTitle("#eta ");
696  fhEtaMCPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
697  outputContainer->Add(fhEtaMCPart[imcPart]);
698 
699  fhPtMCPrimPart[imcPart] = new TH1F (Form("hPtMCPrimary%s",histoName[imcPart].Data()),
700  Form("generated #it{p}_{T} distribution from %s",titleName[imcPart].Data()),
701  nptbins,ptmin,ptmax);
702  fhPtMCPrimPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
703  outputContainer->Add(fhPtMCPrimPart[imcPart]);
704 
705  fhPhiMCPrimPart[imcPart] = new TH2F (Form("hPhiMCPrimary%s",histoName[imcPart].Data()),
706  Form("generated #phi vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()),
707  nptbins,ptmin,ptmax, nphibins,phimin,phimax);
708  fhPhiMCPrimPart[imcPart]->SetYTitle("#phi (rad)");
709  fhPhiMCPrimPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
710  outputContainer->Add(fhPhiMCPrimPart[imcPart]);
711 
712  fhEtaMCPrimPart[imcPart] = new TH2F (Form("hEtaMCPrimary%s",histoName[imcPart].Data()),
713  Form("generated #eta vs #it{p}_{T} distribution from %s",titleName[imcPart].Data()),
714  nptbins,ptmin,ptmax, netabins,etamin,etamax);
715  fhEtaMCPrimPart[imcPart]->SetYTitle("#eta ");
716  fhEtaMCPrimPart[imcPart]->SetXTitle("#it{p}_{T} (GeV/#it{c})");
717  outputContainer->Add(fhEtaMCPrimPart[imcPart]);
718  }
719  }
720 
721  fhPtNPileUpSPDVtx = new TH2F ("hPt_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
722  nptbins,ptmin,ptmax,20,0,20);
723  fhPtNPileUpSPDVtx->SetYTitle("# vertex ");
724  fhPtNPileUpSPDVtx->SetXTitle("#it{p}_{T} (GeV/#it{c})");
725  outputContainer->Add(fhPtNPileUpSPDVtx);
726 
727  fhPtNPileUpTrkVtx = new TH2F ("hPt_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
728  nptbins,ptmin,ptmax, 20,0,20 );
729  fhPtNPileUpTrkVtx->SetYTitle("# vertex ");
730  fhPtNPileUpTrkVtx->SetXTitle("#it{p}_{T} (GeV/#it{c})");
731  outputContainer->Add(fhPtNPileUpTrkVtx);
732 
734  {
735  fhPtNPileUpSPDVtxBC0 = new TH2F ("hPt_NPileUpVertSPD_BC0","pT of cluster vs N pile-up SPD vertex",
736  nptbins,ptmin,ptmax,20,0,20);
737  fhPtNPileUpSPDVtxBC0->SetYTitle("# vertex ");
738  fhPtNPileUpSPDVtxBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
739  outputContainer->Add(fhPtNPileUpSPDVtxBC0);
740 
741  fhPtNPileUpTrkVtxBC0 = new TH2F ("hPt_NPileUpVertTracks_BC0","pT of cluster vs N pile-up Tracks vertex",
742  nptbins,ptmin,ptmax, 20,0,20 );
743  fhPtNPileUpTrkVtxBC0->SetYTitle("# vertex ");
744  fhPtNPileUpTrkVtxBC0->SetXTitle("#it{p}_{T} (GeV/#it{c})");
745  outputContainer->Add(fhPtNPileUpTrkVtxBC0);
746  }
747 
748  return outputContainer;
749 }
750 
751 //___________________________________________
753 //___________________________________________
755 {
756  SetOutputAODClassName("AliAODPWG4Particle");
757  SetOutputAODName("PWG4Particle");
758 
759  AddToHistogramsName("AnaCharged_");
760 }
761 
762 //____________________________________________________________
764 //____________________________________________________________
765 void AliAnaChargedParticles::Print(const Option_t * opt) const
766 {
767  if(! opt)
768  return;
769 
770  printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
772 
773  printf("Min Pt = %3.2f\n", GetMinPt());
774  printf("Max Pt = %3.2f\n", GetMaxPt());
775 }
776 
777 //_________________________________
779 //_________________________________
781 {
782  if(!GetReader()->IsCTSSwitchedOn())
783  AliFatal("STOP!: You want to use CTS tracks in analysis but not read!! \n!!Check the configuration file!!");
784 }
785 
786 //_________________________________________________
789 //_________________________________________________
791 {
792  if(!GetCTSTracks() || GetCTSTracks()->GetEntriesFast() == 0) return ;
793 
794  Int_t ntracks = GetCTSTracks()->GetEntriesFast();
795  Double_t vert[3] = {0,0,0}; //vertex ;
796 
797  AliDebug(1,Form("In CTS aod entries %d", ntracks));
798 
799  AliVEvent * event = GetReader()->GetInputEvent();
800  AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
801  AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
802 
803  Int_t vtxBC = GetReader()->GetVertexBC();
804  if(!GetReader()->IsDCACutOn()) vtxBC = GetReader()->GetVertexBC(event->GetPrimaryVertex());
805 
807  {
808  fhProductionVertexBC->Fill(vtxBC, GetEventWeight());
809 
810  if(IsPileUpAnalysisOn())
811  {
812  if(GetReader()->IsPileUpFromSPD()) fhProductionVertexBCPileUp[0]->Fill(vtxBC, GetEventWeight());
813  if(GetReader()->IsPileUpFromEMCal()) fhProductionVertexBCPileUp[1]->Fill(vtxBC, GetEventWeight());
814  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhProductionVertexBCPileUp[2]->Fill(vtxBC, GetEventWeight());
815  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhProductionVertexBCPileUp[3]->Fill(vtxBC, GetEventWeight());
816  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhProductionVertexBCPileUp[4]->Fill(vtxBC, GetEventWeight());
817  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhProductionVertexBCPileUp[5]->Fill(vtxBC, GetEventWeight());
818  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhProductionVertexBCPileUp[6]->Fill(vtxBC, GetEventWeight());
819  }
820  }
821 
822  // N pile up vertices
823  Int_t nVtxSPD = -1;
824  Int_t nVtxTrk = -1;
825 
826  if (esdEv)
827  {
828  nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
829  nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
830 
831  }//ESD
832  else if (aodEv)
833  {
834  nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
835  nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
836  }//AOD
837 
838 
839  //printf("AliAnaChargedParticles::MakeAnalysisFillAOD() - primary vertex BC %d\n",vtxBC);
840 
841  Double_t bz = event->GetMagneticField();
842 
843  // Fill AODParticle with CTS aods
844  Float_t pt = 0;
845  Float_t phi = 0;
846  Float_t eta = 0;
847  Int_t evtIndex = 0;
848  for(Int_t i = 0; i < ntracks; i++)
849  {
850  AliVTrack * track = (AliVTrack*) (GetCTSTracks()->At(i));
851 
852  pt = track->Pt();
853  eta = track->Eta();
854  phi = track->Phi();
855 
856  fhPtNoCut->Fill(pt, GetEventWeight());
857 
858  fhPtNPileUpSPDVtx->Fill(pt, nVtxSPD, GetEventWeight());
859  fhPtNPileUpTrkVtx->Fill(pt, nVtxTrk, GetEventWeight());
860 
861  AliAODTrack * aodTrack = dynamic_cast<AliAODTrack*>(track);
862  AliESDtrack * esdTrack = dynamic_cast<AliESDtrack*>(track);
863 
864  if(aodTrack)
865  {
866  Double_t frac = Double_t(aodTrack->GetTPCnclsS()) / Double_t(aodTrack->GetTPCncls());
867 
868  if ( frac > GetReader()->GetTPCSharedClusterFraction() )
870 
871  if ( aodTrack->GetType()!= AliAODTrack::kPrimary )
872  fhPtNotPrimary->Fill(pt, GetEventWeight());
873  }
874 
875  // TOF
876  ULong_t status = track->GetStatus();
877  Bool_t okTOF = (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ;
878  Double32_t tof = track->GetTOFsignal()*1e-3;
879 
880  // DCA
881  Double_t dcaCons = -999;
882  if(aodTrack)
883  {
884  dcaCons = aodTrack->DCA();
885  //vtxBC = aodTrack->GetProdVertex()->GetBC();
886  }
887 
888  Double_t dca[2] = {1e6,1e6};
889  Double_t covar[3] = {1e6,1e6,1e6};
890  track->PropagateToDCA(GetReader()->GetInputEvent()->GetPrimaryVertex(),bz,100.,dca,covar);
891 
892  Float_t trackDCA = dca[0];
893 
894  if(dcaCons == -999)
895  {
896  fhPtDCA[0]->Fill(pt, dca[0], GetEventWeight());
897  fhPtDCA[1]->Fill(pt, dca[1], GetEventWeight());
898  }
899  else
900  {
901  trackDCA = dcaCons;
902  fhPtDCA[2]->Fill(pt, dcaCons, GetEventWeight());
903  }
904 
905  if ( GetReader()->AcceptDCA(pt,trackDCA) && !GetReader()->IsDCACutOn() )
906  fhPtCutDCA->Fill(pt, GetEventWeight());
907 
909  {
910  if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
911  {
912  fhPtVtxOutBC0->Fill(pt, GetEventWeight());
913  fhEtaPhiVtxOutBC0->Fill(eta, phi, GetEventWeight());
914 
915  if(dcaCons == -999)
916  {
917  fhPtDCAVtxOutBC0[0]->Fill(pt, dca[0], GetEventWeight());
918  fhPtDCAVtxOutBC0[1]->Fill(pt, dca[1], GetEventWeight());
919  }
920  else
921  fhPtDCAVtxOutBC0[2]->Fill(pt, dcaCons, GetEventWeight());
922  }
923  else
924  {
925  fhPtVtxInBC0->Fill(pt, GetEventWeight());
926  fhEtaPhiVtxInBC0->Fill(eta, phi, GetEventWeight());
927 
928  fhPtNPileUpSPDVtxBC0->Fill(pt, nVtxSPD, GetEventWeight());
929  fhPtNPileUpTrkVtxBC0->Fill(pt, nVtxTrk, GetEventWeight());
930 
931  if ( GetReader()->AcceptDCA(pt,trackDCA) && !GetReader()->IsDCACutOn() )
932  fhPtCutDCABCOK->Fill(pt, GetEventWeight());
933 
934  if(dcaCons == -999)
935  {
936  fhPtDCAVtxInBC0[0]->Fill(pt, dca[0], GetEventWeight());
937  fhPtDCAVtxInBC0[1]->Fill(pt, dca[1], GetEventWeight());
938  }
939  else
940  fhPtDCAVtxInBC0[2]->Fill(pt, dcaCons, GetEventWeight());
941  }
942  }
943 
944  if(IsPileUpAnalysisOn() && GetReader()->IsPileUpFromSPD())
945  {
946  if(dcaCons == -999)
947  {
948  fhPtDCAPileUp[0]->Fill(pt, dca[0], GetEventWeight());
949  fhPtDCAPileUp[1]->Fill(pt, dca[1], GetEventWeight());
950  }
951  else
952  fhPtDCAPileUp[2]->Fill(pt, dcaCons, GetEventWeight());
953 
955  {
956  if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
957  {
958  if(dcaCons == -999)
959  {
960  fhPtDCAVtxOutBC0PileUp[0]->Fill(pt, dca[0], GetEventWeight());
961  fhPtDCAVtxOutBC0PileUp[1]->Fill(pt, dca[1], GetEventWeight());
962  }
963  else fhPtDCAVtxOutBC0PileUp[2]->Fill(pt, dcaCons, GetEventWeight());
964  }
965  else
966  {
967  if(dcaCons == -999)
968  {
969  fhPtDCAVtxInBC0PileUp[0]->Fill(pt, dca[0], GetEventWeight());
970  fhPtDCAVtxInBC0PileUp[1]->Fill(pt, dca[1], GetEventWeight());
971  }
972  else fhPtDCAVtxInBC0PileUp[2]->Fill(pt, dcaCons, GetEventWeight());
973  }
974  }
975  }
976 
977  if(!okTOF)
978  {
979  if(dcaCons == -999)
980  {
981  fhPtDCANoTOFHit[0]->Fill(pt, dca[0], GetEventWeight());
982  fhPtDCANoTOFHit[1]->Fill(pt, dca[1], GetEventWeight());
983  }
984  else
985  fhPtDCANoTOFHit[2]->Fill(pt, dcaCons, GetEventWeight());
986 
988  {
989  if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
990  {
991  if(dcaCons == -999)
992  {
993  fhPtDCAVtxOutBC0NoTOFHit[0]->Fill(pt, dca[0], GetEventWeight());
994  fhPtDCAVtxOutBC0NoTOFHit[1]->Fill(pt, dca[1], GetEventWeight());
995  }
996  else
997  fhPtDCAVtxOutBC0NoTOFHit[2]->Fill(pt, dcaCons, GetEventWeight());
998  }
999  else
1000  {
1001  if(dcaCons == -999)
1002  {
1003  fhPtDCAVtxInBC0NoTOFHit[0]->Fill(pt, dca[0], GetEventWeight());
1004  fhPtDCAVtxInBC0NoTOFHit[1]->Fill(pt, dca[1], GetEventWeight());
1005  }
1006  else
1007  fhPtDCAVtxInBC0NoTOFHit[2]->Fill(pt, dcaCons, GetEventWeight());
1008 
1009  }
1010  }
1011 
1012  if(IsPileUpAnalysisOn() && GetReader()->IsPileUpFromSPD())
1013  {
1014  if(dcaCons == -999)
1015  {
1016  fhPtDCAPileUpNoTOFHit[0]->Fill(pt, dca[0], GetEventWeight());
1017  fhPtDCAPileUpNoTOFHit[1]->Fill(pt, dca[1], GetEventWeight());
1018  }
1019  else
1020  fhPtDCAPileUpNoTOFHit[2]->Fill(pt, dcaCons, GetEventWeight());
1021 
1023  {
1024  if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
1025  {
1026  if(dcaCons == -999)
1027  {
1028  fhPtDCAVtxOutBC0PileUpNoTOFHit[0]->Fill(pt, dca[0], GetEventWeight());
1029  fhPtDCAVtxOutBC0PileUpNoTOFHit[1]->Fill(pt, dca[1], GetEventWeight());
1030  }
1031  else
1032  fhPtDCAVtxOutBC0PileUpNoTOFHit[2]->Fill(pt, dcaCons, GetEventWeight());
1033  }
1034  else
1035  {
1036  if(dcaCons == -999)
1037  {
1038  fhPtDCAVtxInBC0PileUpNoTOFHit[0]->Fill(pt, dca[0], GetEventWeight());
1039  fhPtDCAVtxInBC0PileUpNoTOFHit[1]->Fill(pt, dca[1], GetEventWeight());
1040  }
1041  else
1042  fhPtDCAVtxInBC0PileUpNoTOFHit[2]->Fill(pt, dcaCons, GetEventWeight());
1043 
1044  }
1045  }
1046  }
1047  }
1048 
1049  //printf("track pT %2.2f, DCA Cons %f, DCA1 %f, DCA2 %f, TOFBC %d, oktof %d, tof %f\n",
1050  // pt,dcaCons,dca[0],dca[1],track->GetTOFBunchCrossing(bz),okTOF, tof);
1051 
1052 
1053 // if( vtxBC == 0 && trackBC !=0 && trackBC!=AliVTrack::kTOFBCNA)
1054 // printf("TOF Signal %e, BC %d, pt %f, dca_xy %f, dca_z %f, dca_tpc %f \n", tof,trackBC, pt,dca[0],dca[1],dcaCons);
1055 
1056 
1057  if(okTOF)
1058  {
1059  fhTOFSignal ->Fill(tof, GetEventWeight());
1060  fhPtTOFSignal->Fill(pt, tof, GetEventWeight());
1061  if(GetReader()->AcceptDCA(pt,trackDCA) && !GetReader()->IsDCACutOn() )
1062  fhPtTOFSignalDCACut->Fill(pt, tof, GetEventWeight());
1063 
1065  {
1066  if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
1067  fhPtTOFSignalVtxOutBC0->Fill(pt, tof, GetEventWeight());
1068  else
1069  fhPtTOFSignalVtxInBC0->Fill(pt, tof, GetEventWeight());
1070  }
1071 
1072  Int_t trackBC = 1000;
1073 
1075  {
1076  trackBC = track->GetTOFBunchCrossing(bz);
1077 
1078  if(trackBC==0)
1079  {
1080  fhTOFSignalBCOK->Fill(tof, GetEventWeight());
1081 
1082  if(dcaCons == -999)
1083  {
1084  fhPtDCATOFBC0[0]->Fill(pt, dca[0], GetEventWeight());
1085  fhPtDCATOFBC0[1]->Fill(pt, dca[1], GetEventWeight());
1086  }
1087  else
1088  fhPtDCATOFBC0[2]->Fill(pt, dcaCons, GetEventWeight());
1089 
1090  if(IsPileUpAnalysisOn() && GetReader()->IsPileUpFromSPD())
1091  {
1092  if(dcaCons == -999)
1093  {
1094  fhPtDCAPileUpTOFBC0[0]->Fill(pt, dca[0], GetEventWeight());
1095  fhPtDCAPileUpTOFBC0[1]->Fill(pt, dca[1], GetEventWeight());
1096  }
1097  else
1098  fhPtDCAPileUpTOFBC0[2]->Fill(pt, dcaCons, GetEventWeight());
1099  }
1100  }
1101  else if(trackBC!=AliVTrack::kTOFBCNA)
1102  {
1103  if(dcaCons == -999)
1104  {
1105  fhPtDCATOFBCOut[0]->Fill(pt, dca[0], GetEventWeight());
1106  fhPtDCATOFBCOut[1]->Fill(pt, dca[1], GetEventWeight());
1107  }
1108  else
1109  fhPtDCATOFBCOut[2]->Fill(pt, dcaCons, GetEventWeight());
1110  }
1111  }
1112 
1113  if(IsPileUpAnalysisOn())
1114  {
1115  if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalPileUp[0]->Fill(pt, tof, GetEventWeight());
1116  if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalPileUp[1]->Fill(pt, tof, GetEventWeight());
1117  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalPileUp[2]->Fill(pt, tof, GetEventWeight());
1118  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalPileUp[3]->Fill(pt, tof, GetEventWeight());
1119  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalPileUp[4]->Fill(pt, tof, GetEventWeight());
1120  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalPileUp[5]->Fill(pt, tof, GetEventWeight());
1121  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalPileUp[6]->Fill(pt, tof, GetEventWeight());
1122 
1124  {
1125  if (trackBC == 0 )
1126  {
1127  fhEtaPhiTOFBC0 ->Fill(eta, phi, GetEventWeight());
1128  if(IsPileUpAnalysisOn() && GetReader()->IsPileUpFromSPD())
1129  fhEtaPhiTOFBC0PileUpSPD->Fill(eta, phi, GetEventWeight());
1130  }
1131  else if (trackBC < 0 )
1132  {
1133  fhEtaPhiTOFBCPlus ->Fill(eta, phi, GetEventWeight());
1134  if(IsPileUpAnalysisOn() && GetReader()->IsPileUpFromSPD())
1135  fhEtaPhiTOFBCPlusPileUpSPD ->Fill(eta, phi, GetEventWeight());
1136  }
1137  else if (trackBC > 0)
1138  {
1139  fhEtaPhiTOFBCMinus->Fill(eta, phi, GetEventWeight());
1140  if(IsPileUpAnalysisOn() && GetReader()->IsPileUpFromSPD())
1141  fhEtaPhiTOFBCMinusPileUpSPD->Fill(eta, phi, GetEventWeight());
1142  }
1143  }
1144 
1146  {
1147  if(TMath::Abs(vtxBC) > 0 && vtxBC!=AliVTrack::kTOFBCNA)
1148  {
1149  if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalVtxOutBC0PileUp[0]->Fill(pt, tof, GetEventWeight());
1150  if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalVtxOutBC0PileUp[1]->Fill(pt, tof, GetEventWeight());
1151  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalVtxOutBC0PileUp[2]->Fill(pt, tof, GetEventWeight());
1152  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalVtxOutBC0PileUp[3]->Fill(pt, tof, GetEventWeight());
1153  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalVtxOutBC0PileUp[4]->Fill(pt, tof, GetEventWeight());
1154  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalVtxOutBC0PileUp[5]->Fill(pt, tof, GetEventWeight());
1155  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalVtxOutBC0PileUp[6]->Fill(pt, tof, GetEventWeight());
1156  }
1157  else
1158  {
1159  if(GetReader()->IsPileUpFromSPD()) fhPtTOFSignalVtxInBC0PileUp[0]->Fill(pt, tof, GetEventWeight());
1160  if(GetReader()->IsPileUpFromEMCal()) fhPtTOFSignalVtxInBC0PileUp[1]->Fill(pt, tof, GetEventWeight());
1161  if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtTOFSignalVtxInBC0PileUp[2]->Fill(pt, tof, GetEventWeight());
1162  if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtTOFSignalVtxInBC0PileUp[3]->Fill(pt, tof, GetEventWeight());
1163  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtTOFSignalVtxInBC0PileUp[4]->Fill(pt, tof, GetEventWeight());
1164  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtTOFSignalVtxInBC0PileUp[5]->Fill(pt, tof, GetEventWeight());
1165  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtTOFSignalVtxInBC0PileUp[6]->Fill(pt, tof, GetEventWeight());
1166  }
1167  }
1168  }
1169  }
1170 
1171  // Fill AODParticle after some selection
1172  fMomentum.SetPxPyPzE(track->Px(),track->Py(),track->Pz(),0);
1173  Bool_t in = GetFiducialCut()->IsInFiducialCut(fMomentum.Eta(),fMomentum.Phi(),kCTS) ;
1174 
1175  AliDebug(1,Form("Track pt %2.2f, eta %2.2f, phi %2.2f in fiducial cut %d",pt,eta,phi,in));
1176 
1177  // Acceptance selection
1178  if(IsFiducialCutOn() && ! in ) continue ;
1179 
1180  // Momentum selection
1181  if(pt < GetMinPt() || pt > GetMaxPt()) continue;
1182 
1183  if(okTOF) fhTOFSignalPtCut->Fill(tof, GetEventWeight());
1184  else
1185  {
1186  fhPtTOFStatus0 ->Fill(pt, GetEventWeight());
1187  fhEtaPhiTOFStatus0->Fill(eta, phi, GetEventWeight());
1188  }
1189 
1190  Bool_t bITSRefit = (status & AliVTrack::kITSrefit) == AliVTrack::kITSrefit;
1191  Bool_t bConstrained = kFALSE;
1192  if (aodTrack) bConstrained = aodTrack->IsGlobalConstrained();
1193  else if(esdTrack) bConstrained = (!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1));
1194  //printf("Track %d, pt %2.2f, eta %2.2f, phi %2.2f, SPDRefit %d, refit %d, dcaCons %2.2f\n",
1195  // i, pt, eta, phi, bConstrained, bITSRefit, dcaCons);
1196 
1197  if(bConstrained)
1198  {
1199  if(bITSRefit)
1200  {
1201  fhPtNoSPDRefit->Fill(pt, GetEventWeight());
1202  if(pt < 2)fhEtaPhiNoSPDRefitPt02->Fill(eta, phi, GetEventWeight());
1203  if(pt > 3)fhEtaPhiNoSPDRefitPt3 ->Fill(eta, phi, GetEventWeight());
1204 
1205  if(dcaCons == -999)
1206  {
1207  fhPtDCANoSPDRefit[0]->Fill(pt, dca[0], GetEventWeight());
1208  fhPtDCANoSPDRefit[1]->Fill(pt, dca[1], GetEventWeight());
1209  }
1210  else
1211  fhPtDCANoSPDRefit[2]->Fill(pt, dcaCons, GetEventWeight());
1212 
1213  }
1214  else
1215  {
1216  fhPtNoSPDNoRefit->Fill(pt, GetEventWeight());
1217  if(pt < 2)fhEtaPhiNoSPDNoRefitPt02->Fill(eta, phi, GetEventWeight());
1218  if(pt > 3)fhEtaPhiNoSPDNoRefitPt3 ->Fill(eta, phi, GetEventWeight());
1219  if(dcaCons == -999)
1220  {
1221  fhPtDCANoSPDNoRefit[0]->Fill(pt, dca[0], GetEventWeight());
1222  fhPtDCANoSPDNoRefit[1]->Fill(pt, dca[1], GetEventWeight());
1223  }
1224  else
1225  fhPtDCANoSPDNoRefit[2]->Fill(pt, dcaCons, GetEventWeight());
1226  }
1227  }
1228  else
1229  {
1230  fhPtSPDRefit->Fill(pt, GetEventWeight());
1231  if(pt < 2)fhEtaPhiSPDRefitPt02->Fill(eta, phi, GetEventWeight());
1232  if(pt > 3)fhEtaPhiSPDRefitPt3 ->Fill(eta, phi, GetEventWeight());
1233  if(dcaCons == -999)
1234  {
1235  fhPtDCASPDRefit[0]->Fill(pt, dca[0], GetEventWeight());
1236  fhPtDCASPDRefit[1]->Fill(pt, dca[1], GetEventWeight());
1237  }
1238  else
1239  fhPtDCASPDRefit[2]->Fill(pt, dcaCons, GetEventWeight());
1240  }
1241 
1242  // Mixed event
1243  if (GetMixedEvent())
1244  {
1245  evtIndex = GetMixedEvent()->EventIndex(track->GetID()) ;
1246  }
1247 
1248  GetVertex(vert,evtIndex);
1249  if(TMath::Abs(vert[2])> GetZvertexCut()) return;
1250 
1251  AliAODPWG4Particle tr = AliAODPWG4Particle(track->Px(),track->Py(),track->Pz(),0);
1252  tr.SetDetectorTag(kCTS);
1253  tr.SetLabel(track->GetLabel());
1254  tr.SetTrackLabel(track->GetID(),-1);
1255  tr.SetChargedBit(track->Charge()>0);
1256 
1257  AddAODParticle(tr);
1258  } // loop
1259 
1260  AliDebug(1,Form("Final aod branch entries %d", GetOutputAODBranch()->GetEntriesFast()));
1261 }
1262 
1263 //________________________________________________________
1265 //________________________________________________________
1267 {
1269 
1270  //Loop on stored AODParticles
1271  Int_t naod = GetOutputAODBranch()->GetEntriesFast();
1272 
1274 
1275  AliDebug(1,Form("AOD branch entries %d", naod));
1276 
1277  Float_t pt = 0;
1278  Float_t phi = 0;
1279  Float_t eta = 0;
1280 
1281  for(Int_t iaod = 0; iaod < naod ; iaod++)
1282  {
1283  AliAODPWG4Particle* track = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
1284 
1285  pt = track->Pt();
1286  eta = track->Eta();
1287  phi = track->Phi();
1288 
1289  fhPt->Fill(pt, GetEventWeight());
1290 
1291  if(track->GetChargedBit())
1292  {
1293  fhPhiPos ->Fill(pt, phi, GetEventWeight());
1294  fhEtaPos ->Fill(pt, eta, GetEventWeight());
1295  fhEtaPhiPos->Fill(eta, phi, GetEventWeight());
1296  }
1297  else
1298  {
1299  fhPhiNeg ->Fill(pt, phi, GetEventWeight());
1300  fhEtaNeg ->Fill(pt, eta, GetEventWeight());
1301  fhEtaPhiNeg->Fill(eta, phi, GetEventWeight());
1302  }
1303 
1304  if(IsPileUpAnalysisOn())
1305  {
1306  if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(pt, GetEventWeight());}
1307  if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(pt, GetEventWeight());}
1308  if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(pt, GetEventWeight());}
1309  if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(pt, GetEventWeight());}
1310  if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(pt, GetEventWeight());}
1311  if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(pt, GetEventWeight());}
1312  if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(pt, GetEventWeight());}
1313  }
1314 
1315  if(IsDataMC())
1316  {
1317  // Play with the MC stack if available
1318  Int_t mompdg = -1;
1319  Int_t label = track->GetLabel();
1320 
1321  if(label >= 0)
1322  {
1323  if( GetReader()->ReadStack() && label < GetMCStack()->GetNtrack())
1324  {
1325  TParticle * mom = GetMCStack()->Particle(label);
1326  mompdg =TMath::Abs(mom->GetPdgCode());
1327  }
1328  else if(GetReader()->ReadAODMCParticles())
1329  {
1330  AliAODMCParticle * aodmom = 0;
1331  //Get the list of MC particles
1332  aodmom = (AliAODMCParticle*) (GetReader()->GetAODMCParticles())->At(label);
1333  mompdg =TMath::Abs(aodmom->GetPdgCode());
1334  }
1335  }
1336 
1337  Int_t mcType = kmcUnknown;
1338  if (mompdg==211 ) mcType = kmcPion;
1339  else if(mompdg==2212) mcType = kmcProton;
1340  else if(mompdg==321 ) mcType = kmcKaon;
1341  else if(mompdg==11 ) mcType = kmcElectron;
1342  else if(mompdg==13 ) mcType = kmcMuon;
1343 
1344  fhPtMCPart [mcType]->Fill(pt, GetEventWeight());
1345  fhEtaMCPart[mcType]->Fill(pt, eta, GetEventWeight());
1346  fhPhiMCPart[mcType]->Fill(pt, phi, GetEventWeight());
1347 
1348  } // Work with stack also
1349 
1350  } // aod branch loop
1351 }
Int_t charge
Float_t GetHistoPtMax() const
TH2F * fhPtDCAVtxInBC0PileUpNoTOFHit[3]
! DCA (xy,z,constrained) of all tracks, vertex BC=0, SPD pile-up, no hit in TOF
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Float_t GetHistoPtMin() const
virtual TObjArray * GetCTSTracks() const
TH2F * fhPtDCANoTOFHit[3]
! DCA (xy,z,constrained) of all tracks, no hit in TOF
TH2F * fhPtDCAPileUpNoTOFHit[3]
! DCA (xy,z,constrained) of all tracks, SPD pile-up, no hit in TOF
TH2F * fhPtDCATOFBCOut[3]
! DCA (xy,z,constrained) of all tracks, hit in TOF and BC!=0
Bool_t fFillTrackBCHistograms
Fill histograms for tracks with TOF BC=0 or not related histograms.
TH2F * fhPtTOFSignalVtxInBC0
! TOF signal vs track pT, good status
TH1F * fhPtNotSharedClusterCut
! pT spectra of tracks not passing the shared clusters cut (AOD)
virtual void AddToHistogramsName(TString add)
TH2F * fhPtTOFSignalVtxInBC0PileUp[7]
! TOF signal vs track pT, good status, pile-up
TH1F * fhTOFSignalPtCut
! TOF signal pt and acceptance cut
TH2F * fhPtDCAVtxOutBC0PileUp[3]
! DCA (xy,z,constrained) of all tracks, vertex BC!=0, SPD pile-up
TH2F * fhPtDCAVtxOutBC0NoTOFHit[3]
! DCA (xy,z,constrained) of all tracks, vertex BC!=0, no hit in TOF
TH2F * fhPtTOFSignalPileUp[7]
! TOF signal vs track pT, good status, pile-up
Bool_t ReadAODMCParticles() const
virtual void GetVertex(Double_t vertex[3]) const
TH2F * fhPtTOFSignalDCACut
! TOF signal vs track pT, good status
TH2F * fhPtNPileUpSPDVtx
! cluster pt vs number of spd pile-up vertices
Int_t GetVertexBC(const AliVVertex *vtx)
virtual AliVEvent * GetInputEvent() const
TH1F * fhProductionVertexBCPileUp[7]
! Check BC of production vertex, pile-up
TH2F * fhEtaPhiNoSPDRefitPt3
! eta-phi distribution of constrained tracks no SPD and with ITSRefit, pT > 3 GeV ...
TH2F * fhEtaPhiTOFBCMinusPileUpSPD
! eta/phi of tracks passing TOF status selection, tracks in BC<0, pile-up spd
TH2F * fhPhiMCPart[6]
! phi distribution vs pT, 6 hadron ID
TH2F * fhEtaPhiPos
! eta vs phi distribution of positive charge
TH2F * fhEtaPhiNoSPDRefitPt02
! eta-phi distribution of constrained tracks no SPD and with ITSRefit, 0 < pT < 2 GeV ...
void FillPrimaryHistograms()
Fill primary generated particles histograms if MC data is available.
TH2F * fhPtTOFSignalVtxOutBC0PileUp[7]
! TOF signal vs track pT, good status, pile-up
virtual void SetOutputAODClassName(TString name)
TH2F * fhEtaMCPrimPart[6]
! Number of generated charged hadrons vs eta coming from MC particle, 6 hadron ID ...
TH2F * fhEtaPhiTOFStatus0
! eta/phi of tracks not passing TOF status selection
Int_t GetHistoPhiBins() const
TH2F * fhEtaPhiNeg
! eta vs phi distribution of negative charge
TH2F * fhPtDCAVtxInBC0NoTOFHit[3]
! DCA (xy,z,constrained) of all tracks, vertex BC=0, no hit in TOF
TH2F * fhPtDCA[3]
! DCA (xy,z,constrained) of all tracks
TH2F * fhPtDCAPileUp[3]
! DCA (xy,z,constrained) of all tracks, SPD pile-up
TH1F * fhPt
! pT distribution
virtual TClonesArray * GetOutputAODBranch() const
TH1F * fhNtracks
! Track multiplicity distribution
TH2F * fhEtaPhiTOFBC0PileUpSPD
! eta/phi of tracks passing TOF status selection, tracks in BC=0, pile-up spd
TH1F * fhPtPileUp[7]
! pT distribution, pile-up defined events
TH2F * fhPtTOFSignalVtxOutBC0
! TOF signal vs track pT, good status
Float_t GetHistoPhiMin() const
TH2F * fhPhiNeg
! phi distribution vs pT, negative
void MakeAnalysisFillHistograms()
Fill histograms for the selected tracks.
virtual void SetOutputAODName(TString name)
TH1F * fhPtNoSPDRefit
! pT distribution of constrained tracks no SPD and with ITSRefit
TH2F * fhEtaPhiTOFBCPlusPileUpSPD
! eta/phi of tracks passing TOF status selection, tracks in BC>0, pile-up spd
Base class for CaloTrackCorr analysis algorithms.
void Init()
Init. Check that tracks are read, if not abort.
virtual AliFiducialCut * GetFiducialCut()
TH1F * fhPtNotPrimary
! pT spectra of tracks not declared as primary (AOD)
TH1F * fhPtVtxInBC0
! pT distribution of tracks from a vertex with BC=0
TH2F * fhPtNPileUpTrkVtx
! cluster pt vs number of track pile-up vertices
virtual TClonesArray * GetAODMCParticles() const
virtual AliHistogramRanges * GetHistogramRanges()
TH2F * fhEtaNeg
! eta distribution vs pT, negative
TH2F * fhPtDCAVtxOutBC0PileUpNoTOFHit[3]
! DCA (xy,z,constrained) of all tracks, vertex BC!=0, SPD pile-up, no hit in TOF
TH2F * fhEtaPhiSPDRefitPt3
! eta-phi distribution of tracks with SPD and ITS refit, pT > 3 GeV
TH1F * fhPtTOFStatus0
! pT of tracks not passing TOF status selection
Bool_t IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
TH2F * fhEtaPhiNoSPDNoRefitPt3
! eta-phi distribution of constrained tracks with no SPD requierement and without ITSRefit...
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH2F * fhEtaPhiTOFBC0
! eta/phi of tracks passing TOF status selection, tracks in BC=0
TH2F * fhPhiMCPrimPart[6]
! Number of generated charged hadrons vs phi coming from MC particle, 6 hadron ID ...
TH1F * fhPtVtxOutBC0
! pT distribution of tracks from a vertex with BC!=0
TH2F * fhPtNPileUpSPDVtxBC0
! cluster pt vs number of spd pile-up vertices, track in BC=0
virtual Float_t GetTPCSharedClusterFraction() const
virtual Double_t GetEventWeight() const
TH2F * fhPtTOFSignal
! TOF signal vs track pT, good status
TH1F * fhProductionVertexBC
! Check BC of production vertex
TH2F * fhPtDCAPileUpTOFBC0[3]
! DCA (xy,z,constrained) of all tracks, hit in TOF and BC=0
Float_t GetHistoEtaMin() const
TH1F * fhTOFSignal
! TOF signal
TH1F * fhPtCutDCA
! pT distribution, Apply DCA cut
TH2F * fhPtDCATOFBC0[3]
! DCA (xy,z,constrained) of all tracks, hit in TOF and BC=0
TH2F * fhEtaMCPart[6]
! eta distribution vs pT, 6 hadron ID
TH1F * fhPtNoSPDNoRefit
! pT distribution of constrained tracks with no SPD requierement and without ITSRefit ...
void InitParameters()
Initialize the parameters of the analysis.
Float_t GetHistoEtaMax() const
virtual void AddAODParticle(AliAODPWG4Particle part)
Int_t GetHistoPtBins() const
TH1F * fhPtMCPart[6]
! pT distribution, 6 hadron ID
Track selection for correlation analysis.
Bool_t fFillVertexBC0Histograms
Fill histograms for tracks with vertex BC=0 or not related histograms.
TH2F * fhEtaPhiVtxInBC0
! eta/phi distribution of tracks from a vertex with BC=0
TH2F * fhPhiPos
! phi distribution vs pT, positive
TH1F * fhPtMCPrimPart[6]
! Number of generated charged hadrons vs pT coming from MC particle, 6 hadron ID
TH2F * fhEtaPos
! eta distribution vs pT, positive
TH2F * fhPtDCANoSPDRefit[3]
! DCA (xy,z,constrained) of constrained tracks no SPD and with ITSRefit
TH1F * fhPtCutDCABCOK
! pT distribution, Apply DCA cut, BC=0 or -100
TH2F * fhPtDCAVtxInBC0[3]
! DCA (xy,z,constrained) of all tracks, vertex BC==0
TH2F * fhEtaPhiNoSPDNoRefitPt02
! eta-phi distribution of constrained tracks with no SPD requierement and without ITSRefit...
virtual void Print(const Option_t *) const
Print some relevant parameters set for the analysis.
TH1F * fhTOFSignalBCOK
! TOF signal pt and acceptance cut
TH2F * fhEtaPhiSPDRefitPt02
! eta-phi distribution of tracks with SPD and ITS refit, 0 < pT < 2 GeV
TH2F * fhPtDCAVtxInBC0PileUp[3]
! DCA (xy,z,constrained) of all tracks, vertex BC==0, SPD pile-up
TH2F * fhPtNPileUpTrkVtxBC0
! cluster pt vs number of track pile-up vertices, track in BC=0
Float_t GetHistoPhiMax() const
AliAnaChargedParticles()
Default constructor. Initialize parameters with default values.
virtual AliCaloTrackReader * GetReader() const
Int_t GetHistoEtaBins() const
TH2F * fhEtaPhiTOFBCMinus
! eta/phi of tracks passing TOF status selection, tracks in BC<0
TH1F * fhPtSPDRefit
! pT distribution of tracks with SPD and ITS refit
TH2F * fhPtDCASPDRefit[3]
! DCA (xy,z,constrained) of tracks with SPD and ITS refit
TH2F * fhEtaPhiTOFBCPlus
! eta/phi of tracks passing TOF status selection, tracks in BC>0
TH2F * fhEtaPhiVtxOutBC0
! eta/phi distribution of tracks from a vertex with BC!=0
TH2F * fhPtDCAVtxOutBC0[3]
! DCA (xy,z,constrained) of all tracks, vertex BC!=0
TLorentzVector fMomentum
! Temporary momentum container
TH2F * fhPtDCANoSPDNoRefit[3]
! DCA (xy,z,constrained) of constrained tracks with no SPD requierement and without ITSRefit ...
TH1F * fhPtNoCut
! pT distribution, no cut
virtual AliMixedEvent * GetMixedEvent() const