CbmRoot
Loading...
Searching...
No Matches
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
19#include <TClonesArray.h>
20
21class TParticle;
22class CbmMCTrack;
24
25#include "PairAnalysisPair.h"
27
28class PairAnalysisMC : public TObject {
29
30public:
32 virtual ~PairAnalysisMC();
33
34 void SetHasMC(Bool_t hasMC) { fHasMC = hasMC; }
35 Bool_t HasMC() const { return fHasMC; }
36
38
39 Int_t GetNMCTracks(); // return number of generated tracks
40 Int_t GetMotherPDG(const PairAnalysisTrack* _track); // return mother PID from the MC stack
41 Int_t GetMotherPDG(const CbmMCTrack* _track); // return mother PID from the MC stack
42
43 Bool_t ConnectMCEvent();
44
45 Bool_t IsMotherPdg(const PairAnalysisPair* pair, Int_t pdgMother);
46 Bool_t IsMotherPdg(const PairAnalysisTrack* particle1, const PairAnalysisTrack* particle2, Int_t pdgMother);
47
48 Bool_t IsMCTruth(const PairAnalysisPair* pair, const PairAnalysisSignalMC* signalMC) const;
49 Bool_t IsMCTruth(const PairAnalysisTrack* trk, PairAnalysisSignalMC* signalMC, Int_t branch) const;
50 Bool_t IsMCTruth(Int_t label, PairAnalysisSignalMC* signalMC, Int_t branch) const;
51
52 Int_t GetMothersLabel(Int_t daughterLabel) const;
53 Int_t GetPdgFromLabel(Int_t label) const;
54
55 Bool_t CheckGEANTProcess(Int_t label, TMCProcess process) const;
56 // Bool_t IsPhysicalPrimary(Int_t label) const; // checks if a particle is physical primary
57 // Bool_t IsSecondaryFromWeakDecay(Int_t label) const;
58 // Bool_t IsSecondaryFromMaterial(Int_t label) const;
59
60 Bool_t HaveSameMother(const PairAnalysisPair* pair) const;
61
62 Int_t GetLabelMotherWithPdg(const PairAnalysisPair* pair, Int_t pdgMother);
63 Int_t GetLabelMotherWithPdg(const PairAnalysisTrack* particle1, const PairAnalysisTrack* particle2, Int_t pdgMother);
64
65 CbmMCTrack* GetMCTrackFromMCEvent(Int_t label) const; // return MC track directly from MC event
66 CbmMCTrack* GetMCTrack(const PairAnalysisTrack* _track); // return MC track associated with reco track
67
68 CbmMCTrack* GetMCTrackMother(const PairAnalysisTrack* _track); // return MC mother for reco track
69 CbmMCTrack* GetMCTrackMother(const CbmMCTrack* _track); // return MC mother for mc rtack
70
71 Int_t NumberOfDaughters(const CbmMCTrack* particle); // return number of daughters
72
73 void GetDaughters(const TObject* mother, CbmMCTrack*& d1, CbmMCTrack*& d2);
74 Bool_t CheckParticleSource(Int_t label, PairAnalysisSignalMC::ESource source) const;
75 // Bool_t GetPrimaryVertex(Double_t &primVtxX, Double_t &primVtxY, Double_t &primVtxZ);
76 // AliMCEvent* GetMCEvent() { return fMCEvent; } // return the AliMCEvent
77
78private:
79 TObject* fMCEvent; // MC event object
80 Bool_t fHasMC; // Do we have an MC handler?
81 TClonesArray* fMCArray; //mcArray for AOD MC particles
82
84
87
88 Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t pdgExclusion, Bool_t checkBothCharges) const;
89
90 Bool_t CheckIsDalitz(Int_t label, const PairAnalysisSignalMC* const signalMC) const;
91 Bool_t CheckDalitzDecision(Int_t mLabel, const PairAnalysisSignalMC* const signalMC) const;
92 Bool_t IsPhysicalPrimary(Int_t label, UInt_t processID) const;
93 Bool_t IsSecondaryFromWeakDecay(Int_t label, UInt_t processID) const;
94 Bool_t IsSecondaryFromMaterial(Int_t label, UInt_t processID) const;
95
96 ClassDef(PairAnalysisMC, 0) // MC signal finder
97};
98
99//
100// inline functions
101//
102inline Bool_t PairAnalysisMC::IsMotherPdg(const PairAnalysisPair* pair, Int_t pdgMother)
103{
104 return IsMotherPdg(pair->GetFirstDaughter(), pair->GetSecondDaughter(), pdgMother);
105}
106//___________________________________________________________
107inline Bool_t PairAnalysisMC::IsMotherPdg(const PairAnalysisTrack* particle1, const PairAnalysisTrack* particle2,
108 Int_t pdgMother)
109{
110 return GetLabelMotherWithPdg(particle1, particle2, pdgMother) >= 0;
111}
112//___________________________________________________________
113inline Int_t PairAnalysisMC::GetLabelMotherWithPdg(const PairAnalysisPair* pair, Int_t pdgMother)
114{
115 return GetLabelMotherWithPdg(pair->GetFirstDaughter(), pair->GetSecondDaughter(), pdgMother);
116}
117
118#endif
PairAnalysisMC(const PairAnalysisMC &c)
singleton pointer
Int_t NumberOfDaughters(const CbmMCTrack *particle)
virtual ~PairAnalysisMC()
void GetDaughters(const TObject *mother, CbmMCTrack *&d1, CbmMCTrack *&d2)
Int_t GetLabelMotherWithPdg(const PairAnalysisPair *pair, Int_t pdgMother)
Bool_t IsSecondaryFromMaterial(Int_t label, UInt_t processID) const
CbmMCTrack * GetMCTrack(const PairAnalysisTrack *_track)
Bool_t IsPhysicalPrimary(Int_t label, UInt_t processID) const
void SetHasMC(Bool_t hasMC)
Bool_t HaveSameMother(const PairAnalysisPair *pair) const
static PairAnalysisMC * Instance()
Bool_t CheckParticleSource(Int_t label, PairAnalysisSignalMC::ESource source) const
TClonesArray * fMCArray
Int_t GetPdgFromLabel(Int_t label) const
PairAnalysisMC & operator=(const PairAnalysisMC &c)
TObject * fMCEvent
Bool_t IsMotherPdg(const PairAnalysisPair *pair, Int_t pdgMother)
Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t pdgExclusion, Bool_t checkBothCharges) const
Int_t GetMothersLabel(Int_t daughterLabel) const
Bool_t CheckDalitzDecision(Int_t mLabel, const PairAnalysisSignalMC *const signalMC) const
Bool_t CheckGEANTProcess(Int_t label, TMCProcess process) const
Bool_t IsSecondaryFromWeakDecay(Int_t label, UInt_t processID) const
CbmMCTrack * GetMCTrackMother(const PairAnalysisTrack *_track)
static PairAnalysisMC * fgInstance
Bool_t HasMC() const
Bool_t CheckIsDalitz(Int_t label, const PairAnalysisSignalMC *const signalMC) const
CbmMCTrack * GetMCTrackFromMCEvent(Int_t label) const
Int_t GetMotherPDG(const PairAnalysisTrack *_track)
Bool_t IsMCTruth(const PairAnalysisPair *pair, const PairAnalysisSignalMC *signalMC) const