CbmRoot
PairAnalysisMC.h
Go to the documentation of this file.
1 #ifndef PAIRANALYSISMC_H
2 #define PAIRANALYSISMC_H
3 /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 //#####################################################
7 //# #
8 //# Class PairAnalysisMC #
9 //# #
10 //# by Julian Book, Uni Ffm, Julian.Book@cern.ch #
11 //# #
12 //#####################################################
13 
14 #ifndef ROOT_TObject
15 #include <TMCProcess.h>
16 #include <TObject.h>
17 #endif
18 class TParticle;
19 class CbmMCTrack;
20 class PairAnalysisTrack;
21 
22 #include "PairAnalysisPair.h"
23 #include "PairAnalysisSignalMC.h"
24 
25 class PairAnalysisMC : public TObject {
26 
27 public:
29  virtual ~PairAnalysisMC();
30 
31  void SetHasMC(Bool_t hasMC) { fHasMC = hasMC; }
32  Bool_t HasMC() const { return fHasMC; }
33 
35 
36  Int_t GetNMCTracks(); // return number of generated tracks
37  Int_t GetMotherPDG(
38  const PairAnalysisTrack* _track); // return mother PID from the MC stack
39  Int_t GetMotherPDG(
40  const CbmMCTrack* _track); // return mother PID from the MC stack
41 
42  Bool_t ConnectMCEvent();
43 
44  Bool_t IsMotherPdg(const PairAnalysisPair* pair, Int_t pdgMother);
45  Bool_t IsMotherPdg(const PairAnalysisTrack* particle1,
46  const PairAnalysisTrack* particle2,
47  Int_t pdgMother);
48 
49  Bool_t IsMCTruth(const PairAnalysisPair* pair,
50  const PairAnalysisSignalMC* signalMC) const;
51  Bool_t IsMCTruth(const PairAnalysisTrack* trk,
52  PairAnalysisSignalMC* signalMC,
53  Int_t branch) const;
54  Bool_t
55  IsMCTruth(Int_t label, PairAnalysisSignalMC* signalMC, Int_t branch) const;
56 
57  Int_t GetMothersLabel(Int_t daughterLabel) const;
58  Int_t GetPdgFromLabel(Int_t label) const;
59 
60  Bool_t CheckGEANTProcess(Int_t label, TMCProcess process) const;
61  // Bool_t IsPhysicalPrimary(Int_t label) const; // checks if a particle is physical primary
62  // Bool_t IsSecondaryFromWeakDecay(Int_t label) const;
63  // Bool_t IsSecondaryFromMaterial(Int_t label) const;
64 
65  Bool_t HaveSameMother(const PairAnalysisPair* pair) const;
66 
67  Int_t GetLabelMotherWithPdg(const PairAnalysisPair* pair, Int_t pdgMother);
68  Int_t GetLabelMotherWithPdg(const PairAnalysisTrack* particle1,
69  const PairAnalysisTrack* particle2,
70  Int_t pdgMother);
71 
73  Int_t label) const; // return MC track directly from MC event
74  CbmMCTrack*
76  _track); // return MC track associated with reco track
77 
79  const PairAnalysisTrack* _track); // return MC mother for reco track
80  CbmMCTrack*
81  GetMCTrackMother(const CbmMCTrack* _track); // return MC mother for mc rtack
82 
83  Int_t
84  NumberOfDaughters(const CbmMCTrack* particle); // return number of daughters
85 
86  void GetDaughters(const TObject* mother, CbmMCTrack*& d1, CbmMCTrack*& d2);
87  Bool_t CheckParticleSource(Int_t label,
88  PairAnalysisSignalMC::ESource source) const;
89  // Bool_t GetPrimaryVertex(Double_t &primVtxX, Double_t &primVtxY, Double_t &primVtxZ);
90  // AliMCEvent* GetMCEvent() { return fMCEvent; } // return the AliMCEvent
91 
92 private:
93  TObject* fMCEvent; // MC event object
94  Bool_t fHasMC; // Do we have an MC handler?
95  TClonesArray* fMCArray; //mcArray for AOD MC particles
96 
98 
101 
102  Bool_t ComparePDG(Int_t particlePDG,
103  Int_t requiredPDG,
104  Bool_t pdgExclusion,
105  Bool_t checkBothCharges) const;
106 
107  Bool_t CheckIsDalitz(Int_t label,
108  const PairAnalysisSignalMC* const signalMC) const;
109  Bool_t CheckDalitzDecision(Int_t mLabel,
110  const PairAnalysisSignalMC* const signalMC) const;
111  Bool_t IsPhysicalPrimary(Int_t label, UInt_t processID) const;
112  Bool_t IsSecondaryFromWeakDecay(Int_t label, UInt_t processID) const;
113  Bool_t IsSecondaryFromMaterial(Int_t label, UInt_t processID) const;
114 
115  ClassDef(PairAnalysisMC, 0) // MC signal finder
116 };
117 
118 //
119 // inline functions
120 //
122  Int_t pdgMother) {
123  return IsMotherPdg(
124  pair->GetFirstDaughter(), pair->GetSecondDaughter(), pdgMother);
125 }
126 //___________________________________________________________
127 inline Bool_t PairAnalysisMC::IsMotherPdg(const PairAnalysisTrack* particle1,
128  const PairAnalysisTrack* particle2,
129  Int_t pdgMother) {
130  return GetLabelMotherWithPdg(particle1, particle2, pdgMother) >= 0;
131 }
132 //___________________________________________________________
134  Int_t pdgMother) {
135  return GetLabelMotherWithPdg(
136  pair->GetFirstDaughter(), pair->GetSecondDaughter(), pdgMother);
137 }
138 
139 #endif
PairAnalysisMC::GetLabelMotherWithPdg
Int_t GetLabelMotherWithPdg(const PairAnalysisPair *pair, Int_t pdgMother)
Definition: PairAnalysisMC.h:133
PairAnalysisPair::GetFirstDaughter
PairAnalysisTrack * GetFirstDaughter() const
Definition: PairAnalysisPair.h:140
PairAnalysisSignalMC::ESource
ESource
Definition: PairAnalysisSignalMC.h:19
PairAnalysisMC::GetMotherPDG
Int_t GetMotherPDG(const PairAnalysisTrack *_track)
Definition: PairAnalysisMC.cxx:154
PairAnalysisMC::CheckGEANTProcess
Bool_t CheckGEANTProcess(Int_t label, TMCProcess process) const
Definition: PairAnalysisMC.cxx:519
PairAnalysisMC::ComparePDG
Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t pdgExclusion, Bool_t checkBothCharges) const
Definition: PairAnalysisMC.cxx:264
PairAnalysisMC::fMCArray
TClonesArray * fMCArray
Definition: PairAnalysisMC.h:95
PairAnalysisMC::GetMCTrack
CbmMCTrack * GetMCTrack(const PairAnalysisTrack *_track)
Definition: PairAnalysisMC.cxx:124
PairAnalysisMC::fgInstance
static PairAnalysisMC * fgInstance
Definition: PairAnalysisMC.h:97
PairAnalysisTrack
Definition: PairAnalysisTrack.h:37
PairAnalysisPair
Definition: PairAnalysisPair.h:25
PairAnalysisMC::IsSecondaryFromMaterial
Bool_t IsSecondaryFromMaterial(Int_t label, UInt_t processID) const
Definition: PairAnalysisMC.cxx:1124
PairAnalysisMC::IsMotherPdg
Bool_t IsMotherPdg(const PairAnalysisPair *pair, Int_t pdgMother)
Definition: PairAnalysisMC.h:121
PairAnalysisMC::IsMCTruth
Bool_t IsMCTruth(const PairAnalysisPair *pair, const PairAnalysisSignalMC *signalMC) const
Definition: PairAnalysisMC.cxx:753
PairAnalysisMC::~PairAnalysisMC
virtual ~PairAnalysisMC()
Definition: PairAnalysisMC.cxx:56
PairAnalysisMC::CheckDalitzDecision
Bool_t CheckDalitzDecision(Int_t mLabel, const PairAnalysisSignalMC *const signalMC) const
Definition: PairAnalysisMC.cxx:615
PairAnalysisMC::operator=
PairAnalysisMC & operator=(const PairAnalysisMC &c)
PairAnalysisMC::CheckIsDalitz
Bool_t CheckIsDalitz(Int_t label, const PairAnalysisSignalMC *const signalMC) const
Definition: PairAnalysisMC.cxx:594
PairAnalysisMC::IsSecondaryFromWeakDecay
Bool_t IsSecondaryFromWeakDecay(Int_t label, UInt_t processID) const
Definition: PairAnalysisMC.cxx:1107
PairAnalysisMC::CheckParticleSource
Bool_t CheckParticleSource(Int_t label, PairAnalysisSignalMC::ESource source) const
Definition: PairAnalysisMC.cxx:534
PairAnalysisMC
Definition: PairAnalysisMC.h:25
PairAnalysisMC::fHasMC
Bool_t fHasMC
Definition: PairAnalysisMC.h:94
PairAnalysisMC::NumberOfDaughters
Int_t NumberOfDaughters(const CbmMCTrack *particle)
Definition: PairAnalysisMC.cxx:175
PairAnalysisMC::SetHasMC
void SetHasMC(Bool_t hasMC)
Definition: PairAnalysisMC.h:31
PairAnalysisMC::ConnectMCEvent
Bool_t ConnectMCEvent()
Definition: PairAnalysisMC.cxx:101
PairAnalysisMC::GetDaughters
void GetDaughters(const TObject *mother, CbmMCTrack *&d1, CbmMCTrack *&d2)
Definition: PairAnalysisMC.cxx:214
PairAnalysisMC::GetMCTrackMother
CbmMCTrack * GetMCTrackMother(const PairAnalysisTrack *_track)
Definition: PairAnalysisMC.cxx:132
CbmMCTrack
Definition: CbmMCTrack.h:34
PairAnalysisMC::GetPdgFromLabel
Int_t GetPdgFromLabel(Int_t label) const
Definition: PairAnalysisMC.cxx:251
PairAnalysisMC::PairAnalysisMC
PairAnalysisMC(const PairAnalysisMC &c)
singleton pointer
PairAnalysisMC::HaveSameMother
Bool_t HaveSameMother(const PairAnalysisPair *pair) const
Definition: PairAnalysisMC.cxx:1018
PairAnalysisMC::PairAnalysisMC
PairAnalysisMC()
Definition: PairAnalysisMC.cxx:47
PairAnalysisPair.h
PairAnalysisMC::HasMC
Bool_t HasMC() const
Definition: PairAnalysisMC.h:32
PairAnalysisMC::GetMCTrackFromMCEvent
CbmMCTrack * GetMCTrackFromMCEvent(Int_t label) const
Definition: PairAnalysisMC.cxx:75
PairAnalysisSignalMC.h
PairAnalysisMC::Instance
static PairAnalysisMC * Instance()
PairAnalysisSignalMC
Definition: PairAnalysisSignalMC.h:15
PairAnalysisMC::fMCEvent
TObject * fMCEvent
Definition: PairAnalysisMC.h:93
PairAnalysisMC::IsPhysicalPrimary
Bool_t IsPhysicalPrimary(Int_t label, UInt_t processID) const
Definition: PairAnalysisMC.cxx:1040
PairAnalysisPair::GetSecondDaughter
PairAnalysisTrack * GetSecondDaughter() const
Definition: PairAnalysisPair.h:143
PairAnalysisMC::GetNMCTracks
Int_t GetNMCTracks()
Definition: PairAnalysisMC.cxx:63
PairAnalysisMC::GetMothersLabel
Int_t GetMothersLabel(Int_t daughterLabel) const
Definition: PairAnalysisMC.cxx:237