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 */
6 //#####################################################
8 //# Class AliDielectronMC #
9 //# Cut Class for Jpsi->e+e- analysis #
11 //# by WooJin J. Park, GSI / W.J.Park@gsi.de #
13 //#####################################################
25 class AliAODMCParticle;
27 #include "AliDielectronPair.h"
29 class AliDielectronMC : public TObject{
32 enum AnalysisType {kUNSET=0, kESD, kAOD};
34 AliDielectronMC(AnalysisType type=kUNSET);
35 virtual ~AliDielectronMC();
37 static AliDielectronMC* Instance();
39 void Initialize(); // initialization
40 Int_t GetNMCTracks(); // return number of generated tracks
41 Int_t GetNMCTracksFromStack(); // return number of generated tracks from stack
42 Int_t GetMCPID(AliESDtrack* _track); // return MC PID
43 Int_t GetMCPIDFromStack(AliESDtrack* _track); // return MC PID
44 Int_t GetMotherPDG(AliESDtrack* _track); // return mother PID from the MC stack
45 Int_t GetMotherPDGFromStack(AliESDtrack* _track); // return mother PID from the MC stack
46 Int_t GetMCProcess(AliESDtrack* _track); // return process number
47 Int_t GetMCProcessFromStack(AliESDtrack* _track); // return process number
48 Int_t GetMCProcessMother(AliESDtrack* _track); // return process number of the mother track
49 Int_t GetMCProcessMotherFromStack(AliESDtrack* _track); // return process number of the mother track
51 Bool_t ConnectMCEvent();
54 Bool_t IsMotherPdg(const TObject* particle, Int_t pdgMother);
55 Bool_t IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
56 Bool_t IsMCMotherToEE(const AliVParticle *particle, Int_t pdgMother);
58 AliVParticle* GetMCTrackFromMCEvent(AliVParticle *track); // return MC track directly from MC event
59 AliVParticle* GetMCTrackFromMCEvent(Int_t _itrk); // return MC track directly from MC event
60 TParticle* GetMCTrackFromStack(AliESDtrack* _track); // return MC track from stack
61 AliMCParticle* GetMCTrack(AliESDtrack* _track); // return MC track associated with reco track
62 TParticle* GetMCTrackMotherFromStack(AliESDtrack* _track); // return MC mother track from stack
63 AliMCParticle* GetMCTrackMother(AliESDtrack* _track); // return MC mother track from stack
66 AliMCEvent *fMCEvent; // MC event object
67 AliStack *fStack; // MC stack
69 AnalysisType fAnaType; // Analysis type
71 static AliDielectronMC* fgInstance; //! singleton pointer
73 AliDielectronMC(const AliDielectronMC &c);
74 AliDielectronMC &operator=(const AliDielectronMC &c);
76 Bool_t IsMCMotherToEEesd(const AliMCParticle *particle, Int_t pdgMother);
77 Bool_t IsMCMotherToEEaod(const AliAODMCParticle *particle, Int_t pdgMother);
79 Bool_t IsMotherPdgESD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
80 Bool_t IsMotherPdgAOD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
82 ClassDef(AliDielectronMC, 0)
85 inline Bool_t AliDielectronMC::IsMotherPdg(const TObject* particle, Int_t pdgMother)
90 if (particle->IsA()!=AliDielectronPair::Class()) return kFALSE;
91 const AliDielectronPair *pair=static_cast<const AliDielectronPair*>(particle);
92 return IsMotherPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother);