AliPhysics  2c6b7ad (2c6b7ad)
AliMCAnalysisUtils.h
Go to the documentation of this file.
1 #ifndef ALIMCANALYSISUTILS_H
2 #define ALIMCANALYSISUTILS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 //_________________________________________________________________________
20 //_________________________________________________________________________
21 
22 // --- ROOT system ---
23 #include <TObject.h>
24 #include <TString.h>
25 #include <TLorentzVector.h>
26 class TList ;
27 class TVector3;
28 class TClonesArray;
29 
30 //--- AliRoot system ---
31 class AliMCEvent;
32 class AliGenEventHeader;
33 class AliGenPythiaEventHeader;
34 
35 class AliMCAnalysisUtils : public TObject {
36 
37  public:
38 
39  AliMCAnalysisUtils() ; // ctor
40 
41  virtual ~AliMCAnalysisUtils() ; // virtual dtor
42 
43  //--------------------------------------
44  // Enum with tag for origin of particles
45  //--------------------------------------
46 
61 
62  //--------------------------------------
63  // Methods to check origin of clusters
64  //--------------------------------------
65 
66  Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliMCEvent* mcevent,
67  Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & prodVertex) ;
68 
69  Int_t CheckOrigin(Int_t label, AliMCEvent* mcevent, TString selectHeaderName) ;
70  Int_t CheckOrigin(const Int_t *labels, Int_t nlabels, AliMCEvent* mcevent,
71  TString selectHeaderName, const TObjArray *arrayCluster = 0x0) ;
72 
73  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const AliMCEvent* mcevent, Int_t & tag);
74 
75  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const AliMCEvent* mcevent, Int_t & tag);
76 
77  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Bool_t & ok);
78  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok);
79  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
80  TLorentzVector GetGrandMother(Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
81 
82  TLorentzVector GetMotherWithPDG (Int_t label, Int_t pdg,const AliMCEvent* mcevent, Bool_t & ok, Int_t & momLabel);
83  TLorentzVector GetFirstMotherWithPDG(Int_t label, Int_t pdg,const AliMCEvent* mcevent, Bool_t & ok, Int_t & momLabel, Int_t & gparentlabel);
84 
85  void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliMCEvent* mcevent,
86  Float_t & asy, Float_t & angle, Bool_t & ok);
87 
88  Int_t GetNDaughters(Int_t label,const AliMCEvent* mcevent, Bool_t & ok);
89  TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliMCEvent* mcevent,
90  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel, TVector3 & prodVertex);
91 
92  Int_t GetNOverlaps(const Int_t * label, UInt_t nlabels,
93  Int_t mctag, Int_t mesonLabel,
94  AliMCEvent* mcevent,
95  Int_t *overpdg, Int_t *overlabel);
96 
97  //Check or set the bits produced in the above methods
98  void SetTagBit(Int_t &tag, UInt_t set) const {
99  // Set bit of type set (mcTypes) in tag
100  tag |= (1<<set) ;
101  }
102 
104  // Check if in tag the bit test (mcTypes) is set.
105  if (tag & (1<<test) ) return kTRUE ;
106  else return kFALSE ;
107  }
108 
109  //--------------------------------------
110  // Other methods
111  //--------------------------------------
112 
113  // Method to recover MC jets stored in generator
114  TList * GetJets(AliMCEvent* mcevent, Bool_t check) ;
115 
116  static AliGenPythiaEventHeader * GetPythiaEventHeader
117  (AliMCEvent* mcevent, TString selecHeaderName,
118  TString & genName, TString & processName,
119  Int_t & process, Int_t & firstParticle,
120  Int_t & pythiaVersion);
121 
122  AliGenPythiaEventHeader * CheckAndGetPythiaEventHeader
123  (AliMCEvent* mcevent, TString selecHeaderName);
126  Int_t GetPythiaProcess() const { return fPyProcess ; }
128  Int_t GetPythiaVersion() const { return fPyVersion ; }
129 
130  void SetDebug(Int_t deb) { fDebug=deb ; }
131  Int_t GetDebug() const { return fDebug ; }
132 
133  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
134  void SetMCGenerator(Int_t mcgen) ;
135  void SetMCGenerator(TString mcgen) ;
136  Int_t GetMCGenerator() const { return fMCGenerator ; }
138 
139  void Print(const Option_t * opt) const;
140  void PrintAncestry(AliMCEvent* mcevent, Int_t label, Int_t nGenerMax = 1000) const;
141  void PrintMCTag(Int_t tag) const;
142 
143  private:
144 
146 
148 
150 
152 
154 
155  TLorentzVector fDaughMom;
156 
157  TLorentzVector fDaughMom2;
158 
159  TLorentzVector fMotherMom;
160 
161  TLorentzVector fGMotherMom;
162 
163  // Specific to pythia events and header recovery
164  // avoid multiple times checks
165  AliGenPythiaEventHeader
172 
175 
178 
180  AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ;
181 
183  ClassDef(AliMCAnalysisUtils,8) ;
185 
186 } ;
187 
188 #endif //ALIMCANALYSISUTILS_H
189 
190 
191 
Int_t pdg
Int_t GetMCGenerator() const
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.
Int_t GetPythiaFirstParticle() const
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 GetPythiaVersion() const
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
AliMCAnalysisUtils & operator=(const AliMCAnalysisUtils &mcu)
Copy constructor not implemented.
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.
Int_t GetDebug() const
Int_t GetPythiaProcess() const
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.
void SetDebug(Int_t deb)
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
void test(int runnumber=195345)
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)
TString GetPythiaProcessName() const
Class with analysis utils for simulations.
TString GetMCGeneratorString() const
Bool_t CheckTagBit(Int_t tag, UInt_t test) const
TString GetPythiaHeaderName() 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.