]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/PartCorrBase/AliMCAnalysisUtils.h
add calibration histograms for vzero centroids
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / 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 /* $Id:  $ */
6
7 //_________________________________________________________________________
8 // Class for analysis utils for MC data
9 // stored in stack or event header.
10 // Contains:
11 //  - method to check the origin of a given track/cluster
12 //  - method to obtain the generated jets
13 //
14 //*-- Author: Gustavo Conesa (INFN-LNF)
15
16 // --- ROOT system ---
17 #include <TObject.h>
18 #include <TString.h> 
19 class TList ;
20 class TVector3;
21
22 //--- AliRoot system ---
23 class AliCaloTrackReader ;
24 class AliStack ;
25
26 class AliMCAnalysisUtils : public TObject {
27         
28  public: 
29   AliMCAnalysisUtils() ; // ctor
30   virtual ~AliMCAnalysisUtils() ;//virtual dtor
31  private:
32   AliMCAnalysisUtils & operator = (const AliMCAnalysisUtils & ) ;//cpy assignment
33   AliMCAnalysisUtils(const AliMCAnalysisUtils & mcu) ; // cpy ctor
34   
35  public:
36   
37   //--------------------------------------
38   //Enum with tag for origin of particles
39   //--------------------------------------
40   
41   //"Mostly" photon parent types on line 1,
42   //                                                  
43   //then "mostly" electron parent types on line 2, (e.g. electrons can
44   //come from pi0 decay)                              
45   //then charged particles on line 3,                                                                                    
46   //followed by other and unknown on line 4                                                                              
47   enum mcTypes { kMCPhoton,   kMCPrompt,      kMCFragmentation, kMCISR,    kMCPi0Decay, kMCEtaDecay, kMCOtherDecay, kMCConversion,
48                  kMCElectron, kMCEFromCFromB, kMCEFromC,        kMCEFromB, kMCZDecay,   kMCWDecay,
49                  kMCMuon,     kMCPion,        kMCPi0,           kMCKaon,   kMCEta,      kMCProton,   kMCAntiProton, kMCNeutron,    kMCAntiNeutron,
50                  kMCOther,    kMCUnknown,     kMCBadLabel                                                                                         } ;
51   
52   //--------------------------------------
53   // Methods to check origin of clusters
54   //--------------------------------------
55   
56   Int_t   CheckCommonAncestor(const Int_t index1, const Int_t index2, AliCaloTrackReader* reader, 
57                               Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & v) ;
58   Int_t   CheckOrigin(const Int_t label, AliCaloTrackReader * reader, const Int_t input) ;
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, const Int_t nlabels, AliCaloTrackReader * reader, const Int_t input) ;
61   
62   Int_t   CheckOriginInStack(const Int_t *labels, const Int_t nlabels, AliStack * stack) ;
63   Int_t   CheckOriginInAOD  (const Int_t *labels, const Int_t nlabels, TClonesArray* mcparticles) ;
64   
65   void    CheckOverlapped2GammaDecay(const Int_t *labels, const Int_t nlabels, const Int_t mesonIndex, AliStack * stack, Int_t & tag);
66   void    CheckOverlapped2GammaDecay(const Int_t *labels, const Int_t nlabels, const Int_t mesonIndex, TClonesArray* mcparticles, Int_t & tag);
67   
68   //Check or set the bits produced in the above methods
69   void    SetTagBit(Int_t &tag, const UInt_t set) const {
70     // Set bit of type set (mcTypes) in tag
71     tag |= (1<<set) ; 
72   } 
73   
74   Bool_t  CheckTagBit(const Int_t tag, const UInt_t test) const {
75     // Check if in tag the bit test (mcTypes) is set.
76     if (tag & (1<<test) ) return  kTRUE ;    
77     else return kFALSE ;
78   }
79   
80   //--------------------------------------
81   // Other methods
82   //--------------------------------------
83   
84   // Method to recover MC jets stored in generator
85   TList * GetJets(AliCaloTrackReader * const reader) ;
86   
87   void    SetDebug(Int_t deb)           { fDebug=deb           ; }
88   Int_t   GetDebug()              const { return fDebug        ; }      
89   
90   void    SetMCGenerator(TString mcgen) { fMCGenerator = mcgen ; }
91   TString GetMCGenerator()        const { return fMCGenerator  ; }      
92   
93   void    Print(const Option_t * opt) const;
94   
95  private:
96   Int_t   fCurrentEvent;        // Current Event
97   Int_t   fDebug;               // Debug level
98   TList * fJetsList;            // List of jets
99   TString fMCGenerator;         // MC geneator used to generate data in simulation
100   
101   ClassDef(AliMCAnalysisUtils,3)
102
103 } ;
104
105 #endif //ALIMCANALYSISUTILS_H
106
107
108