]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGDQ/dielectron/AliDielectronMC.h
Add event selection depending on high energy clusters existance in EMCal to speed...
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronMC.h
CommitLineData
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
6//#####################################################
7//# #
8//# Class AliDielectronMC #
9//# Cut Class for Jpsi->e+e- analysis #
10//# #
11//# by WooJin J. Park, GSI / W.J.Park@gsi.de #
12//# #
13//#####################################################
14
15#ifndef ROOT_TObject
16#include <TObject.h>
17#endif
18class AliESDEvent;
19class AliHFEpid;
20class AliStack;
21class AliMCEvent;
22class AliESDtrack;
fb7d2d99 23class AliAODTrack;
b2a297fa 24class TParticle;
25class AliMCParticle;
26class AliAODMCParticle;
27
ba15fdfb 28#include "AliDielectronSignalMC.h"
b2a297fa 29#include "AliDielectronPair.h"
30
31class AliDielectronMC : public TObject{
32
33public:
34 enum AnalysisType {kUNSET=0, kESD, kAOD};
35
36 AliDielectronMC(AnalysisType type=kUNSET);
37 virtual ~AliDielectronMC();
38
572b0139 39 void SetHasMC(Bool_t hasMC) { fHasMC=hasMC; }
40 Bool_t HasMC() const { return fHasMC; }
41
b2a297fa 42 static AliDielectronMC* Instance();
43
44 void Initialize(); // initialization
45 Int_t GetNMCTracks(); // return number of generated tracks
46 Int_t GetNMCTracksFromStack(); // return number of generated tracks from stack
c8f0f810 47 Int_t GetNPrimary() const; // return number of primary tracks
2a14a7b1 48 Int_t GetNPrimaryFromStack(); // return number of primary tracks from stack
8df8e382 49 Int_t GetMCPID(const AliESDtrack* _track); // return MC PID
fb7d2d99 50 Int_t GetMCPID(const AliAODTrack* _track); // return MC PID for AODtrack
8df8e382 51 Int_t GetMCPIDFromStack(const AliESDtrack* _track); // return MC PID
52 Int_t GetMotherPDG(const AliESDtrack* _track); // return mother PID from the MC stack
fb7d2d99 53 Int_t GetMotherPDG(const AliAODTrack* _track); // return mother PID from the MC stack
8df8e382 54 Int_t GetMotherPDGFromStack(const AliESDtrack* _track); // return mother PID from the MC stack
55 Int_t GetMCProcess(const AliESDtrack* _track); // return process number
56 Int_t GetMCProcessFromStack(const AliESDtrack* _track); // return process number
57 Int_t GetMCProcessMother(const AliESDtrack* _track); // return process number of the mother track
58 Int_t GetMCProcessMotherFromStack(const AliESDtrack* _track); // return process number of the mother track
b2a297fa 59
60 Bool_t ConnectMCEvent();
61 Bool_t UpdateStack();
62
a655b716 63 Bool_t IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother);
b2a297fa 64 Bool_t IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
65 Bool_t IsMCMotherToEE(const AliVParticle *particle, Int_t pdgMother);
c8f0f810 66 Bool_t IsMCTruth(const AliDielectronPair* pair, const AliDielectronSignalMC* signalMC) const;
ee877a49 67 Bool_t IsMCTruth(Int_t ipart, AliDielectronSignalMC* signalMC, Int_t branch) const;
c8f0f810 68 Int_t GetMothersLabel(Int_t daughterLabel) const;
69 Int_t GetPdgFromLabel(Int_t label) const;
8df8e382 70
5720c765 71 Bool_t IsPhysicalPrimary(Int_t label) const; // checks if a particle is physical primary
72
c8f0f810 73 Bool_t HaveSameMother(const AliDielectronPair *pair) const;
b2a297fa 74
a655b716 75 Int_t GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother);
76 Int_t GetLabelMotherWithPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
77
5720c765 78// AliVParticle* GetMCTrackFromMCEvent(const AliVParticle *track); // return MC track directly from MC event
c8f0f810 79 AliVParticle* GetMCTrackFromMCEvent(Int_t itrk) const; // return MC track directly from MC event
8df8e382 80 TParticle* GetMCTrackFromStack(const AliESDtrack* _track); // return MC track from stack
81 AliMCParticle* GetMCTrack(const AliESDtrack* _track); // return MC track associated with reco track
fb7d2d99 82 AliAODMCParticle* GetMCTrack( const AliAODTrack* _track); // return MC track associated with reco AOD track
8df8e382 83
84 TParticle* GetMCTrackMotherFromStack(const AliESDtrack* _track); // return MC mother track from stack
85 AliMCParticle* GetMCTrackMother(const AliESDtrack* _track); // return MC mother track from stack
fb7d2d99 86 AliAODMCParticle* GetMCTrackMother(const AliAODTrack* _track); // return MC mother fot track AODTrack
8df8e382 87 AliMCParticle* GetMCTrackMother(const AliMCParticle* _particle); // return MC mother track from stack
88 AliAODMCParticle* GetMCTrackMother(const AliAODMCParticle* _particle); // return MC mother track from stack
89
90 Int_t NumberOfDaughters(const AliESDtrack* track); // return number of daughters
fb7d2d99 91 Int_t NumberOfDaughters(const AliAODTrack* track); // return number of daughters for AOD track
8df8e382 92 Int_t NumberOfDaughters(const AliMCParticle* particle); // return number of daughters
93 Int_t NumberOfDaughters(const AliAODMCParticle* particle); // return number of daughters
6551594b 94
95 void GetDaughters(const TObject *mother, AliVParticle* &d1, AliVParticle* &d2);
fb7d2d99 96 Int_t IsJpsiPrimary(const AliDielectronPair * pair);
97 Int_t IsJpsiPrimary(const AliVParticle * pair);
1bb1fef1 98 Bool_t CheckParticleSource(Int_t label, AliDielectronSignalMC::ESource source) const;
ba15fdfb 99
100 AliMCEvent* GetMCEvent() { return fMCEvent; } // return the AliMCEvent
b2a297fa 101
102private:
103 AliMCEvent *fMCEvent; // MC event object
104 AliStack *fStack; // MC stack
105
106 AnalysisType fAnaType; // Analysis type
572b0139 107 Bool_t fHasMC; // Do we have an MC handler?
b2a297fa 108
109 static AliDielectronMC* fgInstance; //! singleton pointer
fb7d2d99 110 TClonesArray* fMcArray; //mcArray for AOD MC particles
111
112
b2a297fa 113 AliDielectronMC(const AliDielectronMC &c);
114 AliDielectronMC &operator=(const AliDielectronMC &c);
115
116 Bool_t IsMCMotherToEEesd(const AliMCParticle *particle, Int_t pdgMother);
117 Bool_t IsMCMotherToEEaod(const AliAODMCParticle *particle, Int_t pdgMother);
118
a655b716 119 Int_t GetLabelMotherWithPdgESD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
120 Int_t GetLabelMotherWithPdgAOD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
b2a297fa 121
5720c765 122 Bool_t ComparePDG(Int_t particlePDG, Int_t requiredPDG, Bool_t pdgExclusion, Bool_t checkBothCharges) const;
ee877a49 123 Bool_t CheckIsRadiative(Int_t label) const;
124 Bool_t CheckRadiativeDecision(Int_t mLabel, const AliDielectronSignalMC * const signalMC) const;
125
ef37a5a8 126
b2a297fa 127 ClassDef(AliDielectronMC, 0)
128};
129
a655b716 130//
131// inline functions
132//
133inline Bool_t AliDielectronMC::IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother)
b2a297fa 134{
b2a297fa 135 return IsMotherPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother);
136}
a655b716 137//___________________________________________________________
138inline Bool_t AliDielectronMC::IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother){
139 return GetLabelMotherWithPdg(particle1,particle2,pdgMother)>=0;
140}
141//___________________________________________________________
142inline Int_t AliDielectronMC::GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother){
143 return GetLabelMotherWithPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother);
144}
b2a297fa 145
fb7d2d99 146#endif
147