AliPhysics  ef3b16e (ef3b16e)
AliAnalysisTaskHadronicCocktailMC.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: Friederike Bock, Lucas Altenk√§mper *
5  * Version 1.0 *
6  * *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  **************************************************************************/
16 
18 //----------------------------------------------------------------
19 // Class used to do analysis on hadronic cocktail output
20 //----------------------------------------------------------------
22 #include "TChain.h"
23 #include "TTree.h"
24 #include "TBranch.h"
25 #include "TFile.h"
26 #include "TF1.h"
27 #include "TH1F.h"
28 #include "TH1D.h"
29 #include "TH2F.h"
30 #include "TObject.h"
31 #include "TObjArray.h"
32 #include "TProfile.h"
33 #include "THnSparse.h"
34 #include "TCanvas.h"
35 #include "TNtuple.h"
36 #include "AliAnalysisTask.h"
37 #include "AliAnalysisManager.h"
38 #include "AliESDEvent.h"
39 #include "AliESDInputHandler.h"
40 #include "AliMCEventHandler.h"
41 #include "AliMCEvent.h"
42 #include "AliMCParticle.h"
44 #include "AliVParticle.h"
45 #include "AliEventplane.h"
46 #include "AliInputEventHandler.h"
47 #include "AliMCGenHandler.h"
48 #include "AliGenEMCocktailV2.h"
49 #include "AliGenerator.h"
50 #include "AliPythia6.h"
51 #include <map>
52 #include <vector>
53 #include <algorithm>
54 
56 
57 //________________________________________________________________________
59  fOutputContainer(NULL),
60  fInputEvent(NULL),
61  fMCEvent(NULL),
62  fMCGenHandler(NULL),
63  fMCGenerator(NULL),
64  fMCCocktailGen(NULL),
65  fAnalyzedMeson(0),
66  fAnalyzeNeutralPi(kFALSE),
67  fAnalyzeChargedPi(kFALSE),
68  fDoLightOutput(kFALSE),
69  fHasMother{kFALSE},
70  fHistNEvents(NULL),
71  fHistPtPhiDaughterSource(NULL),
72  fHistPtPhiInput(NULL),
73  fHistPtYInput(NULL),
74  fHistPtYDaughterSource(NULL),
75  fHistDecayChannelsInput(NULL),
76  fHistPythiaBR(NULL),
77  fHistPtDaughterPtSourceInput(NULL),
78  fHistPhiDaughterPhiSourceInput(NULL),
79  fHistPdgInputRest(NULL),
80  fHistPdgDaughterSourceRest(NULL),
81  fHistPtYGammaFromXFromInput(NULL),
82  fHistPtPhiGammaFromXFromInput(NULL),
83  fHistPtYGammaFromPi0FromInput(NULL),
84  fHistPtPhiGammaFromPi0FromInput(NULL),
85  fParticleList(NULL),
86  fParticleListNames(NULL),
87  fPtParametrization{NULL},
88  fPtParametrizationProton(NULL),
89  fPtParametrizationPi0(NULL),
90  fCocktailSettings{NULL},
91  fMtScalingFactors(NULL),
92  fPtYDistributions{NULL},
93  fUserInfo(NULL),
94  fOutputTree(NULL),
95  fIsMC(1),
96  fMaxY(2),
97  fMaxEta(0)
98 {
99 
100 }
101 
102 //________________________________________________________________________
104  AliAnalysisTaskSE(name),
105  fOutputContainer(NULL),
106  fInputEvent(NULL),
107  fMCEvent(NULL),
108  fMCGenHandler(NULL),
109  fMCGenerator(NULL),
110  fMCCocktailGen(NULL),
111  fAnalyzedMeson(0),
112  fAnalyzeNeutralPi(kFALSE),
113  fAnalyzeChargedPi(kFALSE),
114  fDoLightOutput(kFALSE),
115  fHasMother{kFALSE},
116  fHistNEvents(NULL),
118  fHistPtPhiInput(NULL),
119  fHistPtYInput(NULL),
122  fHistPythiaBR(NULL),
125  fHistPdgInputRest(NULL),
131  fParticleList(NULL),
132  fParticleListNames(NULL),
133  fPtParametrization{NULL},
135  fPtParametrizationPi0(NULL),
136  fCocktailSettings{NULL},
137  fMtScalingFactors(NULL),
138  fPtYDistributions{NULL},
139  fUserInfo(NULL),
140  fOutputTree(NULL),
141  fIsMC(1),
142  fMaxY(2),
143  fMaxEta(0)
144 {
145  // Define output slots here
146  DefineOutput(1, TList::Class());
147 }
148 
150 {
151  for (Int_t i=0; i<12; i++) {
152  if (fCocktailSettings[i]) delete fCocktailSettings[i];
153  }
154 }
155 
156 //________________________________________________________________________
158 
159  // Create histograms
160  if(fOutputContainer != NULL){
161  delete fOutputContainer;
162  fOutputContainer = NULL;
163  }
164  if(fOutputContainer == NULL){
165  fOutputContainer = new TList();
166  fOutputContainer->SetOwner(kTRUE);
167  }
168 
169  TString fAnalyzedParticle = "";
170  if (fAnalyzedMeson==0) fAnalyzedParticle = "Pi0";
171  else if (fAnalyzedMeson==1) fAnalyzedParticle = "Eta";
172  else if (fAnalyzedMeson==2) fAnalyzedParticle = "Pi+-";
173  else AliFatalClass("Analyzed particle not recognized!");
174 
175  // tree + user info list to protect contents from merging
176  fOutputTree = new TTree("cocktailSettings", "cocktailSettings");
177  fUserInfo = (TList*)fOutputTree->GetUserInfo();
178 
179  fMCGenHandler = (AliMCGenHandler*)AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler();
180  fMCGenerator = fMCGenHandler->GetGenerator();
181  TString mcGeneratorClassName = "";
182  if (fMCGenerator) mcGeneratorClassName = fMCGenerator->ClassName();
183 
184  if (mcGeneratorClassName.CompareTo("AliGenEMCocktailV2") == 0) {
185 
186  fMCCocktailGen = (AliGenEMCocktailV2*)fMCGenerator;
187 
188  // has mother i
189  SetHasMother((UInt_t)fMCCocktailGen->GetSelectedMothers());
190 
191  // pt parametrizations
193  for (Int_t i=0; i<24; i++) {
194  if (fHasMother[i]) fUserInfo->Add(fPtParametrization[i]);
195  }
198 
199  // cocktail settings
201  fMCCocktailGen->GetPtRange(ptMin, ptMax);
202  fCocktailSettings[0] = new TObjString(Form("collSys_%d", fMCCocktailGen->GetCollisionSystem()));
203  fCocktailSettings[1] = new TObjString(Form("cent_%d", fMCCocktailGen->GetCentrality()));
204  fCocktailSettings[2] = new TObjString(Form("decayMode_%.0f", fMCCocktailGen->GetDecayMode()));
205  fCocktailSettings[3] = new TObjString(Form("selectMothers_%d", fMCCocktailGen->GetSelectedMothers()));
206  fCocktailSettings[4] = new TObjString(Form("paramFile_%s", (fMCCocktailGen->GetParametrizationFile()).Data()));
207  fCocktailSettings[5] = new TObjString(Form("paramDir_%s", (fMCCocktailGen->GetParametrizationFileDirectory()).Data()));
208  fCocktailSettings[6] = new TObjString(Form("nParticles_%d", fMCCocktailGen->GetNumberOfParticles()));
209  fCocktailSettings[7] = new TObjString(Form("ptMin_%.2f", ptMin));
210  fCocktailSettings[8] = new TObjString(Form("ptMax_%.2f", ptMax));
211  fCocktailSettings[9] = new TObjString(Form("weightMode_%.0f", fMCCocktailGen->GetWeightingMode()));
212  fCocktailSettings[10] = new TObjString(Form("dynamicalPtRange_%d",fMCCocktailGen->GetDynamicalPtRangeOption()));
213  fCocktailSettings[11] = new TObjString(Form("yWeights_%d", fMCCocktailGen->GetYWeightOption()));
214  for (Int_t i=0; i<12; i++) fUserInfo->Add(fCocktailSettings[i]);
215 
216  // mt scaling params
217  fMtScalingFactors = (TH1D*)fMCCocktailGen->GetMtScalingFactors();
219 
220  // pt-y distributions
222  for (Int_t i=0; i<24; i++) {
223  if (fHasMother[i]) fUserInfo->Add(fPtYDistributions[i]);
224  }
225  } else {
226  for (Int_t i=0; i<24; i++) fHasMother[i] = kTRUE;
227  }
228 
229  fHistNEvents = (TH1F*)SetHist1D(fHistNEvents,"f","NEvents","","N_{evt}",1,0,1, kTRUE);
231 
232  const Int_t nInputParticles = 24;
233  Int_t fParticleList_local[] = {221,310,130,3122,113,331,223,213,-213,333,443,2114,2214,1114,2224,321,-321,-3334,3334,-3312,3312,3224,3114,313};
234  TString fParticleListNames_local[] = {"Eta","K0s","K0l","Lambda","rho0","EtaPrim","omega","rho+","rho-","phi","J/psi","Delta0","Delta+","Delta-","Delta++",
235  "K+","K-","Omega+","Omega-","Xi+","Xi-","Sigma(1385)+", "Sigma(1385)-","K*(892)0"};
236 
237  // pi0/eta/pi+- from X
238  fParticleList = fParticleList_local;
239  fParticleListNames = fParticleListNames_local;
240  fHistPtYInput = new TH2F*[nInputParticles];
241  fHistPtYDaughterSource = new TH2F*[nInputParticles];
242  fHistDecayChannelsInput = new TH1F*[nInputParticles];
243  fHistPythiaBR = new TH1F*[nInputParticles];
244  fHistPtPhiDaughterSource = new TH2F*[nInputParticles];
245  fHistPtPhiInput = new TH2F*[nInputParticles];
246  fHistPtDaughterPtSourceInput = new TH2F*[nInputParticles];
247  fHistPhiDaughterPhiSourceInput = new TH2F*[nInputParticles];
248  for(Int_t i=0; i<nInputParticles; i++){
249  if (fHasMother[i]) {
250  fHistPtYInput[i] = (TH2F*)SetHist2D(fHistPtYInput[i],"f", Form("Pt_Y_%s",fParticleListNames[i].Data()),"#it{p}_{T}","Y", 1000, 0, 50, 400, -2.0, 2.0, kTRUE);
252 
253  // pi0/eta/pi+- from certain mother
254  fHistPtYDaughterSource[i] = (TH2F*)SetHist2D(fHistPtYDaughterSource[i],"f", Form("Pt_Y_%s_From_%s",fAnalyzedParticle.Data(),fParticleListNames[i].Data()),"#it{p}_{T}","Y",
255  1000, 0, 50, 400, -2.0, 2.0, kTRUE);
257 
258  // phi distributions
259  fHistPtPhiInput[i] = (TH2F*)SetHist2D(fHistPtPhiInput[i],"f", Form("Pt_Phi_%s",fParticleListNames[i].Data()),"#it{p}_{T}","#phi", 1000, 0, 50, 100, 0, 2*TMath::Pi(), kTRUE);
261 
262  fHistPtPhiDaughterSource[i] = (TH2F*)SetHist2D(fHistPtPhiDaughterSource[i],"f", Form("Pt_Phi_%s_From_%s",fAnalyzedParticle.Data(),fParticleListNames[i].Data()),"#it{p}_{T}","#phi",
263  1000, 0, 50, 100, 0, 7, kTRUE);
265 
266  // correlation gamma from certain mother to mother
267  fHistPtDaughterPtSourceInput[i] = (TH2F*)SetHist2D(fHistPtDaughterPtSourceInput[i],"f", Form("Pt%s_PtMother_%s",fAnalyzedParticle.Data(),fParticleListNames[i].Data()),
268  "#it{p}_{T,daughter}","#it{p}_{T,mother}", 1000, 0, 50, 1000, 0, 50, kTRUE);
270 
272  Form("Phi%s_PhiMother_%s",fAnalyzedParticle.Data(),fParticleListNames[i].Data()),"#phi_{daughter}","#phi_{mother}",
273  100, 0, 7, 100, 0, 7, kTRUE);
275 
276  // decay channels mother
277  fHistDecayChannelsInput[i] = (TH1F*)SetHist1D(fHistDecayChannelsInput[i],"f", Form("DecayChannels_%s",fParticleListNames[i].Data()),"","", 20, -0.5, 19.5, kTRUE);
280 
281  // BR from pythia
282  fHistPythiaBR[i] = (TH1F*)SetHist1D(fHistPythiaBR[i],"f", Form("PythiaBR_%s",fParticleListNames[i].Data()),"","", 20, -0.5, 19.5, kTRUE);
285  fUserInfo->Add(fHistPythiaBR[i]);
286  } else {
287  fHistPtYInput[i] = NULL;
288  fHistPtYDaughterSource[i] = NULL;
289  fHistPtPhiInput[i] = NULL;
290  fHistPtPhiDaughterSource[i] = NULL;
293  fHistDecayChannelsInput[i] = NULL;
294  fHistPythiaBR[i] = NULL;
295  }
296  }
297 
298  // gamma from X (or pi0) from X
303  for (Int_t i = 0; i<3; i++) {
304  if (fHasMother[i+1]) {
305 
306  fHistPtYGammaFromXFromInput[i] = (TH2F*)SetHist2D(fHistPtYGammaFromXFromInput[i],"f", Form("Pt_Y_Gamma_From_X_From_%s",fParticleListNames[i+1].Data()),"#it{p}_{T}","Y",
307  1000, 0, 50, 400, -2.0, 2.0, kTRUE);
309 
310  fHistPtYGammaFromPi0FromInput[i] = (TH2F*)SetHist2D(fHistPtYGammaFromPi0FromInput[i],"f", Form("Pt_Y_Gamma_From_Pi0_From_%s",fParticleListNames[i+1].Data()),"#it{p}_{T}","Y",
311  1000, 0, 50, 400, -2.0, 2.0, kTRUE);
313 
314  fHistPtPhiGammaFromXFromInput[i] = (TH2F*)SetHist2D(fHistPtPhiGammaFromXFromInput[i],"f", Form("Pt_Phi_Gamma_From_X_From_%s",fParticleListNames[i+1].Data()),"#it{p}_{T}","#phi",
315  1000, 0, 50, 100, 0, 2*TMath::Pi(), kTRUE);
317 
318  fHistPtPhiGammaFromPi0FromInput[i] = (TH2F*)SetHist2D(fHistPtPhiGammaFromPi0FromInput[i],"f", Form("Pt_Phi_Gamma_From_Pi0_From_%s",fParticleListNames[i+1].Data()),"#it{p}_{T}","#phi",
319  1000, 0, 50, 100, 0, 2*TMath::Pi(), kTRUE);
321 
322  } else {
323  fHistPtYGammaFromXFromInput[i] = NULL;
327  }
328  }
329 
330  fHistPdgInputRest = (TH1I*)SetHist1D(fHistPdgInputRest,"f","Pdg_primary_rest","PDG code","",5000, 0, 5000, kTRUE);
332 
333  fHistPdgDaughterSourceRest = (TH1I*)SetHist1D(fHistPdgDaughterSourceRest,"f", Form("Pdg_%s_From_rest",fAnalyzedParticle.Data()),"PDG code mother","",5000, 0, 5000, kTRUE);
335 
337 
338  PostData(1, fOutputContainer);
339 }
340 
341 //_____________________________________________________________________________
343 {
344 
345  fInputEvent = InputEvent();
346 
347  fMCEvent = MCEvent();
348  if(fMCEvent == NULL) fIsMC = 0;
349  if (fIsMC==0) return;
350 
351  fHistNEvents->Fill(0.5);
353 
354  PostData(1, fOutputContainer);
355 }
356 
357 //_____________________________________________________________________________
359 {
360  if (!fMCCocktailGen) return;
361 
362  for (Int_t i=0; i<24; i++) fPtParametrization[i] = NULL;
364  fPtParametrizationPi0 = NULL;
365 
366  TF1* fct = NULL;
367  TString fctName = "";
368  for (Int_t i=0; i<27; i++) {
369  fct = (TF1*)fMCCocktailGen->GetPtParametrization(i);
370  if (fct) {
371  fctName = fct->GetName();
372  if (fctName.BeginsWith("221_pt") && fHasMother[0]) fPtParametrization[0] = fct;
373  if (fctName.BeginsWith("310_pt") && fHasMother[1]) fPtParametrization[1] = fct;
374  if (fctName.BeginsWith("130_pt") && fHasMother[2]) fPtParametrization[2] = fct;
375  if (fctName.BeginsWith("3122_pt") && fHasMother[3]) fPtParametrization[3] = fct;
376  if (fctName.BeginsWith("113_pt") && fHasMother[4]) fPtParametrization[4] = fct;
377  if (fctName.BeginsWith("331_pt") && fHasMother[5]) fPtParametrization[5] = fct;
378  if (fctName.BeginsWith("223_pt") && fHasMother[6]) fPtParametrization[6] = fct;
379  if (fctName.BeginsWith("213_pt") && fHasMother[7]) fPtParametrization[7] = fct;
380  if (fctName.BeginsWith("-213_pt") && fHasMother[8]) fPtParametrization[8] = fct;
381  if (fctName.BeginsWith("333_pt") && fHasMother[9]) fPtParametrization[9] = fct;
382  if (fctName.BeginsWith("443_pt") && fHasMother[10]) fPtParametrization[10] = fct;
383  if (fctName.BeginsWith("2114_pt") && fHasMother[11]) fPtParametrization[11] = fct;
384  if (fctName.BeginsWith("2214_pt") && fHasMother[12]) fPtParametrization[12] = fct;
385  if (fctName.BeginsWith("1114_pt") && fHasMother[13]) fPtParametrization[13] = fct;
386  if (fctName.BeginsWith("2224_pt") && fHasMother[14]) fPtParametrization[14] = fct;
387  if (fctName.BeginsWith("321_pt") && fHasMother[15]) fPtParametrization[15] = fct;
388  if (fctName.BeginsWith("-321_pt") && fHasMother[16]) fPtParametrization[16] = fct;
389  if (fctName.BeginsWith("-3334_pt") && fHasMother[17]) fPtParametrization[17] = fct;
390  if (fctName.BeginsWith("3334_pt") && fHasMother[18]) fPtParametrization[18] = fct;
391  if (fctName.BeginsWith("-3312_pt") && fHasMother[19]) fPtParametrization[19] = fct;
392  if (fctName.BeginsWith("3312_pt") && fHasMother[20]) fPtParametrization[20] = fct;
393  if (fctName.BeginsWith("3224_pt") && fHasMother[21]) fPtParametrization[21] = fct;
394  if (fctName.BeginsWith("3114_pt") && fHasMother[22]) fPtParametrization[22] = fct;
395  if (fctName.BeginsWith("313_pt") && fHasMother[23]) fPtParametrization[23] = fct;
396  if (fctName.BeginsWith("2212_pt")) fPtParametrizationProton = fct;
397  if (fctName.BeginsWith("111_pt")) fPtParametrizationPi0 = fct;
398  }
399  }
400 }
401 
402 //_____________________________________________________________________________
404 {
405  if (!fMCCocktailGen) return;
406 
407  for (Int_t i=0; i<24; i++) fPtYDistributions[i] = NULL;
408 
409  TH2F* tempPtY = NULL;
410  TString tempPtYName = "";
411  for (Int_t i=0; i<26; i++) {
412  tempPtY = (TH2F*)fMCCocktailGen->GetPtYDistribution(i);
413  if (tempPtY) {
414  tempPtYName = tempPtY->GetName();
415  if (tempPtYName.BeginsWith("221_pt_y") && fHasMother[0]) fPtYDistributions[0] = tempPtY;
416  if (tempPtYName.BeginsWith("310_pt_y") && fHasMother[1]) fPtYDistributions[1] = tempPtY;
417  if (tempPtYName.BeginsWith("130_pt_y") && fHasMother[2]) fPtYDistributions[2] = tempPtY;
418  if (tempPtYName.BeginsWith("3122_pt_y") && fHasMother[3]) fPtYDistributions[3] = tempPtY;
419  if (tempPtYName.BeginsWith("113_pt_y") && fHasMother[4]) fPtYDistributions[4] = tempPtY;
420  if (tempPtYName.BeginsWith("331_pt_y") && fHasMother[5]) fPtYDistributions[5] = tempPtY;
421  if (tempPtYName.BeginsWith("223_pt_y") && fHasMother[6]) fPtYDistributions[6] = tempPtY;
422  if (tempPtYName.BeginsWith("213_pt_y") && fHasMother[7]) fPtYDistributions[7] = tempPtY;
423  if (tempPtYName.BeginsWith("-213_pt_y") && fHasMother[8]) fPtYDistributions[8] = tempPtY;
424  if (tempPtYName.BeginsWith("333_pt_y") && fHasMother[9]) fPtYDistributions[9] = tempPtY;
425  if (tempPtYName.BeginsWith("443_pt_y") && fHasMother[10]) fPtYDistributions[10] = tempPtY;
426  if (tempPtYName.BeginsWith("2114_pt_y") && fHasMother[11]) fPtYDistributions[11] = tempPtY;
427  if (tempPtYName.BeginsWith("2214_pt_y") && fHasMother[12]) fPtYDistributions[12] = tempPtY;
428  if (tempPtYName.BeginsWith("1114_pt_y") && fHasMother[13]) fPtYDistributions[13] = tempPtY;
429  if (tempPtYName.BeginsWith("2224_pt_y") && fHasMother[14]) fPtYDistributions[14] = tempPtY;
430  if (tempPtYName.BeginsWith("321_pt_y") && fHasMother[15]) fPtYDistributions[15] = tempPtY;
431  if (tempPtYName.BeginsWith("-321_pt_y") && fHasMother[16]) fPtYDistributions[16] = tempPtY;
432  if (tempPtYName.BeginsWith("-3334_pt_y") && fHasMother[17]) fPtYDistributions[17] = tempPtY;
433  if (tempPtYName.BeginsWith("3334_pt_y") && fHasMother[18]) fPtYDistributions[18] = tempPtY;
434  if (tempPtYName.BeginsWith("-3312_pt_y") && fHasMother[19]) fPtYDistributions[19] = tempPtY;
435  if (tempPtYName.BeginsWith("3312_pt_y") && fHasMother[20]) fPtYDistributions[20] = tempPtY;
436  if (tempPtYName.BeginsWith("3224_pt_y") && fHasMother[21]) fPtYDistributions[21] = tempPtY;
437  if (tempPtYName.BeginsWith("3114_pt_y") && fHasMother[22]) fPtYDistributions[22] = tempPtY;
438  if (tempPtYName.BeginsWith("313_pt_y") && fHasMother[23]) fPtYDistributions[23] = tempPtY;
439  }
440  }
441 }
442 
443 //_____________________________________________________________________________
445 
446  for (Int_t i=0; i<24; i++) fHasMother[i] = kFALSE;
447 
448  // selects mother particles according to choice and possible decays (i.e. into pi/pi+-/eta)
449  if ( (selectedMothers&AliGenEMCocktailV2::kGenEta) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[0] = kTRUE;
450  if ( (selectedMothers&AliGenEMCocktailV2::kGenK0s) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[1] = kTRUE;
451  if ( (selectedMothers&AliGenEMCocktailV2::kGenK0l) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[2] = kTRUE;
452  if ( (selectedMothers&AliGenEMCocktailV2::kGenLambda) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[3] = kTRUE;
453  if ( selectedMothers&AliGenEMCocktailV2::kGenRho0) fHasMother[4] = kTRUE;
454  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenEtaprime)) fHasMother[5] = kTRUE;
455  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenOmega)) fHasMother[6] = kTRUE;
456  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenRhoPl)) fHasMother[7] = kTRUE;
457  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenRhoMi)) fHasMother[8] = kTRUE;
458  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenPhi)) fHasMother[9] = kTRUE;
459  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenJpsi)) fHasMother[10] = kTRUE;
460  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenDeltaZero) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[11] = kTRUE;
461  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenDeltaPl) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[12] = kTRUE;
462  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenDeltaMi) && fAnalyzeChargedPi) fHasMother[13] = kTRUE;
463  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenDeltaPlPl) && fAnalyzeChargedPi) fHasMother[14] = kTRUE;
464  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenKPl) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[15] = kTRUE;
465  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenKMi) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[16] = kTRUE;
466  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenOmegaPl) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[17] = kTRUE;
467  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenOmegaMi) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[18] = kTRUE;
468  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenXiPl) && fAnalyzeChargedPi) fHasMother[19] = kTRUE;
469  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenXiMi) && fAnalyzeChargedPi) fHasMother[20] = kTRUE;
470  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenSigmaPl) && fAnalyzeChargedPi) fHasMother[21] = kTRUE;
471  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenSigmaMi) && fAnalyzeChargedPi) fHasMother[22] = kTRUE;
472  if (!fDoLightOutput && (selectedMothers&AliGenEMCocktailV2::kGenK0star) && (fAnalyzeNeutralPi || fAnalyzeChargedPi)) fHasMother[23] = kTRUE;
473 }
474 
475 //________________________________________________________________________
477 
478  // Loop over all primary MC particle
479  for(Long_t i = 0; i < fMCEvent->GetNumberOfTracks(); i++) {
480  // fill primary histograms
481  TParticle* particle = NULL;
482  particle = (TParticle *)fMCEvent->Particle(i);
483  if (!particle) continue;
484  Bool_t hasMother = kFALSE;
485  Bool_t particleIsPrimary = kTRUE;
486 
487  if (particle->GetMother(0)>-1){
488  hasMother = kTRUE;
489  particleIsPrimary = kFALSE;
490  }
491  TParticle* motherParticle = NULL;
492  if (hasMother) motherParticle = (TParticle*)fMCEvent->Particle(particle->GetMother(0));
493  if (motherParticle) hasMother = kTRUE;
494  else hasMother = kFALSE;
495 
496  Bool_t motherIsPrimary = kFALSE;
497  if(hasMother){
498  if(motherParticle->GetMother(0)>-1) motherIsPrimary = kFALSE;
499  else motherIsPrimary = kTRUE;
500  }
501 
502  TParticle* grandMotherParticle = NULL;
503  Bool_t motherHasMother = kFALSE;
504  if (hasMother && !motherIsPrimary) {
505  grandMotherParticle = (TParticle*)fMCEvent->Particle(motherParticle->GetMother(0));
506  motherHasMother = kTRUE;
507  }
508 
509  Bool_t grandMotherIsPrimary = kFALSE;
510  if (motherHasMother) {
511  if(grandMotherParticle->GetMother(0)>-1) grandMotherIsPrimary = kFALSE;
512  else grandMotherIsPrimary = kTRUE;
513  }
514 
515  if (!(TMath::Abs(particle->Energy()-particle->Pz())>0.)) continue;
516  Double_t yPre = (particle->Energy()+particle->Pz())/(particle->Energy()-particle->Pz());
517  if( yPre <= 0 ) continue;
518 
519  Double_t y = 0.5*TMath::Log(yPre);
520 
521  Int_t PdgAnalyzedParticle = 0;
522  if (fAnalyzedMeson==0) PdgAnalyzedParticle = 111;
523  else if (fAnalyzedMeson==1) PdgAnalyzedParticle = 221;
524  else if (fAnalyzedMeson==2) PdgAnalyzedParticle = 211; // set to pi+ pdg code, but both are accepted, no distinction between pi+ and pi-
525 
526  // pi0/eta/pi+- from source
527  if(TMath::Abs(particle->GetPdgCode())==PdgAnalyzedParticle && hasMother==kTRUE){
528  if (TMath::Abs(y) > fMaxY) continue;
529  if(motherIsPrimary && fHasMother[GetParticlePosLocal(motherParticle->GetPdgCode())]){
530 
531  switch(motherParticle->GetPdgCode()){
532  case 221:
533  fHistPtYDaughterSource[0]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
534  fHistPtPhiDaughterSource[0]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
535  fHistPtDaughterPtSourceInput[0]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
536  fHistPhiDaughterPhiSourceInput[0]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
537  break;
538  case 310:
539  fHistPtYDaughterSource[1]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
540  fHistPtPhiDaughterSource[1]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
541  fHistPtDaughterPtSourceInput[1]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
542  fHistPhiDaughterPhiSourceInput[1]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
543  break;
544  case 130:
545  fHistPtYDaughterSource[2]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
546  fHistPtPhiDaughterSource[2]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
547  fHistPtDaughterPtSourceInput[2]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
548  fHistPhiDaughterPhiSourceInput[2]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
549  break;
550  case 3122:
551  fHistPtYDaughterSource[3]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
552  fHistPtPhiDaughterSource[3]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
553  fHistPtDaughterPtSourceInput[3]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
554  fHistPhiDaughterPhiSourceInput[3]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
555  break;
556  case 113:
557  fHistPtYDaughterSource[4]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
558  fHistPtPhiDaughterSource[4]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
559  fHistPtDaughterPtSourceInput[4]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
560  fHistPhiDaughterPhiSourceInput[4]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
561  break;
562  case 331:
563  fHistPtYDaughterSource[5]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
564  fHistPtPhiDaughterSource[5]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
565  fHistPtDaughterPtSourceInput[5]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
566  fHistPhiDaughterPhiSourceInput[5]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
567  break;
568  case 223:
569  fHistPtYDaughterSource[6]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
570  fHistPtPhiDaughterSource[6]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
571  fHistPtDaughterPtSourceInput[6]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
572  fHistPhiDaughterPhiSourceInput[6]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
573  break;
574  case 213:
575  fHistPtYDaughterSource[7]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
576  fHistPtPhiDaughterSource[7]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
577  fHistPtDaughterPtSourceInput[7]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
578  fHistPhiDaughterPhiSourceInput[7]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
579  break;
580  case -213:
581  fHistPtYDaughterSource[8]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
582  fHistPtPhiDaughterSource[8]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
583  fHistPtDaughterPtSourceInput[8]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
584  fHistPhiDaughterPhiSourceInput[8]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
585  break;
586  case 333:
587  fHistPtYDaughterSource[9]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
588  fHistPtPhiDaughterSource[9]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
589  fHistPtDaughterPtSourceInput[9]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
590  fHistPhiDaughterPhiSourceInput[9]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
591  break;
592  case 443:
593  fHistPtYDaughterSource[10]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
594  fHistPtPhiDaughterSource[10]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
595  fHistPtDaughterPtSourceInput[10]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
596  fHistPhiDaughterPhiSourceInput[10]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
597  break;
598  case 2114:
599  fHistPtYDaughterSource[11]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
600  fHistPtPhiDaughterSource[11]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
601  fHistPtDaughterPtSourceInput[11]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
602  fHistPhiDaughterPhiSourceInput[11]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
603  break;
604  case 2214:
605  fHistPtYDaughterSource[12]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
606  fHistPtPhiDaughterSource[12]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
607  fHistPtDaughterPtSourceInput[12]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
608  fHistPhiDaughterPhiSourceInput[12]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
609  break;
610  case 1114:
611  fHistPtYDaughterSource[13]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
612  fHistPtPhiDaughterSource[13]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
613  fHistPtDaughterPtSourceInput[13]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
614  fHistPhiDaughterPhiSourceInput[13]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
615  break;
616  case 2224:
617  fHistPtYDaughterSource[14]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
618  fHistPtPhiDaughterSource[14]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
619  fHistPtDaughterPtSourceInput[14]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
620  fHistPhiDaughterPhiSourceInput[14]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
621  break;
622  case 321:
623  fHistPtYDaughterSource[15]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
624  fHistPtPhiDaughterSource[15]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
625  fHistPtDaughterPtSourceInput[15]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
626  fHistPhiDaughterPhiSourceInput[15]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
627  break;
628  case -321:
629  fHistPtYDaughterSource[16]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
630  fHistPtPhiDaughterSource[16]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
631  fHistPtDaughterPtSourceInput[16]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
632  fHistPhiDaughterPhiSourceInput[16]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
633  break;
634  case -3334:
635  fHistPtYDaughterSource[17]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
636  fHistPtPhiDaughterSource[17]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
637  fHistPtDaughterPtSourceInput[17]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
638  fHistPhiDaughterPhiSourceInput[17]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
639  break;
640  case 3334:
641  fHistPtYDaughterSource[18]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
642  fHistPtPhiDaughterSource[18]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
643  fHistPtDaughterPtSourceInput[18]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
644  fHistPhiDaughterPhiSourceInput[18]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
645  break;
646  case -3312:
647  fHistPtYDaughterSource[19]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
648  fHistPtPhiDaughterSource[19]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
649  fHistPtDaughterPtSourceInput[19]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
650  fHistPhiDaughterPhiSourceInput[19]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
651  break;
652  case 3312:
653  fHistPtYDaughterSource[20]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
654  fHistPtPhiDaughterSource[20]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
655  fHistPtDaughterPtSourceInput[20]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
656  fHistPhiDaughterPhiSourceInput[20]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
657  break;
658  case 3224:
659  fHistPtYDaughterSource[21]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
660  fHistPtPhiDaughterSource[21]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
661  fHistPtDaughterPtSourceInput[21]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
662  fHistPhiDaughterPhiSourceInput[21]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
663  break;
664  case 3114:
665  fHistPtYDaughterSource[22]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
666  fHistPtPhiDaughterSource[22]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
667  fHistPtDaughterPtSourceInput[22]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
668  fHistPhiDaughterPhiSourceInput[22]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
669  break;
670  case 313:
671  fHistPtYDaughterSource[23]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
672  fHistPtPhiDaughterSource[23]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
673  fHistPtDaughterPtSourceInput[23]->Fill(particle->Pt(), motherParticle->Pt(), particle->GetWeight());
674  fHistPhiDaughterPhiSourceInput[23]->Fill(particle->Phi(), motherParticle->Phi(), particle->GetWeight());
675  break;
676  default:
677  fHistPdgDaughterSourceRest->Fill(motherParticle->GetPdgCode());
678  break;
679  }
680  }
681  }
682 
683  // source
684  if(particle->GetPdgCode()!=PdgAnalyzedParticle && particleIsPrimary && fHasMother[GetParticlePosLocal(particle->GetPdgCode())]){
685  if (TMath::Abs(y) > fMaxY) continue;
686 
687  switch(particle->GetPdgCode()){
688  case 221:
689  fHistPtYInput[0]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
690  fHistPtPhiInput[0]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
691  fHistDecayChannelsInput[0]->Fill(0., particle->GetWeight());
692  fHistDecayChannelsInput[0]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
693  break;
694  case 310:
695  fHistPtYInput[1]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
696  fHistPtPhiInput[1]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
697  fHistDecayChannelsInput[1]->Fill(0., particle->GetWeight());
698  fHistDecayChannelsInput[1]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
699  break;
700  case 130:
701  fHistPtYInput[2]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
702  fHistPtPhiInput[2]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
703  fHistDecayChannelsInput[2]->Fill(0., particle->GetWeight());
704  fHistDecayChannelsInput[2]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
705  break;
706  case 3122:
707  fHistPtYInput[3]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
708  fHistPtPhiInput[3]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
709  fHistDecayChannelsInput[3]->Fill(0., particle->GetWeight());
710  fHistDecayChannelsInput[3]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
711  break;
712  case 113:
713  fHistPtYInput[4]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
714  fHistPtPhiInput[4]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
715  fHistDecayChannelsInput[4]->Fill(0., particle->GetWeight());
716  fHistDecayChannelsInput[4]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
717  break;
718  case 331:
719  fHistPtYInput[5]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
720  fHistPtPhiInput[5]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
721  fHistDecayChannelsInput[5]->Fill(0., particle->GetWeight());
722  fHistDecayChannelsInput[5]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
723  break;
724  case 223:
725  fHistPtYInput[6]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
726  fHistPtPhiInput[6]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
727  fHistDecayChannelsInput[6]->Fill(0., particle->GetWeight());
728  fHistDecayChannelsInput[6]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
729  break;
730  case 213:
731  fHistPtYInput[7]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
732  fHistPtPhiInput[7]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
733  fHistDecayChannelsInput[7]->Fill(0., particle->GetWeight());
734  fHistDecayChannelsInput[7]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
735  break;
736  case -213:
737  fHistPtYInput[8]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
738  fHistPtPhiInput[8]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
739  fHistDecayChannelsInput[8]->Fill(0., particle->GetWeight());
740  fHistDecayChannelsInput[8]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
741  break;
742  case 333:
743  fHistPtYInput[9]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
744  fHistPtPhiInput[9]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
745  fHistDecayChannelsInput[9]->Fill(0., particle->GetWeight());
746  fHistDecayChannelsInput[9]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
747  break;
748  case 443:
749  fHistPtYInput[10]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
750  fHistPtPhiInput[10]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
751  fHistDecayChannelsInput[10]->Fill(0., particle->GetWeight());
752  fHistDecayChannelsInput[10]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
753  break;
754  case 2114:
755  fHistPtYInput[11]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
756  fHistPtPhiInput[11]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
757  fHistDecayChannelsInput[11]->Fill(0., particle->GetWeight());
758  fHistDecayChannelsInput[11]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
759  break;
760  case 2214:
761  fHistPtYInput[12]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
762  fHistPtPhiInput[12]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
763  fHistDecayChannelsInput[12]->Fill(0., particle->GetWeight());
764  fHistDecayChannelsInput[12]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
765  break;
766  case 1114:
767  fHistPtYInput[13]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
768  fHistPtPhiInput[13]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
769  fHistDecayChannelsInput[13]->Fill(0., particle->GetWeight());
770  fHistDecayChannelsInput[13]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
771  break;
772  case 2224:
773  fHistPtYInput[14]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
774  fHistPtPhiInput[14]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
775  fHistDecayChannelsInput[14]->Fill(0., particle->GetWeight());
776  fHistDecayChannelsInput[14]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
777  break;
778  case 321:
779  fHistPtYInput[15]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
780  fHistPtPhiInput[15]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
781  fHistDecayChannelsInput[15]->Fill(0., particle->GetWeight());
782  fHistDecayChannelsInput[15]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
783  break;
784  case -321:
785  fHistPtYInput[16]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
786  fHistPtPhiInput[16]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
787  fHistDecayChannelsInput[16]->Fill(0., particle->GetWeight());
788  fHistDecayChannelsInput[16]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
789  break;
790  case -3334:
791  fHistPtYInput[17]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
792  fHistPtPhiInput[17]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
793  fHistDecayChannelsInput[17]->Fill(0., particle->GetWeight());
794  fHistDecayChannelsInput[17]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
795  break;
796  case 3334:
797  fHistPtYInput[18]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
798  fHistPtPhiInput[18]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
799  fHistDecayChannelsInput[18]->Fill(0., particle->GetWeight());
800  fHistDecayChannelsInput[18]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
801  break;
802  case -3312:
803  fHistPtYInput[19]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
804  fHistPtPhiInput[19]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
805  fHistDecayChannelsInput[19]->Fill(0., particle->GetWeight());
806  fHistDecayChannelsInput[19]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
807  break;
808  case 3312:
809  fHistPtYInput[20]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
810  fHistPtPhiInput[20]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
811  fHistDecayChannelsInput[20]->Fill(0., particle->GetWeight());
812  fHistDecayChannelsInput[20]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
813  break;
814  case 3224:
815  fHistPtYInput[21]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
816  fHistPtPhiInput[21]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
817  fHistDecayChannelsInput[21]->Fill(0., particle->GetWeight());
818  fHistDecayChannelsInput[21]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
819  break;
820  case 3114:
821  fHistPtYInput[22]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
822  fHistPtPhiInput[22]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
823  fHistDecayChannelsInput[22]->Fill(0., particle->GetWeight());
824  fHistDecayChannelsInput[22]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
825  break;
826  case 313:
827  fHistPtYInput[23]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
828  fHistPtPhiInput[23]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
829  fHistDecayChannelsInput[23]->Fill(0., particle->GetWeight());
830  fHistDecayChannelsInput[23]->Fill(GetDecayChannel(fMCEvent, particle), particle->GetWeight());
831  break;
832  default:
833  fHistPdgInputRest->Fill(particle->GetPdgCode());
834  break;
835  }
836  }
837 
838  // gamma from X/pi0 from source
839  if (particle->GetPdgCode()==22 && motherHasMother) {
840  // additional condition to remove gammas out of eta range
841  if (fMaxEta>0){
842  if (TMath::Abs(particle->Eta()) > fMaxEta) continue;
843  } else {
844  if (TMath::Abs(y) > fMaxY) continue;
845  }
846  if (grandMotherIsPrimary && fHasMother[GetParticlePosLocal(grandMotherParticle->GetPdgCode())]) {
847 
848  switch(grandMotherParticle->GetPdgCode()){
849  case 310:
850  fHistPtYGammaFromXFromInput[0]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
851  fHistPtPhiGammaFromXFromInput[0]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
852  if(motherParticle->GetPdgCode() == 111) {
853  fHistPtYGammaFromPi0FromInput[0]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
854  fHistPtPhiGammaFromPi0FromInput[0]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
855  }
856  break;
857  case 130:
858  fHistPtYGammaFromXFromInput[1]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
859  fHistPtPhiGammaFromXFromInput[1]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
860  if(motherParticle->GetPdgCode() == 111) {
861  fHistPtYGammaFromPi0FromInput[1]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
862  fHistPtPhiGammaFromPi0FromInput[1]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
863  }
864  break;
865  case 3122:
866  fHistPtYGammaFromXFromInput[2]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
867  fHistPtPhiGammaFromXFromInput[2]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
868  if(motherParticle->GetPdgCode() == 111) {
869  fHistPtYGammaFromPi0FromInput[2]->Fill(particle->Pt(), particle->Y(), particle->GetWeight());
870  fHistPtPhiGammaFromPi0FromInput[2]->Fill(particle->Pt(), particle->Phi(), particle->GetWeight());
871  }
872  break;
873  }
874  }
875  }
876  }
877 }
878 
879 //_________________________________________________________________________________
881 {
882  //fOutputContainer->Print(); // Will crash on GRID
883 }
884 
885 //_________________________________________________________________________________
887  if (flag>=0 && flag<3) {
888  fAnalyzedMeson = flag;
889  // neutral pion flag
890  if (fAnalyzedMeson==0) fAnalyzeNeutralPi = kTRUE;
891  else fAnalyzeNeutralPi = kFALSE;
892  // charged pion flag
893  if (fAnalyzedMeson==2) fAnalyzeChargedPi = kTRUE;
894  else fAnalyzeChargedPi = kFALSE;
895  } else {
896  AliFatalClass(Form("Requested particle type flag (%d) for analysis not recognized!",flag));
897  }
898 }
899 
900 //_________________________________________________________________________________
902  TAxis *axisafter = histoRebin->GetXaxis();
903  Int_t bins = axisafter->GetNbins();
904  Double_t from = axisafter->GetXmin();
905  Double_t to = axisafter->GetXmax();
906  Double_t *newbins = new Double_t[bins+1];
907  newbins[0] = from;
908  Double_t factor = TMath::Power(to/from, 1./bins);
909  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
910  axisafter->Set(bins, newbins);
911  delete [] newbins;
912 }
913 
914 //_________________________________________________________________________________
916  TAxis *axisafter = histoRebin->GetXaxis();
917  Int_t bins = axisafter->GetNbins();
918  Double_t from = axisafter->GetXmin();
919  Double_t to = axisafter->GetXmax();
920  Double_t *newbins = new Double_t[bins+1];
921  newbins[0] = from;
922  Double_t factor = TMath::Power(to/from, 1./bins);
923  for(Int_t i=1; i<=bins; ++i) newbins[i] = factor * newbins[i-1];
924  axisafter->Set(bins, newbins);
925  delete [] newbins;
926 }
927 
928 //_________________________________________________________________________________
930 
931  switch (np) {
932 
933  case 0: // eta
934  hist->GetXaxis()->SetBinLabel(1,"all");
935  hist->GetXaxis()->SetBinLabel(2,"#gamma #gamma");
936  hist->GetXaxis()->SetBinLabel(3,"#pi^{0} #pi^{0} #pi^{0}");
937  hist->GetXaxis()->SetBinLabel(4,"#pi^{0} #gamma #gamma");
938  hist->GetXaxis()->SetBinLabel(5,"#pi^{+} #pi^{-} #pi^{0}");
939  hist->GetXaxis()->SetBinLabel(6,"#pi^{+} #pi^{-} #gamma");
940  hist->GetXaxis()->SetBinLabel(20,"rest");
941  break;
942 
943  case 1: // K0s
944  hist->GetXaxis()->SetBinLabel(1,"all");
945  hist->GetXaxis()->SetBinLabel(2,"#pi^{0} #pi^{0}");
946  hist->GetXaxis()->SetBinLabel(3,"#pi^{+} #pi^{-}");
947  hist->GetXaxis()->SetBinLabel(4,"#pi^{+} #pi^{-} #pi^{0}");
948  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} #gamma #gamma");
949  hist->GetXaxis()->SetBinLabel(6,"#pi^{0} e^{+} e^{-}");
950  hist->GetXaxis()->SetBinLabel(7,"#pi^{0} #mu^{+} #mu^{-}");
951  hist->GetXaxis()->SetBinLabel(8,"#pi^{+} #pi^{-} #gamma");
952  hist->GetXaxis()->SetBinLabel(9,"#pi^{+} #pi^{-} e^{+} e^{-}");
953  hist->GetXaxis()->SetBinLabel(10,"#pi^{#pm} e^{#mp} #nu");
954  hist->GetXaxis()->SetBinLabel(11,"#pi^{#pm} #mu^{#mp} #nu");
955  hist->GetXaxis()->SetBinLabel(20,"rest");
956  break;
957 
958  case 2: // K0l
959  hist->GetXaxis()->SetBinLabel(1,"all");
960  hist->GetXaxis()->SetBinLabel(2,"#pi^{0} #pi^{0} #pi^{0}");
961  hist->GetXaxis()->SetBinLabel(3,"#pi^{+} #pi^{-} #pi^{0}");
962  hist->GetXaxis()->SetBinLabel(4,"#pi^{0} #pi^{0}");
963  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} #gamma #gamma");
964  hist->GetXaxis()->SetBinLabel(6,"#pi^{0} e^{+} e^{-} #gamma");
965  hist->GetXaxis()->SetBinLabel(7,"#pi^{0} #pi^{#pm} e^{#mp} #nu");
966  hist->GetXaxis()->SetBinLabel(8,"#pi^{+} #pi^{-}");
967  hist->GetXaxis()->SetBinLabel(9,"#pi^{#pm} e^{#mp} #nu");
968  hist->GetXaxis()->SetBinLabel(10,"#pi^{#pm} #mu^{#mp} #nu");
969  hist->GetXaxis()->SetBinLabel(11,"#pi^{#pm} e^{#mp} #nu #e{+} e^{-}");
970  hist->GetXaxis()->SetBinLabel(12,"#pi^{#pm} e^{#mp} #nu #gamma");
971  hist->GetXaxis()->SetBinLabel(13,"#pi^{#pm} #mu^{#mp} #nu #gamma");
972  hist->GetXaxis()->SetBinLabel(14,"#pi^{+} #pi^{-} #gamma");
973  hist->GetXaxis()->SetBinLabel(20,"rest");
974  break;
975 
976  case 3: // Lambda
977  hist->GetXaxis()->SetBinLabel(1,"all");
978  hist->GetXaxis()->SetBinLabel(2,"p #pi^{-}");
979  hist->GetXaxis()->SetBinLabel(3,"n #pi^{0}");
980  hist->GetXaxis()->SetBinLabel(4,"p #pi^{-} #gamma");
981  hist->GetXaxis()->SetBinLabel(20,"rest");
982  break;
983 
984  case 4: // rho0
985  hist->GetXaxis()->SetBinLabel(1,"all");
986  hist->GetXaxis()->SetBinLabel(2,"#pi^{+} #pi^{-}");
987  hist->GetXaxis()->SetBinLabel(3,"#pi^{0} #gamma");
988  hist->GetXaxis()->SetBinLabel(4,"#eta #gamma");
989  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} #pi^{0} #gamma");
990  hist->GetXaxis()->SetBinLabel(6,"#pi^{+} #pi^{-} #pi^{0}");
991  hist->GetXaxis()->SetBinLabel(7,"#pi^{+} #pi^{-} #pi^{0} #pi^{0}");
992  hist->GetXaxis()->SetBinLabel(8,"#pi^{+} #pi^{-} #gamma");
993  hist->GetXaxis()->SetBinLabel(20,"rest");
994  break;
995 
996  case 5: // eta'
997  hist->GetXaxis()->SetBinLabel(1,"all");
998  hist->GetXaxis()->SetBinLabel(2,"#pi^{+} #pi^{-} #eta");
999  hist->GetXaxis()->SetBinLabel(3,"#pi^{0} #pi^{0} #eta");
1000  hist->GetXaxis()->SetBinLabel(4,"#pi^{0} #pi^{0} #pi^{0}");
1001  hist->GetXaxis()->SetBinLabel(5,"#pi^{+} #pi^{-} #pi^{0}");
1002  hist->GetXaxis()->SetBinLabel(6,"#pi^{#pm} #rho^{#mp}");
1003  hist->GetXaxis()->SetBinLabel(7,"#pi^{+} #pi^{-} #pi^{0} #pi^{0}");
1004  hist->GetXaxis()->SetBinLabel(8,"#pi^{+} #pi^{-} e^{+} e^{-}");
1005  hist->GetXaxis()->SetBinLabel(20,"rest");
1006  break;
1007 
1008  case 6: // omega
1009  hist->GetXaxis()->SetBinLabel(1,"all");
1010  hist->GetXaxis()->SetBinLabel(2,"#pi^{+} #pi^{-} #pi^{0}");
1011  hist->GetXaxis()->SetBinLabel(3,"#pi^{0} #gamma");
1012  hist->GetXaxis()->SetBinLabel(4,"#eta #gamma");
1013  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} e^{+} e^{-}");
1014  hist->GetXaxis()->SetBinLabel(6,"#pi^{0} #mu^{+} #mu^{-}");
1015  hist->GetXaxis()->SetBinLabel(7,"#pi^{0} #pi^{0} #gamma");
1016  hist->GetXaxis()->SetBinLabel(8,"#pi^{+} #pi^{-}");
1017  hist->GetXaxis()->SetBinLabel(20,"rest");
1018  break;
1019 
1020  case 7: // rho+
1021  hist->GetXaxis()->SetBinLabel(1,"all");
1022  hist->GetXaxis()->SetBinLabel(2,"#pi^{+} #pi^{0}");
1023  hist->GetXaxis()->SetBinLabel(3,"#pi^{+} #gamma");
1024  hist->GetXaxis()->SetBinLabel(20,"rest");
1025  break;
1026 
1027  case 8: // rho-
1028  hist->GetXaxis()->SetBinLabel(1,"all");
1029  hist->GetXaxis()->SetBinLabel(2,"#pi^{-} #pi^{0}");
1030  hist->GetXaxis()->SetBinLabel(3,"#pi^{-} #gamma");
1031  hist->GetXaxis()->SetBinLabel(20,"rest");
1032  break;
1033 
1034  case 9: // phi
1035  hist->GetXaxis()->SetBinLabel(1,"all");
1036  hist->GetXaxis()->SetBinLabel(2,"K^{+} K^{-}");
1037  hist->GetXaxis()->SetBinLabel(3,"K^{0}_{L} K^{0}_{S}");
1038  hist->GetXaxis()->SetBinLabel(4,"#eta #gamma");
1039  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} #gamma");
1040  hist->GetXaxis()->SetBinLabel(6,"#eta e^{+} e^{-}");
1041  hist->GetXaxis()->SetBinLabel(7,"#omega #pi^{0}");
1042  hist->GetXaxis()->SetBinLabel(8,"#pi^{0} #pi^{0} #gamma");
1043  hist->GetXaxis()->SetBinLabel(9,"#pi^{0} e^{+} e^{-}");
1044  hist->GetXaxis()->SetBinLabel(10,"#pi^{0} #eta #gamma");
1045  hist->GetXaxis()->SetBinLabel(11,"#pi^{+} #pi^{-} #pi^{0}");
1046  hist->GetXaxis()->SetBinLabel(12,"#rho^{0} #pi^{0}");
1047  hist->GetXaxis()->SetBinLabel(13,"#rho^{#pm} #pi^{#mp}");
1048  hist->GetXaxis()->SetBinLabel(20,"rest");
1049  break;
1050 
1051  case 10: // J/psi
1052  hist->GetXaxis()->SetBinLabel(1,"all");
1053  hist->GetXaxis()->SetBinLabel(2,"#pi^{0} X");
1054  hist->GetXaxis()->SetBinLabel(3,"#eta X");
1055  hist->GetXaxis()->SetBinLabel(4,"#pi^{+} X");
1056  hist->GetXaxis()->SetBinLabel(5,"#pi^{-} X");
1057  hist->GetXaxis()->SetBinLabel(20,"rest");
1058  break;
1059 
1060  case 11: //Delta0
1061  hist->GetXaxis()->SetBinLabel(1,"all");
1062  hist->GetXaxis()->SetBinLabel(2,"n #pi^{0}");
1063  hist->GetXaxis()->SetBinLabel(3,"p #pi^{-}");
1064  hist->GetXaxis()->SetBinLabel(20,"rest");
1065  break;
1066 
1067  case 12: // Delta+
1068  hist->GetXaxis()->SetBinLabel(1,"all");
1069  hist->GetXaxis()->SetBinLabel(2,"n #pi^{+}");
1070  hist->GetXaxis()->SetBinLabel(3,"p #pi^{0}");
1071  hist->GetXaxis()->SetBinLabel(20,"rest");
1072  break;
1073 
1074  case 13: // Delta-
1075  hist->GetXaxis()->SetBinLabel(1,"all");
1076  hist->GetXaxis()->SetBinLabel(2,"n #pi^{-}");
1077  hist->GetXaxis()->SetBinLabel(20,"rest");
1078  break;
1079 
1080  case 14: //Delta++
1081  hist->GetXaxis()->SetBinLabel(1,"all");
1082  hist->GetXaxis()->SetBinLabel(2,"p #pi^{+}");
1083  hist->GetXaxis()->SetBinLabel(20,"rest");
1084  break;
1085 
1086  case 15: // K+
1087  hist->GetXaxis()->SetBinLabel(1,"all");
1088  hist->GetXaxis()->SetBinLabel(2,"#mu^{+} #nu");
1089  hist->GetXaxis()->SetBinLabel(3,"#mu^{+} #nu #gamma");
1090  hist->GetXaxis()->SetBinLabel(4,"#pi^{0} e^{+} #nu");
1091  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} #mu^{+} #nu");
1092  hist->GetXaxis()->SetBinLabel(6,"#pi^{0} #pi^{0} e^{+} #nu");
1093  hist->GetXaxis()->SetBinLabel(7,"#pi^{+} #pi^{-} e^{+} #nu");
1094  hist->GetXaxis()->SetBinLabel(8,"#pi^{+} #pi^{0}");
1095  hist->GetXaxis()->SetBinLabel(9,"#pi^{+} #pi^{0} #pi^{0}");
1096  hist->GetXaxis()->SetBinLabel(10,"#pi^{+} #pi^{+} #pi^{-}");
1097  hist->GetXaxis()->SetBinLabel(20,"rest");
1098  break;
1099 
1100  case 16: // K-
1101  hist->GetXaxis()->SetBinLabel(1,"all");
1102  hist->GetXaxis()->SetBinLabel(2,"#mu^{-} #nu");
1103  hist->GetXaxis()->SetBinLabel(3,"#mu^{-} #nu #gamma");
1104  hist->GetXaxis()->SetBinLabel(4,"#pi^{0} e^{-} #nu");
1105  hist->GetXaxis()->SetBinLabel(5,"#pi^{0} #mu^{-} #nu");
1106  hist->GetXaxis()->SetBinLabel(6,"#pi^{0} #pi^{0} e^{-} #nu");
1107  hist->GetXaxis()->SetBinLabel(7,"#pi^{+} #pi^{-} e^{-} #nu");
1108  hist->GetXaxis()->SetBinLabel(8,"#pi^{-} #pi^{0}");
1109  hist->GetXaxis()->SetBinLabel(9,"#pi^{-} #pi^{0} #pi^{0}");
1110  hist->GetXaxis()->SetBinLabel(10,"#pi^{+} #pi^{-} #pi^{-}");
1111  hist->GetXaxis()->SetBinLabel(20,"rest");
1112  break;
1113 
1114  case 17: // Omega+
1115  hist->GetXaxis()->SetBinLabel(1,"all");
1116  hist->GetXaxis()->SetBinLabel(2,"#Lambda K^{+}");
1117  hist->GetXaxis()->SetBinLabel(3,"#Xi^{0} #pi^{+}");
1118  hist->GetXaxis()->SetBinLabel(4,"#Xi^{+} #pi^{0}");
1119  hist->GetXaxis()->SetBinLabel(5,"#Xi^{+} #pi^{+} #pi^{-}");
1120  hist->GetXaxis()->SetBinLabel(20,"rest");
1121  break;
1122 
1123  case 18: // Omega-
1124  hist->GetXaxis()->SetBinLabel(1,"all");
1125  hist->GetXaxis()->SetBinLabel(2,"#Lambda K^{-}");
1126  hist->GetXaxis()->SetBinLabel(3,"#Xi^{0} #pi^{-}");
1127  hist->GetXaxis()->SetBinLabel(4,"#Xi^{-} #pi^{0}");
1128  hist->GetXaxis()->SetBinLabel(5,"#Xi^{-} #pi^{+} #pi^{-}");
1129  hist->GetXaxis()->SetBinLabel(20,"rest");
1130  break;
1131 
1132  case 19: // Xi+
1133  hist->GetXaxis()->SetBinLabel(1,"all");
1134  hist->GetXaxis()->SetBinLabel(2,"#Lambda #pi^{+}");
1135  hist->GetXaxis()->SetBinLabel(20,"rest");
1136  break;
1137 
1138  case 20: // Xi-
1139  hist->GetXaxis()->SetBinLabel(1,"all");
1140  hist->GetXaxis()->SetBinLabel(2,"#Lambda #pi^{-}");
1141  hist->GetXaxis()->SetBinLabel(20,"rest");
1142  break;
1143 
1144  case 21: // Sigma(1385)+
1145  hist->GetXaxis()->SetBinLabel(1,"all");
1146  hist->GetXaxis()->SetBinLabel(2,"#Lambda #pi^{+}");
1147  hist->GetXaxis()->SetBinLabel(3,"#Sigma^{0} #pi^{+}");
1148  hist->GetXaxis()->SetBinLabel(4,"#Sigma^{+} #pi^{0}");
1149  hist->GetXaxis()->SetBinLabel(20,"rest");
1150  break;
1151 
1152  case 22: // Sigma(1385)-
1153  hist->GetXaxis()->SetBinLabel(1,"all");
1154  hist->GetXaxis()->SetBinLabel(2,"#Lambda #pi^{-}");
1155  hist->GetXaxis()->SetBinLabel(3,"#Sigma^{0} #pi^{-}");
1156  hist->GetXaxis()->SetBinLabel(4,"#Sigma^{-} #pi^{0}");
1157  hist->GetXaxis()->SetBinLabel(20,"rest");
1158  break;
1159 
1160  case 23: // K*(892)0
1161  hist->GetXaxis()->SetBinLabel(1,"all");
1162  hist->GetXaxis()->SetBinLabel(2,"K^{+} #pi^{-}");
1163  hist->GetXaxis()->SetBinLabel(3,"K^{-} #pi^{+}");
1164  hist->GetXaxis()->SetBinLabel(4,"K^{0} #pi^{0}");
1165  hist->GetXaxis()->SetBinLabel(20,"rest");
1166  break;
1167 
1168  default:
1169  break;
1170  }
1171 }
1172 
1173 //_________________________________________________________________________________
1174 Float_t AliAnalysisTaskHadronicCocktailMC::GetDecayChannel(AliMCEvent* mcEvent, TParticle* part) {
1175 
1176  Int_t nDaughters = part->GetNDaughters();
1177  if (nDaughters > 10) return 19.;
1178 
1179  std::vector<Long64_t> *PdgDaughter = new std::vector<Long64_t>(nDaughters);
1180  Long64_t tempPdgCode = 0;
1181  for (Int_t i=0; i<nDaughters; i++) {
1182  tempPdgCode = (Long64_t)((TParticle*)mcEvent->Particle(part->GetFirstDaughter()+i))->GetPdgCode();
1183  if (TMath::Abs(tempPdgCode) == 111 || TMath::Abs(tempPdgCode) == 113 || TMath::Abs(tempPdgCode) == 130 || TMath::Abs(tempPdgCode) == 310 || TMath::Abs(tempPdgCode) == 223 || TMath::Abs(tempPdgCode) == 221 || TMath::Abs(tempPdgCode) == 331 || TMath::Abs(tempPdgCode) == 2112 || TMath::Abs(tempPdgCode) == 3122 || TMath::Abs(tempPdgCode) == 9000111 || TMath::Abs(tempPdgCode) == 9010221 || TMath::Abs(tempPdgCode) == 3322)
1184  tempPdgCode = TMath::Abs(tempPdgCode);
1185  PdgDaughter->at(i) = tempPdgCode;
1186  }
1187  std::sort(PdgDaughter->begin(), PdgDaughter->end());
1188 
1189  Double_t returnVal = -1.;
1190 
1191  switch (part->GetPdgCode()) {
1192  case 221:
1193  if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 22)
1194  returnVal = 1.;
1195  else if (nDaughters == 3 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1196  returnVal = 2.;
1197  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 111)
1198  returnVal = 3.;
1199  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1200  returnVal = 4.;
1201  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 211)
1202  returnVal = 5.;
1203  else
1204  returnVal = 19.;
1205  break;
1206 
1207  case 310:
1208  if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111)
1209  returnVal = 1.;
1210  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211)
1211  returnVal = 2.;
1212  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1213  returnVal = 3.;
1214  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 111)
1215  returnVal = 4.;
1216  else if (nDaughters == 3 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 111)
1217  returnVal = 5.;
1218  else if (nDaughters == 3 && PdgDaughter->at(0) == -13 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 111)
1219  returnVal = 6.;
1220  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 211)
1221  returnVal = 7.;
1222  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 11 && PdgDaughter->at(3) == 211)
1223  returnVal = 8.;
1224  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 12)
1225  returnVal = 9.;
1226  else if (nDaughters == 3 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 211)
1227  returnVal = 9.;
1228  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -13 && PdgDaughter->at(2) == 14)
1229  returnVal = 10.;
1230  else if (nDaughters == 3 && PdgDaughter->at(0) == -14 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 211)
1231  returnVal = 10.;
1232  else
1233  returnVal = 19.;
1234  break;
1235 
1236  case 130:
1237  if (nDaughters == 3 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1238  returnVal = 1.;
1239  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1240  returnVal = 2.;
1241  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111)
1242  returnVal = 3.;
1243  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 111)
1244  returnVal = 4.;
1245  else if (nDaughters == 4 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 22 && PdgDaughter->at(3) == 111)
1246  returnVal = 5.;
1247  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 12 && PdgDaughter->at(3) == 111)
1248  returnVal = 6.;
1249  else if (nDaughters == 4 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 111 && PdgDaughter->at(3) == 211)
1250  returnVal = 6.;
1251  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211)
1252  returnVal = 7.;
1253  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 12)
1254  returnVal = 8.;
1255  else if (nDaughters == 3 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 211)
1256  returnVal = 8.;
1257  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -13 && PdgDaughter->at(2) == 14)
1258  returnVal = 9.;
1259  else if (nDaughters == 3 && PdgDaughter->at(0) == -14 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 211)
1260  returnVal = 9.;
1261  else if (nDaughters == 5 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == -11 && PdgDaughter->at(3) == 11 && PdgDaughter->at(4) == 12)
1262  returnVal = 10.;
1263  else if (nDaughters == 5 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 11 && PdgDaughter->at(3) == 11 && PdgDaughter->at(4) == 211)
1264  returnVal = 10.;
1265  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 12 && PdgDaughter->at(3) == 22)
1266  returnVal = 11.;
1267  else if (nDaughters == 4 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 22 && PdgDaughter->at(3) == 211)
1268  returnVal = 11.;
1269  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -13 && PdgDaughter->at(2) == 14 && PdgDaughter->at(3) == 22)
1270  returnVal = 12.;
1271  else if (nDaughters == 4 && PdgDaughter->at(0) == -14 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 22 && PdgDaughter->at(3) == 211)
1272  returnVal = 12.;
1273  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 211)
1274  returnVal = 13.;
1275  else
1276  returnVal = 19.;
1277  break;
1278 
1279  case 3122:
1280  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 2212)
1281  returnVal = 1.;
1282  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 2112)
1283  returnVal = 2.;
1284  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 2212)
1285  returnVal = 3.;
1286  else
1287  returnVal = 19.;
1288  break;
1289 
1290  case 113:
1291  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211)
1292  returnVal = 1.;
1293  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111)
1294  returnVal = 2.;
1295  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 221)
1296  returnVal = 3.;
1297  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1298  returnVal = 4.;
1299  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1300  returnVal = 5.;
1301  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111 && PdgDaughter->at(3) == 211)
1302  returnVal = 6.;
1303  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 22 && PdgDaughter->at(2) == 211)
1304  returnVal = 7.;
1305  else
1306  returnVal = 19.;
1307  break;
1308 
1309  case 331:
1310  if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211 && PdgDaughter->at(2) == 221)
1311  returnVal = 1.;
1312  else if (nDaughters == 3 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 221)
1313  returnVal = 2.;
1314  else if (nDaughters == 3 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1315  returnVal = 3.;
1316  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1317  returnVal = 4.;
1318  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 213)
1319  returnVal = 5.;
1320  else if (nDaughters == 2 && PdgDaughter->at(0) == -213 && PdgDaughter->at(1) == 211)
1321  returnVal = 5.;
1322  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111 && PdgDaughter->at(3) == 211)
1323  returnVal = 6.;
1324  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 11 && PdgDaughter->at(3) == 211)
1325  returnVal = 7.;
1326  else
1327  returnVal = 19.;
1328  break;
1329 
1330  case 223:
1331  if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1332  returnVal = 1.;
1333  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111)
1334  returnVal = 2.;
1335  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 221)
1336  returnVal = 3.;
1337  else if (nDaughters == 3 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 111)
1338  returnVal = 4.;
1339  else if (nDaughters == 3 && PdgDaughter->at(0) == -13 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 111)
1340  returnVal = 5.;
1341  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1342  returnVal = 6.;
1343  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211)
1344  returnVal = 7.;
1345  else
1346  returnVal = 19.;
1347  break;
1348 
1349  case 213:
1350  if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 211)
1351  returnVal = 1.;
1352  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 211)
1353  returnVal = 2.;
1354  else
1355  returnVal = 19.;
1356  break;
1357 
1358  case -213:
1359  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111)
1360  returnVal = 1.;
1361  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 22)
1362  returnVal = 1.;
1363  else
1364  returnVal = 19.;
1365  break;
1366 
1367  case 333:
1368  if (nDaughters == 2 && PdgDaughter->at(0) == -321 && PdgDaughter->at(1) == 321)
1369  returnVal = 1.;
1370  else if (nDaughters == 2 && PdgDaughter->at(0) == 130 && PdgDaughter->at(1) == 310)
1371  returnVal = 2.;
1372  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 221)
1373  returnVal = 3.;
1374  else if (nDaughters == 2 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111)
1375  returnVal = 4.;
1376  else if (nDaughters == 3 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 221)
1377  returnVal = 5.;
1378  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 223)
1379  returnVal = 6.;
1380  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1381  returnVal = 7.;
1382  else if (nDaughters == 3 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 111)
1383  returnVal = 8.;
1384  else if (nDaughters == 3 && PdgDaughter->at(0) == 22 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 221)
1385  returnVal = 9.;
1386  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1387  returnVal = 10.;
1388  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 113)
1389  returnVal = 11.;
1390  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 213)
1391  returnVal = 12.;
1392  else if (nDaughters == 2 && PdgDaughter->at(0) == -213 && PdgDaughter->at(1) == 211)
1393  returnVal = 12.;
1394  else
1395  returnVal = 19.;
1396  break;
1397 
1398  case 443:
1399  if (std::find(PdgDaughter->begin(), PdgDaughter->end(), 111) != PdgDaughter->end())
1400  returnVal = 1.;
1401  else if (std::find(PdgDaughter->begin(), PdgDaughter->end(), 221) != PdgDaughter->end())
1402  returnVal = 2.;
1403  else if (std::find(PdgDaughter->begin(), PdgDaughter->end(), 211) != PdgDaughter->end())
1404  returnVal = 3.;
1405  else if (std::find(PdgDaughter->begin(), PdgDaughter->end(), -211) != PdgDaughter->end())
1406  returnVal = 4.;
1407  else
1408  returnVal = 19.;
1409  break;
1410 
1411  case 2114:
1412  if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 2112)
1413  returnVal = 1.;
1414  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 2212)
1415  returnVal = 2.;
1416  else
1417  returnVal = 19.;
1418  break;
1419 
1420  case 2214:
1421  if (nDaughters == 2 && PdgDaughter->at(0) == 211 && PdgDaughter->at(1) == 2112)
1422  returnVal = 1.;
1423  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 2212)
1424  returnVal = 2.;
1425  else
1426  returnVal = 19.;
1427  break;
1428 
1429  case 1114:
1430  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 2112)
1431  returnVal = 1.;
1432  else
1433  returnVal = 19.;
1434  break;
1435 
1436  case 2224:
1437  if (nDaughters == 2 && PdgDaughter->at(0) == 211 && PdgDaughter->at(1) == 2212)
1438  returnVal = 1.;
1439  else
1440  returnVal = 19.;
1441  break;
1442 
1443  case 321:
1444  if (nDaughters == 2 && PdgDaughter->at(0) == -13 && PdgDaughter->at(1) == 14)
1445  returnVal = 1.;
1446  else if (nDaughters == 3 && PdgDaughter->at(0) == -13 && PdgDaughter->at(1) == 14 && PdgDaughter->at(2) == 22)
1447  returnVal = 2.;
1448  else if (nDaughters == 3 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 12 && PdgDaughter->at(2) == 111)
1449  returnVal = 3.;
1450  else if (nDaughters == 3 && PdgDaughter->at(0) == -13 && PdgDaughter->at(1) == 14 && PdgDaughter->at(2) == 111)
1451  returnVal = 4.;
1452  else if (nDaughters == 4 && PdgDaughter->at(0) == -11 && PdgDaughter->at(1) == 12 && PdgDaughter->at(2) == 111 && PdgDaughter->at(3) == 111)
1453  returnVal = 5.;
1454  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -11 && PdgDaughter->at(2) == 12 && PdgDaughter->at(3) == 211)
1455  returnVal = 6.;
1456  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 211)
1457  returnVal = 7.;
1458  else if (nDaughters == 3 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 211)
1459  returnVal = 8.;
1460  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211 && PdgDaughter->at(2) == 211)
1461  returnVal = 9.;
1462  else
1463  returnVal = 19.;
1464  break;
1465 
1466  case -321:
1467  if (nDaughters == 2 && PdgDaughter->at(0) == -14 && PdgDaughter->at(1) == 13)
1468  returnVal = 1.;
1469  else if (nDaughters == 3 && PdgDaughter->at(0) == -14 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 22)
1470  returnVal = 2.;
1471  else if (nDaughters == 3 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 111)
1472  returnVal = 3.;
1473  else if (nDaughters == 3 && PdgDaughter->at(0) == -14 && PdgDaughter->at(1) == 13 && PdgDaughter->at(2) == 111)
1474  returnVal = 4.;
1475  else if (nDaughters == 4 && PdgDaughter->at(0) == -12 && PdgDaughter->at(1) == 11 && PdgDaughter->at(2) == 111 && PdgDaughter->at(3) == 111)
1476  returnVal = 5.;
1477  else if (nDaughters == 4 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -12 && PdgDaughter->at(2) == 11 && PdgDaughter->at(3) == 211)
1478  returnVal = 6.;
1479  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111)
1480  returnVal = 7.;
1481  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 111 && PdgDaughter->at(2) == 111)
1482  returnVal = 8.;
1483  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == -211 && PdgDaughter->at(2) == 211)
1484  returnVal = 9.;
1485  else
1486  returnVal = 19.;
1487  break;
1488 
1489  case -3334:
1490  if (nDaughters == 2 && PdgDaughter->at(0) == 321 && PdgDaughter->at(1) == 3122)
1491  returnVal = 1.;
1492  else if (nDaughters == 2 && PdgDaughter->at(0) == 211 && PdgDaughter->at(1) == 3322)
1493  returnVal = 2.;
1494  else if (nDaughters == 2 && PdgDaughter->at(0) == -3312 && PdgDaughter->at(1) == 111)
1495  returnVal = 3.;
1496  else if (nDaughters == 3 && PdgDaughter->at(0) == -3312 && PdgDaughter->at(1) == -211 && PdgDaughter->at(2) == 211)
1497  returnVal = 4.;
1498  else
1499  returnVal = 19.;
1500  break;
1501 
1502  case 3334:
1503  if (nDaughters == 2 && PdgDaughter->at(0) == -321 && PdgDaughter->at(1) == 3122)
1504  returnVal = 1.;
1505  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 3322)
1506  returnVal = 2.;
1507  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 3312)
1508  returnVal = 3.;
1509  else if (nDaughters == 3 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 211 && PdgDaughter->at(2) == 3312)
1510  returnVal = 4.;
1511  else
1512  returnVal = 19.;
1513  break;
1514 
1515  case -3312:
1516  if (nDaughters == 2 && PdgDaughter->at(0) == 211 && PdgDaughter->at(1) == 3122)
1517  returnVal = 1.;
1518  else
1519  returnVal = 19.;
1520  break;
1521 
1522  case 3312:
1523  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 3122)
1524  returnVal = 1.;
1525  else
1526  returnVal = 19.;
1527  break;
1528 
1529  case 3224:
1530  if (nDaughters == 2 && PdgDaughter->at(0) == 211 && PdgDaughter->at(1) == 3122)
1531  returnVal = 1.;
1532  else if (nDaughters == 2 && PdgDaughter->at(0) == 211 && PdgDaughter->at(1) == 3212)
1533  returnVal = 2.;
1534  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 3222)
1535  returnVal = 3.;
1536  else
1537  returnVal = 19.;
1538  break;
1539 
1540  case 3114:
1541  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 3122)
1542  returnVal = 1.;
1543  else if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 3212)
1544  returnVal = 2.;
1545  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 3112)
1546  returnVal = 3.;
1547  else
1548  returnVal = 19.;
1549  break;
1550 
1551  case 313:
1552  if (nDaughters == 2 && PdgDaughter->at(0) == -211 && PdgDaughter->at(1) == 321)
1553  returnVal = 1.;
1554  else if (nDaughters == 2 && PdgDaughter->at(0) == -321 && PdgDaughter->at(1) == 211)
1555  returnVal = 2.;
1556  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 130)
1557  returnVal = 3.;
1558  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 310)
1559  returnVal = 3.;
1560  else if (nDaughters == 2 && PdgDaughter->at(0) == 111 && PdgDaughter->at(1) == 311)
1561  returnVal = 3.;
1562  else
1563  returnVal = 19.;
1564  break;
1565 
1566  default:
1567  return -1.;
1568  break;
1569  }
1570 
1571  delete PdgDaughter;
1572 
1573  return returnVal;
1574 }
1575 
1576 //_________________________________________________________________________________
1578 
1579  Int_t kc, nPart, firstChannel, lastChannel;
1580  Double_t BR, BRtot;
1581  std::vector<Int_t> pdgCodes;
1582 
1583  switch (np) {
1584 
1585  case 0:
1586  kc = (AliPythia6::Instance())->Pycomp(221);
1587  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1588  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1589  BRtot = 0.;
1590  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1591  BR = (AliPythia6::Instance())->GetBRAT(channel);
1592  BRtot = BRtot + BR;
1593  nPart = 0;
1594  for (Int_t i=1; i<=5; i++) {
1595  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1596  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1597  nPart++;
1598  }
1599  }
1600  std::sort(pdgCodes.begin(), pdgCodes.end());
1601  if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 22)
1602  histo->SetBinContent(2, BR);
1603  else if (nPart == 3 && pdgCodes[0] == 111 && pdgCodes[1] == 111 && pdgCodes[2] == 111)
1604  histo->SetBinContent(3, BR);
1605  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 22 && pdgCodes[2] == 111)
1606  histo->SetBinContent(4, BR);
1607  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1608  histo->SetBinContent(5, BR);
1609  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 22 && pdgCodes[2] == 211)
1610  histo->SetBinContent(6, BR);
1611  else
1612  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1613  pdgCodes.clear();
1614  }
1615  histo->SetBinContent(1, BRtot);
1616  pdgCodes.clear();
1617  break;
1618 
1619  case 1:
1620  kc = (AliPythia6::Instance())->Pycomp(310);
1621  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1622  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1623  BRtot = 0.;
1624  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1625  BR = (AliPythia6::Instance())->GetBRAT(channel);
1626  BRtot = BRtot + BR;
1627  nPart = 0;
1628  for (Int_t i=1; i<=5; i++) {
1629  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1630  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1631  nPart++;
1632  }
1633  }
1634  std::sort(pdgCodes.begin(), pdgCodes.end());
1635  if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 111)
1636  histo->SetBinContent(2, BR);
1637  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 211)
1638  histo->SetBinContent(3, BR);
1639  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1640  histo->SetBinContent(4, BR);
1641  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 22 && pdgCodes[2] == 111)
1642  histo->SetBinContent(5, BR);
1643  else if (nPart == 3 && pdgCodes[0] == -11 && pdgCodes[1] == 11 && pdgCodes[2] == 111)
1644  histo->SetBinContent(6, BR);
1645  else if (nPart == 3 && pdgCodes[0] == -13 && pdgCodes[1] == 13 && pdgCodes[2] == 111)
1646  histo->SetBinContent(7, BR);
1647  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 22 && pdgCodes[2] == 211)
1648  histo->SetBinContent(8, BR);
1649  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 11 && pdgCodes[3] == 211)
1650  histo->SetBinContent(9, BR);
1651  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 12)
1652  histo->SetBinContent(10, BR+histo->GetBinContent(10));
1653  else if (nPart == 3 && pdgCodes[0] == -12 && pdgCodes[1] == 11 && pdgCodes[2] == 211)
1654  histo->SetBinContent(10, BR+histo->GetBinContent(10));
1655  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == -13 && pdgCodes[2] == 14)
1656  histo->SetBinContent(11, BR+histo->GetBinContent(11));
1657  else if (nPart == 3 && pdgCodes[0] == -14 && pdgCodes[1] == 13 && pdgCodes[2] == 211)
1658  histo->SetBinContent(11, BR+histo->GetBinContent(11));
1659  else
1660  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1661  pdgCodes.clear();
1662  }
1663  histo->SetBinContent(1, BRtot);
1664  pdgCodes.clear();
1665  break;
1666 
1667  case 2:
1668  kc = (AliPythia6::Instance())->Pycomp(130);
1669  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1670  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1671  BRtot = 0.;
1672  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1673  BR = (AliPythia6::Instance())->GetBRAT(channel);
1674  BRtot = BRtot + BR;
1675  nPart = 0;
1676  for (Int_t i=1; i<=5; i++) {
1677  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1678  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1679  nPart++;
1680  }
1681  }
1682  std::sort(pdgCodes.begin(), pdgCodes.end());
1683  if (nPart == 3 && pdgCodes[0] == 111 && pdgCodes[1] == 111 && pdgCodes[2] == 111)
1684  histo->SetBinContent(2, BR);
1685  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1686  histo->SetBinContent(3, BR);
1687  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 111)
1688  histo->SetBinContent(4, BR);
1689  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 22 && pdgCodes[2] == 111)
1690  histo->SetBinContent(5, BR);
1691  else if (nPart == 4 && pdgCodes[0] == -11 && pdgCodes[1] == 11 && pdgCodes[2] == 22 && pdgCodes[3] == 111)
1692  histo->SetBinContent(6, BR);
1693  else if (nPart == 4 && pdgCodes[0] == -12 && pdgCodes[1] == 11 && pdgCodes[2] == 111 && pdgCodes[3] == 211)
1694  histo->SetBinContent(7, BR+histo->GetBinContent(7));
1695  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 12 && pdgCodes[3] == 111)
1696  histo->SetBinContent(7, BR+histo->GetBinContent(7));
1697  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 211)
1698  histo->SetBinContent(8, BR);
1699  else if (nPart == 3 && pdgCodes[0] == -12 && pdgCodes[1] == 11 && pdgCodes[2] == 211)
1700  histo->SetBinContent(9, BR+histo->GetBinContent(9));
1701  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 12)
1702  histo->SetBinContent(9, BR+histo->GetBinContent(9));
1703  else if (nPart == 3 && pdgCodes[0] == -14 && pdgCodes[1] == 13 && pdgCodes[2] == 211)
1704  histo->SetBinContent(10, BR+histo->GetBinContent(10));
1705  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == -13 && pdgCodes[2] == 14)
1706  histo->SetBinContent(10, BR+histo->GetBinContent(10));
1707  else if (nPart == 5 && pdgCodes[0] == -12 && pdgCodes[1] == -11 && pdgCodes[2] == 11 && pdgCodes[3] == 11 && pdgCodes[4] == 211)
1708  histo->SetBinContent(11, BR+histo->GetBinContent(11));
1709  else if (nPart == 5 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == -11 && pdgCodes[3] == 11 && pdgCodes[4] == 12)
1710  histo->SetBinContent(11, BR+histo->GetBinContent(11));
1711  else if (nPart == 4 && pdgCodes[0] == -12 && pdgCodes[1] == 11 && pdgCodes[2] == 22 && pdgCodes[3] == 211)
1712  histo->SetBinContent(12, BR+histo->GetBinContent(12));
1713  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 12 && pdgCodes[3] == 22)
1714  histo->SetBinContent(12, BR+histo->GetBinContent(12));
1715  else if (nPart == 4 && pdgCodes[0] == -14 && pdgCodes[1] == 13 && pdgCodes[2] == 22 && pdgCodes[3] == 211)
1716  histo->SetBinContent(13, BR+histo->GetBinContent(13));
1717  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == -13 && pdgCodes[2] == 14 && pdgCodes[3] == 22)
1718  histo->SetBinContent(13, BR+histo->GetBinContent(13));
1719  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 22 && pdgCodes[2] == 211)
1720  histo->SetBinContent(14, BR);
1721  else
1722  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1723  pdgCodes.clear();
1724  }
1725  histo->SetBinContent(1, BRtot);
1726  pdgCodes.clear();
1727  break;
1728 
1729  case 3:
1730  kc = (AliPythia6::Instance())->Pycomp(3122);
1731  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1732  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1733  BRtot = 0.;
1734  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1735  BR = (AliPythia6::Instance())->GetBRAT(channel);
1736  BRtot = BRtot + BR;
1737  nPart = 0;
1738  for (Int_t i=1; i<=5; i++) {
1739  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1740  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1741  nPart++;
1742  }
1743  }
1744  std::sort(pdgCodes.begin(), pdgCodes.end());
1745  if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 2212)
1746  histo->SetBinContent(2, BR);
1747  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 2112)
1748  histo->SetBinContent(3, BR);
1749  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 22 && pdgCodes[2] == 2212)
1750  histo->SetBinContent(4, BR);
1751  else
1752  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1753  pdgCodes.clear();
1754  }
1755  histo->SetBinContent(1, BRtot);
1756  pdgCodes.clear();
1757  break;
1758 
1759  case 4:
1760  kc = (AliPythia6::Instance())->Pycomp(113);
1761  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1762  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1763  BRtot = 0.;
1764  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1765  BR = (AliPythia6::Instance())->GetBRAT(channel);
1766  BRtot = BRtot + BR;
1767  nPart = 0;
1768  for (Int_t i=1; i<=5; i++) {
1769  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1770  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1771  nPart++;
1772  }
1773  }
1774  std::sort(pdgCodes.begin(), pdgCodes.end());
1775  if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 211)
1776  histo->SetBinContent(2, BR);
1777  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 111)
1778  histo->SetBinContent(3, BR);
1779  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 221)
1780  histo->SetBinContent(4, BR);
1781  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 111 && pdgCodes[2] == 111)
1782  histo->SetBinContent(5, BR);
1783  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1784  histo->SetBinContent(6, BR);
1785  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 111 && pdgCodes[3] == 211)
1786  histo->SetBinContent(7, BR);
1787  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 22 && pdgCodes[2] == 211)
1788  histo->SetBinContent(8, BR);
1789  else
1790  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1791  pdgCodes.clear();
1792  }
1793  histo->SetBinContent(1, BRtot);
1794  pdgCodes.clear();
1795  break;
1796 
1797  case 5:
1798  kc = (AliPythia6::Instance())->Pycomp(331);
1799  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1800  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1801  BRtot = 0.;
1802  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1803  BR = (AliPythia6::Instance())->GetBRAT(channel);
1804  BRtot = BRtot + BR;
1805  nPart = 0;
1806  for (Int_t i=1; i<=5; i++) {
1807  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1808  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1809  nPart++;
1810  }
1811  }
1812  std::sort(pdgCodes.begin(), pdgCodes.end());
1813  if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 211 && pdgCodes[2] == 221)
1814  histo->SetBinContent(2, BR);
1815  else if (nPart == 3 && pdgCodes[0] == 111 && pdgCodes[1] == 111 && pdgCodes[2] == 221)
1816  histo->SetBinContent(3, BR);
1817  else if (nPart == 3 && pdgCodes[0] == 111 && pdgCodes[1] == 111 && pdgCodes[2] == 111)
1818  histo->SetBinContent(4, BR);
1819  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1820  histo->SetBinContent(5, BR);
1821  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 213)
1822  histo->SetBinContent(6, BR+histo->GetBinContent(6));
1823  else if (nPart == 2 && pdgCodes[0] == -213 && pdgCodes[1] == 211)
1824  histo->SetBinContent(6, BR+histo->GetBinContent(6));
1825  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 111 && pdgCodes[3] == 211)
1826  histo->SetBinContent(7, BR+histo->GetBinContent(7));
1827  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 11 && pdgCodes[3] == 211)
1828  histo->SetBinContent(8, BR+histo->GetBinContent(8));
1829  else
1830  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1831  pdgCodes.clear();
1832  }
1833  histo->SetBinContent(1, BRtot);
1834  pdgCodes.clear();
1835  break;
1836 
1837  case 6:
1838  kc = (AliPythia6::Instance())->Pycomp(223);
1839  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1840  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1841  BRtot = 0.;
1842  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1843  BR = (AliPythia6::Instance())->GetBRAT(channel);
1844  BRtot = BRtot + BR;
1845  nPart = 0;
1846  for (Int_t i=1; i<=5; i++) {
1847  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1848  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1849  nPart++;
1850  }
1851  }
1852  std::sort(pdgCodes.begin(), pdgCodes.end());
1853  if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1854  histo->SetBinContent(2, BR);
1855  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 111)
1856  histo->SetBinContent(3, BR);
1857  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 221)
1858  histo->SetBinContent(4, BR);
1859  else if (nPart == 3 && pdgCodes[0] == -11 && pdgCodes[1] == 11 && pdgCodes[2] == 111)
1860  histo->SetBinContent(5, BR);
1861  else if (nPart == 3 && pdgCodes[0] == -13 && pdgCodes[1] == 13 && pdgCodes[2] == 111)
1862  histo->SetBinContent(6, BR);
1863  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 111 && pdgCodes[2] == 111)
1864  histo->SetBinContent(7, BR);
1865  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 211)
1866  histo->SetBinContent(8, BR);
1867  else
1868  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1869  pdgCodes.clear();
1870  }
1871  histo->SetBinContent(1, BRtot);
1872  pdgCodes.clear();
1873  break;
1874 
1875  case 7: case 8: // PYTHIA doesn't distinguish between rho+/rho-
1876  kc = (AliPythia6::Instance())->Pycomp(213);
1877  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1878  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1879  BRtot = 0.;
1880  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1881  BR = (AliPythia6::Instance())->GetBRAT(channel);
1882  BRtot = BRtot + BR;
1883  nPart = 0;
1884  for (Int_t i=1; i<=5; i++) {
1885  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1886  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1887  nPart++;
1888  }
1889  }
1890  std::sort(pdgCodes.begin(), pdgCodes.end());
1891  if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 211)
1892  histo->SetBinContent(2, BR);
1893  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 211)
1894  histo->SetBinContent(3, BR);
1895  else
1896  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1897  pdgCodes.clear();
1898  }
1899  histo->SetBinContent(1, BRtot);
1900  pdgCodes.clear();
1901  break;
1902 
1903  case 9:
1904  kc = (AliPythia6::Instance())->Pycomp(333);
1905  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1906  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1907  BRtot = 0.;
1908  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1909  BR = (AliPythia6::Instance())->GetBRAT(channel);
1910  BRtot = BRtot + BR;
1911  nPart = 0;
1912  for (Int_t i=1; i<=5; i++) {
1913  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1914  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1915  nPart++;
1916  }
1917  }
1918  std::sort(pdgCodes.begin(), pdgCodes.end());
1919  if (nPart == 2 && pdgCodes[0] == -321 && pdgCodes[1] == 321)
1920  histo->SetBinContent(2, BR);
1921  else if (nPart == 2 && pdgCodes[0] == 130 && pdgCodes[1] == 310)
1922  histo->SetBinContent(3, BR);
1923  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 221)
1924  histo->SetBinContent(4, BR);
1925  else if (nPart == 2 && pdgCodes[0] == 22 && pdgCodes[1] == 111)
1926  histo->SetBinContent(5, BR);
1927  else if (nPart == 3 && pdgCodes[0] == -11 && pdgCodes[1] == 11 && pdgCodes[2] == 221)
1928  histo->SetBinContent(6, BR);
1929  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 223)
1930  histo->SetBinContent(7, BR);
1931  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 111 && pdgCodes[2] == 111)
1932  histo->SetBinContent(8, BR);
1933  else if (nPart == 3 && pdgCodes[0] == -11 && pdgCodes[1] == 11 && pdgCodes[2] == 111)
1934  histo->SetBinContent(9, BR);
1935  else if (nPart == 3 && pdgCodes[0] == 22 && pdgCodes[1] == 111 && pdgCodes[2] == 221)
1936  histo->SetBinContent(10, BR);
1937  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
1938  histo->SetBinContent(11, BR);
1939  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 113)
1940  histo->SetBinContent(12, BR);
1941  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 213)
1942  histo->SetBinContent(13, BR+histo->GetBinContent(13));
1943  else if (nPart == 2 && pdgCodes[0] == -213 && pdgCodes[1] == 211)
1944  histo->SetBinContent(13, BR+histo->GetBinContent(13));
1945  else
1946  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1947  pdgCodes.clear();
1948  }
1949  histo->SetBinContent(1, BRtot);
1950  pdgCodes.clear();
1951  break;
1952 
1953  case 10:
1954  kc = (AliPythia6::Instance())->Pycomp(443);
1955  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1956  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1957  BRtot = 0.;
1958  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1959  BR = (AliPythia6::Instance())->GetBRAT(channel);
1960  BRtot = BRtot + BR;
1961  nPart = 0;
1962  for (Int_t i=1; i<=5; i++) {
1963  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1964  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1965  nPart++;
1966  }
1967  }
1968  if (std::find(pdgCodes.begin(), pdgCodes.end(), 111) != pdgCodes.end())
1969  histo->SetBinContent(2, BR+histo->GetBinContent(2));
1970  else if (std::find(pdgCodes.begin(), pdgCodes.end(), 221) != pdgCodes.end())
1971  histo->SetBinContent(3, BR+histo->GetBinContent(3));
1972  else if (std::find(pdgCodes.begin(), pdgCodes.end(), 211) != pdgCodes.end())
1973  histo->SetBinContent(4, BR+histo->GetBinContent(4));
1974  else if (std::find(pdgCodes.begin(), pdgCodes.end(), -211) != pdgCodes.end())
1975  histo->SetBinContent(5, BR+histo->GetBinContent(5));
1976  else
1977  histo->SetBinContent(20, BR+histo->GetBinContent(20));
1978  pdgCodes.clear();
1979  }
1980  histo->SetBinContent(1, BRtot);
1981  pdgCodes.clear();
1982  break;
1983 
1984  case 11:
1985  kc = (AliPythia6::Instance())->Pycomp(2114);
1986  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
1987  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
1988  BRtot = 0.;
1989  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
1990  BR = (AliPythia6::Instance())->GetBRAT(channel);
1991  BRtot = BRtot + BR;
1992  nPart = 0;
1993  for (Int_t i=1; i<=5; i++) {
1994  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
1995  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
1996  nPart++;
1997  }
1998  }
1999  std::sort(pdgCodes.begin(), pdgCodes.end());
2000  if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 2112)
2001  histo->SetBinContent(2, BR);
2002  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 2212)
2003  histo->SetBinContent(3, BR);
2004  else
2005  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2006  pdgCodes.clear();
2007  }
2008  histo->SetBinContent(1, BRtot);
2009  pdgCodes.clear();
2010  break;
2011 
2012  case 12:
2013  kc = (AliPythia6::Instance())->Pycomp(2214);
2014  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2015  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2016  BRtot = 0.;
2017  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2018  BR = (AliPythia6::Instance())->GetBRAT(channel);
2019  BRtot = BRtot + BR;
2020  nPart = 0;
2021  for (Int_t i=1; i<=5; i++) {
2022  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2023  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2024  nPart++;
2025  }
2026  }
2027  std::sort(pdgCodes.begin(), pdgCodes.end());
2028  if (nPart == 2 && pdgCodes[0] == 211 && pdgCodes[1] == 2112)
2029  histo->SetBinContent(2, BR);
2030  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 2212)
2031  histo->SetBinContent(3, BR);
2032  else
2033  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2034  pdgCodes.clear();
2035  }
2036  histo->SetBinContent(1, BRtot);
2037  pdgCodes.clear();
2038  break;
2039 
2040  case 13:
2041  kc = (AliPythia6::Instance())->Pycomp(1114);
2042  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2043  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2044  BRtot = 0.;
2045  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2046  BR = (AliPythia6::Instance())->GetBRAT(channel);
2047  BRtot = BRtot + BR;
2048  nPart = 0;
2049  for (Int_t i=1; i<=5; i++) {
2050  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2051  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2052  nPart++;
2053  }
2054  }
2055  std::sort(pdgCodes.begin(), pdgCodes.end());
2056  if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 2112)
2057  histo->SetBinContent(2, BR);
2058  else
2059  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2060  pdgCodes.clear();
2061  }
2062  histo->SetBinContent(1, BRtot);
2063  pdgCodes.clear();
2064  break;
2065 
2066  case 14:
2067  kc = (AliPythia6::Instance())->Pycomp(2224);
2068  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2069  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2070  BRtot = 0.;
2071  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2072  BR = (AliPythia6::Instance())->GetBRAT(channel);
2073  BRtot = BRtot + BR;
2074  nPart = 0;
2075  for (Int_t i=1; i<=5; i++) {
2076  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2077  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2078  nPart++;
2079  }
2080  }
2081  std::sort(pdgCodes.begin(), pdgCodes.end());
2082  if (nPart == 2 && pdgCodes[0] == 211 && pdgCodes[1] == 2212)
2083  histo->SetBinContent(2, BR);
2084  else
2085  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2086  pdgCodes.clear();
2087  }
2088  histo->SetBinContent(1, BRtot);
2089  pdgCodes.clear();
2090  break;
2091 
2092  case 15: case 16: // PYTHIA doesn't distinguish between K+/K-
2093  kc = (AliPythia6::Instance())->Pycomp(321);
2094  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2095  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2096  BRtot = 0.;
2097  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2098  BR = (AliPythia6::Instance())->GetBRAT(channel);
2099  BRtot = BRtot + BR;
2100  nPart = 0;
2101  for (Int_t i=1; i<=5; i++) {
2102  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2103  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2104  nPart++;
2105  }
2106  }
2107  std::sort(pdgCodes.begin(), pdgCodes.end());
2108  if (nPart == 2 && pdgCodes[0] == -13 && pdgCodes[1] == 14)
2109  histo->SetBinContent(2, BR);
2110  else if (nPart == 3 && pdgCodes[0] == -13 && pdgCodes[1] == 14 && pdgCodes[2] == 22)
2111  histo->SetBinContent(3, BR);
2112  else if (nPart == 3 && pdgCodes[0] == -11 && pdgCodes[1] == 12 && pdgCodes[2] == 111)
2113  histo->SetBinContent(4, BR);
2114  else if (nPart == 3 && pdgCodes[0] == -13 && pdgCodes[1] == 14 && pdgCodes[2] == 111)
2115  histo->SetBinContent(5, BR);
2116  else if (nPart == 4 && pdgCodes[0] == -11 && pdgCodes[1] == 12 && pdgCodes[2] == 111 && pdgCodes[3] == 111)
2117  histo->SetBinContent(6, BR);
2118  else if (nPart == 4 && pdgCodes[0] == -211 && pdgCodes[1] == -11 && pdgCodes[2] == 12 && pdgCodes[3] == 211)
2119  histo->SetBinContent(7, BR);
2120  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 211)
2121  histo->SetBinContent(8, BR);
2122  else if (nPart == 3 && pdgCodes[0] == 111 && pdgCodes[1] == 111 && pdgCodes[2] == 211)
2123  histo->SetBinContent(9, BR);
2124  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 211 && pdgCodes[2] == 211)
2125  histo->SetBinContent(10, BR);
2126  else
2127  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2128  pdgCodes.clear();
2129  }
2130  histo->SetBinContent(1, BRtot);
2131  pdgCodes.clear();
2132  break;
2133 
2134  case 17: case 18: // PYTHIA doesn't distinguish between Omega-/Omega+
2135  kc = (AliPythia6::Instance())->Pycomp(3334);
2136  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2137  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2138  BRtot = 0.;
2139  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2140  BR = (AliPythia6::Instance())->GetBRAT(channel);
2141  BRtot = BRtot + BR;
2142  nPart = 0;
2143  for (Int_t i=1; i<=5; i++) {
2144  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2145  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2146  nPart++;
2147  }
2148  }
2149  std::sort(pdgCodes.begin(), pdgCodes.end());
2150  if (nPart == 2 && pdgCodes[0] == -321 && pdgCodes[1] == 3122)
2151  histo->SetBinContent(2, BR);
2152  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 3322)
2153  histo->SetBinContent(3, BR);
2154  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 3312)
2155  histo->SetBinContent(4, BR);
2156  else if (nPart == 3 && pdgCodes[0] == -211 && pdgCodes[1] == 211 && pdgCodes[2] == 3312)
2157  histo->SetBinContent(5, BR);
2158  else
2159  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2160  pdgCodes.clear();
2161  }
2162  histo->SetBinContent(1, BRtot);
2163  pdgCodes.clear();
2164  break;
2165 
2166  case 19: case 20: // PYTHIA doesn't distinguish between Xi-/Xi+
2167  kc = (AliPythia6::Instance())->Pycomp(3312);
2168  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2169  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2170  BRtot = 0.;
2171  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2172  BR = (AliPythia6::Instance())->GetBRAT(channel);
2173  BRtot = BRtot + BR;
2174  nPart = 0;
2175  for (Int_t i=1; i<=5; i++) {
2176  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2177  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2178  nPart++;
2179  }
2180  }
2181  std::sort(pdgCodes.begin(), pdgCodes.end());
2182  if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 3122)
2183  histo->SetBinContent(2, BR);
2184  else
2185  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2186  pdgCodes.clear();
2187  }
2188  histo->SetBinContent(1, BRtot);
2189  pdgCodes.clear();
2190  break;
2191 
2192  case 21:
2193  kc = (AliPythia6::Instance())->Pycomp(3224);
2194  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2195  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2196  BRtot = 0.;
2197  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2198  BR = (AliPythia6::Instance())->GetBRAT(channel);
2199  BRtot = BRtot + BR;
2200  nPart = 0;
2201  for (Int_t i=1; i<=5; i++) {
2202  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2203  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2204  nPart++;
2205  }
2206  }
2207  std::sort(pdgCodes.begin(), pdgCodes.end());
2208  if (nPart == 2 && pdgCodes[0] == 211 && pdgCodes[1] == 3122)
2209  histo->SetBinContent(2, BR);
2210  else if (nPart == 2 && pdgCodes[0] == 211 && pdgCodes[1] == 3212)
2211  histo->SetBinContent(3, BR);
2212  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 3222)
2213  histo->SetBinContent(4, BR);
2214  else
2215  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2216  pdgCodes.clear();
2217  }
2218  histo->SetBinContent(1, BRtot);
2219  pdgCodes.clear();
2220  break;
2221 
2222  case 22:
2223  kc = (AliPythia6::Instance())->Pycomp(3114);
2224  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2225  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2226  BRtot = 0.;
2227  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2228  BR = (AliPythia6::Instance())->GetBRAT(channel);
2229  BRtot = BRtot + BR;
2230  nPart = 0;
2231  for (Int_t i=1; i<=5; i++) {
2232  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2233  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2234  nPart++;
2235  }
2236  }
2237  std::sort(pdgCodes.begin(), pdgCodes.end());
2238  if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 3122)
2239  histo->SetBinContent(2, BR);
2240  else if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 3212)
2241  histo->SetBinContent(3, BR);
2242  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 3112)
2243  histo->SetBinContent(4, BR);
2244  else
2245  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2246  pdgCodes.clear();
2247  }
2248  histo->SetBinContent(1, BRtot);
2249  pdgCodes.clear();
2250  break;
2251 
2252  case 23:
2253  kc = (AliPythia6::Instance())->Pycomp(313);
2254  firstChannel = (AliPythia6::Instance())->GetMDCY(kc,2);
2255  lastChannel = firstChannel + (AliPythia6::Instance())->GetMDCY(kc,3) - 1;
2256  BRtot = 0.;
2257  for (Int_t channel=firstChannel; channel<=lastChannel; channel++) {
2258  BR = (AliPythia6::Instance())->GetBRAT(channel);
2259  BRtot = BRtot + BR;
2260  nPart = 0;
2261  for (Int_t i=1; i<=5; i++) {
2262  if ((AliPythia6::Instance())->GetKFDP(channel,i)) {
2263  pdgCodes.push_back((AliPythia6::Instance())->GetKFDP(channel,i));
2264  nPart++;
2265  }
2266  }
2267  std::sort(pdgCodes.begin(), pdgCodes.end());
2268  if (nPart == 2 && pdgCodes[0] == -211 && pdgCodes[1] == 321)
2269  histo->SetBinContent(2, BR);
2270  else if (nPart == 2 && pdgCodes[0] == -321 && pdgCodes[1] == 211)
2271  histo->SetBinContent(3, BR);
2272  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 130)
2273  histo->SetBinContent(4, BR+histo->GetBinContent(4));
2274  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 310)
2275  histo->SetBinContent(4, BR+histo->GetBinContent(4));
2276  else if (nPart == 2 && pdgCodes[0] == 111 && pdgCodes[1] == 311)
2277  histo->SetBinContent(4, BR+histo->GetBinContent(4));
2278  else
2279  histo->SetBinContent(20, BR+histo->GetBinContent(20));
2280  pdgCodes.clear();
2281  }
2282  histo->SetBinContent(1, BRtot);
2283  pdgCodes.clear();
2284  break;
2285 
2286  default:
2287  break;
2288  }
2289 }
2290 
2291 //_________________________________________________________________________________
2293 
2294  Int_t returnVal = -9999;
2295 
2296  switch (pdg) {
2297  case 221:
2298  returnVal = 0;
2299  break;
2300  case 310:
2301  returnVal = 1;
2302  break;
2303  case 130:
2304  returnVal = 2;
2305  break;
2306  case 3122:
2307  returnVal = 3;
2308  break;
2309  case 113:
2310  returnVal = 4;
2311  break;
2312  case 331:
2313  returnVal = 5;
2314  break;
2315  case 223:
2316  returnVal = 6;
2317  break;
2318  case 213:
2319  returnVal = 7;
2320  break;
2321  case -213:
2322  returnVal = 8;
2323  break;
2324  case 333:
2325  returnVal = 9;
2326  break;
2327  case 443:
2328  returnVal = 10;
2329  break;
2330  case 2114:
2331  returnVal = 11;
2332  break;
2333  case 2214:
2334  returnVal = 12;
2335  break;
2336  case 1114:
2337  returnVal = 13;
2338  break;
2339  case 2224:
2340  returnVal = 14;
2341  break;
2342  case 321:
2343  returnVal = 15;
2344  break;
2345  case -321:
2346  returnVal = 16;
2347  break;
2348  case -3334:
2349  returnVal = 17;
2350  break;
2351  case 3334:
2352  returnVal = 18;
2353  break;
2354  case -3312:
2355  returnVal = 19;
2356  break;
2357  case 3312:
2358  returnVal = 20;
2359  break;
2360  case 3224:
2361  returnVal = 21;
2362  break;
2363  case 3114:
2364  returnVal = 22;
2365  break;
2366  case 313:
2367  returnVal = 23;
2368  break;
2369  default:
2370  break;
2371  }
2372 
2373  return returnVal;
2374 }
2375 
2376 //_________________________________________________________________________________
2377 TH1* AliAnalysisTaskHadronicCocktailMC::SetHist1D(TH1* hist, TString histType, TString histName, TString xTitle, TString yTitle, Int_t nBinsX, Double_t xMin, Double_t xMax, Bool_t optSumw2) {
2378 
2379  if (histType.CompareTo("f") == 0 || histType.CompareTo("F") == 0)
2380  hist = new TH1F(histName, histName, nBinsX, xMin, xMax);
2381  if (histType.CompareTo("i") == 0 || histType.CompareTo("I") == 0)
2382  hist = new TH1I(histName, histName, nBinsX, xMin, xMax);
2383 
2384  hist->GetXaxis()->SetTitle(xTitle);
2385  hist->GetYaxis()->SetTitle(yTitle);
2386 
2387  if (optSumw2)
2388  hist->Sumw2();
2389 
2390  return hist;
2391 }
2392 
2393 //_________________________________________________________________________________
2394 TH2* AliAnalysisTaskHadronicCocktailMC::SetHist2D(TH2* hist, TString histType, TString histName, TString xTitle, TString yTitle, Int_t nBinsX, Double_t xMin, Double_t xMax, Int_t nBinsY, Double_t yMin, Double_t yMax, Bool_t optSumw2) {
2395 
2396  if (histType.CompareTo("f") == 0 || histType.CompareTo("F") == 0)
2397  hist = new TH2F(histName, histName, nBinsX, xMin, xMax, nBinsY, yMin, yMax);
2398  if (histType.CompareTo("i") == 0 || histType.CompareTo("I") == 0)
2399  hist = new TH2I(histName, histName, nBinsX, xMin, xMax, nBinsY, yMin, yMax);
2400 
2401  hist->GetXaxis()->SetTitle(xTitle);
2402  hist->GetYaxis()->SetTitle(yTitle);
2403 
2404  if (optSumw2)
2405  hist->Sumw2();
2406 
2407  return hist;
2408 }
2409 
2410 //_________________________________________________________________________________
2411 TH2* AliAnalysisTaskHadronicCocktailMC::SetHist2D(TH2* hist, TString histType, TString histName, TString xTitle, TString yTitle, Int_t nBinsX, Double_t xMin, Double_t xMax, Int_t nBinsY, Double_t* binsY, Bool_t optSumw2) {
2412 
2413  if (histType.CompareTo("f") == 0 || histType.CompareTo("F") == 0)
2414  hist = new TH2F(histName, histName, nBinsX, xMin, xMax, nBinsY, binsY);
2415  if (histType.CompareTo("i") == 0 || histType.CompareTo("I") == 0)
2416  hist = new TH2I(histName, histName, nBinsX, xMin, xMax, nBinsY, binsY);
2417 
2418  hist->GetXaxis()->SetTitle(xTitle);
2419  hist->GetYaxis()->SetTitle(yTitle);
2420 
2421  if (optSumw2)
2422  hist->Sumw2();
2423 
2424  return hist;
2425 }
2426 
Int_t pdg
TH2F ** fHistPtYInput
histo for phi of input particles
double Double_t
Definition: External.C:58
Definition: External.C:236
long long Long64_t
Definition: External.C:43
void GetAndSetPtYDistributions(AliGenEMCocktailV2 *mcCocktailGen)
TH2F ** fHistPtYDaughterSource
histo for pi0/eta from input particles
Double_t ptMin
TH1 * SetHist1D(TH1 *hist, TString histType, TString histName, TString xTitle, TString yTitle, Int_t nBinsX, Double_t xMin, Double_t xMax, Bool_t optSumw2)
int Int_t
Definition: External.C:63
Float_t GetDecayChannel(AliMCEvent *mcEvent, TParticle *part)
Definition: External.C:204
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
TH1I * fHistPdgInputRest
histo for phi correlation of gammas from input particles to source
TH2 * SetHist2D(TH2 *hist, TString histType, TString histName, TString xTitle, TString yTitle, Int_t nBinsX, Double_t xMin, Double_t xMax, Int_t nBinsY, Double_t yMin, Double_t yMax, Bool_t optSumw2)
Definition: External.C:212
TH1F ** fHistDecayChannelsInput
histo for input particles
TH2F ** fHistPtPhiInput
histo for phi of pi0/eta from input particles
TH2F ** fHistPtPhiGammaFromPi0FromInput
gammas from pi0 from k0s, k0l, lambda
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)
Definition: External.C:220
TH2F ** fHistPhiDaughterPhiSourceInput
histo for pt correlation of gammas from input particles to source
TH2F ** fHistPtDaughterPtSourceInput
histo for input particle BR from pythia
TH2F ** fHistPtYGammaFromXFromInput
histo for gamma from rest
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
Double_t ptMax
TH2F ** fHistPtPhiGammaFromXFromInput
gammas from X from k0s, k0l, lambda
Double_t yMin
void GetAndSetPtParametrizations(AliGenEMCocktailV2 *mcCocktailGen)
Definition: External.C:196
TH1F ** fHistPythiaBR
histo for input particle decay channels
Double_t yMax