]>
Commit | Line | Data |
---|---|---|
415d9f5c | 1 | // -*- mode: C++ -*- |
2 | #ifndef ALIMCEVENT_H | |
3 | #define ALIMCEVENT_H | |
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | ||
8 | /* $Id$ */ | |
9 | ||
10 | //------------------------------------------------------------------------- | |
11 | // Class AliMCEvent | |
12 | // | |
13 | // Origin: Andreas.Morsch, CERN, andreas.morsch@cern.ch | |
14 | //------------------------------------------------------------------------- | |
15 | ||
16 | ||
17 | #include <TTree.h> | |
93df0e9b | 18 | #include <TRefArray.h> |
7aad0c47 | 19 | #include <TClonesArray.h> |
415d9f5c | 20 | |
faf00b0d | 21 | #include "AliVEvent.h" |
415d9f5c | 22 | #include "AliVHeader.h" |
7aad0c47 | 23 | #include "AliVParticle.h" |
5df3496b | 24 | #include "AliVVertex.h" |
415d9f5c | 25 | #include "AliMCParticle.h" |
26 | ||
befa9db4 | 27 | class AliCentrality; |
ce7adfe9 | 28 | class AliEventplane; |
415d9f5c | 29 | class AliStack; |
30 | class AliHeader; | |
31 | class AliGenEventHeader; | |
32 | ||
33 | class TClonesArray; | |
93836e1b | 34 | class TList; |
415d9f5c | 35 | |
36 | class AliMCEvent : public AliVEvent { | |
37 | ||
38 | public: | |
39 | ||
40 | AliMCEvent(); | |
41 | virtual ~AliMCEvent() {;} | |
42 | AliMCEvent(const AliMCEvent& mcEvnt); | |
43 | AliMCEvent& operator=(const AliMCEvent& mcEvnt); | |
44 | // | |
45 | // Methods implementing the interface | |
46 | // | |
47 | // Services | |
48 | virtual void AddObject(TObject* /*obj*/) {;} | |
2811495d | 49 | virtual TObject* FindListObject(const char */*name*/) const {return 0;} |
415d9f5c | 50 | virtual TList* GetList() const {return 0;} |
51 | virtual void CreateStdContent() {;} | |
52 | virtual void GetStdContent() {;} | |
1d0dd492 | 53 | virtual void ReadFromTree(TTree * /*tree*/, Option_t* /*opt*/) {;} |
ec8aded8 | 54 | virtual void WriteToTree(TTree* /*tree*/) const {;} |
415d9f5c | 55 | |
56 | virtual void SetStdNames() {;} | |
57 | virtual void Print(Option_t */*option=""*/) const {;} | |
35152e4b | 58 | virtual void PreReadAll(); |
ec8aded8 | 59 | virtual void Reset() {;} |
415d9f5c | 60 | |
61 | // Header | |
62 | virtual AliVHeader* GetHeader() const {return 0;} | |
63 | ||
64 | // Delegated methods for fESDRun or AODHeader | |
65 | ||
66 | virtual void SetRunNumber(Int_t /*n*/) {;} | |
67 | virtual void SetPeriodNumber(UInt_t /*n*/) {;} | |
68 | virtual void SetMagneticField(Double_t /*mf*/) {;} | |
69 | ||
70 | ||
71 | virtual Int_t GetRunNumber() const {return 0;} | |
7aad0c47 | 72 | virtual UInt_t GetPeriodNumber() const {return 0;} |
415d9f5c | 73 | virtual Double_t GetMagneticField() const {return 0.;} |
74 | ||
75 | // Setters not needed | |
76 | virtual void SetOrbitNumber(UInt_t /*n*/) {;} | |
77 | virtual void SetBunchCrossNumber(UShort_t /*n*/) {;} | |
78 | virtual void SetEventType(UInt_t /*eventType*/) {;} | |
79 | virtual void SetTriggerMask(ULong64_t /*n*/) {;} | |
80 | virtual void SetTriggerCluster(UChar_t /*n*/) {;} | |
81 | ||
7aad0c47 | 82 | virtual UInt_t GetOrbitNumber() const {return 0;} |
83 | virtual UShort_t GetBunchCrossNumber() const {return 0;} | |
415d9f5c | 84 | |
7aad0c47 | 85 | virtual UInt_t GetEventType() const {return 0;} |
415d9f5c | 86 | |
a85132e7 | 87 | virtual ULong64_t GetTriggerMask() const {return 0;} |
88 | virtual UChar_t GetTriggerCluster() const {return 0;} | |
6b3a0436 | 89 | virtual TString GetFiredTriggerClasses()const {return ("");} |
a85132e7 | 90 | virtual Double_t GetZDCN1Energy() const {return 0.;} |
91 | virtual Double_t GetZDCP1Energy() const {return 0.;} | |
92 | virtual Double_t GetZDCN2Energy() const {return 0.;} | |
93 | virtual Double_t GetZDCP2Energy() const {return 0.;} | |
eee13e8d | 94 | virtual Double_t GetZDCEMEnergy(Int_t /*i*/) |
95 | const {return 0.;} | |
415d9f5c | 96 | // Tracks |
7aad0c47 | 97 | virtual AliVParticle *GetTrack(Int_t i) const; |
415d9f5c | 98 | virtual Int_t GetNumberOfTracks() const {return fNparticles;} |
c1b93f02 | 99 | virtual Int_t GetNumberOfV0s() const {return -1;} |
bc0379e5 | 100 | virtual Int_t GetNumberOfCascades() const {return -1;} |
5df3496b | 101 | // Vertex |
102 | virtual const AliVVertex *GetPrimaryVertex() const; | |
103 | ||
415d9f5c | 104 | // |
105 | // MC Specific methods | |
106 | // | |
107 | // Getters | |
108 | AliStack* Stack() {return fStack;} | |
109 | AliHeader* Header() {return fHeader;} | |
5df3496b | 110 | AliGenEventHeader* GenEventHeader() const; |
415d9f5c | 111 | // Services |
112 | virtual void ConnectTreeE (TTree* tree); | |
113 | virtual void ConnectTreeK (TTree* tree); | |
205cbea7 | 114 | virtual void ConnectHeaderAndStack(AliHeader* header); |
415d9f5c | 115 | virtual void ConnectTreeTR(TTree* tree); |
116 | virtual void Clean(); | |
93836e1b | 117 | virtual void InitEvent(); |
415d9f5c | 118 | virtual void FinishEvent(); |
119 | virtual Int_t GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs); | |
120 | virtual void DrawCheck(Int_t i, Int_t search); | |
93836e1b | 121 | virtual void AddSubsidiaryEvent(AliMCEvent* event); |
122 | virtual Int_t GetNumberOfPrimaries() {return fNprimaries;} | |
123 | virtual Int_t GetPrimaryOffset() const {return fPrimaryOffset;} | |
124 | virtual Int_t GetSecondaryOffset() const {return fSecondaryOffset;} | |
125 | virtual void SetPrimaryOffset(Int_t ioff) {fPrimaryOffset = ioff;} | |
126 | virtual void SetSecondaryOffset(Int_t ioff) {fSecondaryOffset = ioff;} | |
69fcabe8 | 127 | virtual Bool_t IsPhysicalPrimary(Int_t i) const; |
1081342d | 128 | |
93836e1b | 129 | virtual Int_t BgLabelToIndex(Int_t label); |
130 | static Int_t BgLabelOffset() {return fgkBgLabelOffset;} | |
2e7ca177 | 131 | virtual Bool_t IsFromBGEvent(Int_t index); |
16632e6b | 132 | TString GetGenerator(Int_t index); |
133 | Bool_t GetCocktailGenerator(Int_t index,TClonesArray *arrayMC,TString &nameGen); | |
1081342d | 134 | virtual Bool_t IsSecondaryFromWeakDecay(Int_t index); |
135 | virtual Bool_t IsSecondaryFromMaterial(Int_t index); | |
7aad0c47 | 136 | // External particle array |
137 | virtual void SetParticleArray(TClonesArray* mcParticles) | |
138 | {fMCParticles = mcParticles; fNparticles = fMCParticles->GetEntries(); fExternal = kTRUE;} | |
139 | ||
95121282 | 140 | virtual AliGenEventHeader *FindHeader(Int_t ipart); |
c8fe2783 | 141 | //Following needed only for mixed event |
142 | virtual Int_t EventIndex(Int_t) const {return 0;} | |
143 | virtual Int_t EventIndexForCaloCluster(Int_t) const {return 0;} | |
144 | virtual Int_t EventIndexForPHOSCell(Int_t) const {return 0;} | |
145 | virtual Int_t EventIndexForEMCALCell(Int_t) const {return 0;} | |
befa9db4 | 146 | AliCentrality* GetCentrality() {return 0;} |
ce7adfe9 | 147 | AliEventplane* GetEventplane() {return 0;} |
ae2bccf1 | 148 | |
2e7ca177 | 149 | virtual AliVVZERO *GetVZEROData() const {return 0;} |
16d867eb | 150 | virtual AliVZDC *GetZDCData() const {return 0;} |
2e7ca177 | 151 | |
38e7ce48 | 152 | |
415d9f5c | 153 | private: |
154 | virtual void ReorderAndExpandTreeTR(); | |
93836e1b | 155 | virtual Int_t FindIndexAndEvent(Int_t oldidx, AliMCEvent*& event) const; |
205cbea7 | 156 | void UpdateEventInformation(); |
befa9db4 | 157 | |
93836e1b | 158 | private: |
7aad0c47 | 159 | // Stanndard implementation for ESD production |
93836e1b | 160 | AliStack *fStack; // Current pointer to stack |
161 | TClonesArray *fMCParticles; // Pointer to list of particles | |
091fa189 | 162 | TObjArray *fMCParticleMap; // Map of MC Particles |
93836e1b | 163 | AliHeader *fHeader; // Current pointer to header |
164 | TClonesArray *fTRBuffer; // Track reference buffer | |
165 | TClonesArray *fTrackReferences; // Array of track references | |
166 | TTree *fTreeTR; // Pointer to Track Reference Tree | |
167 | TTree *fTmpTreeTR; // Temporary tree TR to read old format | |
168 | TFile *fTmpFileTR; // Temporary file with TreeTR to read old format | |
169 | Int_t fNprimaries; // Number of primaries | |
170 | Int_t fNparticles; // Number of particles | |
171 | TList *fSubsidiaryEvents; // List of possible subsidiary events (for example merged underlying event) | |
172 | Int_t fPrimaryOffset; // Offset for primaries | |
173 | Int_t fSecondaryOffset; // Offset for secondaries | |
7aad0c47 | 174 | Bool_t fExternal; // True if external particle array |
5df3496b | 175 | static Int_t fgkBgLabelOffset; // Standard branch name |
176 | mutable AliVVertex* fVertex; // MC Vertex | |
1ab6d8df | 177 | Int_t fNBG; //! Background particles in current event |
2e7ca177 | 178 | |
1ab6d8df | 179 | ClassDef(AliMCEvent, 2) // AliVEvent realisation for MC data |
415d9f5c | 180 | }; |
181 | ||
182 | ||
183 | #endif | |
184 |