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