1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // AliAnalysisTaskDDMeson
21 // Xianguo Lu <lu@physi.uni-heidelberg.de>
23 // Felix Reidt <Felix.Reidt@cern.ch>
29 #include "THnSparse.h"
33 #include "AliCDMesonBase.h"
36 //------------------------------------------------------------------------------
37 //== INVARIANT MASS DISTRIBUTIONS (ThnMother) ================================
38 //-- event characteristics
39 // number of charged primary particles - combined => can be w/ soft tracks
40 const Int_t AliCDMesonBase::fgkNNcombined = 2; // number of bins
41 const Double_t AliCDMesonBase::fgkMinNcombined = 2; // lower border
42 const Double_t AliCDMesonBase::fgkMaxNcombined = 4; // upper border (#bins + lower border)
44 // unlike sign or like sign charged?
45 const Int_t AliCDMesonBase::fgkNCombCh = 2; // kBinPPMM = number of bins
46 const Double_t AliCDMesonBase::fgkMinCombCh = 1.; // kBinPM = lower border
47 const Double_t AliCDMesonBase::fgkMaxCombCh = 3.; // kBinPPMM + kBinPM = upper border
49 // two track PID, take care the enum changed from time to time
50 const Int_t AliCDMesonBase::fgkNCombPID = 13; // kBinPIDUnknown = number of bins
51 const Double_t AliCDMesonBase::fgkMinCombPID = 1.; // kBinPionE = lower border
52 const Double_t AliCDMesonBase::fgkMaxCombPID = 14.;// ... = upper border
54 // gap configuration, used for different detectors
55 const Int_t AliCDMesonBase::fgkNGapConfig = 4; // kBinNG = number of bins
56 const Double_t AliCDMesonBase::fgkMinGapConfig = 1.; // kBinDG = lower border
57 const Double_t AliCDMesonBase::fgkMaxGapConfig = 5.; // kBinNG + kBinDG = upper border
59 //-- mother kinematics
60 // invariant mass of the two-track system
61 const Int_t AliCDMesonBase::fgkNMass = 1024; // number of bins
62 const Double_t AliCDMesonBase::fgkMinMass = 0.; // lower border
63 const Double_t AliCDMesonBase::fgkMaxMass = 5.12; // upper border
65 // transverse momentum of the two-track system
66 const Int_t AliCDMesonBase::fgkNMotherPt = 128;//10; // number of bins
67 const Double_t AliCDMesonBase::fgkMinMotherPt = 0.; // lower border
68 const Double_t AliCDMesonBase::fgkMaxMotherPt = .64; //6.4 //2; // upper border
70 // cosine theta* (opening angle of the two daugther tracks in the
71 // centre-of-mass system of the two-track/mother system)
72 // **no meaning full variable**
73 const Int_t AliCDMesonBase::fgkNCTS = 2; // number of bins
74 const Double_t AliCDMesonBase::fgkMinCTS = -1.; // lower border
75 const Double_t AliCDMesonBase::fgkMaxCTS = -0.9; // upper border
77 // opening angle in the lab frame
78 const Int_t AliCDMesonBase::fgkNOA = 20; // number of bins
79 const Double_t AliCDMesonBase::fgkMinOA = -1.; // lower border
80 const Double_t AliCDMesonBase::fgkMaxOA = 1.; // upper border
82 //-- daughter kinematics
83 // transverse momentum of one of the two daughter particles
84 // (randomly selected)
85 const Int_t AliCDMesonBase::fgkNDaughterPt = 128; // number of bins
86 const Double_t AliCDMesonBase::fgkMinDaughterPt = 0.; // lower border
87 const Double_t AliCDMesonBase::fgkMaxDaughterPt = 6.4; // upper border
89 // pseudo rapidity of one of the two daughter particles
90 // (randomly selected)
91 //const Int_t AliCDMesonBase::fgkNDaughterEta = 64; // number of bins
92 //const Double_t AliCDMesonBase::fgkMinDaughterEta = -1.28; // lower border
93 //const Double_t AliCDMesonBase::fgkMaxDaughterEta = 1.28; // upper border
95 //-- Event quality information
96 // boolean values to reduce output size
98 // are there tracks in addition to the ones selected using AliCDMesonTracks
99 // (ITSTPC, ITSsa, ITSpureSA) (0 = no, 1 = yes)
100 const Int_t AliCDMesonBase::fgkNTrackResiduals = 2; // number of bins
101 const Double_t AliCDMesonBase::fgkMinTrackResiduals = 0.; // lower border
102 const Double_t AliCDMesonBase::fgkMaxTrackResiduals = 2.; // upper border
104 // vertex with in +/-4cm (0 = no, 1 = yes)
105 const Int_t AliCDMesonBase::fgkNVertexZinRng = 2; // number of bins
106 const Double_t AliCDMesonBase::fgkMinVertexZinRng = 0.; // lower border
107 const Double_t AliCDMesonBase::fgkMaxVertexZinRng = 2.; // upper border
109 // are the vertices from SPD and tracks within 0.5cm? (0 = no, 1 = yes)
110 const Int_t AliCDMesonBase::fgkNVertexCoincidence = 2; // number of bins
111 const Double_t AliCDMesonBase::fgkMinVertexCoincidence = 0.; // lower border
112 const Double_t AliCDMesonBase::fgkMaxVertexCoincidence = 2.; // upper border
114 // are there SPD tracklets which are not assigned to tracks? (0 = no, 1 = yes)
115 const Int_t AliCDMesonBase::fgkNTrackletResiduals = 2; // number of bins
116 const Double_t AliCDMesonBase::fgkMinTrackletResiduals = 0.; // lower border
117 const Double_t AliCDMesonBase::fgkMaxTrackletResiduals = 2.; // upper border
119 //-- MC event information
120 const Int_t AliCDMesonBase::fgkNProcessType = 4; // kBinDD = number of bins
121 const Double_t AliCDMesonBase::fgkMinProcessType = 0.; // kBinND = lower border
122 const Double_t AliCDMesonBase::fgkMaxProcessType = 4.; // kBinDD = upper border
125 //== EMPTY EVENT STUDY (ThnEmptyEvents) ======================================
127 const Int_t AliCDMesonBase::fgkNEventType = 5; // kBinEventE = number of bins (5)
128 const Double_t AliCDMesonBase::fgkMinEventType = 1.; // kBinEventI = lower border (1)
129 const Double_t AliCDMesonBase::fgkMaxEventType = 6.; // kBinEventE+kBinEventI = u. b.
131 // multiplicities (reused for different detectors and ways of counting)
132 const Int_t AliCDMesonBase::fgkNMult = 32; // number of bins
133 const Double_t AliCDMesonBase::fgkMinMult = 0.; // lower border
134 const Double_t AliCDMesonBase::fgkMaxMult = 31.; // upper border
136 // multplicities - extended range
137 // (reused for different detectors and ways of counting)
138 const Int_t AliCDMesonBase::fgkNMultW = 64; // number of bins
139 const Double_t AliCDMesonBase::fgkMinMultW = 0; // lower border
140 const Double_t AliCDMesonBase::fgkMaxMultW = 63; // upper border
142 //== MULTIPLICITY STUDY (TnnMultiplicity) ====================================
143 // number of ITSTPC tracks in event
144 const Int_t AliCDMesonBase::fgkNNch = 51; // number of bins
145 const Double_t AliCDMesonBase::fgkMinNch = 0.; // lower border
146 const Double_t AliCDMesonBase::fgkMaxNch = 51.; // upper border
148 // number of ITS standalone tracks in event
149 const Int_t AliCDMesonBase::fgkNNsoft = 11; // number of bins
150 const Double_t AliCDMesonBase::fgkMinNsoft = 0.; // lower border
151 const Double_t AliCDMesonBase::fgkMaxNsoft = 11.; // upper border
153 // combined multiplicity
154 const Int_t AliCDMesonBase::fgkNNcomb = 61; // number of bins
155 const Double_t AliCDMesonBase::fgkMinNcomb = 0.; // lower border
156 const Double_t AliCDMesonBase::fgkMaxNcomb = 61.; // upper border
158 // gap configuration is reused from THnMother
160 // number of residual tracks
161 const Int_t AliCDMesonBase::fgkNNresidualTracks = 11; // number of bins
162 const Double_t AliCDMesonBase::fgkMinNresidualTracks = 0.; // lower border
163 const Double_t AliCDMesonBase::fgkMaxNresidualTracks = 11.; // upper border
165 // number of residual tracklets
166 const Int_t AliCDMesonBase::fgkNNresidualTracklets = 21; // number of bins
167 const Double_t AliCDMesonBase::fgkMinNresidualTracklets = 0.; // lower border
168 const Double_t AliCDMesonBase::fgkMaxNresidualTracklets = 21.; // upper border
171 const Int_t AliCDMesonBase::fgkNVertexZ = 20; // number of bins
172 const Double_t AliCDMesonBase::fgkMinVertexZ = -10.; // lower border
173 const Double_t AliCDMesonBase::fgkMaxVertexZ = 10.; // upper border
175 // SPD and track vertex distance
176 const Int_t AliCDMesonBase::fgkNVerticesDistance = 10; // number of bins
177 const Double_t AliCDMesonBase::fgkMinVerticesDistance = 0.; // lower border
178 const Double_t AliCDMesonBase::fgkMaxVerticesDistance = 5.; // upper border
181 //------------------------------------------------------------------------------
182 Int_t AliCDMesonBase::GetGapBin(TString tag, Int_t gapcg,
183 Bool_t checkCentralActivity /* = kTRUE */)
186 // retrieve gap topology for a given string
191 Bool_t ka = kFALSE, kc = kFALSE;
193 if(tag.Contains("V0")){
194 ka = ka || (gapcg & kBitV0A);
195 kc = kc || (gapcg & kBitV0C);
197 if(tag.Contains("FMD")){
198 ka = ka || (gapcg & kBitFMDA);
199 kc = kc || (gapcg & kBitFMDC);
201 if(tag.Contains("SPD")){
202 ka = ka || (gapcg & kBitSPDA);
203 kc = kc || (gapcg & kBitSPDC);
205 if(tag.Contains("TPC")){
206 ka = ka || (gapcg & kBitTPCA);
207 kc = kc || (gapcg & kBitTPCC);
209 if(tag.Contains("ZDC")){
210 ka = ka || (gapcg & kBitZDCA);
211 kc = kc || (gapcg & kBitZDCC);
218 if (((gapcg & kBitCentAct) && checkCentralActivity) ||
219 !checkCentralActivity) {
220 return kBinDG; // central activity seen (or not required)
223 return kBinNG; // no central activity
233 //------------------------------------------------------------------------------
234 void AliCDMesonBase::CheckRange(Double_t &var, Double_t min,
238 // check whether the value is with in the range specified with min and max
241 const Double_t eps = 1e-3;
242 if( var >= max ) var = max - eps;
243 if( var <= min ) var = min + eps;
247 //------------------------------------------------------------------------------
248 Int_t AliCDMesonBase::GetAxis(TString thntit, TString name)
251 // get the number of an axis, derived from the ThnSparse title (list of axes)
255 thntit.ReplaceAll(" ","");
256 const Int_t nmax = 20;
259 while(thntit.Contains(",")){
260 const Int_t pos = thntit.First(",");
261 tits[counter] = thntit(0, pos);
262 thntit = thntit(pos+1, thntit.Length()-pos);
265 printf("AliCDMesonBase AliCDMesonBase::GetAxis too small nmax! %d %d\n",
267 return -1; //exit(1); // TODO
270 tits[counter++] = thntit;
276 for(Int_t ii=0; ii<counter; ii++){
277 if( tits[ii] == name )
280 printf("AliCDMesonBase AliCDMesonBase::GetAxis !%s! %s not found!\n",
281 name.Data(), thntit.Data());
282 for(Int_t ii=0; ii<counter; ii++){
283 printf("*************** AliCDMesonBase::GetAxis *****************\n");
284 printf("AliCDMesonBase AliCDMesonBase::GetAxis %d !%s!\n", ii,
288 return -1; //exit(1); // TODO
292 //------------------------------------------------------------------------------
293 TString AliCDMesonBase::GetTitleMother()
296 // get the title of ThnMother (= list of axes)
299 TString title = "Ncombined, CombCh, CombPID, V0, FMD, SPD, TPC,";
300 title += " Mass, Pt, CTS, OA, DaughterPt, TrackResiduals, VertexZinRng,";
301 title += " ProcessType, VertexCoincidence, TrackletResiduals";
306 //------------------------------------------------------------------------------
307 THnSparseD * AliCDMesonBase::GetThnMother(TString name /* = "CDMeson_Mother" */)
309 // creates the THnSparse called Mother (used for the generation of invariant
310 // mass distributions)
313 const Int_t nbin[] = {
314 fgkNNcombined, fgkNCombCh, fgkNCombPID, fgkNGapConfig, fgkNGapConfig,
315 fgkNGapConfig, fgkNGapConfig, fgkNMass, fgkNMotherPt, fgkNCTS, fgkNOA,
316 fgkNDaughterPt, fgkNTrackResiduals, fgkNVertexZinRng, fgkNProcessType,
317 fgkNVertexCoincidence, fgkNTrackletResiduals
319 const Double_t binmin[] = {
320 fgkMinNcombined, fgkMinCombCh, fgkMinCombPID, fgkMinGapConfig,
321 fgkMinGapConfig, fgkMinGapConfig, fgkMinGapConfig, fgkMinMass,
322 fgkMinMotherPt, fgkMinCTS, fgkMinOA, fgkMinDaughterPt,
323 fgkMinTrackResiduals, fgkMinVertexZinRng, fgkMinProcessType,
324 fgkMinVertexCoincidence, fgkMinTrackletResiduals
326 const Double_t binmax[] = {
327 fgkMaxNcombined, fgkMaxCombCh, fgkMaxCombPID, fgkMaxGapConfig,
328 fgkMaxGapConfig, fgkMaxGapConfig, fgkMaxGapConfig, fgkMaxMass,
329 fgkMaxMotherPt, fgkMaxCTS, fgkMaxOA, fgkMaxDaughterPt,
330 fgkMaxTrackResiduals, fgkMaxVertexZinRng, fgkMaxProcessType,
331 fgkMaxVertexCoincidence, fgkMaxTrackletResiduals
334 const Int_t npar = sizeof(nbin)/sizeof(Int_t);
336 return new THnSparseD(name.Data(), GetTitleMother(), npar, nbin, binmin,
341 //------------------------------------------------------------------------------
342 void AliCDMesonBase::FillThnMother(THnSparseD *thn, Double_t vNch,
344 Double_t vCombPID, Double_t vV0,
345 Double_t vFMD, Double_t vSPD,
346 Double_t vTPC, Double_t vMass,
347 Double_t vPt, Double_t vOA,
349 Double_t vDaughterPt,
350 Double_t vTrackResiduals,
352 Double_t vProcessType,
353 Double_t vVertexCoincidence,
354 Double_t vTrkltResiduals)
361 vNch, vCombCh, vCombPID, vV0, vFMD, vSPD, vTPC, vMass, vPt, vOA, vCTS,
362 vDaughterPt, vTrackResiduals, vVertexZ, vProcessType, vVertexCoincidence,
365 const Int_t nv = sizeof(var)/sizeof(Double_t);
366 if(nv!=thn->GetNdimensions()){
367 printf("AliCDMesonBase::FillThnMother nv error!! %d %d\n", nv,
368 thn->GetNdimensions());
372 CheckRange(var[7], fgkMinMass, fgkMaxMass);
373 CheckRange(var[8], fgkMinMotherPt, fgkMaxMotherPt);
374 CheckRange(var[11], fgkMinDaughterPt, fgkMaxDaughterPt);
380 //------------------------------------------------------------------------------
381 Int_t AliCDMesonBase::GetAxisMother(TString name)
384 // return axis number corresponding to the name
387 return GetAxis(GetTitleMother(), name);
391 //------------------------------------------------------------------------------
392 TString AliCDMesonBase::GetTitleEmptyEvents()
395 // title / list of axes of the empty event study THnSparse
398 TString title = "EventType, FMD-A, FMD-C, SPD-I-A, SPD-I-C, SPD-O-A, SPD-O-C";
399 title += ", SPDtrkltA, SPDtrkltC";
400 title += ", fmdSum1I, fmdSum2I, fmdSum2O, fmdSum3I, fmdSum3O";
401 //title += ", TPC_all, TPC_diffVertex";
406 //------------------------------------------------------------------------------
407 THnSparseD* AliCDMesonBase::GetThnEmptyEvents()
409 // creates the THnSparse called Empty Events
410 // EventType, FMD-A, FMD-C, SPD-I-A, SPD-I-C, SPD-O-A, SPD-O-C, FMD1I..FMD3O
411 // TPC_all, TPC_diffVertex (not used so far)
413 const Int_t nbin[] = {
414 fgkNEventType, fgkNMultW, fgkNMultW, fgkNMult, fgkNMult, fgkNMult, fgkNMult,
415 fgkNMult, fgkNMult, fgkNMult, fgkNMult, fgkNMult, fgkNMult, fgkNMult
416 //, fgkNMult, fgkNMult
418 const Double_t binmin[] = {
419 fgkMinEventType, fgkMinMultW, fgkMinMultW, fgkMinMult, fgkMinMult,
420 fgkMinMult, fgkMinMult, fgkMinMult, fgkMinMult, fgkMinMult, fgkMinMult,
421 fgkMinMult, fgkMinMult, fgkMinMult //, fgkMinMult, fgkMinMult
423 const Double_t binmax[] = {
424 fgkMaxEventType, fgkMaxMultW, fgkMaxMultW, fgkMaxMult, fgkMaxMult,
425 fgkMaxMult, fgkMaxMult, fgkMaxMult, fgkMaxMult, fgkMaxMult, fgkMaxMult,
426 fgkMaxMult, fgkMaxMult, fgkMaxMult //, fgkMaxMult, fgkMaxMult
429 const Int_t npar = sizeof(nbin)/sizeof(Int_t);
431 return new THnSparseD("CDMeson_EmptyEvents", GetTitleEmptyEvents(), npar,
432 nbin, binmin, binmax);
436 //------------------------------------------------------------------------------
437 void AliCDMesonBase::FillThnEmptyEvents(THnSparseD * thn, Int_t eventType,
452 Int_t multTPCdiffVertex */)
455 // Fill ThnEmptyEvents
459 static_cast<Double_t>(eventType), static_cast<Double_t>(multFMDA), static_cast<Double_t>(multFMDC), static_cast<Double_t>(multSPDIA), static_cast<Double_t>(multSPDIC), static_cast<Double_t>(multSPDOA),
460 static_cast<Double_t>(multSPDOC), static_cast<Double_t>(multSPDtrkltA), static_cast<Double_t>(multSPDtrkltC), static_cast<Double_t>(fmdSum1I), static_cast<Double_t>(fmdSum2I), static_cast<Double_t>(fmdSum2O),
461 static_cast<Double_t>(fmdSum3I), static_cast<Double_t>(fmdSum3O)//, multTPC, multTPCdiffVertex
463 const Int_t nv = sizeof(var)/sizeof(Double_t);
464 if(nv!=thn->GetNdimensions()){
465 printf("AliCDMesonBase::FillThnEmptyEvents nv error!! %d %d\n", nv,
466 thn->GetNdimensions());
467 return; //exit(1); // TODO
474 //------------------------------------------------------------------------------
475 Int_t AliCDMesonBase::GetAxisEmptyEvents(TString name)
478 // return axis number corresponding to the name
481 return GetAxis(GetTitleEmptyEvents(), name);
485 //------------------------------------------------------------------------------
486 TString AliCDMesonBase::GetTitleMultiplicity()
489 // get title of the multiplicity study ThnSparse
492 TString title = "Nch, Nsoft, Ncombined, V0, FMD, SPD, TPC, NresidualTracks";
493 title += ", NresidualTracklets, VertexZ, VerticesDistance, ProcessType";
498 //------------------------------------------------------------------------------
499 THnSparseD* AliCDMesonBase::GetThnMultiplicity()
502 // creates the THnSparse called Multiplicity
505 const Int_t nbin[] = {
506 fgkNNch, fgkNNsoft, fgkNNcomb,fgkNGapConfig, fgkNGapConfig,
507 fgkNGapConfig, fgkNGapConfig, fgkNNresidualTracks, fgkNNresidualTracklets,
508 fgkNVertexZ, fgkNVerticesDistance, fgkNProcessType
510 const Double_t binmin[] = {
511 fgkMinNch, fgkMinNsoft, fgkMinNcomb, fgkMinGapConfig, fgkMinGapConfig,
512 fgkMinGapConfig, fgkMinGapConfig, fgkMinNresidualTracks,
513 fgkMinNresidualTracklets, fgkMinVertexZ, fgkMinVerticesDistance,
516 const Double_t binmax[] = {
517 fgkMaxNch, fgkMaxNsoft, fgkMaxNcomb, fgkMaxGapConfig, fgkMaxGapConfig,
518 fgkMaxGapConfig, fgkMaxGapConfig, fgkMaxNresidualTracks,
519 fgkMaxNresidualTracklets, fgkMaxVertexZ, fgkMaxVerticesDistance,
523 const Int_t npar = sizeof(nbin)/sizeof(Int_t);
525 return new THnSparseD("CDMeson_Multiplicity", GetTitleMultiplicity(), npar,
526 nbin, binmin, binmax);
530 //------------------------------------------------------------------------------
531 void AliCDMesonBase::FillThnMultiplicity(THnSparseD *thn, Double_t vNch,
538 Double_t vNresidualTracks,
539 Double_t vNresidualTracklets,
541 Double_t vVerticesDistance,
542 Double_t vProcessType)
544 // fill ThnMultiplicity
545 // input list copied from GetTitle
546 // var[] copied from GetTitle
549 vNch, vNsoft, vNcombined, vV0, vFMD, vSPD, vTPC, vNresidualTracks,
550 vNresidualTracklets, vVertexZ, vVerticesDistance, vProcessType
552 const Int_t nv = sizeof(var)/sizeof(Double_t);
553 if(nv!=thn->GetNdimensions()){
554 printf("AliCDMesonBase::FillThnMultiplicity nv error!! %d %d\n", nv,
555 thn->GetNdimensions());
563 //------------------------------------------------------------------------------
564 Int_t AliCDMesonBase::GetAxisMultiplicity(TString name)
567 // return axis number corresponding to the name
570 return GetAxis(GetTitleMultiplicity(), name);
574 //------------------------------------------------------------------------------
575 TH1F* AliCDMesonBase::GetHistStatsFlow()
578 // setup the stats flow histogram
581 TH1F *hist = new TH1F("c00_statsFlow", "", AliCDMesonBase::kBinLastValue,
582 0, AliCDMesonBase::kBinLastValue);
583 TAxis* axis = hist->GetXaxis();
584 axis->SetBinLabel(AliCDMesonBase::kBinTotalInput+1, "total Input");
585 axis->SetBinLabel(AliCDMesonBase::kBinGoodInput+1, "good ESDs");
586 axis->SetBinLabel(AliCDMesonBase::kBinV0OR+1, "V0-OR");
587 axis->SetBinLabel(AliCDMesonBase::kBinV0AND+1, "V0-AND");
588 axis->SetBinLabel(AliCDMesonBase::kBinEventsAfterCuts+1, "after cuts");
589 axis->SetBinLabel(AliCDMesonBase::kBinEventsWithOutPileUp+1, "w/o pile up");
590 axis->SetBinLabel(AliCDMesonBase::kBinv0Gap+1, "with V0 DG gap");
591 axis->SetBinLabel(AliCDMesonBase::kBinv0fmdGap+1, "with V0-FMD DG gap");
592 axis->SetBinLabel(AliCDMesonBase::kBinv0fmdspdGap+1,
593 "with V0-FMD-SPD DG gap");
594 axis->SetBinLabel(AliCDMesonBase::kBinv0fmdspdtpcGap+1,
595 "with V0-FMD-SPD-TPC DG gap");
596 axis->SetBinLabel(AliCDMesonBase::kBinv0fmdspdtpczdcGap+1,
597 "with V0-FMD-SPD-TPC-ZDC DG gap");
598 axis->SetBinLabel(AliCDMesonBase::kBinfmdGap+1, "with FMD DG gap");
599 axis->SetBinLabel(AliCDMesonBase::kBinspdGap+1, "with SPD DG gap");
600 axis->SetBinLabel(AliCDMesonBase::kBintpcGap+1, "with TPC DG gap");
601 axis->SetBinLabel(AliCDMesonBase::kBintpcspdGap+1, "width TPC-SPD DG gap");
602 axis->SetBinLabel(AliCDMesonBase::kBintpcspdfmdGap+1,
603 "width TPC-SPD-FMD DG gap");
604 axis->SetBinLabel(AliCDMesonBase::kBintpcspdfmdv0Gap+1,
605 "width TPC-SPD-FMD-V0 DG gap");
606 axis->SetBinLabel(AliCDMesonBase::kBinspdfmdGap+1, "with SPD FMD gap");
607 axis->SetBinLabel(AliCDMesonBase::kBinspdfmdv0Gap+1, "with SPD FMD V0 gap");
608 axis->SetBinLabel(AliCDMesonBase::kBinTwoTrackEvents+1, "with two tracks");
609 axis->SetBinLabel(AliCDMesonBase::kBinThreeTrackEvents+1,
610 "with three tracks");
611 axis->SetBinLabel(AliCDMesonBase::kBinPionEvents+1, "with two pions");
612 axis->SetBinLabel(AliCDMesonBase::kBinKaonEvents+1, "with two kaons");
613 axis->SetBinLabel(AliCDMesonBase::kBinProtonEvents+1, "with two proton");
614 axis->SetBinLabel(AliCDMesonBase::kBinElectronEvents+1, "with two electron");
615 axis->SetBinLabel(AliCDMesonBase::kBinUnknownPIDEvents+1, "with unknown PID");
616 axis->SetBinLabel(AliCDMesonBase::kBinResidualTracks+1,
617 "without residual tracks");
618 axis->SetBinLabel(AliCDMesonBase::kBinResidualTracklets+1,
619 "without residual tracklets");
620 axis->SetBinLabel(AliCDMesonBase::kBinCDonlyEvents+1, "CD only events");
625 //------------------------------------------------------------------------------
626 TH2F* AliCDMesonBase::GetHistPIDStudies(TString name)
629 // setup the PID studies histogram
632 TH2F *hist = new TH2F(name.Data(), ";particle 1;particle 2",
633 AliCDMesonBase::kBinPIDUnknown,
634 AliCDMesonBase::kBinPionE,
635 AliCDMesonBase::kBinPIDUnknown+1,
636 AliCDMesonBase::kBinPIDUnknown,
637 AliCDMesonBase::kBinPionE,
638 AliCDMesonBase::kBinPIDUnknown+1);
639 TAxis* x = hist->GetXaxis();
640 TAxis* y = hist->GetYaxis();
641 x->SetBinLabel(AliCDMesonBase::kBinPionE, "#pi (ex)");
642 x->SetBinLabel(AliCDMesonBase::kBinPion, "#pi");
643 x->SetBinLabel(AliCDMesonBase::kBinSinglePion, "-");
644 x->SetBinLabel(AliCDMesonBase::kBinKaonE, "K (ex)");
645 x->SetBinLabel(AliCDMesonBase::kBinKaon, "K");
646 x->SetBinLabel(AliCDMesonBase::kBinSingleKaon, ",");
647 x->SetBinLabel(AliCDMesonBase::kBinProtonE, "p (ex)");
648 x->SetBinLabel(AliCDMesonBase::kBinProton, "p");
649 x->SetBinLabel(AliCDMesonBase::kBinSingleProton, "_");
650 x->SetBinLabel(AliCDMesonBase::kBinElectronE, "e (ex)");
651 x->SetBinLabel(AliCDMesonBase::kBinElectron, "e");
652 x->SetBinLabel(AliCDMesonBase::kBinSingleElectron, ".");
653 x->SetBinLabel(AliCDMesonBase::kBinPIDUnknown, "X");
654 y->SetBinLabel(AliCDMesonBase::kBinPionE, "#pi (ex)");
655 y->SetBinLabel(AliCDMesonBase::kBinPion, "#pi");
656 y->SetBinLabel(AliCDMesonBase::kBinSinglePion, "-");
657 y->SetBinLabel(AliCDMesonBase::kBinKaonE, "K (ex)");
658 y->SetBinLabel(AliCDMesonBase::kBinKaon, "K");
659 y->SetBinLabel(AliCDMesonBase::kBinSingleKaon, ",");
660 y->SetBinLabel(AliCDMesonBase::kBinProtonE, "p (ex)");
661 y->SetBinLabel(AliCDMesonBase::kBinProton, "p");
662 y->SetBinLabel(AliCDMesonBase::kBinSingleProton, "_");
663 y->SetBinLabel(AliCDMesonBase::kBinElectronE, "e (ex)");
664 y->SetBinLabel(AliCDMesonBase::kBinElectron, "e");
665 y->SetBinLabel(AliCDMesonBase::kBinSingleElectron, ".");
666 y->SetBinLabel(AliCDMesonBase::kBinPIDUnknown, "X");
671 //------------------------------------------------------------------------------
672 TObjArray* AliCDMesonBase::GetHistVZEROStudies(TList* l)
675 // Create Histograms for the VZERO trigger studies
678 TObjArray* arr = new TObjArray(130);
681 for (Int_t iPMT = 0; iPMT < 64; ++iPMT) {
682 o = (TObject*)new TH2F(Form("h00_%02d_ADC_TriggerThr", iPMT),
683 ";ADC Counts;Trigger Threshold (ADC Counts)",
684 400, 0., 4000., 48, 2., 50.);
688 for (Int_t iPMT = 0; iPMT < 64; ++iPMT) {
689 o = (TObject*)new TH2F(Form("h01_%02d_ADC_Multiplicity", iPMT),
690 ";ADC Counts;Multiplicity",
691 400, 0., 4000., 250, 0., 250.);
696 // not of use for pp data in 2010
697 o = (TObject*)new TH2F("h02_TriggerChargeA_Trigger",
698 ";Trigger Charge A;Trigger Decision A",
699 250, 0., 5000., 2, 0., 2.);
702 o = (TObject*)new TH2F("h03__TriggerChargeC_Trigger",
703 ";Trigger Charge C;Trigger Decision C",
704 250, 0., 5000., 2, 0., 2.);
713 //------------------------------------------------------------------------------
714 void AliCDMesonBase::GetGapTriggers(THnSparseI* gaprun, Int_t gapCondition,
715 Int_t run, Double_t& triggers,
718 // determine the number of certain triggers with a gap in the detectors
719 // specified by gapCondition in run and the total number of events
720 // surviving all cuts (including pile-up rejection)
724 Int_t nTuple[] = { gaprun->GetAxis(0)->FindBin(run), 0 };
725 for (Int_t i = 0; i< kBitGapMax; ++i) {
727 Double_t temp = gaprun->GetBinContent(nTuple);
728 if (!(i & gapCondition)) {
736 //------------------------------------------------------------------------------
737 void AliCDMesonBase::GetNoGapTriggers(THnSparseI* gaprun, Int_t gapCondition,
738 Int_t run, Double_t& triggers,
741 // determine the number of certain triggers with a NO gap in the detectors
742 // specified by the gapCondition in run and the total number of events
743 // surviving all cuts (including pile-up rejection)
747 Int_t nTuple[] = { gaprun->GetAxis(0)->FindBin(run), 0 };
748 for (Int_t i = 0; i< kBitGapMax; ++i) {
750 Double_t temp = gaprun->GetBinContent(nTuple);
751 if (i & gapCondition) {