AliPhysics  4e47bdd (4e47bdd)
 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 //_________________________________________________________________________
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 AliCaloTrackReader ;
32 class AliStack ;
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 AliCaloTrackReader* reader,
66  Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & prodVertex) ;
67 
68  Int_t CheckOrigin(Int_t label, const AliCaloTrackReader * reader, Int_t calorimeter) ;
69 
70  //Check the label of the most significant particle but do checks on the rest of the contributing labels
71  Int_t CheckOrigin (const Int_t *label, Int_t nlabels, const AliCaloTrackReader * reader, Int_t calorimeter) ;
72  Int_t CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack , const TObjArray *arrayCluster) ; // ESD
73  Int_t CheckOriginInAOD (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
74 
75  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack * stack, Int_t & tag); // ESD
76  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
77 
78  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack* stack, Int_t & tag); // ESD
79  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const TClonesArray* mcparticles, Int_t & tag); // AOD
80 
81  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
82  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
83  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
84  TLorentzVector GetGrandMother(Int_t label,const AliCaloTrackReader* reader,
85  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
86 
87  TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok, Int_t & momLabel);
88 
90  Float_t & asy, Float_t & angle, Bool_t & ok);
91 
92  Int_t GetNDaughters(Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
93  TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliCaloTrackReader* reader,
94  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel, TVector3 & prodVertex);
95 
96  Int_t GetNOverlaps(const Int_t * label, UInt_t nlabels,
97  Int_t mctag, Int_t mesonLabel,
98  AliCaloTrackReader * reader,
99  Int_t *overpdg, Int_t *overlabel);
100 
101  //Check or set the bits produced in the above methods
102  void SetTagBit(Int_t &tag, UInt_t set) const {
103  // Set bit of type set (mcTypes) in tag
104  tag |= (1<<set) ;
105  }
106 
107  Bool_t CheckTagBit(Int_t tag, UInt_t test) const {
108  // Check if in tag the bit test (mcTypes) is set.
109  if (tag & (1<<test) ) return kTRUE ;
110  else return kFALSE ;
111  }
112 
113  //--------------------------------------
114  // Other methods
115  //--------------------------------------
116 
117  // Method to recover MC jets stored in generator
118  TList * GetJets(const AliCaloTrackReader * reader) ;
119 
120  void SetDebug(Int_t deb) { fDebug=deb ; }
121  Int_t GetDebug() const { return fDebug ; }
122 
123  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
124  void SetMCGenerator(Int_t mcgen) ;
125  void SetMCGenerator(TString mcgen) ;
126  Int_t GetMCGenerator() const { return fMCGenerator ; }
128 
129  void Print(const Option_t * opt) const;
130  void PrintMCTag(Int_t tag) const;
131 
132  private:
133 
135 
137 
139 
141 
143 
144  TLorentzVector fDaughMom;
145 
146  TLorentzVector fDaughMom2;
147 
148  TLorentzVector fMotherMom;
149 
150  TLorentzVector fGMotherMom;
151 
154 
156  AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ;
157 
159  ClassDef(AliMCAnalysisUtils,6) ;
161 
162 } ;
163 
164 #endif //ALIMCANALYSISUTILS_H
165 
166 
167 
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:36
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)
Int_t GetNOverlaps(const Int_t *label, UInt_t nlabels, Int_t mctag, Int_t mesonLabel, AliCaloTrackReader *reader, Int_t *overpdg, Int_t *overlabel)
void SetDebug(Int_t deb)
TString fMCGeneratorString
MC generator used to generate data in simulation.
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