]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/EvTrkSelection/AliAnalysisTrackingUncertainties.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGPP / EvTrkSelection / AliAnalysisTrackingUncertainties.cxx
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, proviyaded 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 purapose. It is         *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //////////////////////////////////////////////////////////////////////////////
17 //                                                                          //
18 // Analysis task for the systematic study of the uncertainties related to   //
19 // the tracking and ITS-TPC matching efficiency for different particle      //
20 // species.                                                                 //
21 //                                                                          //
22 //////////////////////////////////////////////////////////////////////////////
23
24
25 #include "Riostream.h"
26 #include "TH1F.h"
27 #include "TH2D.h"
28 #include "TH3F.h"
29 #include "THn.h"
30 #include "TList.h"
31 #include "TMath.h"
32 #include "TParticlePDG.h"
33 //
34 #include "AliAnalysisTaskSE.h"
35 #include "AliAnalysisManager.h"
36 #include "AliPID.h"
37 #include "AliESDtrackCuts.h"
38 #include "AliESDVertex.h"
39 #include "AliESDEvent.h"
40 #include "AliESDInputHandler.h"
41 #include "AliESDtrack.h"
42 #include "AliESDpid.h"
43 #include "AliESDUtils.h"
44 #include "AliMCEventHandler.h"
45 #include "AliMCEvent.h"
46 #include "AliStack.h"
47 #include "AliLog.h"
48 //
49 #include "AliAnalysisTrackingUncertainties.h"
50
51
52 ClassImp(AliAnalysisTrackingUncertainties)
53
54 // histogram constants
55 const Int_t kNumberOfAxes = 5;
56
57 //________________________________________________________________________
58 AliAnalysisTrackingUncertainties::AliAnalysisTrackingUncertainties() 
59   : AliAnalysisTaskSE("TaskTestPA"), 
60     fESD(0),
61     fESDpid(0),
62     fUtils(0),
63     fMCtrue(0),
64     fListHist(0),
65     fESDtrackCuts(0),
66     fMatchTr(),
67     fMatchChi()
68 {
69   // default Constructor
70   /* fast compilation test
71
72      gSystem->Load("libANALYSIS");
73      gSystem->Load("libANALYSISalice");
74      .L AliAnalysisTrackingUncertainties.cxx++
75    */
76 }
77
78
79 //________________________________________________________________________
80 AliAnalysisTrackingUncertainties::AliAnalysisTrackingUncertainties(const char *name) 
81   : AliAnalysisTaskSE(name),
82     fESD(0),
83     fESDpid(0),
84     fUtils(0),
85     fMCtrue(0),
86     fListHist(0),
87     fESDtrackCuts(0),
88     fMatchTr(),
89     fMatchChi()
90 {
91   //
92   // standard constructur which should be used
93   //
94   fMCtrue = kTRUE; 
95   //
96   // create track cuts
97   //
98   fESDtrackCuts = new AliESDtrackCuts("AliESDtrackCuts","AliESDtrackCuts");
99   fESDtrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE);
100   fESDtrackCuts->SetEtaRange(-1., 1.);
101   //
102   // analysis utils if needed
103   //
104   fUtils = new AliAnalysisUtils();
105   //
106
107   // Output slot #0 writes into a TList container
108   DefineOutput(1, TList::Class());
109
110 }
111
112
113 //________________________________________________________________________
114 void AliAnalysisTrackingUncertainties::UserCreateOutputObjects() 
115 {
116   //
117   // Create histograms
118   // Called once
119   //
120   fListHist = new TList();
121   fListHist->SetOwner(kTRUE);
122   //
123   // basic QA and statistics histograms
124   //
125   TH2F * histVertexSelection = new TH2F("histVertexSelection", "vertex selection; vertex z (cm); accepted/rejected", 100, -50., 50., 2, -0.5, 1.5);
126   fListHist->Add(histVertexSelection);
127   //
128   // track cut variation histograms
129   InitializeTrackCutHistograms();
130   //
131   //
132   // matching histograms
133   //
134   const int nbPt=40;
135   const double ptMax=5;
136   //
137   TH2F * hNMatch    = new TH2F("hNMatch","N Matches",nbPt,0,ptMax,kMaxMatch+1,-0.5,kMaxMatch+0.5);
138   TH2F * hBestMatch = new TH2F("hBestMatch","Best Match Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2);
139   TH2F * hAllMatch  = new TH2F("hAllMatch","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2);
140   TH2F * hAllMatchGlo  = new TH2F("hAllMatchGlo","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2);
141   fListHist->Add(hNMatch);
142   fListHist->Add(hBestMatch);
143   fListHist->Add(hAllMatch);
144   fListHist->Add(hAllMatchGlo);
145   //
146   TH2F * hNMatchBg    = new TH2F("hNMatchBg","N Matches",nbPt,0,ptMax,kMaxMatch+1,-0.5,kMaxMatch+0.5);
147   TH2F * hBestMatchBg = new TH2F("hBestMatchBg","Best Match Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2);
148   TH2F * hAllMatchBg  = new TH2F("hAllMatchBg","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2);
149   TH2F * hAllMatchGloBg  = new TH2F("hAllMatchGloBg","All Matches Chi2",nbPt,0,ptMax,2*int(TMath::Max(1.1,kMaxChi2)),0,kMaxChi2);
150   fListHist->Add(hNMatchBg);
151   fListHist->Add(hBestMatchBg);
152   fListHist->Add(hAllMatchBg);
153   fListHist->Add(hAllMatchGloBg);
154   //
155   // post data
156   //
157   PostData(1, fListHist);
158
159
160 }
161
162
163
164 //________________________________________________________________________
165 void AliAnalysisTrackingUncertainties::UserExec(Option_t *) 
166 {
167   //
168   // main event loop
169   //
170   fESD = dynamic_cast<AliESDEvent*>( InputEvent() );
171   if (!fESD) {
172     PostData(1, fListHist);
173     return;
174   }
175   //
176   if (!fESDpid) fESDpid = ((AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetESDpid();
177   //
178   // Check Monte Carlo information and other access first:
179   //
180   AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
181   if (!eventHandler) {
182     fMCtrue = kFALSE;
183   }
184   //
185   // extract generated particles information
186   //
187   AliMCEvent* mcEvent = 0x0;
188   AliStack* stack = 0x0;
189   if (eventHandler) mcEvent = eventHandler->MCEvent();
190   if (!mcEvent) {
191     if (fMCtrue) return;
192   }
193   if (fMCtrue) {
194     //
195     stack = mcEvent->Stack();
196     if (!stack) return;
197     //
198     for(Int_t i = 0; i < stack->GetNtrack(); i++) {
199       /* at the moment nothing is needed here
200       TParticle * trackMC = stack->Particle(i);
201       Double_t rap = trackMC->Eta();
202       Double_t y = trackMC->Y();
203       Double_t pT  = trackMC->Pt();
204       */
205       //
206     }
207
208   }
209   //
210   if (!fESDtrackCuts) {
211     PostData(1, fListHist);
212     return;
213   }
214   //
215   // monitor vertex position and selection
216   //
217   TH2F * histVertexSelection = (TH2F *) fListHist->FindObject("histVertexSelection");
218   //
219   Float_t vertexZ = 0.;
220   if (IsVertexAccepted(fESD, vertexZ)) {
221     histVertexSelection->Fill(vertexZ, 0);
222   } else {
223     histVertexSelection->Fill(vertexZ, 1);
224     return;
225   }
226   //
227   // fill track cut variation histograms
228   //
229   ProcessTrackCutVariation();
230   //
231   // fill ITS->TPC matching histograms
232   //
233   ProcessItsTpcMatching();
234   
235   // Post output data  
236   PostData(1, fListHist);
237   
238 }      
239
240
241 //________________________________________________________________________
242 void  AliAnalysisTrackingUncertainties::ProcessItsTpcMatching(){
243   //
244   // check how many its-sa tracks get matched to TPC
245   //
246   int ntr = fESD->GetNumberOfTracks();
247   //
248   // initialize histograms
249   //
250   TH2F * hNMatch      = (TH2F*) fListHist->FindObject("hNMatch");
251   TH2F * hBestMatch   = (TH2F*) fListHist->FindObject("hBestMatch");
252   TH2F * hAllMatch    = (TH2F*) fListHist->FindObject("hAllMatch");
253   TH2F * hAllMatchGlo = (TH2F*) fListHist->FindObject("hAllMatchGlo");  
254   //
255   TH2F * hNMatchBg      = (TH2F*) fListHist->FindObject("hNMatchBg");
256   TH2F * hBestMatchBg   = (TH2F*) fListHist->FindObject("hBestMatchBg");
257   TH2F * hAllMatchBg    = (TH2F*) fListHist->FindObject("hAllMatchBg");
258   TH2F * hAllMatchGloBg = (TH2F*) fListHist->FindObject("hAllMatchGloBg");    
259   //
260   for (int it=0;it<ntr;it++) {
261     AliESDtrack* trSA = fESD->GetTrack(it);
262     if (!trSA->IsOn(AliESDtrack::kITSpureSA) || !trSA->IsOn(AliESDtrack::kITSrefit)) continue;
263     double pt = trSA->Pt();
264     //
265     Int_t nmatch = 0;
266     for (int i=kMaxMatch;i--;) {fMatchChi[i]=0; fMatchTr[i]=0;} // reset array
267     for (int it1=0;it1<ntr;it1++) { 
268       if (it1==it) continue;
269       AliESDtrack* trESD = fESD->GetTrack(it1);
270       if (!trESD->IsOn(AliESDtrack::kTPCrefit)) continue;
271       Match(trSA,trESD, nmatch);
272     }
273     //
274     hNMatch->Fill(pt,nmatch);
275     if (nmatch>0) hBestMatch->Fill(pt,fMatchChi[0]);
276     for (int imt=nmatch;imt--;) {
277       hAllMatch->Fill(pt,fMatchChi[imt]);
278       if (fMatchTr[imt]->IsOn(AliESDtrack::kITSrefit)) hAllMatchGlo->Fill(pt,fMatchChi[imt]);
279     }
280     //
281     nmatch = 0;
282     for (int i=kMaxMatch;i--;) {fMatchChi[i]=0; fMatchTr[i]=0;}
283     for (int it1=0;it1<ntr;it1++) {
284       if (it1==it) continue;
285       AliESDtrack* trESD = fESD->GetTrack(it1);
286       if (!trESD->IsOn(AliESDtrack::kTPCrefit)) continue;
287       Match(trSA,trESD, nmatch, TMath::Pi());
288     }
289     //
290     hNMatchBg->Fill(pt,nmatch);
291     if (nmatch>0) hBestMatchBg->Fill(pt,fMatchChi[0]);
292     for (int imt=nmatch;imt--;) {
293       hAllMatchBg->Fill(pt,fMatchChi[imt]);
294       if (fMatchTr[imt]->IsOn(AliESDtrack::kITSrefit)) hAllMatchGloBg->Fill(pt,fMatchChi[imt]);
295     }
296     //
297   }
298
299
300 }
301
302
303 void AliAnalysisTrackingUncertainties::Match(const AliESDtrack* tr0, const AliESDtrack* tr1, Int_t &nmatch, Double_t rotate) {
304   //
305   // check if two tracks are matching, possible rotation for combinatoric backgr.
306   // 
307   Float_t bField = fESD->GetMagneticField();
308   //
309   const AliExternalTrackParam* trtpc0 = tr1->GetInnerParam();
310   if (!trtpc0) return;
311   AliExternalTrackParam trtpc(*trtpc0);
312   //
313   if (TMath::Abs(rotate)>1e-5) {
314     const double *par = trtpc.GetParameter();
315     const double *cov = trtpc.GetCovariance();
316     double alp = trtpc.GetAlpha() + rotate;
317     trtpc.Set(trtpc.GetX(),alp,par,cov);
318   }
319   //
320   if (!trtpc.Rotate(tr0->GetAlpha())) return;
321   if (!trtpc.PropagateTo(tr0->GetX(),bField)) return;
322   double chi2 = tr0->GetPredictedChi2(&trtpc);
323   if (chi2>kMaxChi2) return;
324   //
325   int ins;
326   for (ins=0;ins<nmatch;ins++) if (chi2<fMatchChi[ins]) break;
327   if (ins>=kMaxMatch) return;
328   
329   for (int imv=nmatch;imv>ins;imv--) {
330     if (imv>=kMaxMatch) continue;
331     fMatchTr[imv]  = fMatchTr[imv-1];
332     fMatchChi[imv] = fMatchChi[imv-1];
333   }
334   fMatchTr[ins] = tr1;
335   fMatchChi[ins] = chi2;
336   nmatch++;
337   if (nmatch>=kMaxMatch) nmatch = kMaxMatch;
338   //
339 }
340
341
342 //________________________________________________________________________
343 void AliAnalysisTrackingUncertainties::ProcessTrackCutVariation() {
344   //
345   // fill track cut variation histograms - undo cuts step-by-step and fill histograms
346   //
347   //
348   // initialize histograms
349   //
350   THnF * histNcl     = (THnF *) fListHist->FindObject("histNcl");
351   THnF * histChi2Tpc = (THnF *) fListHist->FindObject("histChi2Tpc");
352   THnF * histDcaZ    = (THnF *) fListHist->FindObject("histDcaZ");
353   THnF * histSpd     = (THnF *) fListHist->FindObject("histSpd");
354   //
355   Float_t dca[2], cov[3]; // dca_xy, dca_z, sigma_xy, sigma_xy_z, sigma_z for the vertex cut
356   //
357   for (Int_t i=0;i<fESD->GetNumberOfTracks();++i) {
358     //
359     AliESDtrack *track =fESD->GetTrack(i);
360     //
361     // relevant variables
362     //
363     Int_t nclsTPC = track->GetTPCncls();
364     Float_t pT  = track->Pt();
365     Float_t eta = track->Eta();
366     Float_t phi = track->Phi();
367     Float_t chi2TPC = track->GetTPCchi2();
368     Double_t pid = Double_t(GetPid(track));
369     if (nclsTPC != 0) {
370       chi2TPC /= nclsTPC; 
371     } else {
372       chi2TPC = 999.;
373     }
374     //
375     track->GetImpactParameters(dca, cov);
376     //
377     // (1.) fill number of clusters histogram
378     //
379     Int_t minNclsTPC = fESDtrackCuts->GetMinNClusterTPC();
380     fESDtrackCuts->SetMinNClustersTPC(0);
381     if (fESDtrackCuts->AcceptTrack(track)) {
382       Double_t vecHistNcl[kNumberOfAxes] = {nclsTPC, pT, eta, phi, pid};
383       histNcl->Fill(vecHistNcl);
384     }
385     fESDtrackCuts->SetMinNClustersTPC(minNclsTPC);
386     //
387     // (2.) fill chi2 TPC histogram
388     //
389     Float_t maxChi2 = fESDtrackCuts->GetMaxChi2PerClusterTPC();
390     fESDtrackCuts->SetMaxChi2PerClusterTPC(999.);
391     if (fESDtrackCuts->AcceptTrack(track)) {
392       Double_t vecHistChi2Tpc[kNumberOfAxes] = {chi2TPC, pT, eta, phi, pid};
393       histChi2Tpc->Fill(vecHistChi2Tpc);
394     }
395     fESDtrackCuts->SetMaxChi2PerClusterTPC(maxChi2);
396     //
397     // (3.) fill dca_z histogram
398     //
399     Float_t maxDcaZ = fESDtrackCuts->GetMaxDCAToVertexZ();
400     fESDtrackCuts->SetMaxDCAToVertexZ(999.);
401     if (fESDtrackCuts->AcceptTrack(track)) {
402       Double_t vecHistDcaZ[kNumberOfAxes] = {TMath::Abs(dca[1]), pT, eta, phi, pid};
403       histDcaZ->Fill(vecHistDcaZ);
404     }
405     fESDtrackCuts->SetMaxDCAToVertexZ(maxDcaZ);
406     //
407     // (4.) fill hit in SPD histogram
408     //
409     fESDtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kOff);
410     if (fESDtrackCuts->AcceptTrack(track)) {
411       Int_t hasPoint = 0;
412       if (track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)) hasPoint = 1;
413       Double_t vecHistSpd[kNumberOfAxes] = {hasPoint, pT, eta, phi, pid};
414       histSpd->Fill(vecHistSpd);
415     }
416     fESDtrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
417
418
419   } // end of track loop
420
421
422 }
423
424
425
426 //________________________________________________________________________
427 void AliAnalysisTrackingUncertainties::Terminate(Option_t *) 
428 {
429   // Draw result to the screen
430   // Called once at the end of the query
431
432
433 }
434
435
436 //________________________________________________________________________
437 void AliAnalysisTrackingUncertainties::BinLogAxis(const THn *h, Int_t axisNumber) {
438   //
439   // Method for the correct logarithmic binning of histograms
440   //
441   TAxis *axis = h->GetAxis(axisNumber);
442   int bins = axis->GetNbins();
443
444   Double_t from = axis->GetXmin();
445   Double_t to = axis->GetXmax();
446   Double_t *newBins = new Double_t[bins + 1];
447    
448   newBins[0] = from;
449   Double_t factor = pow(to/from, 1./bins);
450   
451   for (int i = 1; i <= bins; i++) {
452    newBins[i] = factor * newBins[i-1];
453   }
454   axis->Set(bins, newBins);
455   delete [] newBins;
456   
457 }
458
459
460 //________________________________________________________________________
461 Bool_t AliAnalysisTrackingUncertainties::IsVertexAccepted(AliESDEvent * esd, Float_t &vertexZ) {
462   //
463   // function to check if a proper vertex is reconstructed and write z-position in vertexZ
464   //
465   vertexZ = -999.;
466   Bool_t vertexOkay = kFALSE;
467   const AliESDVertex *vertex = esd->GetPrimaryVertexTracks();
468   if (vertex->GetNContributors() < 1) {
469     //
470     vertex = esd->GetPrimaryVertexSPD();
471     if (vertex->GetNContributors() < 1) {
472       vertexOkay = kFALSE; }
473     else {
474       vertexOkay = kTRUE;
475     }
476     //
477     TString vtxTyp = vertex->GetTitle();
478     Double_t cov[6]={0};
479     vertex->GetCovarianceMatrix(cov);
480     Double_t zRes = TMath::Sqrt(cov[5]);
481     if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) vertexOkay = kFALSE;
482   }
483   else {
484     vertexOkay = kTRUE;
485   }
486
487   vertexZ = vertex->GetZ();  
488   return vertexOkay;
489
490 }
491
492 //________________________________________________________________________
493 AliAnalysisTrackingUncertainties::ESpecies_t AliAnalysisTrackingUncertainties::GetPid(const AliESDtrack * const tr, Bool_t useTPCTOF) const {
494     //
495     // Determine particle species for a given track
496     // Two approaches can be used: As default the selection is done using TPC-only, in addition
497     // the TOF usage is optional. In case of TPC-TOF, a valid TOF signal has to be provided for 
498     // the given track. The identification is delegated to helper function for each species. 
499     // Tracks which are selected as more than one species (ambiguous decision) are rejected.
500     //
501     // @Return: Particles species (kUndef in case no identification is possible)
502     //
503     if(!fESDpid) return kUndef;
504     if(useTPCTOF && !(tr->GetStatus() & AliVTrack::kTOFpid)) return kUndef;
505
506     Bool_t isElectron(kFALSE), isPion(kFALSE), isKaon(kFALSE), isProton(kFALSE);
507     Int_t nspec(0);
508     if((isElectron = IsElectron(tr, useTPCTOF))) nspec++;
509     if((isPion = IsPion(tr, useTPCTOF))) nspec++;
510     if((isKaon = IsKaon(tr, useTPCTOF))) nspec++;
511     if((isProton = IsProton(tr,useTPCTOF))) nspec++;
512     if(nspec != 1) return kUndef;   // No decision or ambiguous decision;
513     if(isElectron) return kSpecElectron;
514     if(isPion) return kSpecElectron;
515     if(isProton) return kSpecElectron;
516     if(isKaon) return kSpecElectron;
517     return kUndef;
518 }
519
520 //________________________________________________________________________
521 Bool_t AliAnalysisTrackingUncertainties::IsElectron(const AliESDtrack * const tr, Bool_t useTPCTOF) const {
522     //
523     // Selection of electron candidates using the upper half of the TPC sigma band, starting at 
524     // the mean ignoring its shift, and going up to 3 sigma above the mean. In case TOF information 
525     // is available, tracks which are incompatible with electrons within 3 sigma are rejected. If 
526     // no TOF information is used, the momentum regions where the kaon and the proton line cross 
527     // the electron line are cut out using a 3 sigma cut around the kaon or proton line.
528     //
529
530     Float_t nsigmaElectronTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kElectron);
531     if(nsigmaElectronTPC < 0 || nsigmaElectronTPC  > 3) return kFALSE;
532
533     if(useTPCTOF){
534         Float_t nsigmaElectronTOF = fESDpid->NumberOfSigmasTOF(tr, AliPID::kElectron);
535         if(TMath::Abs(nsigmaElectronTOF) > 3) return kFALSE;
536         else return kTRUE;
537     } else {
538         Float_t nsigmaKaonTPC = fESDpid->NumberOfSigmasTPC(tr, AliPID::kKaon),
539                 nsigmaProtonTPC =fESDpid->NumberOfSigmasTPC(tr, AliPID::kProton);
540         if(TMath::Abs(nsigmaKaonTPC < 3) || TMath::Abs(nsigmaProtonTPC < 3)) return kFALSE;
541         else return kTRUE;
542     }
543 }
544
545 //________________________________________________________________________
546 Bool_t AliAnalysisTrackingUncertainties::IsPion(const AliESDtrack * const /*tr*/, Bool_t /*useTPCPTOF*/) const{
547     //
548     // Selectron of pion candidates
549     // @TODO: To be implemented
550     //
551     return kFALSE;
552 }
553
554 //________________________________________________________________________
555 Bool_t AliAnalysisTrackingUncertainties::IsKaon(const AliESDtrack * const /*tr*/, Bool_t /*useTPCPTOF*/) const {
556     //
557     // Selection of kaon candidates
558     // @TODO: To be implemented
559     //
560     return kFALSE;
561 }
562
563 //________________________________________________________________________
564 Bool_t AliAnalysisTrackingUncertainties::IsProton(const AliESDtrack * const /*tr*/, Bool_t /*useTPCPTOF*/) const{
565     // 
566     // Selection of proton candidates
567     // @TODO: To be implemented
568     //
569     return kFALSE;
570 }
571
572 //________________________________________________________________________
573 void AliAnalysisTrackingUncertainties::InitializeTrackCutHistograms() {
574   //
575   // create histograms for the track cut studies
576   //
577   //
578   // (1.) number of clusters       
579   //                               0-ncl, 1-pt, 2-eta,         3-phi, 4-pid(0,unid,etc.)
580   Int_t    binsNcl[kNumberOfAxes] = { 40,   50,    20,            18,  6};
581   Double_t minNcl[kNumberOfAxes]  = { 20,  0.1,    -1,             0, -0.5};
582   Double_t maxNcl[kNumberOfAxes]  = {160,   20,    +1, 2*TMath::Pi(),  5.5};
583   //
584   TString axisNameNcl[kNumberOfAxes]  = {"ncl","pT","eta","phi","pid"};
585   TString axisTitleNcl[kNumberOfAxes] = {"ncl","pT","eta","phi","pid"};
586   //
587   THnF * histNcl = new THnF("histNcl","number of clusters histogram",kNumberOfAxes, binsNcl, minNcl, maxNcl);
588   BinLogAxis(histNcl, 1);
589   fListHist->Add(histNcl);
590   //
591   for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){
592     histNcl->GetAxis(iaxis)->SetName(axisNameNcl[iaxis]);
593     histNcl->GetAxis(iaxis)->SetTitle(axisTitleNcl[iaxis]);
594   }
595   //
596   // (2.) chi2/cls-TPC            
597   //                                  0-chi2, 1-pt, 2-eta,         3-phi, 4-pid(0,unid,etc.)
598   Int_t    binsChi2Tpc[kNumberOfAxes] = { 40,   50,    20,            18,  6};
599   Double_t minChi2Tpc[kNumberOfAxes]  = {  0,  0.1,    -1,             0, -0.5};
600   Double_t maxChi2Tpc[kNumberOfAxes]  = {  8,   20,    +1, 2*TMath::Pi(),  5.5};
601   //
602   TString axisNameChi2Tpc[kNumberOfAxes]  = {"chi2tpc","pT","eta","phi","pid"};
603   TString axisTitleChi2Tpc[kNumberOfAxes] = {"chi2tpc","pT","eta","phi","pid"};
604   //
605   THnF * histChi2Tpc = new THnF("histChi2Tpc","number of clusters histogram",kNumberOfAxes, binsChi2Tpc, minChi2Tpc, maxChi2Tpc);
606   BinLogAxis(histChi2Tpc, 1);
607   fListHist->Add(histChi2Tpc);
608   //
609   for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){
610     histChi2Tpc->GetAxis(iaxis)->SetName(axisNameChi2Tpc[iaxis]);
611     histChi2Tpc->GetAxis(iaxis)->SetTitle(axisTitleChi2Tpc[iaxis]);
612   }
613   //
614   // (3.) dca_z
615   //                               0-dcaZ, 1-pt, 2-eta,         3-phi, 4-pid(0,unid,etc.)
616   Int_t    binsDcaZ[kNumberOfAxes] = { 20,   50,    20,            18,  6};
617   Double_t minDcaZ[kNumberOfAxes]  = {  0,  0.1,    -1,             0, -0.5};
618   Double_t maxDcaZ[kNumberOfAxes]  = {  4,   20,    +1, 2*TMath::Pi(),  5.5};
619   //
620   TString axisNameDcaZ[kNumberOfAxes]  = {"dcaZ","pT","eta","phi","pid"};
621   TString axisTitleDcaZ[kNumberOfAxes] = {"dcaZ","pT","eta","phi","pid"};
622   //
623   THnF * histDcaZ = new THnF("histDcaZ","number of clusters histogram",kNumberOfAxes, binsDcaZ, minDcaZ, maxDcaZ);
624   BinLogAxis(histDcaZ, 1);
625   fListHist->Add(histDcaZ);
626   //
627   for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){
628     histDcaZ->GetAxis(iaxis)->SetName(axisNameDcaZ[iaxis]);
629     histDcaZ->GetAxis(iaxis)->SetTitle(axisTitleDcaZ[iaxis]);
630   }
631   //
632   // (4.) hit in SPD layer
633   //                              0-spdHit, 1-pt, 2-eta,         3-phi, 4-pid(0,unid,etc.)
634   Int_t    binsSpd[kNumberOfAxes] = {    2,   50,    20,            18,  6};
635   Double_t minSpd[kNumberOfAxes]  = { -0.5,  0.1,    -1,             0, -0.5};
636   Double_t maxSpd[kNumberOfAxes]  = {  1.5,   20,    +1, 2*TMath::Pi(),  5.5};
637   //
638   TString axisNameSpd[kNumberOfAxes]  = {"spdHit","pT","eta","phi","pid"};
639   TString axisTitleSpd[kNumberOfAxes] = {"spdHit","pT","eta","phi","pid"};
640   //
641   THnF * histSpd = new THnF("histSpd","number of clusters histogram",kNumberOfAxes, binsSpd, minSpd, maxSpd);
642   BinLogAxis(histSpd, 1);
643   fListHist->Add(histSpd);
644   //
645   for (Int_t iaxis=0; iaxis<kNumberOfAxes;iaxis++){
646     histSpd->GetAxis(iaxis)->SetName(axisNameSpd[iaxis]);
647     histSpd->GetAxis(iaxis)->SetTitle(axisTitleSpd[iaxis]);
648   }
649
650
651
652
653 }
654