AliPhysics  vAN-20150822 (d56cf94)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
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 
28 //--- AliRoot system ---
29 class AliCaloTrackReader ;
30 class AliStack ;
31 
32 class AliMCAnalysisUtils : public TObject {
33 
34  public:
35 
36  AliMCAnalysisUtils() ; // ctor
37 
38  virtual ~AliMCAnalysisUtils() ; // virtual dtor
39 
40  //--------------------------------------
41  // Enum with tag for origin of particles
42  //--------------------------------------
43 
58 
59  //--------------------------------------
60  // Methods to check origin of clusters
61  //--------------------------------------
62 
63  Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader* reader,
64  Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & prodVertex) ;
65 
66  Int_t CheckOrigin(Int_t label, const AliCaloTrackReader * reader, Int_t calorimeter) ;
67 
68  //Check the label of the most significant particle but do checks on the rest of the contributing labels
69  Int_t CheckOrigin (const Int_t *label, Int_t nlabels, const AliCaloTrackReader * reader, Int_t calorimeter) ;
70  Int_t CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack , const TObjArray *arrayCluster) ; // ESD
71  Int_t CheckOriginInAOD (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
72 
73  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack * stack, Int_t & tag); // ESD
74  void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
75 
76  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack* stack, Int_t & tag); // ESD
77  void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const TClonesArray* mcparticles, Int_t & tag); // AOD
78 
79  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
80  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
81  TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
82  TLorentzVector GetGrandMother(Int_t label,const AliCaloTrackReader* reader,
83  Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
84 
85  TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok, Int_t & momLabel);
86 
87  void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader,
88  Float_t & asy, Float_t & angle, Bool_t & ok);
89 
90  Int_t GetNDaughters(Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
91  TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliCaloTrackReader* reader,
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  AliCaloTrackReader * reader,Int_t *overpdg);
97 
98  //Check or set the bits produced in the above methods
99  void SetTagBit(Int_t &tag, UInt_t set) const {
100  // Set bit of type set (mcTypes) in tag
101  tag |= (1<<set) ;
102  }
103 
104  Bool_t CheckTagBit(Int_t tag, UInt_t test) const {
105  // Check if in tag the bit test (mcTypes) is set.
106  if (tag & (1<<test) ) return kTRUE ;
107  else return kFALSE ;
108  }
109 
110  //--------------------------------------
111  // Other methods
112  //--------------------------------------
113 
114  // Method to recover MC jets stored in generator
115  TList * GetJets(const AliCaloTrackReader * reader) ;
116 
117  void SetDebug(Int_t deb) { fDebug=deb ; }
118  Int_t GetDebug() const { return fDebug ; }
119 
120  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
121  void SetMCGenerator(Int_t mcgen) ;
122  void SetMCGenerator(TString mcgen) ;
123  Int_t GetMCGenerator() const { return fMCGenerator ; }
124  TString GetMCGeneratorString() const { return fMCGeneratorString ; }
125 
126  void Print(const Option_t * opt) const;
127  void PrintMCTag(Int_t tag) const;
128 
129  private:
130 
132 
133  Int_t fDebug;
134 
135  TList * fJetsList;
136 
137  Int_t fMCGenerator;
138 
140 
141  TLorentzVector fDaughMom;
142 
143  TLorentzVector fDaughMom2;
144 
145  TLorentzVector fMotherMom;
146 
147  TLorentzVector fGMotherMom;
148 
151 
153  AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ;
154 
156  ClassDef(AliMCAnalysisUtils,6) ;
158 
159 } ;
160 
161 #endif //ALIMCANALYSISUTILS_H
162 
163 
164 
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...
AliMCAnalysisUtils & operator=(const AliMCAnalysisUtils &mcu)
Copy constructor not implemented.
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)
AliMCAnalysisUtils()
Constructor.
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