AliPhysics  d565ceb (d565ceb)
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 
34 class AliMCAnalysisUtils : public TObject {
35 
36  public:
37 
38  AliMCAnalysisUtils() ; // ctor
39 
40  virtual ~AliMCAnalysisUtils() ; // virtual dtor
41 
42  //--------------------------------------
43  // Enum with tag for origin of particles
44  //--------------------------------------
45 
60 
61  //--------------------------------------
62  // Methods to check origin of clusters
63  //--------------------------------------
64 
65  Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliMCEvent* mcevent,
66  Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & prodVertex) ;
67 
68  Int_t CheckOrigin(Int_t label, const AliMCEvent* mcevent) ;
69  Int_t CheckOrigin(const Int_t *labels, Int_t nlabels, const AliMCEvent* mcevent, const TObjArray *arrayCluster = 0x0) ;
70 
71  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const AliMCEvent* mcevent, Int_t & tag);
72 
73  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const AliMCEvent* mcevent, Int_t & tag);
74 
75  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Bool_t & ok);
76  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok);
77  TLorentzVector GetMother (Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
78  TLorentzVector GetGrandMother(Int_t label,const AliMCEvent* mcevent, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
79 
80  TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliMCEvent* mcevent, Bool_t & ok, Int_t & momLabel);
81 
82  void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliMCEvent* mcevent,
83  Float_t & asy, Float_t & angle, Bool_t & ok);
84 
85  Int_t GetNDaughters(Int_t label,const AliMCEvent* mcevent, Bool_t & ok);
86  TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliMCEvent* mcevent,
87  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel, TVector3 & prodVertex);
88 
89  Int_t GetNOverlaps(const Int_t * label, UInt_t nlabels,
90  Int_t mctag, Int_t mesonLabel,
91  AliMCEvent* mcevent,
92  Int_t *overpdg, Int_t *overlabel);
93 
94  //Check or set the bits produced in the above methods
95  void SetTagBit(Int_t &tag, UInt_t set) const {
96  // Set bit of type set (mcTypes) in tag
97  tag |= (1<<set) ;
98  }
99 
101  // Check if in tag the bit test (mcTypes) is set.
102  if (tag & (1<<test) ) return kTRUE ;
103  else return kFALSE ;
104  }
105 
106  //--------------------------------------
107  // Other methods
108  //--------------------------------------
109 
110  // Method to recover MC jets stored in generator
111  TList * GetJets(AliMCEvent* mcevent, AliGenEventHeader * mcheader, Int_t eventNumber) ;
112 
113  void SetDebug(Int_t deb) { fDebug=deb ; }
114  Int_t GetDebug() const { return fDebug ; }
115 
116  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
117  void SetMCGenerator(Int_t mcgen) ;
118  void SetMCGenerator(TString mcgen) ;
119  Int_t GetMCGenerator() const { return fMCGenerator ; }
121 
122  void Print(const Option_t * opt) const;
123  void PrintAncestry(AliMCEvent* mcevent, Int_t label, Int_t nGenerMax = 1000) const;
124  void PrintMCTag(Int_t tag) const;
125 
126  private:
127 
129 
131 
133 
135 
137 
138  TLorentzVector fDaughMom;
139 
140  TLorentzVector fDaughMom2;
141 
142  TLorentzVector fMotherMom;
143 
144  TLorentzVector fGMotherMom;
145 
148 
150  AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ;
151 
153  ClassDef(AliMCAnalysisUtils,7) ;
155 
156 } ;
157 
158 #endif //ALIMCANALYSISUTILS_H
159 
160 
161 
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)
TLorentzVector fMotherMom
! particle momentum
void PrintMCTag(Int_t tag) const
Print the assigned origins to this particle.
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 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
Int_t CheckOrigin(Int_t label, const AliMCEvent *mcevent)
TLorentzVector fGMotherMom
! particle momentum
Int_t fDebug
Debug level.
TLorentzVector fDaughMom2
! particle momentum
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.
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
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()
TList * GetJets(AliMCEvent *mcevent, AliGenEventHeader *mcheader, Int_t eventNumber)
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)
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
Class with analysis utils for simulations.
TString GetMCGeneratorString() const
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)