]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/CaloTrackCorrBase/AliMCAnalysisUtils.h
check if clusters tagged as photon decay have the decay companion in the list of...
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliMCAnalysisUtils.h
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 //_________________________________________________________________________
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 ---
16 #include <TObject.h>
17 #include <TString.h> 
18 class TList ;
19 class TVector3;
20
21 //--- AliRoot system ---
22 class AliCaloTrackReader ;
23 class AliStack ;
24
25 class AliMCAnalysisUtils : public TObject {
26         
27  public: 
28   AliMCAnalysisUtils() ; // ctor
29   virtual ~AliMCAnalysisUtils() ;//virtual dtor
30     
31   //--------------------------------------
32   //Enum with tag for origin of particles
33   //--------------------------------------
34   
35   //"Mostly" photon parent types on line 1,
36   //                                                  
37   //then "mostly" electron parent types on line 3, (e.g. electrons can
38   //come from pi0 decay)                              
39   //then charged particles on line 4,                                                                                    
40   //followed by other and unknown on line 5                                                                              
41   enum mcTypes { kMCPhoton,     kMCPrompt,      kMCFragmentation, kMCISR,    
42                  kMCPi0Decay,   kMCEtaDecay,    kMCOtherDecay,
43                  kMCDecayPairLost, kMCDecayPairInCalo,
44                  kMCDecayDalitz,kMCConversion,  kMCElectron,
45                  kMCEFromCFromB,kMCEFromC,      kMCEFromB,        kMCZDecay, kMCWDecay,
46                  kMCMuon,       kMCPion,        kMCPi0,           kMCKaon,   kMCEta,      kMCProton,   
47                  kMCAntiProton, kMCNeutron,     kMCAntiNeutron,
48                  kMCUnknown,    kMCBadLabel                                                         } ;
49   
50   //--------------------------------------
51   // Methods to check origin of clusters
52   //--------------------------------------
53   
54   Int_t   CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader* reader, 
55                               Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & v) ;
56   
57   Int_t   CheckOrigin(Int_t label, const AliCaloTrackReader * reader, TString calorimeter) ;
58   
59   //Check the label of the most significant particle but do checks on the rest of the contributing labels
60   Int_t   CheckOrigin       (const Int_t *label,  Int_t nlabels, const AliCaloTrackReader * reader, TString calorimeter) ;
61   Int_t   CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack               , const TObjArray *arrayCluster) ; // ESD
62   Int_t   CheckOriginInAOD  (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
63   
64   void    CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack * stack,                Int_t & tag); // ESD
65   void    CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
66   
67   void    CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack* stack,                 Int_t & tag); // ESD
68   void    CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const TClonesArray* mcparticles, Int_t & tag); // AOD
69   
70   TLorentzVector GetMother     (Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
71   TLorentzVector GetMother     (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
72   TLorentzVector GetMother     (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
73   TLorentzVector GetGrandMother(Int_t label,const AliCaloTrackReader* reader,
74                                 Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
75
76   TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok, Int_t & momLabel);
77   
78   void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader,
79                                       Float_t & asy, Float_t & angle, Bool_t & ok);
80
81   Int_t          GetNDaughters(Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
82   TLorentzVector GetDaughter  (Int_t daughter, Int_t label,const AliCaloTrackReader* reader,
83                                Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel);
84
85   Int_t          GetNOverlaps(const Int_t * label, UInt_t nlabels,
86                               Int_t mctag, Int_t mesonLabel,
87                               AliCaloTrackReader * reader,Int_t *overpdg);
88   
89   //Check or set the bits produced in the above methods
90   void    SetTagBit(Int_t &tag, UInt_t set) const {
91     // Set bit of type set (mcTypes) in tag
92     tag |= (1<<set) ; 
93   } 
94   
95   Bool_t  CheckTagBit(Int_t tag, UInt_t test) const {
96     // Check if in tag the bit test (mcTypes) is set.
97     if (tag & (1<<test) ) return  kTRUE ;    
98     else return kFALSE ;
99   }
100   
101   //--------------------------------------
102   // Other methods
103   //--------------------------------------
104     
105   // Method to recover MC jets stored in generator
106   TList * GetJets(const AliCaloTrackReader * reader) ;
107   
108   void    SetDebug(Int_t deb)           { fDebug=deb           ; }
109   Int_t   GetDebug()              const { return fDebug        ; }      
110   
111   void    SetMCGenerator(TString mcgen) { fMCGenerator = mcgen ; }
112   TString GetMCGenerator()        const { return fMCGenerator  ; }      
113   
114   void    Print(const Option_t * opt) const;
115   void    PrintMCTag(Int_t tag) const;
116
117  private:
118   Int_t   fCurrentEvent;        // Current Event
119   Int_t   fDebug;               // Debug level
120   TList * fJetsList;            // List of jets
121   TString fMCGenerator;         // MC geneator used to generate data in simulation
122   
123   AliMCAnalysisUtils & operator = (const AliMCAnalysisUtils & mcu) ; // cpy assignment
124   AliMCAnalysisUtils(              const AliMCAnalysisUtils & mcu) ; // cpy ctor
125   
126   ClassDef(AliMCAnalysisUtils,5)
127
128 } ;
129
130 #endif //ALIMCANALYSISUTILS_H
131
132
133