AliPhysics  ff07904 (ff07904)
AliMCAnalysisUtils.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include <TMath.h>
18 #include <TList.h>
19 #include "TParticle.h"
20 #include "TDatabasePDG.h"
21 #include "TVector3.h"
22 
23 //---- ANALYSIS system ----
24 #include "AliAnalysisManager.h"
25 #include "AliInputEventHandler.h"
26 #include "AliMCEvent.h"
27 #include "AliGenPythiaEventHeader.h"
28 #include "AliVParticle.h"
29 #include "AliLog.h"
30 
31 #include "AliMCAnalysisUtils.h"
32 
34 ClassImp(AliMCAnalysisUtils) ;
36 
37 //________________________________________
39 //________________________________________
41 TObject(),
42 fCurrentEvent(-1),
43 fDebug(0),
44 fJetsList(new TList),
45 fMCGenerator(kPythia),
46 fMCGeneratorString("PYTHIA"),
47 fDaughMom(), fDaughMom2(),
48 fMotherMom(), fGMotherMom(),
49 fPyGenHead(NULL) ,
50 fPyGenName(""),
51 fPyProcessName(""),
52 fPyProcess(-1),
53 fPyFirstParticle(0),
54 fPyVersion(0),
55 fMinPartonicParent(5),
56 fMaxPartonicParent(8)
57 {}
58 
59 //_______________________________________
61 //_______________________________________
63 {
64  if (fJetsList)
65  {
66  fJetsList->Clear();
67  delete fJetsList ;
68  }
69 }
70 
71 //_____________________________________________________________________________________________
74 //_____________________________________________________________________________________________
76  const AliMCEvent* mcevent,
77  Int_t & ancPDG, Int_t & ancStatus,
78  TLorentzVector & momentum, TVector3 & prodVertex)
79 {
80  if ( index1 < 0 || index2 < 0 )
81  {
82  ancPDG = -10000;
83  ancStatus = -10000;
84  momentum.SetXYZT(0,0,0,0);
85  prodVertex.SetXYZ(-10,-10,-10);
86  //printf("\t Negative index (%d, %d)\n",index1,index2);
87  }
88 
89  Int_t label1[1000];
90  Int_t label2[1000];
91  label1[0]= index1;
92  label2[0]= index2;
93  Int_t counter1 = 0;
94  Int_t counter2 = 0;
95 
96  if(label1[0]==label2[0])
97  {
98  //printf("\t Already the same label: %d\n",label1[0]);
99  counter1=1;
100  counter2=1;
101  }
102  else
103  {
104  Int_t label=label1[0];
105 
106  while(label > -1 && counter1 < 999)
107  {
108  counter1++;
109  AliVParticle * mom = mcevent->GetTrack(label);
110  if(mom)
111  {
112  label = mom->GetMother() ;
113  label1[counter1]=label;
114  }
115  //printf("\t 1) counter %d, mom label %d, pdg %d\n", counter1,label, mom->PdgCode());
116  }
117 
118  //printf("Org label2=%d,\n",label2[0]);
119  label=label2[0];
120 
121  while(label > -1 && counter2 < 999)
122  {
123  counter2++;
124  AliVParticle * mom = mcevent->GetTrack(label);
125  if(mom)
126  {
127  label = mom->GetMother() ;
128  label2[counter2]=label;
129  }
130  //printf("\t 2) counter %d, mom label %d, pdg %d \n", counter2,label, mom->PdgCode());
131  }
132  }//First labels not the same
133 
134  if((counter1==999 || counter2==999))
135  AliWarning(Form("Genealogy too large, generations: cluster1: %d, cluster2= %d", counter1, counter2));
136 
137  //printf("CheckAncestor:\n");
138 
139  //Int_t commonparents = 0;
140  Int_t ancLabel = -1;
141  //printf("counters %d %d \n",counter1, counter2);
142  for (Int_t c1 = 0; c1 < counter1; c1++)
143  {
144  for (Int_t c2 = 0; c2 < counter2; c2++)
145  {
146  if ( label1[c1]==label2[c2] && label1[c1]>-1 &&
147  ancLabel < label1[c1] ) // make sure to take the first common parent, not needed since array is ordered, just in case
148  {
149  ancLabel = label1[c1];
150  //commonparents++;
151 
152  AliVParticle * mom = mcevent->GetTrack(label1[c1]);
153 
154  if (mom)
155  {
156  ancPDG = mom->PdgCode();
157  ancStatus = mom->MCStatusCode();
158  momentum.SetPxPyPzE(mom->Px(),mom->Py(),mom->Pz(),mom->E());
159  prodVertex.SetXYZ(mom->Xv(),mom->Yv(),mom->Zv());
160  //printf("Ancestor label %d PDG %d, status %d\n",ancLabel,ancPDG,ancStatus);
161  }
162 
163  //First ancestor found, end the loops
164  //counter1=0;
165  //counter2=0;
166  }//Ancestor found
167  }//second cluster loop
168  }//first cluster loop
169 
170  //printf("common ancestors %d\n",commonparents);
171 
172  if(ancLabel < 0)
173  {
174  //printf("No ancestor found!\n");
175  ancPDG = -10000;
176  ancStatus = -10000;
177  momentum.SetXYZT(0,0,0,0);
178  prodVertex.SetXYZ(-10,-10,-10);
179  }
180 
181  return ancLabel;
182 }
183 
184 //____________________________________________________________________________________________________
191 //_____________________________________________________________________________________________________
192 Int_t AliMCAnalysisUtils::CheckOrigin(Int_t label, AliMCEvent* mcevent, TString selectHeaderName)
193 {
194  Int_t labels[] = { label };
195 
196  return CheckOrigin(labels, 1, mcevent, selectHeaderName);
197 }
198 
199 //__________________________________________________________________________________________
215 //__________________________________________________________________________________________
217  AliMCEvent* mcevent, TString selectHeaderName,
218  const TObjArray* arrayCluster)
219 {
220  if( nlabels <= 0 )
221  {
222  AliWarning("No MC labels available, please check!!!");
223  return kMCBadLabel;
224  }
225 
226  if ( !mcevent )
227  {
228  AliDebug(1,"MCEvent is not available, check analysis settings in configuration file, do nothing with MC!!");
229  return -1;
230  }
231 
232  Int_t tag = 0;
233  Int_t nprimaries = mcevent->GetNumberOfTracks();
234 
235  // Bad label
236  if ( labels[0] < 0 || labels[0] >= nprimaries )
237  {
238  if(labels[0] < 0)
239  AliWarning(Form("*** bad label ***: label %d", labels[0]));
240 
241  if(labels[0] >= nprimaries)
242  AliWarning(Form("*** large label ***: label %d, n tracks %d", labels[0], nprimaries));
243 
244  SetTagBit(tag,kMCBadLabel);
245 
246  return tag;
247  } // Bad label
248 
250  //
251  if(fMCGenerator == kPythia)
252  {
253  CheckAndGetPythiaEventHeader(mcevent,selectHeaderName);
254 
255 // printf("CheckOrigin() - Name <%s>, include name? <%s>, Pythia version %d,"
256 // " process %d, process name <%s>, first pythia particle %d\n",
257 // fPyGenName.Data(), selectHeaderName.Data(), fPyVersion,
258 // fPyProcess, fPyProcessName.Data(),fPyFirstParticle);
259 
260  // Select the index range where the prompt photon partonic parent can be
261  // it depends on the pythia version
262  }
263  //
265 
266  // Most significant particle contributing to the cluster
267  Int_t label=labels[0];
268 
269  // Mother
270  AliVParticle * mom = mcevent->GetTrack(label);
271  Int_t iMom = label;
272  Int_t mPdgSign = mom->PdgCode();
273  Int_t mPdg = TMath::Abs(mPdgSign);
274  Int_t mStatus = mom->MCStatusCode() ;
275  Int_t iParent = mom->GetMother() ;
276 
277  //if(label < 8 && fMCGenerator != kBoxLike) AliDebug(1,Form("Mother is parton %d\n",iParent));
278 
279  //GrandParent
280  AliVParticle * firstGparent = NULL ;
281  AliVParticle * parent = NULL ;
282  Int_t pPdg =-1;
283  Int_t pStatus =-1;
284  if(iParent >= 0)
285  {
286  parent = mcevent->GetTrack(iParent);
287  pPdg = TMath::Abs(parent->PdgCode());
288  pStatus = parent->MCStatusCode();
289  }
290  else AliDebug(1,Form("Parent with label %d",iParent));
291 
292  AliDebug(2,"Cluster most contributing mother and its parent:");
293  AliDebug(2,Form("\t Mother label %d, pdg %d, status %d, Primary? %d, Physical Primary? %d",
294  iMom , mPdg, mStatus, mom->IsPrimary() , mom->IsPhysicalPrimary()));
295  AliDebug(2,Form("\t Parent label %d, pdg %d, status %d, Primary? %d, Physical Primary? %d",
296  iParent, pPdg, pStatus, parent?parent->IsPrimary():-1, parent?parent->IsPhysicalPrimary():-1));
297 
298  //Check if mother is converted, if not, get the first non converted mother
299  if((mPdg == 22 || mPdg == 11) && (pPdg == 22 || pPdg == 11) && mStatus==0)
300  {
302 
303  // Check if the mother is photon or electron with status not stable
304  while ((pPdg == 22 || pPdg == 11) && !mom->IsPhysicalPrimary())
305  {
306  // Mother
307  iMom = mom->GetMother();
308 
309  if(iMom < 0)
310  {
311  AliInfo(Form("pdg = %d, mother = %d, skip",pPdg,iMom));
312  break;
313  }
314 
315  mom = mcevent->GetTrack(iMom);
316  mPdgSign = mom->PdgCode();
317  mPdg = TMath::Abs(mPdgSign);
318  mStatus = mom->MCStatusCode() ;
319  iParent = mom->GetMother() ;
320  //if(label < 8 ) AliDebug(1, Form("AliMCAnalysisUtils::CheckOriginInAOD() - Mother is parton %d\n",iParent));
321 
322  // GrandParent
323  if(iParent >= 0 && parent)
324  {
325  parent = mcevent->GetTrack(iParent);
326  pPdg = TMath::Abs(parent->PdgCode());
327  pStatus = parent->MCStatusCode();
328  }
329  // printf("\t While Mother label %d, pdg %d, Primary? %d, Physical Primary? %d\n",iMom, mPdg, mom->IsPrimary(), mom->IsPhysicalPrimary());
330  // printf("\t While Parent label %d, pdg %d, Primary? %d, Physical Primary? %d\n",iParent, pPdg, parent->IsPrimary(), parent->IsPhysicalPrimary());
331 
332  }//while
333 
334  AliDebug(2,"Converted photon/electron:");
335  AliDebug(2,Form("\t Mother label %d, pdg %d, status %d, Primary? %d, Physical Primary? %d"
336  ,iMom , mPdg, mStatus, mom->IsPrimary() , mom->IsPhysicalPrimary()));
337  AliDebug(2,Form("\t Parent label %d, pdg %d, status %d, Primary? %d, Physical Primary? %d"
338  ,iParent, pPdg, pStatus, parent?parent->IsPrimary():-1, parent?parent->IsPhysicalPrimary():-1));
339 
340  } // mother and parent are electron or photon and have status 0 and parent is photon or electron
341  else if((mPdg == 22 || mPdg == 11) && mStatus==0)
342  {
343  // Still a conversion but only one electron/photon generated. Just from hadrons
344  if(pPdg == 2112 || pPdg == 211 || pPdg == 321 ||
345  pPdg == 2212 || pPdg == 130 || pPdg == 13 )
346  {
348  iMom = mom->GetMother();
349 
350  if(iMom < 0)
351  {
352  AliInfo(Form("pdg = %d, mother = %d, skip",pPdg,iMom));
353  }
354  else
355  {
356  mom = mcevent->GetTrack(iMom);
357  mPdgSign = mom->PdgCode();
358  mPdg = TMath::Abs(mPdgSign);
359  mStatus = mom->MCStatusCode() ;
360 
361  AliDebug(2,"Converted hadron:");
362  AliDebug(2,Form("\t Mother label %d, pdg %d, status %d, Primary? %d, Physical Primary? %d",
363  iMom, mPdg, mStatus, mom->IsPrimary(), mom->IsPhysicalPrimary()));
364  }
365  } // hadron converted
366 
367  //Comment for next lines, we do not check the parent of the hadron for the moment.
368  //iParent = mom->GetMother() ;
369  //if(fDebug > 0 && label < 8 ) printf("AliMCAnalysisUtils::CheckOriginInAOD() - Mother is parton %d\n",iParent);
370 
371  //GrandParent
372  //if(iParent >= 0){
373  // parent = mcevent->GetTrack(iParent);
374  // pPdg = TMath::Abs(parent->PdgCode());
375  //}
376  }
377 
378  //printf("Final mother mPDG %d\n",mPdg);
379 
380  // conversion into electrons/photons checked
381 
382  //first check for typical charged particles
383  if (mPdg == 13) SetTagBit(tag,kMCMuon);
384  else if(mPdg == 211) SetTagBit(tag,kMCPion);
385  else if(mPdg == 321) SetTagBit(tag,kMCKaon);
386  else if(mPdgSign == 2212) SetTagBit(tag,kMCProton);
387  else if(mPdgSign == 2112) SetTagBit(tag,kMCNeutron);
388  else if(mPdgSign == -2212) SetTagBit(tag,kMCAntiProton);
389  else if(mPdgSign == -2112) SetTagBit(tag,kMCAntiNeutron);
390 
391  //check for pi0 and eta (shouldn't happen unless their decays were turned off)
392  else if(mPdg == 111)
393  {
394  SetTagBit(tag,kMCPi0Decay);
395 
396  AliDebug(2,"First mother is directly pi0, not decayed by generator");
397 
398  CheckOverlapped2GammaDecay(labels,nlabels, iMom, mcevent, tag); //set to kMCPi0 if 2 gammas in same cluster
399  }
400  else if(mPdg == 221)
401  {
402  SetTagBit(tag,kMCEtaDecay);
403 
404  AliDebug(2,"First mother is directly eta, not decayed by generator");
405 
406  CheckOverlapped2GammaDecay(labels,nlabels, iMom, mcevent, tag); //set to kMCEta if 2 gammas in same cluster
407  }
408  //Photons
409  else if(mPdg == 22)
410  {
411  SetTagBit(tag,kMCPhoton);
412 
413  if ( pPdg == 111 )
414  {
415  SetTagBit(tag,kMCPi0Decay);
416 
417  AliDebug(2,"Generator pi0 decay photon");
418 
419  // Set to kMCPi0 if 2 gammas in same cluster
420  CheckOverlapped2GammaDecay(labels,nlabels, iParent, mcevent, tag);
421 
422  // In case it did not merge, check if the decay companion is lost
424  {
425  CheckLostDecayPair(arrayCluster,iMom, iParent, mcevent, tag);
426  }
427 
428  //printf("Bit set is Merged %d, Pair in calo %d, Lost %d\n",CheckTagBit(tag, kMCPi0),CheckTagBit(tag,kMCDecayPairInCalo),CheckTagBit(tag,kMCDecayPairLost));
429  }
430  else if ( pPdg == 221 )
431  {
432  SetTagBit(tag, kMCEtaDecay);
433 
434  AliDebug(2,"Generator eta decay photon");
435 
436  // Set to kMCEta if 2 gammas in same cluster
437  CheckOverlapped2GammaDecay(labels,nlabels, iParent, mcevent, tag);
438 
439  // In case it did not merge, check if the decay companion is lost
441  CheckLostDecayPair(arrayCluster,iMom, iParent, mcevent, tag);
442  }
443  else if ( pPdg > 100 )
444  {
446 
447  AliDebug(2,Form("Generator decay photon from parent pdg %d",pPdg));
448  }
449  else if( mom->IsPhysicalPrimary() && mStatus == 1 &&
450  ( fMCGenerator == kPythia || fMCGenerator == kHerwig ) ) //undecayed particle
451  {
452  Int_t firstpPdg =-1 ;
453  Int_t firstPhotonLabel =-1 ;
454  Int_t gparentlabel =-1 ;
455  Bool_t ok = kFALSE;
456 
457 // printf("=== Photon Label %d, Mom label %d, iParent %d, pPdg %d, pT %2.3f; "
458 // "process %d (%s), min parent %d, max parent %d, pythia v%d\n",
459 // label,iMom, iParent, pPdg, mom->Pt(), fPyProcess,
460 // fPyProcessName.Data(), fMinPartonicParent,fMaxPartonicParent, fPyVersion);
461 
462  //PrintAncestry(mcevent,iMom,10);
463 
464  if ( fPyVersion == 6 || fMCGenerator == kHerwig ) // to be checked for herwig
465  {
466  if( iParent-fPyFirstParticle < fMaxPartonicParent &&
468  {
469  //outgoing partons
470  if ( pPdg == 22 ) { SetTagBit(tag,kMCPrompt) ; /*printf("\t \t Prompt6\n")*/ ; }
471  else { SetTagBit(tag,kMCFragmentation); /*printf("\t \t Fragment66\n");*/ }
472  }//Outgoing partons
473  else if( iParent <= fMinPartonicParent ) // Pythia6
474  {
475  SetTagBit(tag, kMCISR); //Initial state radiation
476  //printf("\t \t ISR\n");
477  }
478  else if ( pPdg < 23 )
479  {
481 
482  AliDebug(2,Form("Generator fragmentation photon from parent pdg %d",firstpPdg));
483  //printf("\t \t Fragment6\n");
484  }
485  else
486  {
487  AliDebug(2,Form("Generator physical primary (pythia/herwig) unknown photon from parent pdg %d",firstpPdg));
488  //printf("\t \t Unknown\n");
489  SetTagBit(tag,kMCUnknown);
490  }
491  }
492  else if ( fPyVersion == 8 )
493  {
494  GetFirstMotherWithPDG(iMom,22,mcevent, ok, firstPhotonLabel,gparentlabel);
495 // printf("\t First Gen %d, First photon: %d, parent %d; first photon - first gen %d, parent-firstGen %d\n",
496 // fPyFirstParticle, firstPhotonLabel,gparentlabel,
497 // firstPhotonLabel-fPyFirstParticle, gparentlabel-fPyFirstParticle);
498  firstGparent = mcevent->GetTrack(firstPhotonLabel);
499  firstpPdg = TMath::Abs(firstGparent->PdgCode());
500 
501  if( firstPhotonLabel-fPyFirstParticle < fMaxPartonicParent &&
502  firstPhotonLabel-fPyFirstParticle > fMinPartonicParent )
503  {
504  SetTagBit(tag,kMCPrompt);
505  //printf("\t \t Prompt8\n");
506  }
507  else
508  {
510 
511  AliDebug(2,Form("Generator fragmentation photon from parent pdg %d",firstpPdg));
512  //printf("\t \t Fragment8\n");
513  }
514  }
515  } // Physical primary
516  else
517  {
518  AliDebug(2,Form("Generator unknown unphysical photon from parent pdg %d",pPdg));
519 
520  SetTagBit(tag,kMCUnknown);
521  }
522 // //Old Herwig selection for ESDs, maybe should be considered.
523 // if(fMCGenerator == kHerwig)
524 // {
525 // if(pStatus < 197)
526 // {//Not decay
527 // while(1)
528 // {
529 // if(parent)
530 // {
531 // if(parent->GetMother()<=5) break;
532 // iParent = parent->GetMother();
533 // parent = mcevent->GetTrack(iParent);
534 // pStatus = parent->MCStatusCode();
535 // pPdg = TMath::Abs(parent->PdgCode());
536 // } else break;
537 // }//Look for the parton
538 //
539 // if(iParent < 8 && iParent > 5)
540 // {
541 // if(pPdg == 22) SetTagBit(tag,kMCPrompt);
542 // else SetTagBit(tag,kMCFragmentation);
543 // }
544 // else SetTagBit(tag,kMCISR);//Initial state radiation
545 // }//Not decay
546 // else SetTagBit(tag,kMCUnknown);
547 // }//HERWIG
548 
549  } // Mother Photon
550 
551  // Electron check. Where did that electron come from?
552  else if(mPdg == 11)
553  {
554  //electron
555  if(pPdg == 11 && parent)
556  {
557  Int_t iGrandma = parent->GetMother();
558  if(iGrandma >= 0)
559  {
560  AliVParticle * gma = mcevent->GetTrack(iGrandma);
561  Int_t gPdg = TMath::Abs(gma->PdgCode());
562 
563  if (gPdg == 23) { SetTagBit(tag,kMCZDecay); } //parent is Z-boson
564  else if (gPdg == 24) { SetTagBit(tag,kMCWDecay); } //parent is W-boson
565  }
566  }
567 
568  SetTagBit(tag,kMCElectron);
569 
570  AliDebug(1,"Checking ancestors of electrons");
571 
572  if (pPdg == 111) { SetTagBit(tag,kMCPi0Decay); SetTagBit(tag,kMCDecayDalitz);} //Pi0 Dalitz decay
573  else if (pPdg == 221) { SetTagBit(tag,kMCEtaDecay); SetTagBit(tag,kMCDecayDalitz);} //Eta Dalitz decay
574  else if((499 < pPdg && pPdg < 600)||(4999 < pPdg && pPdg < 6000)) { SetTagBit(tag,kMCEFromB);} //b-hadron decay
575  else if((399 < pPdg && pPdg < 500)||(3999 < pPdg && pPdg < 5000))
576  {
577  //c-hadron decay check
578  if(parent)
579  {
580  Int_t iGrandma = parent->GetMother();
581  if(iGrandma >= 0)
582  {
583  AliVParticle * gma = mcevent->GetTrack(iGrandma); //charm's mother
584  Int_t gPdg = TMath::Abs(gma->PdgCode());
585  if((499 < gPdg && gPdg < 600)||(4999 < gPdg && gPdg < 6000)) SetTagBit(tag,kMCEFromCFromB); //b-->c-->e decay
586  else SetTagBit(tag,kMCEFromC); //c-hadron decay
587  }
588  else SetTagBit(tag,kMCEFromC); //c-hadron decay
589  }//parent
590  } else
591  { //prompt or other decay
592 
593  TParticlePDG* foo = TDatabasePDG::Instance()->GetParticle(pPdg);
594  TParticlePDG* foo1 = TDatabasePDG::Instance()->GetParticle(mPdg);
595 
596  AliDebug(1,Form("Electron from other origin: %s (pPdg = %d) %s (mPdg = %d)",foo->GetName(), pPdg,foo1->GetName(),mPdg));
597 
598  if(pPdg > 10000) SetTagBit(tag,kMCUnknown);
599  else SetTagBit(tag,kMCOtherDecay);
600  }
601  }// electron check
602  // cluster was made by something else
603  else
604  {
605  AliDebug(1,Form("\t Setting kMCUnknown for cluster with pdg = %d, Parent pdg = %d",mPdg,pPdg));
606  SetTagBit(tag,kMCUnknown);
607  }
608 
609  return tag;
610 }
611 
612 //_________________________________________________________________________________________
615 //_________________________________________________________________________________________
617  Int_t mesonIndex, const AliMCEvent* mcevent,
618  Int_t & tag)
619 {
620  if(labels[0] < 0 || labels[0] > mcevent->GetNumberOfTracks() || nlabels <= 1)
621  {
622  AliDebug(2,Form("Exit : label[0] %d, n primaries %d, nlabels %d",labels[0],mcevent->GetNumberOfTracks(), nlabels));
623  return;
624  }
625 
626  AliVParticle * meson = mcevent->GetTrack(mesonIndex);
627  Int_t mesonPdg = meson->PdgCode();
628  if(mesonPdg != 111 && mesonPdg != 221)
629  {
630  AliWarning(Form("Wrong pi0/eta PDG : %d",mesonPdg));
631  return;
632  }
633 
634  AliDebug(2,Form("pdg %d, label %d, ndaughters %d", mesonPdg, mesonIndex, meson->GetNDaughters()));
635 
636  // Get the daughters
637  if(meson->GetNDaughters() != 2)
638  {
639 // if(meson->GetNDaughters()>2)
640 // {
641 // printf("xx More than 2 daughters <%d> for pdg %d with E %2.2f, pT %2.2f:\n",
642 // meson->GetNDaughters(),meson->PdgCode(),meson->E(),meson->Pt());
643 // for(Int_t idaugh = 0; idaugh < meson->GetNDaughters(); idaugh++)
644 // {
645 // if(meson->GetDaughterLabel(idaugh) < 0)
646 // {
647 // printf("\t no daughther with index %d:\n",idaugh);
648 // continue;
649 // }
650 // AliVParticle * daugh = mcevent->GetTrack(meson->GetDaughterLabel(idaugh));
651 // printf("\t daughther pdg %d, E %2.2f, pT %2.2f:\n",daugh->PdgCode(),daugh->E(),daugh->Pt());
652 // }
653 // }
654 
655  AliDebug(2,Form("Not overlapped. Number of daughters is %d, not 2",meson->GetNDaughters()));
656  return;
657  }
658 
659  Int_t iPhoton0 = meson->GetDaughterLabel(0);
660  Int_t iPhoton1 = meson->GetDaughterLabel(1);
661 
662  //if((iPhoton0 == -1) || (iPhoton1 == -1))
663  //{
664  // if(fDebug > 2)
665  // printf("AliMCAnalysisUtils::CheckOverlapped2GammaDecay(AOD) - Exit : Not overlapped. At least a daughter do not exists : d1 %d, d2 %d \n", iPhoton0, iPhoton1);
666  // return;
667  //}
668 
669  AliVParticle *photon0 = mcevent->GetTrack(iPhoton0);
670  AliVParticle *photon1 = mcevent->GetTrack(iPhoton1);
671 
672  // Check if both daughters are photons
673  if(photon0->PdgCode() != 22 && photon1->PdgCode()!=22)
674  {
675  AliWarning(Form("Not overlapped. PDG: daughter 1 = %d, of daughter 2 = %d",photon0->PdgCode(),photon1->PdgCode()));
676  return;
677  }
678 
679  AliDebug(2,Form("Daughter labels : photon0 = %d, photon1 = %d",iPhoton0,iPhoton1));
680 
681  // Check if both photons contribute to the cluster
682  Bool_t okPhoton0 = kFALSE;
683  Bool_t okPhoton1 = kFALSE;
684 
685  AliDebug(3,"Labels loop:");
686 
687  Bool_t conversion = kFALSE;
688 
689 // TLorentzVector d0, d1;
690 // photon0->Momentum(d0);
691 // photon1->Momentum(d1);
692 // Float_t openAngle = d0.Angle(d1.Vect());
693 
694  for(Int_t i = 0; i < nlabels; i++)
695  {
696  AliDebug(3, Form("\t label %d/%d: %d, ok? %d, %d", i, nlabels, labels[i], okPhoton0, okPhoton1));
697 
698  if ( labels[i] < 0 ) continue;
699 
700  // If we already found both, break the loop
701  if(okPhoton0 && okPhoton1) break;
702 
703  Int_t index = labels[i];
704  if (iPhoton0 == index)
705  {
706  okPhoton0 = kTRUE;
707  continue;
708  }
709  else if (iPhoton1 == index)
710  {
711  okPhoton1 = kTRUE;
712  continue;
713  }
714 
715  // Trace back the mother in case it was a conversion
716  if(index >= mcevent->GetNumberOfTracks())
717  {
718  AliWarning(Form("Particle index %d larger than size of list %d!!",index,mcevent->GetNumberOfTracks()));
719  continue;
720  }
721 
722  AliVParticle * daught = mcevent->GetTrack(index);
723  Int_t tmpindex = daught->GetMother();
724  AliDebug(3,Form("Conversion? : mother %d",tmpindex));
725 
726  while(tmpindex>=0)
727  {
728  // MC particle of interest is the mother
729  AliDebug(3,Form("\t parent index %d",tmpindex));
730  daught = mcevent->GetTrack(tmpindex);
731  //printf("tmpindex %d\n",tmpindex);
732  if (iPhoton0 == tmpindex)
733  {
734  conversion = kTRUE;
735  okPhoton0 = kTRUE;
736  break;
737  }
738  else if (iPhoton1 == tmpindex)
739  {
740  conversion = kTRUE;
741  okPhoton1 = kTRUE;
742  break;
743  }
744 
745  tmpindex = daught->GetMother();
746 
747  }//While to check if pi0/eta daughter was one of these contributors to the cluster
748 
749  //if(i == 0 && (!okPhoton0 && !okPhoton1)) AliDebug(1,"Something happens, first label should be from a photon decay!");
750 
751  }//loop on list of labels
752 
753  //If both photons contribute tag as the corresponding meson.
754  if(okPhoton0 && okPhoton1)
755  {
756  AliDebug(2,Form("%s OVERLAPPED DECAY",(TDatabasePDG::Instance()->GetParticle(mesonPdg))->GetName()));
757 
758  if(!CheckTagBit(tag,kMCConversion) && conversion)
759  {
760  AliDebug(2,"Second decay photon produced a conversion");
761  SetTagBit(tag,kMCConversion) ;
762  }
763 
764  if(mesonPdg == 111) SetTagBit(tag,kMCPi0);
765  else SetTagBit(tag,kMCEta);
766 
767 // printf("\t Meson E %2.2f, pT %2.2f, Overlapped open angle %2.2f deg, cells %2.1f, conversion %d\n",
768 // meson->E(), meson->Pt(),openAngle*TMath::RadToDeg(),openAngle/0.015,conversion);
769 //
770 // Float_t phi = photon0->Phi()*TMath::RadToDeg();
771 // if(phi < 0) phi+=360;
772 // printf("\t \t daughther1: label %d, E %2.2f, pT %2.2f, eta%2.2f, phi %2.2f, status %d, phys prim %d:\n",
773 // iPhoton0, photon0->E(),photon0->Pt(),
774 // photon0->Eta(),phi,
775 // photon0->MCStatusCode(),photon0->IsPhysicalPrimary());
776 //
777 // phi = photon1->Phi()*TMath::RadToDeg();
778 // if(phi < 0) phi+=360;
779 // printf("\t \t daughther2: label %d, E %2.2f, pT %2.2f, eta%2.2f, phi %2.2f, status %d, phys prim %d:\n",
780 // iPhoton1, photon1->E(),photon1->Pt(),
781 // photon1->Eta(),phi,
782 // photon1->MCStatusCode(),photon1->IsPhysicalPrimary());
783  }
784 }
785 
786 //________________________________________________________________________________________________________
788 //________________________________________________________________________________________________________
789 void AliMCAnalysisUtils::CheckLostDecayPair(const TObjArray* arrayCluster, Int_t iMom, Int_t iParent,
790  const AliMCEvent* mcevent, Int_t & tag)
791 {
792  if(!arrayCluster || iMom < 0 || iParent < 0|| !mcevent) return;
793 
794  AliVParticle * parent = mcevent->GetTrack(iParent);
795 
796  //printf("*** Check label %d with parent %d\n",iMom, iParent);
797 
798  if(parent->GetNDaughters()!=2)
799  {
801  //printf("\t ndaugh = %d\n",parent->GetNDaughters());
802  return ;
803  }
804 
805  Int_t pairLabel = -1;
806  if ( iMom != parent->GetDaughterLabel(0) ) pairLabel = parent->GetDaughterLabel(0);
807  else if( iMom != parent->GetDaughterLabel(1) ) pairLabel = parent->GetDaughterLabel(1);
808 
809  if(pairLabel<0)
810  {
811  //printf("\t pair Label not found = %d\n",pairLabel);
813  return ;
814  }
815 
816  //printf("\t *** find pair %d\n",pairLabel);
817 
818  for(Int_t iclus = 0; iclus < arrayCluster->GetEntriesFast(); iclus++)
819  {
820  AliVCluster * cluster = (AliVCluster*) arrayCluster->At(iclus);
821  //printf("\t \t ** Cluster %d, nlabels %d\n",iclus,cluster->GetNLabels());
822 
823  for(UInt_t ilab = 0; ilab< cluster->GetNLabels(); ilab++)
824  {
825  Int_t label = cluster->GetLabels()[ilab];
826 
827  //printf("\t \t label %d\n",label);
828 
829  if ( label==pairLabel )
830  {
831  //printf("\t \t Pair found\n");
833  return ;
834  }
835  else if ( label== iParent || label== iMom )
836  {
837  //printf("\t \t skip\n");
838  continue;
839  }
840  else // check the ancestry
841  {
842  AliVParticle * mother = mcevent->GetTrack(label);
843 
844  if ( !mother )
845  {
846  AliInfo(Form("MC Mother not available for label %d",label));
847  continue;
848  }
849 
850  Int_t momPDG = TMath::Abs(mother->PdgCode());
851  if ( momPDG!=11 && momPDG!=22 ) continue;
852 
853  // Check if "mother" of entity is converted, if not, get the first non converted mother
854  Int_t iParentClus = mother->GetMother();
855  if(iParentClus < 0) continue;
856 
857  AliVParticle * parentClus = mcevent->GetTrack(iParentClus);
858  if(!parentClus) continue;
859 
860  Int_t parentClusPDG = TMath::Abs(parentClus->PdgCode());
861  Int_t parentClusStatus = parentClus->MCStatusCode();
862 
863  if ( parentClusPDG != 22 && parentClusPDG != 11 && parentClusStatus != 0 )
864  {
865  //printf("\t \t skip, not a conversion, parent: pdg %d, status %d\n",parentClusPDG,parentClusStatus);
866  continue;
867  }
868 
869  //printf("\t \t Conversion\n");
870 
871  // Check if the mother is photon or electron with status not stable
872  while ((parentClusPDG == 22 || parentClusPDG == 11) && parentClusStatus != 1)
873  {
874  //New Mother
875  label = iParentClus;
876  momPDG = parentClusPDG;
877 
878  iParentClus = parentClus->GetMother();
879  if ( iParentClus < 0 ) break;
880 
881  parentClus = mcevent->GetTrack(iParentClus);
882  if ( !parentClus ) break;
883 
884  parentClusPDG = TMath::Abs(parentClus->PdgCode());
885  parentClusStatus = parentClus->MCStatusCode() ;
886  }//while
887 
888  if ( (momPDG == 22 || parentClusPDG ==22) && (label==pairLabel || iParentClus == pairLabel) )
889  {
891  //printf("\t \t Conversion is paired: mom %d, parent %d\n",label,iParentClus);
892  return ;
893  }
894  else
895  {
896  //printf("\t \t Skip, finally label %d, pdg %d, parent label %d, pdg %d, status %d\n",label,momPDG,iParentClus,parentClusPDG,parentClusStatus);
897  continue;
898  }
899 
900  }
901  }
902  } // cluster loop
903 
905 }
906 
907 //_____________________________________________________________________
911 //_____________________________________________________________________
912 TList * AliMCAnalysisUtils::GetJets(AliMCEvent* mcevent, Bool_t check)
913 {
914  if ( !fJetsList || !check ) return fJetsList ;
915 
916  if ( fJetsList ) fJetsList->Clear();
917  else fJetsList = new TList;
918 
919  Int_t nTriggerJets = 0;
920  Float_t tmpjet[]={0,0,0,0};
921 
922  // Get outgoing partons
923  if(mcevent->GetNumberOfTracks() < 8) return fJetsList;
924 
925  AliVParticle * parton1 = mcevent->GetTrack(6);
926  AliVParticle * parton2 = mcevent->GetTrack(7);
927 
928  AliDebug(2,Form("Parton 6 : %s, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f",
929  parton1->GetName(),parton1->Pt(),parton1->E(),parton1->Phi()*TMath::RadToDeg(),parton1->Eta()));
930  AliDebug(2,Form("Parton 7 : %s, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f",
931  parton2->GetName(),parton2->Pt(),parton2->E(),parton2->Phi()*TMath::RadToDeg(),parton2->Eta()));
932 
933  // //Trace the jet from the mother parton
934  // Float_t pt = 0;
935  // Float_t pt1 = 0;
936  // Float_t pt2 = 0;
937  // Float_t e = 0;
938  // Float_t e1 = 0;
939  // Float_t e2 = 0;
940  // TParticle * tmptmp = new TParticle;
941  // for(Int_t i = 0; i< stack->GetNprimary(); i++){
942  // tmptmp = stack->Particle(i);
943 
944  // if(tmptmp->GetStatusCode() == 1){
945  // pt = tmptmp->Pt();
946  // e = tmptmp->Energy();
947  // Int_t imom = tmptmp->GetMother();
948  // Int_t imom1 = 0;
949  // //printf("1st imom %d\n",imom);
950  // while(imom > 5){
951  // imom1=imom;
952  // tmptmp = stack->Particle(imom);
953  // imom = tmptmp->GetMother();
954  // //printf("imom %d \n",imom);
955  // }
956  // //printf("Last imom %d %d\n",imom1, imom);
957  // if(imom1 == 6) {
958  // pt1+=pt;
959  // e1+=e;
960  // }
961  // else if (imom1 == 7){
962  // pt2+=pt;
963  // e2+=e; }
964  // }// status 1
965 
966  // }// for
967 
968  // printf("JET 1, pt %2.2f, e %2.2f; JET 2, pt %2.2f, e %2.2f \n",pt1,e1,pt2,e2);
969 
970  //Get the jet, different way for different generator
971  //PYTHIA
972  if(fMCGenerator == kPythia)
973  {
974  TParticle * jet = 0x0;
975  nTriggerJets = fPyGenHead->NTriggerJets();
976  AliDebug(2,Form("PythiaEventHeader: Njets: %d",nTriggerJets));
977 
978  for(Int_t i = 0; i< nTriggerJets; i++)
979  {
980  fPyGenHead->TriggerJet(i, tmpjet);
981 
982  jet = new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0);
983 
984  // Assign an outgoing parton as mother
985  Float_t phidiff1 = TMath::Abs(jet->Phi()-parton1->Phi());
986  Float_t phidiff2 = TMath::Abs(jet->Phi()-parton2->Phi());
987 
988  if(phidiff1 > phidiff2) jet->SetFirstMother(7);
989  else jet->SetFirstMother(6);
990 
991  //jet->Print();
992  AliDebug(1,Form("PYTHIA Jet %d: mother %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f",
993  i, jet->GetFirstMother(),jet->Pt(),jet->Energy(),jet->Phi()*TMath::RadToDeg(),jet->Eta()));
994  fJetsList->Add(jet);
995  }
996  }//Pythia triggered jets
997  //HERWIG
998  else if (fMCGenerator == kHerwig)
999  {
1000  Int_t pdg = -1;
1001 
1002  // Check parton 1
1003  AliVParticle * tmp = parton1;
1004  if(parton1->PdgCode()!=22)
1005  {
1006  while(pdg != 94)
1007  {
1008  if(tmp->GetFirstDaughter()==-1) return fJetsList;
1009 
1010  tmp = mcevent->GetTrack(tmp->GetFirstDaughter());
1011  pdg = tmp->PdgCode();
1012  }//while
1013 
1014  // Add found jet to list
1015  TParticle *jet1 = new TParticle(94, 21, -1, -1, -1, -1, tmp->Px(),tmp->Py(),tmp->Pz(),tmp->E(), 0,0,0,0);//new TParticle(*tmp);
1016 
1017  jet1->SetFirstMother(6);
1018 
1019  fJetsList->Add(jet1);
1020 
1021  //printf("jet 1: first daughter %d, last daughter %d\n", tmp->GetFirstDaughter(), tmp->GetLastDaughter());
1022  //tmp = stack->Particle(tmp->GetFirstDaughter());
1023  //tmp->Print();
1024  //jet1->Print();
1025  AliDebug(1,Form("HERWIG Jet 1: mother %d, status %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f",
1026  jet1->GetFirstMother(),jet1->GetStatusCode(),jet1->Pt(),jet1->Energy(),jet1->Phi()*TMath::RadToDeg(),jet1->Eta()));
1027  }//not photon
1028 
1029  // Check parton 2
1030  pdg = -1;
1031  tmp = parton2;
1032  if(parton2->PdgCode()!=22)
1033  {
1034  while(pdg != 94)
1035  {
1036  if(tmp->GetFirstDaughter()==-1) return fJetsList;
1037 
1038  tmp = mcevent->GetTrack(tmp->GetFirstDaughter());
1039  pdg = tmp->PdgCode();
1040  }//while
1041 
1042  // Add found jet to list
1043  TParticle *jet2 = new TParticle(94, 21, -1, -1, -1, -1, tmp->Px(),tmp->Py(),tmp->Pz(),tmp->E(), 0,0,0,0);//new TParticle(*tmp);
1044 
1045  jet2->SetFirstMother(7);
1046 
1047  fJetsList->Add(jet2);
1048 
1049  //jet2->Print();
1050  AliDebug(2,Form("HERWIG Jet 2: mother %d, status %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f",
1051  jet2->GetFirstMother(),jet2->GetStatusCode(),jet2->Pt(),jet2->Energy(),jet2->Phi()*TMath::RadToDeg(),jet2->Eta()));
1052  //Int_t first = tmp->GetFirstDaughter();
1053  //Int_t last = tmp->GetLastDaughter();
1054  //printf("jet 2: first daughter %d, last daughter %d, pdg %d\n",first, last, tmp->GetPdgCode());
1055  // for(Int_t d = first ; d < last+1; d++){
1056  // tmp = stack->Particle(d);
1057  // if(i == tmp->GetMother())
1058  // printf("Daughter n %d, Mother %d, name %s, status %d, pT %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n",
1059  // d,tmp->GetMother(), tmp->GetName(), tmp->GetStatusCode(),tmp->Pt(),tmp->Energy(),tmp->Phi()*TMath::RadToDeg(),tmp->Eta());
1060  // }
1061  //tmp->Print();
1062  }//not photon
1063  }//Herwig generated jets
1064 
1065  return fJetsList;
1066 }
1067 
1068 //______________________________________________________________________________
1070 //______________________________________________________________________________
1071 TLorentzVector AliMCAnalysisUtils::GetDaughter(Int_t idaugh, Int_t label,
1072  const AliMCEvent* mcevent,
1073  Int_t & pdg, Int_t & status,
1074  Bool_t & ok, Int_t & daughlabel, TVector3 & prodVertex)
1075 {
1076  fDaughMom.SetPxPyPzE(0,0,0,0);
1077 
1078  if(!mcevent)
1079  {
1080  AliWarning("MCEvent is not available, check analysis settings in configuration file!!");
1081 
1082  ok = kFALSE;
1083  return fDaughMom;
1084  }
1085 
1086  Int_t nprimaries = mcevent->GetNumberOfTracks();
1087  if(label < 0 || label >= nprimaries)
1088  {
1089  ok = kFALSE;
1090  return fDaughMom;
1091  }
1092 
1093  AliVParticle * momP = mcevent->GetTrack(label);
1094  daughlabel = momP->GetDaughterLabel(idaugh);
1095 
1096  if(daughlabel < 0 || daughlabel >= nprimaries)
1097  {
1098  ok = kFALSE;
1099  return fDaughMom;
1100  }
1101 
1102  AliVParticle * daughP = mcevent->GetTrack(daughlabel);
1103  fDaughMom.SetPxPyPzE(daughP->Px(),daughP->Py(),daughP->Pz(),daughP->E());
1104  pdg = daughP->PdgCode();
1105  status = daughP->MCStatusCode();
1106  prodVertex.SetXYZ(daughP->Xv(),daughP->Yv(),daughP->Zv());
1107 
1108  ok = kTRUE;
1109 
1110  return fDaughMom;
1111 }
1112 
1113 //______________________________________________________________________________________________________
1115 //______________________________________________________________________________________________________
1116 TLorentzVector AliMCAnalysisUtils::GetMother(Int_t label, const AliMCEvent* mcevent, Bool_t & ok)
1117 {
1118  Int_t pdg = -1; Int_t status = -1; Int_t momlabel = -1;
1119 
1120  return GetMother(label,mcevent,pdg,status, ok,momlabel);
1121 }
1122 
1123 //_________________________________________________________________________________________
1124 // \return the kinematics of the particle that generated the signal.
1125 //_________________________________________________________________________________________
1126 TLorentzVector AliMCAnalysisUtils::GetMother(Int_t label, const AliMCEvent* mcevent,
1127  Int_t & pdg, Int_t & status, Bool_t & ok)
1128 {
1129  Int_t momlabel = -1;
1130 
1131  return GetMother(label,mcevent,pdg,status, ok,momlabel);
1132 }
1133 
1134 //______________________________________________________________________________________________________
1136 //______________________________________________________________________________________________________
1137 TLorentzVector AliMCAnalysisUtils::GetMother(Int_t label, const AliMCEvent* mcevent,
1138  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momlabel)
1139 {
1140  fMotherMom.SetPxPyPzE(0,0,0,0);
1141 
1142  if(!mcevent)
1143  {
1144  AliWarning("MCEvent is not available, check analysis settings in configuration file, STOP!!");
1145 
1146  ok = kFALSE;
1147  return fMotherMom;
1148  }
1149 
1150  Int_t nprimaries = mcevent->GetNumberOfTracks();
1151  if(label < 0 || label >= nprimaries)
1152  {
1153  ok = kFALSE;
1154  return fMotherMom;
1155  }
1156 
1157  AliVParticle * momP = mcevent->GetTrack(label);
1158  fMotherMom.SetPxPyPzE(momP->Px(),momP->Py(),momP->Pz(),momP->E());
1159  pdg = momP->PdgCode();
1160  status = momP->MCStatusCode();
1161  momlabel = momP->GetMother();
1162 
1163  ok = kTRUE;
1164 
1165  return fMotherMom;
1166 }
1167 
1168 //___________________________________________________________________________________
1170 //___________________________________________________________________________________
1172  const AliMCEvent* mcevent,
1173  Bool_t & ok, Int_t & momlabel)
1174 {
1175  fGMotherMom.SetPxPyPzE(0,0,0,0);
1176 
1177  if ( !mcevent )
1178  {
1179  AliWarning("MCEvent is not available, check analysis settings in configuration file!!");
1180 
1181  ok = kFALSE;
1182  return fGMotherMom;
1183  }
1184 
1185  Int_t nprimaries = mcevent->GetNumberOfTracks();
1186  if ( label < 0 || label >= nprimaries )
1187  {
1188  ok = kFALSE;
1189  return fGMotherMom;
1190  }
1191 
1192 
1193  AliVParticle * momP = mcevent->GetTrack(label);
1194 
1195  if(momP->PdgCode()==pdg)
1196  {
1197  AliDebug(2,"PDG of mother is already the one requested!");
1198  fGMotherMom.SetPxPyPzE(momP->Px(),momP->Py(),momP->Pz(),momP->E());
1199 
1200  ok=kTRUE;
1201  return fGMotherMom;
1202  }
1203 
1204  Int_t grandmomLabel = momP->GetMother();
1205  Int_t grandmomPDG = -1;
1206  AliVParticle * grandmomP = 0x0;
1207 
1208  while (grandmomLabel >=0 )
1209  {
1210  grandmomP = mcevent->GetTrack(grandmomLabel);
1211  grandmomPDG = grandmomP->PdgCode();
1212  if(grandmomPDG==pdg)
1213  {
1214  //printf("AliMCAnalysisUtils::GetMotherWithPDG(AOD) - mother with PDG %d FOUND! \n",pdg);
1215  momlabel = grandmomLabel;
1216  fGMotherMom.SetPxPyPzE(grandmomP->Px(),grandmomP->Py(),grandmomP->Pz(),grandmomP->E());
1217  break;
1218  }
1219 
1220  grandmomLabel = grandmomP->GetMother();
1221  }
1222 
1223  if(grandmomPDG!=pdg) AliInfo(Form("Mother with PDG %d, NOT found!",pdg));
1224 
1225  ok = kTRUE;
1226 
1227  return fGMotherMom;
1228 }
1229 
1230 //___________________________________________________________________________________
1233 //___________________________________________________________________________________
1235  const AliMCEvent* mcevent,
1236  Bool_t & ok, Int_t & momlabel,
1237  Int_t & gparentlabel)
1238 {
1239  fGMotherMom.SetPxPyPzE(0,0,0,0);
1240  momlabel = label;
1241 
1242  if ( !mcevent )
1243  {
1244  AliWarning("MCEvent is not available, check analysis settings in configuration file!!");
1245 
1246  ok = kFALSE;
1247  return fGMotherMom;
1248  }
1249 
1250  Int_t nprimaries = mcevent->GetNumberOfTracks();
1251  if ( label < 0 || label >= nprimaries )
1252  {
1253  ok = kFALSE;
1254  return fGMotherMom;
1255  }
1256 
1257  AliVParticle * momP = mcevent->GetTrack(label);
1258 
1259  Int_t grandmomLabel = momP->GetMother();
1260  gparentlabel = grandmomLabel;
1261  Int_t grandmomPDG = -1;
1262  AliVParticle * grandmomP = 0x0;
1263 
1264  while (grandmomLabel >=0 )
1265  {
1266  grandmomP = mcevent->GetTrack(grandmomLabel);
1267  grandmomPDG = grandmomP->PdgCode();
1268  if(grandmomPDG==pdg)
1269  {
1270  //printf("AliMCAnalysisUtils::GetMotherWithPDG(AOD) - mother with PDG %d FOUND! \n",pdg);
1271  momlabel = grandmomLabel;
1272  fGMotherMom.SetPxPyPzE(grandmomP->Px(),grandmomP->Py(),grandmomP->Pz(),grandmomP->E());
1273  gparentlabel = grandmomP->GetMother();
1274  }
1275 
1276  grandmomLabel = grandmomP->GetMother();
1277  }
1278 
1279  ok = kTRUE;
1280 
1281  return fGMotherMom;
1282 }
1283 
1284 
1285 //______________________________________________________________________________________________
1287 //______________________________________________________________________________________________
1288 TLorentzVector AliMCAnalysisUtils::GetGrandMother(Int_t label, const AliMCEvent* mcevent,
1289  Int_t & pdg, Int_t & status, Bool_t & ok,
1290  Int_t & grandMomLabel, Int_t & greatMomLabel)
1291 {
1292  fGMotherMom.SetPxPyPzE(0,0,0,0);
1293 
1294  if ( !mcevent )
1295  {
1296  AliWarning("MCEvent is not available, check analysis settings in configuration file, STOP!!");
1297 
1298  ok = kFALSE;
1299  return fGMotherMom;
1300  }
1301 
1302  Int_t nprimaries = mcevent->GetNumberOfTracks();
1303  if ( label < 0 || label >= nprimaries )
1304  {
1305  ok = kFALSE;
1306  return fGMotherMom;
1307  }
1308 
1309  AliVParticle * momP = mcevent->GetTrack(label);
1310 
1311  grandMomLabel = momP->GetMother();
1312 
1313  AliVParticle * grandmomP = 0x0;
1314 
1315  if(grandMomLabel >=0 )
1316  {
1317  grandmomP = mcevent->GetTrack(grandMomLabel);
1318  pdg = grandmomP->PdgCode();
1319  status = grandmomP->MCStatusCode();
1320 
1321  fGMotherMom.SetPxPyPzE(grandmomP->Px(),grandmomP->Py(),grandmomP->Pz(),grandmomP->E());
1322  greatMomLabel = grandmomP->GetMother();
1323 
1324  }
1325 
1326  ok = kTRUE;
1327 
1328  return fGMotherMom;
1329 }
1330 
1331 //_______________________________________________________________________________________________________________
1333 //_______________________________________________________________________________________________________________
1335  Float_t & asym, Float_t & angle, Bool_t & ok)
1336 {
1337  if(!mcevent)
1338  {
1339  AliWarning("MCEvent is not available, check analysis settings in configuration file, STOP!!");
1340 
1341  ok = kFALSE;
1342  return;
1343  }
1344 
1345  Int_t nprimaries = mcevent->GetNumberOfTracks();
1346  if ( label < 0 || label >= nprimaries )
1347  {
1348  ok = kFALSE;
1349  return ;
1350  }
1351 
1352  AliVParticle * momP = mcevent->GetTrack(label);
1353 
1354  Int_t grandmomLabel = momP->GetMother();
1355  Int_t grandmomPDG = -1;
1356  AliVParticle * grandmomP = 0x0;
1357 
1358  while (grandmomLabel >=0 )
1359  {
1360  grandmomP = mcevent->GetTrack(grandmomLabel);
1361  grandmomPDG = grandmomP->PdgCode();
1362 
1363  if(grandmomPDG==pdg) break;
1364 
1365  grandmomLabel = grandmomP->GetMother();
1366  }
1367 
1368  if(grandmomPDG==pdg && grandmomP->GetNDaughters()==2)
1369  {
1370  AliVParticle * d1 = mcevent->GetTrack(grandmomP->GetDaughterLabel(0));
1371  AliVParticle * d2 = mcevent->GetTrack(grandmomP->GetDaughterLabel(1));
1372 
1373  if(d1->PdgCode() == 22 && d1->PdgCode() == 22)
1374  {
1375  asym = (d1->E()-d2->E())/grandmomP->E();
1376  fDaughMom .SetPxPyPzE(d1->Px(),d1->Py(),d1->Pz(),d1->E());
1377  fDaughMom2.SetPxPyPzE(d2->Px(),d2->Py(),d2->Pz(),d2->E());
1378  angle = fDaughMom.Angle(fDaughMom2.Vect());
1379  }
1380  }
1381  else
1382  {
1383  ok = kFALSE;
1384  AliInfo(Form("Mother with PDG %d, not found!",pdg));
1385  return;
1386  }
1387 
1388  ok = kTRUE;
1389 }
1390 
1391 //_________________________________________________________________________________________________
1393 //_________________________________________________________________________________________________
1394 Int_t AliMCAnalysisUtils::GetNDaughters(Int_t label, const AliMCEvent* mcevent, Bool_t & ok)
1395 {
1396  if ( !mcevent )
1397  {
1398  AliWarning("MCEvent is not available, check analysis settings in configuration file, STOP!!");
1399 
1400  ok=kFALSE;
1401  return -1;
1402  }
1403 
1404  Int_t nprimaries = mcevent->GetNumberOfTracks();
1405  if ( label < 0 || label >= nprimaries )
1406  {
1407  ok = kFALSE;
1408  return -1;
1409  }
1410 
1411  AliVParticle * momP = mcevent->GetTrack(label);
1412 
1413  ok = kTRUE;
1414 
1415  return momP->GetNDaughters();
1416 }
1417 
1418 //_________________________________________________________________________________
1423 //_________________________________________________________________________________
1425  Int_t mctag, Int_t mesonLabel,
1426  AliMCEvent* mcevent,
1427  Int_t *overpdg, Int_t *overlabel)
1428 {
1429  Int_t ancPDG = 0, ancStatus = -1;
1430  TVector3 prodVertex;
1431  Int_t ancLabel = 0;
1432  Int_t noverlaps = 0;
1433  Bool_t ok = kFALSE;
1434 
1435  for (UInt_t ilab = 1; ilab < nlabels; ilab++ )
1436  {
1437  ancLabel = CheckCommonAncestor(label[0],label[ilab],mcevent,ancPDG,ancStatus,fMotherMom,prodVertex);
1438 
1439  //printf("Overlaps, i %d: Main Label %d, second label %d, ancestor: Label %d, pdg %d - tag %d \n",
1440  // ilab,label[0],label[ilab],ancLabel,ancPDG, mctag);
1441 
1442  Bool_t overlap = kFALSE;
1443 
1444  if ( ancLabel < 0 )
1445  {
1446  overlap = kTRUE;
1447  //printf("\t \t \t No Label = %d\n",ancLabel);
1448  }
1449  else if ( ( ancPDG==111 || ancPDG==221 ) &&
1450  ( CheckTagBit(mctag,kMCPi0) || CheckTagBit(mctag,kMCEta) ) &&
1451  ( (mesonLabel != ancLabel) && mesonLabel >=0 ) ) // in case the label is not provided check it is larger than 0
1452  {
1453  //printf("\t \t meson Label %d, ancestor Label %d\n",mesonLabel,ancLabel);
1454  overlap = kTRUE;
1455  }
1456  else if( ancPDG!=22 && TMath::Abs(ancPDG)!=11 && ancPDG != 111 && ancPDG != 221 )
1457  {
1458  //printf("\t \t \t Non EM PDG = %d\n",ancPDG);
1459  overlap = kTRUE ;
1460  }
1461 
1462  if( !overlap ) continue ;
1463 
1464  // We have at least one overlap
1465 
1466  //printf("Overlap!!!!!!!!!!!!!!\n");
1467 
1468  noverlaps++;
1469 
1470  // What is the origin of the overlap?
1471  Bool_t mOK = 0, gOK = 0;
1472  Int_t mpdg = -999999, gpdg = -1;
1473  Int_t mstatus = -1, gstatus = -1;
1474  Int_t gLabel = -1, ggLabel = -1;
1475 
1476  GetMother (label[ilab],mcevent,mpdg,mstatus,mOK);
1477  fGMotherMom =
1478  GetGrandMother(label[ilab],mcevent,gpdg,gstatus,gOK, gLabel,ggLabel);
1479 
1480  //printf("\t Overlap!, mother pdg %d; grand mother pdg %d",mpdg,gpdg);
1481 
1482  if( ( mpdg == 22 || TMath::Abs(mpdg==11) ) &&
1483  ( gpdg == 22 || TMath::Abs(gpdg==11) ) &&
1484  gLabel >=0 )
1485  {
1486  Int_t labeltmp = gLabel;
1487  while( ( gpdg == 22 || TMath::Abs(gpdg==11) ) && gLabel >=0 )
1488  {
1489  mpdg=gpdg;
1490  fGMotherMom = GetGrandMother(labeltmp,mcevent,gpdg,gstatus,ok, gLabel,ggLabel);
1491  labeltmp=gLabel;
1492  }
1493  }
1494  overpdg [noverlaps-1] = mpdg;
1495  overlabel[noverlaps-1] = label[ilab];
1496  }
1497 
1498  return noverlaps ;
1499 }
1500 
1501 //________________________________________________________
1511 //________________________________________________________
1512 AliGenPythiaEventHeader * AliMCAnalysisUtils::CheckAndGetPythiaEventHeader
1513 (AliMCEvent* mcevent, TString selectHeaderName)
1514 {
1515  Int_t eventN = -1;
1516  if ( (AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler() )
1517  eventN = ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()->GetReadEntry());
1518 
1519  if ( fCurrentEvent != eventN )
1520  {
1521  fCurrentEvent = eventN ;
1522 
1523  //GetJets(mcevent, kTRUE);
1524 
1525  fPyGenHead = GetPythiaEventHeader(mcevent, selectHeaderName,
1528 
1529  if ( fPyVersion == 6 )
1530  {
1531  fMaxPartonicParent = 8 ;
1532  fMinPartonicParent = 5 ;
1533  }
1534  else if ( fPyVersion == 8 )
1535  {
1536  fMaxPartonicParent = 6 ;
1537  fMinPartonicParent = 3 ;
1538  }
1539 
1540  AliDebug(1,Form("For event %d, Pythia v%d name <%s>, process %d <%s>, first generated particle %d,"
1541  " photon partonic parent range [%d,%d]",
1543  fPyProcess, fPyProcessName.Data(),
1545  }
1546 
1547  return fPyGenHead ;
1548 }
1549 
1550 //________________________________________________________
1562 //________________________________________________________
1563 AliGenPythiaEventHeader * AliMCAnalysisUtils::GetPythiaEventHeader
1564 (AliMCEvent* mcevent, TString selectHeaderName,
1565  TString & genName, TString & processName,
1566  Int_t & process, Int_t & firstParticle,
1567  Int_t & pythiaVersion)
1568 {
1569  AliGenPythiaEventHeader * pyGenHead = 0;
1570  firstParticle = 0 ;
1571  genName = "";
1572  processName = "";
1573  pythiaVersion = 0 ;
1574  Int_t ngen = 0 ;
1575 
1576  TList * genlist = mcevent->GetCocktailList();
1577  if ( !genlist )
1578  {
1579  if ( !mcevent->GenEventHeader() ) return pyGenHead;
1580  else ngen = 1 ;
1581  }
1582  else
1583  {
1584  ngen = genlist->GetEntries();
1585  //printf("Cocktail ngen %d\n",ngen);
1586 
1587  if ( ngen < 1 )
1588  {
1589  if ( !mcevent->GenEventHeader() )
1590  return pyGenHead;
1591  else
1592  ngen = 1 ;
1593  }
1594  }
1595 
1596 // printf("GetPythiaEventHeader() - N generators %d, cocktail list %p, gen header %p\n",
1597 // ngen,genlist,mcevent->GenEventHeader());
1598 
1599  if ( ngen == 1 )
1600  {
1601  //printf("GetPythiaEventHeader() - Generator class name %s\n",mcevent->GenEventHeader()->ClassName());
1602  if ( strcmp(mcevent->GenEventHeader()->ClassName(), "AliGenPythiaEventHeader") ) return pyGenHead ;
1603 
1604  pyGenHead = (AliGenPythiaEventHeader*) mcevent->GenEventHeader();
1605 
1606  genName = pyGenHead->GetName();
1607  //printf("GetPythiaEventHeader() - 1 generator: %s\n",genName.Data());
1608  }
1609  else if ( ngen > 1 )
1610  {
1611  // Get the first pythia header
1612  for(Int_t igen = 0; igen < ngen; igen++)
1613  {
1614  AliGenEventHeader * header = (AliGenEventHeader*) genlist->At(igen);
1615 // printf("GetPythiaEventHeader() - igen %d Generator class %s, name %s\n",
1616 // igen, header->ClassName(),header->GetName());
1617 
1618  if ( !header || strcmp(header->ClassName(), "AliGenPythiaEventHeader") )
1619  {
1620  // Count the number of particles before the first header
1621  firstParticle += header->NProduced();
1622 
1623  continue;
1624  }
1625 
1626  genName = header->GetName();
1627 
1628  // In case of cocktail generators, select only the generator with a particular name
1629  if ( selectHeaderName.Length() > 0 && !genName.Contains(selectHeaderName) )
1630  {
1631  firstParticle += header->NProduced();
1632  genName = "";
1633 
1634  continue;
1635  }
1636 
1637  //printf("\t igen %d %s\n",igen,genName.Data());
1638  pyGenHead = (AliGenPythiaEventHeader*) genlist->At(igen);
1639 
1640  break;
1641  } // for igen
1642 
1643 // printf("GetPythiaEventHeader() - N generators %d, pythia pointer %p, %s, first particle %d\n",
1644 // genlist->GetEntries(), pyGenHead, genName.Data(), firstParticle);
1645  } // cocktail
1646 
1647  if ( !pyGenHead ) return pyGenHead;
1648 
1649  // Try to identify what pythia version was used
1650  // and what event type, a bit dangerous, only valid for gamma-jet and jet-jet events
1651  //
1652  process = pyGenHead->ProcessType();
1653 
1654  if ( genName.Contains("Pythia6") ) pythiaVersion = 6;
1655  else if ( genName.Contains("Pythia8") ) pythiaVersion = 8;
1656 
1657  if ( process == 14 || process == 18 || process == 29 )
1658  {
1659  if( !pythiaVersion ) pythiaVersion = 6;
1660  processName = "Gamma-Jet";
1661  }
1662  else if ( process == 11 || process == 12 ||
1663  process == 13 || process == 28 ||
1664  process == 53 || process == 68 || process == 96 )
1665  {
1666  if( !pythiaVersion ) pythiaVersion = 6;
1667  processName = "Jet-Jet";
1668  }
1669  else if (process >= 201 && process <= 205)
1670  {
1671  if( !pythiaVersion ) pythiaVersion = 8;
1672  processName = "Gamma-Jet";
1673  }
1674  else if ( (process >= 111 && process <= 116) || // jet-jet
1675  (process >= 121 && process <= 124) ) // jet-jet (b/c)
1676  {
1677  if( !pythiaVersion ) pythiaVersion = 8;
1678  processName = "Jet-Jet";
1679  }
1680 
1681 // printf("GetPythiaEventHeader() - Pythia version %d, process %d, process name %s\n",
1682 // pythiaVersion, process,processName.Data());
1683 
1684  // TString nameGen = "";
1685  // mcevent->GetCocktailGenerator(firstParticle-1,genName);
1686  // printf("\t -1: %d, %s\n",firstParticle-1,genName.Data());
1687  // mcevent->GetCocktailGenerator(firstParticle,genName);
1688  // printf("\t 0: %d, %s\n",firstParticle,genName.Data());
1689  // mcevent->GetCocktailGenerator(firstParticle+1,genName);
1690  // printf("\t +1: %d, %s\n",firstParticle+1,genName.Data());
1691 
1692  return pyGenHead;
1693 }
1694 
1695 //________________________________________________________
1697 //________________________________________________________
1699 {
1700  if(! opt)
1701  return;
1702 
1703  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
1704 
1705  printf("Debug level = %d\n",fDebug);
1706  printf("MC Generator = %s\n",fMCGeneratorString.Data());
1707  printf(" \n");
1708 }
1709 
1710 //________________________________________________________
1718 //________________________________________________________
1719 void AliMCAnalysisUtils::PrintAncestry(AliMCEvent* mcevent, Int_t label, Int_t nGenerMax) const
1720 {
1721  AliVParticle * primary = 0;
1722  Int_t index = label;
1723  Int_t gener = 0;
1724 
1725  AliInfo("*********** Start");
1726  while ( index > 0 )
1727  {
1728  primary = mcevent->GetTrack(index);
1729 
1730  if(!primary)
1731  {
1732  AliWarning("primary pointer not available!!");
1733  return;
1734  }
1735 
1736  Float_t eta = 0;
1737  // Protection against floating point exception
1738  if ( primary->E() == TMath::Abs(primary->Pz()) ||
1739  (primary->E() - primary->Pz()) < 1e-3 ||
1740  (primary->E() + primary->Pz()) < 0 )
1741  eta = -999;
1742  else
1743  eta = primary->Eta();
1744 
1745  Int_t pdg = primary->PdgCode();
1746 
1747  printf("generation %d, label %d, %s, pdg %d, status %d, phys prim %d, E %2.2f, pT %2.2f, p(%2.2f,%2.2f,%2.2f) eta %2.2f, phi %2.2f"
1748  " mother %d, n daughters %d, d1 %d, d2 %d\n",
1749  gener,index,TDatabasePDG::Instance()->GetParticle(pdg)->GetName(),pdg,primary->MCStatusCode(),primary->IsPhysicalPrimary(),
1750  primary->E(),primary->Pt(),primary->Px(),primary->Py(),primary->Pz(),
1751  eta,primary->Phi()*TMath::RadToDeg(),
1752  primary->GetMother(),primary->GetNDaughters(),primary->GetDaughterLabel(0), primary->GetDaughterLabel(1));
1753 
1754  gener++;
1755  index = primary->GetMother();
1756  if ( nGenerMax < gener ) index = -1; // stop digging ancestry
1757  } // while
1758 
1759  AliInfo("*********** End");
1760 }
1761 
1762 
1763 //__________________________________________________
1765 //__________________________________________________
1767 {
1768  AliInfo
1769  (
1770  Form
1771  ("Tag %d: photon %d, conv %d, prompt %d, frag %d, isr %d,\n"
1772  " pi0 decay %d, eta decay %d, other decay %d, lost decay %d, in calo decay %d, pi0 %d, eta %d,\n"
1773  " electron %d, muon %d,pion %d, proton %d, neutron %d,\n"
1774  " kaon %d, a-proton %d, a-neutron %d, unk %d, bad %d",
1775  tag,
1776  CheckTagBit(tag,kMCPhoton),
1778  CheckTagBit(tag,kMCPrompt),
1780  CheckTagBit(tag,kMCISR),
1781  CheckTagBit(tag,kMCPi0Decay),
1782  CheckTagBit(tag,kMCEtaDecay),
1786  CheckTagBit(tag,kMCPi0),
1787  CheckTagBit(tag,kMCEta),
1788  CheckTagBit(tag,kMCElectron),
1789  CheckTagBit(tag,kMCMuon),
1790  CheckTagBit(tag,kMCPion),
1791  CheckTagBit(tag,kMCProton),
1793  CheckTagBit(tag,kMCKaon),
1794  CheckTagBit(tag,kMCAntiProton),
1796  CheckTagBit(tag,kMCUnknown),
1798  )
1799  );
1800 }
1801 
1802 //__________________________________________________
1804 //__________________________________________________
1806 {
1807  fMCGenerator = mcgen ;
1808  if (mcgen == kPythia) fMCGeneratorString = "PYTHIA";
1809  else if(mcgen == kHerwig) fMCGeneratorString = "HERWIG";
1810  else if(mcgen == kHijing) fMCGeneratorString = "HIJING";
1811  else
1812  {
1813  fMCGeneratorString = "";
1815  }
1816 }
1817 
1818 //____________________________________________________
1820 //____________________________________________________
1822 {
1823  fMCGeneratorString = mcgen ;
1824 
1825  if (mcgen == "PYTHIA") fMCGenerator = kPythia;
1826  else if(mcgen == "HERWIG") fMCGenerator = kHerwig;
1827  else if(mcgen == "HIJING") fMCGenerator = kHijing;
1828  else
1829  {
1831  fMCGeneratorString = "" ;
1832  }
1833 }
1834 
1835 
1836 
Int_t pdg
void SetMCGenerator(Int_t mcgen)
Set the generator type.
Int_t fCurrentEvent
Current Event number - GetJets()
TLorentzVector GetMother(Int_t label, const AliMCEvent *mcevent, Bool_t &ok)
TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg, const AliMCEvent *mcevent, Bool_t &ok, Int_t &momLabel)
TString fPyGenName
Pythia header assigned name.
AliGenPythiaEventHeader * CheckAndGetPythiaEventHeader(AliMCEvent *mcevent, TString selecHeaderName)
TLorentzVector fMotherMom
! particle momentum
TList * GetJets(AliMCEvent *mcevent, Bool_t check)
void PrintMCTag(Int_t tag) const
Print the assigned origins to this particle.
static AliGenPythiaEventHeader * GetPythiaEventHeader(AliMCEvent *mcevent, TString selecHeaderName, TString &genName, TString &processName, Int_t &process, Int_t &firstParticle, Int_t &pythiaVersion)
TLorentzVector GetDaughter(Int_t daughter, Int_t label, const AliMCEvent *mcevent, Int_t &pdg, Int_t &status, Bool_t &ok, Int_t &daugLabel, TVector3 &prodVertex)
Int_t fMinPartonicParent
Minimum label of partonic parent of direct photon.
void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg, const AliMCEvent *mcevent, Float_t &asy, Float_t &angle, Bool_t &ok)
In case of an eta or pi0 decay into 2 photons, get the asymmetry in the energy of the photons...
TLorentzVector GetGrandMother(Int_t label, const AliMCEvent *mcevent, Int_t &pdg, Int_t &status, Bool_t &ok, Int_t &grandMomLabel, Int_t &greatMomLabel)
virtual ~AliMCAnalysisUtils()
Destructor.
void SetTagBit(Int_t &tag, UInt_t set) const
TLorentzVector fGMotherMom
! particle momentum
Int_t fDebug
Debug level.
TLorentzVector fDaughMom2
! particle momentum
AliGenPythiaEventHeader * fPyGenHead
! pythia event header of current event
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
Int_t fPyFirstParticle
First Pythia generated particle in array.
TLorentzVector GetFirstMotherWithPDG(Int_t label, Int_t pdg, const AliMCEvent *mcevent, Bool_t &ok, Int_t &momLabel, Int_t &gparentlabel)
TString fPyProcessName
Pythia process name, Gamma-Jet or Jet-Jet.
void PrintAncestry(AliMCEvent *mcevent, Int_t label, Int_t nGenerMax=1000) const
Int_t fMCGenerator
MC generator used to generate data in simulation.
TLorentzVector fDaughMom
! particle momentum
void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const AliMCEvent *mcevent, Int_t &tag)
TList * fJetsList
List of jets - GetJets()
Int_t fPyProcess
Pythia process code.
TString fMCGeneratorString
MC generator used to generate data in simulation.
void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const AliMCEvent *mcevent, Int_t &tag)
Check on AODs if the current decay photon has the second photon companion lost.
Int_t GetNDaughters(Int_t label, const AliMCEvent *mcevent, Bool_t &ok)
Int_t fPyVersion
Pythia guessed version.
const char Option_t
Definition: External.C:48
Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliMCEvent *mcevent, Int_t &ancPDG, Int_t &ancStatus, TLorentzVector &momentum, TVector3 &prodVertex)
AliMCAnalysisUtils()
Constructor.
bool Bool_t
Definition: External.C:53
Int_t CheckOrigin(Int_t label, AliMCEvent *mcevent, TString selectHeaderName)
Class with analysis utils for simulations.
TString meson
Bool_t CheckTagBit(Int_t tag, UInt_t test) const
Int_t GetNOverlaps(const Int_t *label, UInt_t nlabels, Int_t mctag, Int_t mesonLabel, AliMCEvent *mcevent, Int_t *overpdg, Int_t *overlabel)
Int_t fMaxPartonicParent
Minimum label of partonic parent of direct photon.