]>
Commit | Line | Data |
---|---|---|
b2a297fa | 1 | #ifndef ALIDIELECTRONMC_H |
2 | #define ALIDIELECTRONMC_H | |
3 | /* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
27de2dfb | 6 | /* $Id$ */ |
7 | ||
b2a297fa | 8 | //##################################################### |
9 | //# # | |
10 | //# Class AliDielectronMC # | |
11 | //# Cut Class for Jpsi->e+e- analysis # | |
12 | //# # | |
13 | //# by WooJin J. Park, GSI / W.J.Park@gsi.de # | |
14 | //# # | |
15 | //##################################################### | |
16 | ||
17 | #ifndef ROOT_TObject | |
18 | #include <TObject.h> | |
19 | #endif | |
20 | class AliESDEvent; | |
21 | class AliHFEpid; | |
22 | class AliStack; | |
23 | class AliMCEvent; | |
24 | class AliESDtrack; | |
fb7d2d99 | 25 | class AliAODTrack; |
b2a297fa | 26 | class TParticle; |
27 | class AliMCParticle; | |
28 | class AliAODMCParticle; | |
29 | ||
30 | #include "AliDielectronPair.h" | |
31 | ||
32 | class AliDielectronMC : public TObject{ | |
33 | ||
34 | public: | |
35 | enum AnalysisType {kUNSET=0, kESD, kAOD}; | |
36 | ||
37 | AliDielectronMC(AnalysisType type=kUNSET); | |
38 | virtual ~AliDielectronMC(); | |
39 | ||
572b0139 | 40 | void SetHasMC(Bool_t hasMC) { fHasMC=hasMC; } |
41 | Bool_t HasMC() const { return fHasMC; } | |
42 | ||
b2a297fa | 43 | static AliDielectronMC* Instance(); |
44 | ||
45 | void Initialize(); // initialization | |
46 | Int_t GetNMCTracks(); // return number of generated tracks | |
47 | Int_t GetNMCTracksFromStack(); // return number of generated tracks from stack | |
2a14a7b1 | 48 | Int_t GetNPrimary(); // return number of primary tracks |
49 | Int_t GetNPrimaryFromStack(); // return number of primary tracks from stack | |
8df8e382 | 50 | Int_t GetMCPID(const AliESDtrack* _track); // return MC PID |
fb7d2d99 | 51 | Int_t GetMCPID(const AliAODTrack* _track); // return MC PID for AODtrack |
8df8e382 | 52 | Int_t GetMCPIDFromStack(const AliESDtrack* _track); // return MC PID |
53 | Int_t GetMotherPDG(const AliESDtrack* _track); // return mother PID from the MC stack | |
fb7d2d99 | 54 | Int_t GetMotherPDG(const AliAODTrack* _track); // return mother PID from the MC stack |
8df8e382 | 55 | Int_t GetMotherPDGFromStack(const AliESDtrack* _track); // return mother PID from the MC stack |
56 | Int_t GetMCProcess(const AliESDtrack* _track); // return process number | |
57 | Int_t GetMCProcessFromStack(const AliESDtrack* _track); // return process number | |
58 | Int_t GetMCProcessMother(const AliESDtrack* _track); // return process number of the mother track | |
59 | Int_t GetMCProcessMotherFromStack(const AliESDtrack* _track); // return process number of the mother track | |
b2a297fa | 60 | |
61 | Bool_t ConnectMCEvent(); | |
62 | Bool_t UpdateStack(); | |
63 | ||
a655b716 | 64 | Bool_t IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother); |
b2a297fa | 65 | Bool_t IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother); |
66 | Bool_t IsMCMotherToEE(const AliVParticle *particle, Int_t pdgMother); | |
8df8e382 | 67 | |
68 | Bool_t HaveSameMother(const AliDielectronPair *pair); | |
b2a297fa | 69 | |
a655b716 | 70 | Int_t GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother); |
71 | Int_t GetLabelMotherWithPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother); | |
72 | ||
b2a297fa | 73 | AliVParticle* GetMCTrackFromMCEvent(AliVParticle *track); // return MC track directly from MC event |
83e37742 | 74 | AliVParticle* GetMCTrackFromMCEvent(Int_t itrk); // return MC track directly from MC event |
8df8e382 | 75 | TParticle* GetMCTrackFromStack(const AliESDtrack* _track); // return MC track from stack |
76 | AliMCParticle* GetMCTrack(const AliESDtrack* _track); // return MC track associated with reco track | |
fb7d2d99 | 77 | AliAODMCParticle* GetMCTrack( const AliAODTrack* _track); // return MC track associated with reco AOD track |
8df8e382 | 78 | |
79 | TParticle* GetMCTrackMotherFromStack(const AliESDtrack* _track); // return MC mother track from stack | |
80 | AliMCParticle* GetMCTrackMother(const AliESDtrack* _track); // return MC mother track from stack | |
fb7d2d99 | 81 | AliAODMCParticle* GetMCTrackMother(const AliAODTrack* _track); // return MC mother fot track AODTrack |
8df8e382 | 82 | AliMCParticle* GetMCTrackMother(const AliMCParticle* _particle); // return MC mother track from stack |
83 | AliAODMCParticle* GetMCTrackMother(const AliAODMCParticle* _particle); // return MC mother track from stack | |
84 | ||
85 | Int_t NumberOfDaughters(const AliESDtrack* track); // return number of daughters | |
fb7d2d99 | 86 | Int_t NumberOfDaughters(const AliAODTrack* track); // return number of daughters for AOD track |
8df8e382 | 87 | Int_t NumberOfDaughters(const AliMCParticle* particle); // return number of daughters |
88 | Int_t NumberOfDaughters(const AliAODMCParticle* particle); // return number of daughters | |
6551594b | 89 | |
90 | void GetDaughters(const TObject *mother, AliVParticle* &d1, AliVParticle* &d2); | |
fb7d2d99 | 91 | Int_t IsJpsiPrimary(const AliDielectronPair * pair); |
92 | Int_t IsJpsiPrimary(const AliVParticle * pair); | |
b2a297fa | 93 | |
94 | private: | |
95 | AliMCEvent *fMCEvent; // MC event object | |
96 | AliStack *fStack; // MC stack | |
97 | ||
98 | AnalysisType fAnaType; // Analysis type | |
572b0139 | 99 | Bool_t fHasMC; // Do we have an MC handler? |
b2a297fa | 100 | |
101 | static AliDielectronMC* fgInstance; //! singleton pointer | |
fb7d2d99 | 102 | TClonesArray* fMcArray; //mcArray for AOD MC particles |
103 | ||
104 | ||
b2a297fa | 105 | AliDielectronMC(const AliDielectronMC &c); |
106 | AliDielectronMC &operator=(const AliDielectronMC &c); | |
107 | ||
108 | Bool_t IsMCMotherToEEesd(const AliMCParticle *particle, Int_t pdgMother); | |
109 | Bool_t IsMCMotherToEEaod(const AliAODMCParticle *particle, Int_t pdgMother); | |
110 | ||
a655b716 | 111 | Int_t GetLabelMotherWithPdgESD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother); |
112 | Int_t GetLabelMotherWithPdgAOD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother); | |
b2a297fa | 113 | |
114 | ClassDef(AliDielectronMC, 0) | |
115 | }; | |
116 | ||
a655b716 | 117 | // |
118 | // inline functions | |
119 | // | |
120 | inline Bool_t AliDielectronMC::IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother) | |
b2a297fa | 121 | { |
b2a297fa | 122 | return IsMotherPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother); |
123 | } | |
a655b716 | 124 | //___________________________________________________________ |
125 | inline Bool_t AliDielectronMC::IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother){ | |
126 | return GetLabelMotherWithPdg(particle1,particle2,pdgMother)>=0; | |
127 | } | |
128 | //___________________________________________________________ | |
129 | inline Int_t AliDielectronMC::GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother){ | |
130 | return GetLabelMotherWithPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother); | |
131 | } | |
b2a297fa | 132 | |
fb7d2d99 | 133 | #endif |
134 |