AliPhysics  97a96ce (97a96ce)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 //_________________________________________________________________________
19 //_________________________________________________________________________
20 
21 // --- ROOT system ---
22 #include <TObject.h>
23 #include <TString.h>
24 #include <TLorentzVector.h>
25 class TList ;
26 class TVector3;
27 class TClonesArray;
28 
29 //--- AliRoot system ---
30 class AliCaloTrackReader ;
31 class AliStack ;
32 
33 class AliMCAnalysisUtils : public TObject {
34 
35  public:
36 
37  AliMCAnalysisUtils() ; // ctor
38 
39  virtual ~AliMCAnalysisUtils() ; // virtual dtor
40 
41  //--------------------------------------
42  // Enum with tag for origin of particles
43  //--------------------------------------
44 
59 
60  //--------------------------------------
61  // Methods to check origin of clusters
62  //--------------------------------------
63 
64  Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader* reader,
65  Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & prodVertex) ;
66 
67  Int_t CheckOrigin(Int_t label, const AliCaloTrackReader * reader, Int_t calorimeter) ;
68 
69  //Check the label of the most significant particle but do checks on the rest of the contributing labels
70  Int_t CheckOrigin (const Int_t *label, Int_t nlabels, const AliCaloTrackReader * reader, Int_t calorimeter) ;
71  Int_t CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack , const TObjArray *arrayCluster) ; // ESD
72  Int_t CheckOriginInAOD (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
73 
74  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack * stack, Int_t & tag); // ESD
75  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
76 
77  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack* stack, Int_t & tag); // ESD
78  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const TClonesArray* mcparticles, Int_t & tag); // AOD
79 
80  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
81  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
82  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
83  TLorentzVector GetGrandMother(Int_t label,const AliCaloTrackReader* reader,
84  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
85 
86  TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok, Int_t & momLabel);
87 
89  Float_t & asy, Float_t & angle, Bool_t & ok);
90 
91  Int_t GetNDaughters(Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
92  TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliCaloTrackReader* reader,
93  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel, TVector3 & prodVertex);
94 
95  Int_t GetNOverlaps(const Int_t * label, UInt_t nlabels,
96  Int_t mctag, Int_t mesonLabel,
97  AliCaloTrackReader * reader,Int_t *overpdg);
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 
105  Bool_t CheckTagBit(Int_t tag, UInt_t test) const {
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(const AliCaloTrackReader * reader) ;
117 
118  void SetDebug(Int_t deb) { fDebug=deb ; }
119  Int_t GetDebug() const { return fDebug ; }
120 
121  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
122  void SetMCGenerator(Int_t mcgen) ;
123  void SetMCGenerator(TString mcgen) ;
124  Int_t GetMCGenerator() const { return fMCGenerator ; }
126 
127  void Print(const Option_t * opt) const;
128  void PrintMCTag(Int_t tag) const;
129 
130  private:
131 
133 
135 
137 
139 
141 
142  TLorentzVector fDaughMom;
143 
144  TLorentzVector fDaughMom2;
145 
146  TLorentzVector fMotherMom;
147 
148  TLorentzVector fGMotherMom;
149 
152 
154  AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ;
155 
157  ClassDef(AliMCAnalysisUtils,6) ;
159 
160 } ;
161 
162 #endif //ALIMCANALYSISUTILS_H
163 
164 
165 
TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg, const AliCaloTrackReader *reader, Bool_t &ok, Int_t &momLabel)
Int_t pdg
Int_t GetMCGenerator() const
void SetMCGenerator(Int_t mcgen)
Set the generator type.
void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack *stack, Int_t &tag)
Check on ESDs if the current decay photon has the second photon companion lost.
Int_t fCurrentEvent
Current Event number.
TLorentzVector fMotherMom
! particle momentum
void PrintMCTag(Int_t tag) const
Print the assigned origins to this particle.
const TString calorimeter
Definition: anaM.C:35
virtual ~AliMCAnalysisUtils()
Destructor.
void SetTagBit(Int_t &tag, UInt_t set) const
TLorentzVector fGMotherMom
! particle momentum
Int_t fDebug
Debug level.
TLorentzVector GetMother(Int_t label, const AliCaloTrackReader *reader, Bool_t &ok)
TLorentzVector fDaughMom2
! particle momentum
void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg, const AliCaloTrackReader *reader, 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...
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 CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack *stack, const TObjArray *arrayCluster)
Int_t GetNDaughters(Int_t label, const AliCaloTrackReader *reader, Bool_t &ok)
TLorentzVector GetGrandMother(Int_t label, const AliCaloTrackReader *reader, Int_t &pdg, Int_t &status, Bool_t &ok, Int_t &grandMomLabel, Int_t &greatMomLabel)
Int_t CheckOrigin(Int_t label, const AliCaloTrackReader *reader, Int_t calorimeter)
Base class for event, clusters and tracks filtering and preparation for the analysis.
Int_t fMCGenerator
MC generator used to generate data in simulation.
Int_t GetDebug() const
Int_t CheckOriginInAOD(const Int_t *labels, Int_t nlabels, const TClonesArray *mcparticles, const TObjArray *arrayCluster)
TLorentzVector fDaughMom
! particle momentum
TList * fJetsList
List of jets.
TLorentzVector GetDaughter(Int_t daughter, Int_t label, const AliCaloTrackReader *reader, Int_t &pdg, Int_t &status, Bool_t &ok, Int_t &daugLabel, TVector3 &prodVertex)
void SetDebug(Int_t deb)
TString fMCGeneratorString
MC generator used to generate data in simulation.
Int_t GetNOverlaps(const Int_t *label, UInt_t nlabels, Int_t mctag, Int_t mesonLabel, AliCaloTrackReader *reader, Int_t *overpdg)
void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack *stack, Int_t &tag)
const char Option_t
Definition: External.C:48
AliMCAnalysisUtils()
Constructor.
bool Bool_t
Definition: External.C:53
Class with analysis utils for simulations.
Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader *reader, Int_t &ancPDG, Int_t &ancStatus, TLorentzVector &momentum, TVector3 &prodVertex)
TString GetMCGeneratorString() const
TList * GetJets(const AliCaloTrackReader *reader)
Bool_t CheckTagBit(Int_t tag, UInt_t test) const