AliPhysics  3b4a69f (3b4a69f)
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, Float_t clusE) ;
70  Int_t CheckOrigin(const Int_t *labels, const UShort_t * edepFrac, Int_t nlabels,
71  AliMCEvent* mcevent, TString selectHeaderName, Float_t clusE,
72  const TObjArray *arrayCluster = 0x0) ;
73 
74  void CheckOverlapped2GammaDecay(const Int_t *labels, const UShort_t * edepFrac, Int_t nlabels,
75  Int_t mesonIndex, Float_t clusE, const AliMCEvent* mcevent, Int_t & tag);
76 
77  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const AliMCEvent* mcevent, Int_t & tag);
78 
79  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Bool_t & ok);
80  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok);
81  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
82  TLorentzVector GetGrandMother(Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
83 
84  TLorentzVector GetMotherWithPDG (Int_t label, Int_t pdg,const AliMCEvent* mcevent, Bool_t & ok, Int_t & momLabel);
85  TLorentzVector GetFirstMotherWithPDG(Int_t label, Int_t pdg,const AliMCEvent* mcevent, Bool_t & ok, Int_t & momLabel, Int_t & gparentlabel);
86 
87  void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliMCEvent* mcevent,
88  Float_t & asy, Float_t & angle, Bool_t & ok);
89 
90  Int_t GetNDaughters(Int_t label,const AliMCEvent* mcevent, Bool_t & ok);
91  TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliMCEvent* mcevent,
92  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel, TVector3 & prodVertex);
93 
94  Int_t GetNOverlaps(const Int_t * label, UInt_t nlabels,
95  Int_t mctag, Int_t mesonLabel,
96  AliMCEvent* mcevent,
97  Int_t *overpdg, Int_t *overlabel);
98 
99  //Check or set the bits produced in the above methods
100  void SetTagBit(Int_t &tag, UInt_t set) const {
101  // Set bit of type set (mcTypes) in tag
102  tag |= (1<<set) ;
103  }
104 
106  // Check if in tag the bit test (mcTypes) is set.
107  if (tag & (1<<test) ) return kTRUE ;
108  else return kFALSE ;
109  }
110 
111  //--------------------------------------
112  // Other methods
113  //--------------------------------------
114 
115  // Method to recover MC jets stored in generator
116  TList * GetJets(AliMCEvent* mcevent, Bool_t check) ;
117 
118  static AliGenPythiaEventHeader * GetPythiaEventHeader
119  (AliMCEvent* mcevent, TString selecHeaderName,
120  TString & genName, TString & processName,
121  Int_t & process, Int_t & firstParticle,
122  Int_t & pythiaVersion);
123 
124  AliGenPythiaEventHeader * CheckAndGetPythiaEventHeader
125  (AliMCEvent* mcevent, TString selecHeaderName);
128  Int_t GetPythiaProcess() const { return fPyProcess ; }
130  Int_t GetPythiaVersion() const { return fPyVersion ; }
133 
134 
135  void SetDebug(Int_t deb) { fDebug=deb ; }
136  Int_t GetDebug() const { return fDebug ; }
137 
138  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
139  void SetMCGenerator(Int_t mcgen) ;
140  void SetMCGenerator(TString mcgen) ;
141  Int_t GetMCGenerator() const { return fMCGenerator ; }
143 
144  void Print(const Option_t * opt) const;
145  void PrintAncestry(AliMCEvent* mcevent, Int_t label, Int_t nGenerMax = 1000) const;
146  void PrintMCTag(Int_t tag) const;
147 
148  private:
149 
151 
153 
155 
157 
159 
160  TLorentzVector fDaughMom;
161 
162  TLorentzVector fDaughMom2;
163 
164  TLorentzVector fMotherMom;
165 
166  TLorentzVector fGMotherMom;
167 
168  // Specific to pythia events and header recovery
169  // avoid multiple times checks
170  AliGenPythiaEventHeader
177 
180 
183 
185  AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ;
186 
188  ClassDef(AliMCAnalysisUtils,8) ;
190 
191 } ;
192 
193 #endif //ALIMCANALYSISUTILS_H
194 
195 
196 
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)
void CheckOverlapped2GammaDecay(const Int_t *labels, const UShort_t *edepFrac, Int_t nlabels, Int_t mesonIndex, Float_t clusE, const AliMCEvent *mcevent, Int_t &tag)
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)
Int_t CheckOrigin(Int_t label, AliMCEvent *mcevent, TString selectHeaderName, Float_t clusE)
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.
Int_t GetPythiaMinPartParent() const
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
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)
unsigned short UShort_t
Definition: External.C:28
Int_t fPyVersion
Pythia guessed version.
Int_t GetPythiaMaxPartParent() const
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
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.