]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/CaloTrackCorrBase/AliMCAnalysisUtils.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliMCAnalysisUtils.h
CommitLineData
7cd4e982 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 */
7cd4e982 5
6//_________________________________________________________________________
7// Class for analysis utils for MC data
8// stored in stack or event header.
9// Contains:
10// - method to check the origin of a given track/cluster
11// - method to obtain the generated jets
12//
13//*-- Author: Gustavo Conesa (INFN-LNF)
14
15// --- ROOT system ---
c3ab95b2 16#include <TObject.h>
0d360687 17#include <TString.h>
18#include <TLorentzVector.h>
7cd4e982 19class TList ;
c4a7d28a 20class TVector3;
7cd4e982 21
22//--- AliRoot system ---
23class AliCaloTrackReader ;
24class AliStack ;
25
26class AliMCAnalysisUtils : public TObject {
27
78219bac 28 public:
29 AliMCAnalysisUtils() ; // ctor
30 virtual ~AliMCAnalysisUtils() ;//virtual dtor
c5693f62 31
840124fe 32 //--------------------------------------
33 //Enum with tag for origin of particles
34 //--------------------------------------
3c75ddf7 35
36 //"Mostly" photon parent types on line 1,
37 //
bbb79e66 38 //then "mostly" electron parent types on line 3, (e.g. electrons can
3c75ddf7 39 //come from pi0 decay)
bbb79e66 40 //then charged particles on line 4,
41 //followed by other and unknown on line 5
c5693f62 42 enum mcTypes { kMCPhoton, kMCPrompt, kMCFragmentation, kMCISR,
3e57baab 43 kMCPi0Decay, kMCEtaDecay, kMCOtherDecay,
44 kMCDecayPairLost, kMCDecayPairInCalo,
45 kMCDecayDalitz,kMCConversion, kMCElectron,
46 kMCEFromCFromB,kMCEFromC, kMCEFromB, kMCZDecay, kMCWDecay,
c5693f62 47 kMCMuon, kMCPion, kMCPi0, kMCKaon, kMCEta, kMCProton,
48 kMCAntiProton, kMCNeutron, kMCAntiNeutron,
4250012f 49 kMCUnknown, kMCBadLabel } ;
3c75ddf7 50
840124fe 51 //--------------------------------------
3c75ddf7 52 // Methods to check origin of clusters
840124fe 53 //--------------------------------------
3c75ddf7 54
8a2dbbff 55 Int_t CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader* reader,
3c75ddf7 56 Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & v) ;
bbb79e66 57
320923dc 58 Int_t CheckOrigin(Int_t label, const AliCaloTrackReader * reader, Int_t calorimeter) ;
bbb79e66 59
3c75ddf7 60 //Check the label of the most significant particle but do checks on the rest of the contributing labels
320923dc 61 Int_t CheckOrigin (const Int_t *label, Int_t nlabels, const AliCaloTrackReader * reader, Int_t calorimeter) ;
3e57baab 62 Int_t CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack , const TObjArray *arrayCluster) ; // ESD
63 Int_t CheckOriginInAOD (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
3c75ddf7 64
3e57baab 65 void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack * stack, Int_t & tag); // ESD
8a2dbbff 66 void CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
840124fe 67
3e57baab 68 void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack* stack, Int_t & tag); // ESD
69 void CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const TClonesArray* mcparticles, Int_t & tag); // AOD
70
8a2dbbff 71 TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
72 TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
73 TLorentzVector GetMother (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
74 TLorentzVector GetGrandMother(Int_t label,const AliCaloTrackReader* reader,
914b9fe7 75 Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
76
8a2dbbff 77 TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok, Int_t & momLabel);
9036b2a6 78
8a2dbbff 79 void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader,
4efb6957 80 Float_t & asy, Float_t & angle, Bool_t & ok);
8e81c2cf 81
8a2dbbff 82 Int_t GetNDaughters(Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
83 TLorentzVector GetDaughter (Int_t daughter, Int_t label,const AliCaloTrackReader* reader,
36769d30 84 Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel);
64be16b4 85
8a2dbbff 86 Int_t GetNOverlaps(const Int_t * label, UInt_t nlabels,
87 Int_t mctag, Int_t mesonLabel,
4914e781 88 AliCaloTrackReader * reader,Int_t *overpdg);
89
840124fe 90 //Check or set the bits produced in the above methods
8a2dbbff 91 void SetTagBit(Int_t &tag, UInt_t set) const {
3c75ddf7 92 // Set bit of type set (mcTypes) in tag
93 tag |= (1<<set) ;
94 }
95
8a2dbbff 96 Bool_t CheckTagBit(Int_t tag, UInt_t test) const {
3c75ddf7 97 // Check if in tag the bit test (mcTypes) is set.
98 if (tag & (1<<test) ) return kTRUE ;
99 else return kFALSE ;
f8006433 100 }
3c75ddf7 101
840124fe 102 //--------------------------------------
103 // Other methods
104 //--------------------------------------
2644ead9 105
840124fe 106 // Method to recover MC jets stored in generator
c5693f62 107 TList * GetJets(const AliCaloTrackReader * reader) ;
3c75ddf7 108
109 void SetDebug(Int_t deb) { fDebug=deb ; }
110 Int_t GetDebug() const { return fDebug ; }
111
0d360687 112 enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
113 void SetMCGenerator(Int_t mcgen) ;
114 void SetMCGenerator(TString mcgen) ;
115 Int_t GetMCGenerator() const { return fMCGenerator ; }
116 TString GetMCGeneratorString() const { return fMCGeneratorString ; }
840124fe 117
118 void Print(const Option_t * opt) const;
8a2dbbff 119 void PrintMCTag(Int_t tag) const;
bbb79e66 120
3c75ddf7 121 private:
122 Int_t fCurrentEvent; // Current Event
123 Int_t fDebug; // Debug level
124 TList * fJetsList; // List of jets
0d360687 125 Int_t fMCGenerator; // MC generator used to generate data in simulation
126 TString fMCGeneratorString; // MC generator used to generate data in simulation
127
128 TLorentzVector fDaughMom; //! particle momentum
129 TLorentzVector fDaughMom2; //! particle momentum
130 TLorentzVector fMotherMom; //! particle momentum
131 TLorentzVector fGMotherMom; //! particle momentum
3c75ddf7 132
bbb79e66 133 AliMCAnalysisUtils & operator = (const AliMCAnalysisUtils & mcu) ; // cpy assignment
134 AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ; // cpy ctor
c5693f62 135
0d360687 136 ClassDef(AliMCAnalysisUtils,6)
7cd4e982 137
3c75ddf7 138} ;
7cd4e982 139
140#endif //ALIMCANALYSISUTILS_H
141
142
143