]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/dielectron/AliDielectronMC.h
framework update; new classes for track rotation (for background), cuts grouping...
[u/mrichter/AliRoot.git] / PWG3 / 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;
23class TParticle;
24class AliMCParticle;
25class AliAODMCParticle;
26
27#include "AliDielectronPair.h"
28
29class AliDielectronMC : public TObject{
30
31public:
32 enum AnalysisType {kUNSET=0, kESD, kAOD};
33
34 AliDielectronMC(AnalysisType type=kUNSET);
35 virtual ~AliDielectronMC();
36
572b0139 37 void SetHasMC(Bool_t hasMC) { fHasMC=hasMC; }
38 Bool_t HasMC() const { return fHasMC; }
39
b2a297fa 40 static AliDielectronMC* Instance();
41
42 void Initialize(); // initialization
43 Int_t GetNMCTracks(); // return number of generated tracks
44 Int_t GetNMCTracksFromStack(); // return number of generated tracks from stack
2a14a7b1 45 Int_t GetNPrimary(); // return number of primary tracks
46 Int_t GetNPrimaryFromStack(); // return number of primary tracks from stack
8df8e382 47 Int_t GetMCPID(const AliESDtrack* _track); // return MC PID
48 Int_t GetMCPIDFromStack(const AliESDtrack* _track); // return MC PID
49 Int_t GetMotherPDG(const AliESDtrack* _track); // return mother PID from the MC stack
50 Int_t GetMotherPDGFromStack(const AliESDtrack* _track); // return mother PID from the MC stack
51 Int_t GetMCProcess(const AliESDtrack* _track); // return process number
52 Int_t GetMCProcessFromStack(const AliESDtrack* _track); // return process number
53 Int_t GetMCProcessMother(const AliESDtrack* _track); // return process number of the mother track
54 Int_t GetMCProcessMotherFromStack(const AliESDtrack* _track); // return process number of the mother track
b2a297fa 55
56 Bool_t ConnectMCEvent();
57 Bool_t UpdateStack();
58
a655b716 59 Bool_t IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother);
b2a297fa 60 Bool_t IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
61 Bool_t IsMCMotherToEE(const AliVParticle *particle, Int_t pdgMother);
8df8e382 62
63 Bool_t HaveSameMother(const AliDielectronPair *pair);
b2a297fa 64
a655b716 65 Int_t GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother);
66 Int_t GetLabelMotherWithPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
67
b2a297fa 68 AliVParticle* GetMCTrackFromMCEvent(AliVParticle *track); // return MC track directly from MC event
83e37742 69 AliVParticle* GetMCTrackFromMCEvent(Int_t itrk); // return MC track directly from MC event
8df8e382 70 TParticle* GetMCTrackFromStack(const AliESDtrack* _track); // return MC track from stack
71 AliMCParticle* GetMCTrack(const AliESDtrack* _track); // return MC track associated with reco track
72
73 TParticle* GetMCTrackMotherFromStack(const AliESDtrack* _track); // return MC mother track from stack
74 AliMCParticle* GetMCTrackMother(const AliESDtrack* _track); // return MC mother track from stack
75 AliMCParticle* GetMCTrackMother(const AliMCParticle* _particle); // return MC mother track from stack
76 AliAODMCParticle* GetMCTrackMother(const AliAODMCParticle* _particle); // return MC mother track from stack
77
78 Int_t NumberOfDaughters(const AliESDtrack* track); // return number of daughters
79 Int_t NumberOfDaughters(const AliMCParticle* particle); // return number of daughters
80 Int_t NumberOfDaughters(const AliAODMCParticle* particle); // return number of daughters
6551594b 81
82 void GetDaughters(const TObject *mother, AliVParticle* &d1, AliVParticle* &d2);
b2a297fa 83
84private:
85 AliMCEvent *fMCEvent; // MC event object
86 AliStack *fStack; // MC stack
87
88 AnalysisType fAnaType; // Analysis type
572b0139 89 Bool_t fHasMC; // Do we have an MC handler?
b2a297fa 90
91 static AliDielectronMC* fgInstance; //! singleton pointer
92
93 AliDielectronMC(const AliDielectronMC &c);
94 AliDielectronMC &operator=(const AliDielectronMC &c);
95
96 Bool_t IsMCMotherToEEesd(const AliMCParticle *particle, Int_t pdgMother);
97 Bool_t IsMCMotherToEEaod(const AliAODMCParticle *particle, Int_t pdgMother);
98
a655b716 99 Int_t GetLabelMotherWithPdgESD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
100 Int_t GetLabelMotherWithPdgAOD(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother);
b2a297fa 101
102 ClassDef(AliDielectronMC, 0)
103};
104
a655b716 105//
106// inline functions
107//
108inline Bool_t AliDielectronMC::IsMotherPdg(const AliDielectronPair* pair, Int_t pdgMother)
b2a297fa 109{
b2a297fa 110 return IsMotherPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother);
111}
a655b716 112//___________________________________________________________
113inline Bool_t AliDielectronMC::IsMotherPdg(const AliVParticle *particle1, const AliVParticle *particle2, Int_t pdgMother){
114 return GetLabelMotherWithPdg(particle1,particle2,pdgMother)>=0;
115}
116//___________________________________________________________
117inline Int_t AliDielectronMC::GetLabelMotherWithPdg(const AliDielectronPair* pair, Int_t pdgMother){
118 return GetLabelMotherWithPdg(pair->GetFirstDaughter(),pair->GetSecondDaughter(),pdgMother);
119}
b2a297fa 120
121#endif