]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG/CaloTrackCorrBase/AliMCAnalysisUtils.h
Merge branch 'master_patch'
[u/mrichter/AliRoot.git] / PWG / CaloTrackCorrBase / AliMCAnalysisUtils.h
index 470ba64f731c2b413ef4af2baa4e4d94776ac9d6..6b5a7d6482b3dd00ea6e20f393e41549d01d71cb 100755 (executable)
@@ -14,7 +14,8 @@
 
 // --- ROOT system ---
 #include <TObject.h>
-#include <TString.h> 
+#include <TString.h>
+#include <TLorentzVector.h>
 class TList ;
 class TVector3;
 
@@ -39,45 +40,60 @@ class AliMCAnalysisUtils : public TObject {
   //then charged particles on line 4,                                                                                    
   //followed by other and unknown on line 5                                                                              
   enum mcTypes { kMCPhoton,     kMCPrompt,      kMCFragmentation, kMCISR,    
-                 kMCPi0Decay,   kMCEtaDecay,    kMCOtherDecay,    kMCConversion,
-                 kMCElectron,   kMCEFromCFromB, kMCEFromC,        kMCEFromB, kMCZDecay,   kMCWDecay,
+                 kMCPi0Decay,   kMCEtaDecay,    kMCOtherDecay,
+                 kMCDecayPairLost, kMCDecayPairInCalo,
+                 kMCDecayDalitz,kMCConversion,  kMCElectron,
+                 kMCEFromCFromB,kMCEFromC,      kMCEFromB,        kMCZDecay, kMCWDecay,
                  kMCMuon,       kMCPion,        kMCPi0,           kMCKaon,   kMCEta,      kMCProton,   
                  kMCAntiProton, kMCNeutron,     kMCAntiNeutron,
-                 kMCOther,      kMCUnknown,     kMCBadLabel                                                                                         } ;
+                 kMCUnknown,    kMCBadLabel                                                         } ;
   
   //--------------------------------------
   // Methods to check origin of clusters
   //--------------------------------------
   
-  Int_t   CheckCommonAncestor(const Int_t index1, const Int_t index2, const AliCaloTrackReader* reader, 
+  Int_t   CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader* reader, 
                              Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & v) ;
   
-  Int_t   CheckOrigin(const Int_t label, const AliCaloTrackReader * reader) ;
+  Int_t   CheckOrigin(Int_t label, const AliCaloTrackReader * reader, Int_t calorimeter) ;
   
   //Check the label of the most significant particle but do checks on the rest of the contributing labels
-  Int_t   CheckOrigin       (const Int_t *label,  const Int_t nlabels, const AliCaloTrackReader * reader) ;
-  Int_t   CheckOriginInStack(const Int_t *labels, const Int_t nlabels, AliStack * stack)                ; // ESD
-  Int_t   CheckOriginInAOD  (const Int_t *labels, const Int_t nlabels, const TClonesArray* mcparticles) ; // AOD
+  Int_t   CheckOrigin       (const Int_t *label,  Int_t nlabels, const AliCaloTrackReader * reader, Int_t calorimeter) ;
+  Int_t   CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack               , const TObjArray *arrayCluster) ; // ESD
+  Int_t   CheckOriginInAOD  (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
   
-  void    CheckOverlapped2GammaDecay(const Int_t *labels, const Int_t nlabels, const Int_t mesonIndex, AliStack * stack, Int_t & tag); // ESD
-  void    CheckOverlapped2GammaDecay(const Int_t *labels, const Int_t nlabels, const Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
+  void    CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, AliStack * stack,                Int_t & tag); // ESD
+  void    CheckOverlapped2GammaDecay(const Int_t *labels, Int_t nlabels, Int_t mesonIndex, const TClonesArray* mcparticles, Int_t & tag); // AOD
   
-  TLorentzVector GetMother     (const Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
-  TLorentzVector GetMother     (const Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
-  TLorentzVector GetGrandMother(const Int_t label,const AliCaloTrackReader* reader,
+  void    CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, AliStack* stack,                 Int_t & tag); // ESD
+  void    CheckLostDecayPair(const TObjArray *arrayCluster, Int_t iMom, Int_t iParent, const TClonesArray* mcparticles, Int_t & tag); // AOD
+  
+  TLorentzVector GetMother     (Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
+  TLorentzVector GetMother     (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok);
+  TLorentzVector GetMother     (Int_t label,const AliCaloTrackReader* reader, Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & momLabel);
+  TLorentzVector GetGrandMother(Int_t label,const AliCaloTrackReader* reader,
                                 Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & grandMomLabel, Int_t & greatMomLabel);
 
-  TLorentzVector GetMotherWithPDG(const Int_t label, const Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok);
+  TLorentzVector GetMotherWithPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok, Int_t & momLabel);
   
-  Float_t        GetMCDecayAsymmetryForPDG(const Int_t label, const Int_t pdg,const AliCaloTrackReader* reader, Bool_t & ok);
+  void GetMCDecayAsymmetryAngleForPDG(Int_t label, Int_t pdg,const AliCaloTrackReader* reader,
+                                      Float_t & asy, Float_t & angle, Bool_t & ok);
+
+  Int_t          GetNDaughters(Int_t label,const AliCaloTrackReader* reader, Bool_t & ok);
+  TLorentzVector GetDaughter  (Int_t daughter, Int_t label,const AliCaloTrackReader* reader,
+                               Int_t & pdg, Int_t & status, Bool_t & ok, Int_t & daugLabel);
 
+  Int_t          GetNOverlaps(const Int_t * label, UInt_t nlabels,
+                              Int_t mctag, Int_t mesonLabel,
+                              AliCaloTrackReader * reader,Int_t *overpdg);
+  
   //Check or set the bits produced in the above methods
-  void    SetTagBit(Int_t &tag, const UInt_t set) const {
+  void    SetTagBit(Int_t &tag, UInt_t set) const {
     // Set bit of type set (mcTypes) in tag
     tag |= (1<<set) ; 
   } 
   
-  Bool_t  CheckTagBit(const Int_t tag, const UInt_t test) const {
+  Bool_t  CheckTagBit(Int_t tag, UInt_t test) const {
     // Check if in tag the bit test (mcTypes) is set.
     if (tag & (1<<test) ) return  kTRUE ;    
     else return kFALSE ;
@@ -93,22 +109,31 @@ class AliMCAnalysisUtils : public TObject {
   void    SetDebug(Int_t deb)           { fDebug=deb           ; }
   Int_t   GetDebug()              const { return fDebug        ; }     
   
-  void    SetMCGenerator(TString mcgen) { fMCGenerator = mcgen ; }
-  TString GetMCGenerator()        const { return fMCGenerator  ; }     
+  enum generator {kPythia = 0, kHerwig = 1, kHijing = 2, kBoxLike = 3 } ;
+  void    SetMCGenerator(Int_t   mcgen) ;
+  void    SetMCGenerator(TString mcgen) ;
+  Int_t   GetMCGenerator()        const { return fMCGenerator  ; }
+  TString GetMCGeneratorString()  const { return fMCGeneratorString ; }
   
   void    Print(const Option_t * opt) const;
-  void    PrintMCTag(const Int_t tag) const;
+  void    PrintMCTag(Int_t tag) const;
 
  private:
   Int_t   fCurrentEvent;        // Current Event
   Int_t   fDebug;               // Debug level
   TList * fJetsList;            // List of jets
-  TString fMCGenerator;         // MC geneator used to generate data in simulation
+  Int_t   fMCGenerator;         // MC generator used to generate data in simulation
+  TString fMCGeneratorString;   // MC generator used to generate data in simulation
+  
+  TLorentzVector fDaughMom;     //! particle momentum
+  TLorentzVector fDaughMom2;    //! particle momentum
+  TLorentzVector fMotherMom;    //! particle momentum
+  TLorentzVector fGMotherMom;   //! particle momentum
   
   AliMCAnalysisUtils & operator = (const AliMCAnalysisUtils & mcu) ; // cpy assignment
   AliMCAnalysisUtils(              const AliMCAnalysisUtils & mcu) ; // cpy ctor
   
-  ClassDef(AliMCAnalysisUtils,4)
+  ClassDef(AliMCAnalysisUtils,6)
 
 } ;