Line data Source code
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>
18 : #include <TRefArray.h>
19 : #include <TClonesArray.h>
20 :
21 : #include "AliVEvent.h"
22 : #include "AliVHeader.h"
23 : #include "AliVParticle.h"
24 : #include "AliVVertex.h"
25 : #include "AliMCParticle.h"
26 :
27 : class AliCentrality;
28 : class AliEventplane;
29 : class AliStack;
30 : class AliHeader;
31 : class AliGenEventHeader;
32 :
33 : class TClonesArray;
34 : class TList;
35 :
36 : class AliMCEvent : public AliVEvent {
37 :
38 : public:
39 :
40 : AliMCEvent();
41 0 : virtual ~AliMCEvent() {;}
42 : AliMCEvent(const AliMCEvent& mcEvnt);
43 : AliMCEvent& operator=(const AliMCEvent& mcEvnt);
44 : //
45 : // Methods implementing the interface
46 : //
47 : // Services
48 0 : virtual void AddObject(TObject* /*obj*/) {;}
49 0 : virtual TObject* FindListObject(const char */*name*/) const {return 0;}
50 0 : virtual TList* GetList() const {return 0;}
51 0 : virtual void CreateStdContent() {;}
52 0 : virtual void GetStdContent() {;}
53 0 : virtual void ReadFromTree(TTree * /*tree*/, Option_t* /*opt*/) {;}
54 0 : virtual void WriteToTree(TTree* /*tree*/) const {;}
55 :
56 0 : virtual void SetStdNames() {;}
57 0 : virtual void Print(Option_t */*option=""*/) const {;}
58 : virtual void PreReadAll();
59 0 : virtual void Reset() {;}
60 :
61 : // Header
62 0 : virtual AliVHeader* GetHeader() const {return 0;}
63 :
64 : // Delegated methods for fESDRun or AODHeader
65 :
66 0 : virtual void SetRunNumber(Int_t /*n*/) {;}
67 0 : virtual void SetPeriodNumber(UInt_t /*n*/) {;}
68 0 : virtual void SetMagneticField(Double_t /*mf*/) {;}
69 :
70 :
71 0 : virtual Int_t GetRunNumber() const {return 0;}
72 0 : virtual UInt_t GetPeriodNumber() const {return 0;}
73 0 : virtual Double_t GetMagneticField() const {return 0.;}
74 :
75 : // Setters not needed
76 0 : virtual void SetOrbitNumber(UInt_t /*n*/) {;}
77 0 : virtual void SetBunchCrossNumber(UShort_t /*n*/) {;}
78 0 : virtual void SetEventType(UInt_t /*eventType*/) {;}
79 0 : virtual void SetTriggerMask(ULong64_t /*n*/) {;}
80 0 : virtual void SetTriggerCluster(UChar_t /*n*/) {;}
81 :
82 0 : virtual UInt_t GetOrbitNumber() const {return 0;}
83 0 : virtual UShort_t GetBunchCrossNumber() const {return 0;}
84 :
85 0 : virtual UInt_t GetEventType() const {return 0;}
86 :
87 0 : virtual ULong64_t GetTriggerMask() const {return 0;}
88 0 : virtual UChar_t GetTriggerCluster() const {return 0;}
89 0 : virtual TString GetFiredTriggerClasses()const {return ("");}
90 0 : virtual Double_t GetZDCN1Energy() const {return 0.;}
91 0 : virtual Double_t GetZDCP1Energy() const {return 0.;}
92 0 : virtual Double_t GetZDCN2Energy() const {return 0.;}
93 0 : virtual Double_t GetZDCP2Energy() const {return 0.;}
94 : virtual Double_t GetZDCEMEnergy(Int_t /*i*/)
95 0 : const {return 0.;}
96 : // Tracks
97 : virtual AliVParticle *GetTrack(Int_t i) const;
98 8628 : virtual Int_t GetNumberOfTracks() const {return fNparticles;}
99 0 : virtual Int_t GetNumberOfV0s() const {return -1;}
100 0 : virtual Int_t GetNumberOfCascades() const {return -1;}
101 : // Vertex
102 : using AliVEvent::GetPrimaryVertex;
103 : virtual const AliVVertex *GetPrimaryVertex() const;
104 :
105 : //
106 : // MC Specific methods
107 : //
108 : // Getters
109 8 : AliStack* Stack() {return fStack;}
110 34 : AliHeader* Header() {return fHeader;}
111 : AliGenEventHeader* GenEventHeader() const;
112 : // Services
113 : virtual void ConnectTreeE (TTree* tree);
114 : virtual void ConnectTreeK (TTree* tree);
115 : virtual void ConnectHeaderAndStack(AliHeader* header);
116 : virtual void ConnectTreeTR(TTree* tree);
117 : virtual void Clean();
118 : virtual void InitEvent();
119 : virtual void FinishEvent();
120 : virtual Int_t GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
121 : virtual void DrawCheck(Int_t i, Int_t search);
122 : virtual void AddSubsidiaryEvent(AliMCEvent* event);
123 24 : virtual Int_t GetNumberOfPrimaries() {return fNprimaries;}
124 0 : virtual Int_t GetPrimaryOffset() const {return fPrimaryOffset;}
125 0 : virtual Int_t GetSecondaryOffset() const {return fSecondaryOffset;}
126 0 : virtual void SetPrimaryOffset(Int_t ioff) {fPrimaryOffset = ioff;}
127 0 : virtual void SetSecondaryOffset(Int_t ioff) {fSecondaryOffset = ioff;}
128 : virtual Bool_t IsPhysicalPrimary(Int_t i) const;
129 :
130 : virtual Int_t BgLabelToIndex(Int_t label);
131 15588 : static Int_t BgLabelOffset() {return fgkBgLabelOffset;}
132 : virtual Bool_t IsFromBGEvent(Int_t index);
133 : TList* GetCocktailList();
134 : TString GetGenerator(Int_t index);
135 : Bool_t GetCocktailGenerator(Int_t index,TString &nameGen);
136 : virtual Bool_t IsSecondaryFromWeakDecay(Int_t index);
137 : virtual Bool_t IsSecondaryFromMaterial(Int_t index);
138 : // External particle array
139 : virtual void SetParticleArray(TClonesArray* mcParticles);
140 : //External Header
141 : virtual void SetExternalHeader(AliVHeader* aodmcHeader)
142 0 : {fAODMCHeader=aodmcHeader;}
143 : virtual AliGenEventHeader *FindHeader(Int_t ipart);
144 : //Following needed only for mixed event
145 0 : virtual Int_t EventIndex(Int_t) const {return 0;}
146 0 : virtual Int_t EventIndexForCaloCluster(Int_t) const {return 0;}
147 0 : virtual Int_t EventIndexForPHOSCell(Int_t) const {return 0;}
148 0 : virtual Int_t EventIndexForEMCALCell(Int_t) const {return 0;}
149 0 : AliCentrality* GetCentrality() {return 0;}
150 0 : AliEventplane* GetEventplane() {return 0;}
151 :
152 0 : virtual AliVVZERO *GetVZEROData() const {return 0;}
153 0 : virtual AliVZDC *GetZDCData() const {return 0;}
154 :
155 : virtual AliVEvent::EDataLayoutType GetDataLayoutType() const;
156 :
157 : private:
158 : virtual void ReorderAndExpandTreeTR();
159 : virtual Int_t FindIndexAndEvent(Int_t oldidx, AliMCEvent*& event) const;
160 : void UpdateEventInformation();
161 : virtual void AssignGeneratorIndex();
162 : virtual void AssignGeneratorIndex(Int_t index, Int_t dmin, Int_t dmax);
163 :
164 : using AliVEvent::GetVZEROData;
165 :
166 : private:
167 : // Stanndard implementation for ESD production
168 : AliStack *fStack; // Current pointer to stack
169 : TClonesArray *fMCParticles; // Pointer to list of particles
170 : TObjArray *fMCParticleMap; // Map of MC Particles
171 : AliHeader *fHeader; // Current pointer to header
172 : AliVHeader *fAODMCHeader; //Current pointer to AODMC header
173 : TClonesArray *fTRBuffer; // Track reference buffer
174 : TClonesArray *fTrackReferences; // Array of track references
175 : TTree *fTreeTR; // Pointer to Track Reference Tree
176 : TTree *fTmpTreeTR; // Temporary tree TR to read old format
177 : TFile *fTmpFileTR; // Temporary file with TreeTR to read old format
178 : Int_t fNprimaries; // Number of primaries
179 : Int_t fNparticles; // Number of particles
180 : TList *fSubsidiaryEvents; // List of possible subsidiary events (for example merged underlying event)
181 : Int_t fPrimaryOffset; // Offset for primaries
182 : Int_t fSecondaryOffset; // Offset for secondaries
183 : Bool_t fExternal; // True if external particle array
184 : static Int_t fgkBgLabelOffset; // Standard branch name
185 : mutable AliVVertex* fVertex; // MC Vertex
186 : Int_t fNBG; //! Background particles in current event
187 :
188 184 : ClassDef(AliMCEvent, 2) // AliVEvent realisation for MC data
189 : };
190 :
191 :
192 : #endif
193 :
|