]>
Commit | Line | Data |
---|---|---|
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> |
17 | #include <TString.h> | |
7cd4e982 | 18 | class TList ; |
c4a7d28a | 19 | class TVector3; |
7cd4e982 | 20 | |
21 | //--- AliRoot system --- | |
22 | class AliCaloTrackReader ; | |
23 | class AliStack ; | |
24 | ||
25 | class AliMCAnalysisUtils : public TObject { | |
26 | ||
78219bac | 27 | public: |
28 | AliMCAnalysisUtils() ; // ctor | |
29 | virtual ~AliMCAnalysisUtils() ;//virtual dtor | |
c5693f62 | 30 | |
840124fe | 31 | //-------------------------------------- |
32 | //Enum with tag for origin of particles | |
33 | //-------------------------------------- | |
3c75ddf7 | 34 | |
35 | //"Mostly" photon parent types on line 1, | |
36 | // | |
bbb79e66 | 37 | //then "mostly" electron parent types on line 3, (e.g. electrons can |
3c75ddf7 | 38 | //come from pi0 decay) |
bbb79e66 | 39 | //then charged particles on line 4, |
40 | //followed by other and unknown on line 5 | |
c5693f62 | 41 | enum mcTypes { kMCPhoton, kMCPrompt, kMCFragmentation, kMCISR, |
42 | kMCPi0Decay, kMCEtaDecay, kMCOtherDecay, kMCConversion, | |
43 | kMCElectron, kMCEFromCFromB, kMCEFromC, kMCEFromB, kMCZDecay, kMCWDecay, | |
44 | kMCMuon, kMCPion, kMCPi0, kMCKaon, kMCEta, kMCProton, | |
45 | kMCAntiProton, kMCNeutron, kMCAntiNeutron, | |
46 | kMCOther, kMCUnknown, kMCBadLabel } ; | |
3c75ddf7 | 47 | |
840124fe | 48 | //-------------------------------------- |
3c75ddf7 | 49 | // Methods to check origin of clusters |
840124fe | 50 | //-------------------------------------- |
3c75ddf7 | 51 | |
c5693f62 | 52 | Int_t CheckCommonAncestor(const Int_t index1, const Int_t index2, const AliCaloTrackReader* reader, |
3c75ddf7 | 53 | Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & v) ; |
bbb79e66 | 54 | |
c5693f62 | 55 | Int_t CheckOrigin(const Int_t label, const AliCaloTrackReader * reader, const Int_t input) ; |
bbb79e66 | 56 | |
3c75ddf7 | 57 | //Check the label of the most significant particle but do checks on the rest of the contributing labels |
bfc290d0 | 58 | Int_t CheckOrigin (const Int_t *label, const Int_t nlabels, const AliCaloTrackReader * reader, const Int_t input) ; |
59 | Int_t CheckOriginInStack(const Int_t *labels, const Int_t nlabels, AliStack * stack) ; // ESD | |
bbb79e66 | 60 | Int_t CheckOriginInAOD (const Int_t *labels, const Int_t nlabels, const TClonesArray* mcparticles) ; // AOD |
3c75ddf7 | 61 | |
bbb79e66 | 62 | void CheckOverlapped2GammaDecay(const Int_t *labels, const Int_t nlabels, const Int_t mesonIndex, AliStack * stack, Int_t & tag); // ESD |
63 | void CheckOverlapped2GammaDecay(const Int_t *labels, const Int_t nlabels, const Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD | |
840124fe | 64 | |
51a0ace5 | 65 | TLorentzVector GetMother(const Int_t label,const AliCaloTrackReader* reader, Bool_t & ok); |
66 | TLorentzVector GetMother(const Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok); | |
67 | TLorentzVector GetMotherWithPDG(const Int_t label, const Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok); | |
9036b2a6 | 68 | |
840124fe | 69 | //Check or set the bits produced in the above methods |
3c75ddf7 | 70 | void SetTagBit(Int_t &tag, const UInt_t set) const { |
71 | // Set bit of type set (mcTypes) in tag | |
72 | tag |= (1<<set) ; | |
73 | } | |
74 | ||
75 | Bool_t CheckTagBit(const Int_t tag, const UInt_t test) const { | |
76 | // Check if in tag the bit test (mcTypes) is set. | |
77 | if (tag & (1<<test) ) return kTRUE ; | |
78 | else return kFALSE ; | |
f8006433 | 79 | } |
3c75ddf7 | 80 | |
840124fe | 81 | //-------------------------------------- |
82 | // Other methods | |
83 | //-------------------------------------- | |
3c75ddf7 | 84 | |
840124fe | 85 | // Method to recover MC jets stored in generator |
c5693f62 | 86 | TList * GetJets(const AliCaloTrackReader * reader) ; |
3c75ddf7 | 87 | |
88 | void SetDebug(Int_t deb) { fDebug=deb ; } | |
89 | Int_t GetDebug() const { return fDebug ; } | |
90 | ||
91 | void SetMCGenerator(TString mcgen) { fMCGenerator = mcgen ; } | |
92 | TString GetMCGenerator() const { return fMCGenerator ; } | |
840124fe | 93 | |
94 | void Print(const Option_t * opt) const; | |
bbb79e66 | 95 | void PrintMCTag(const Int_t tag) const; |
96 | ||
3c75ddf7 | 97 | private: |
98 | Int_t fCurrentEvent; // Current Event | |
99 | Int_t fDebug; // Debug level | |
100 | TList * fJetsList; // List of jets | |
101 | TString fMCGenerator; // MC geneator used to generate data in simulation | |
102 | ||
bbb79e66 | 103 | AliMCAnalysisUtils & operator = (const AliMCAnalysisUtils & mcu) ; // cpy assignment |
104 | AliMCAnalysisUtils( const AliMCAnalysisUtils & mcu) ; // cpy ctor | |
c5693f62 | 105 | |
bbb79e66 | 106 | ClassDef(AliMCAnalysisUtils,4) |
7cd4e982 | 107 | |
3c75ddf7 | 108 | } ; |
7cd4e982 | 109 | |
110 | #endif //ALIMCANALYSISUTILS_H | |
111 | ||
112 | ||
113 |