]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMCEvent.h
Additional comment.
[u/mrichter/AliRoot.git] / STEER / AliMCEvent.h
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     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*/)               {;}
49     virtual TObject* FindListObject(const char */*name*/)  const {return 0;}
50     virtual TList* GetList() const                         {return 0;}
51     virtual void CreateStdContent()                        {;} 
52     virtual void GetStdContent()                           {;}
53     virtual void ReadFromTree(TTree * /*tree*/, Option_t* /*opt*/) {;}
54     virtual void WriteToTree(TTree* /*tree*/)  const       {;}
55
56     virtual void SetStdNames()                             {;}
57     virtual void Print(Option_t */*option=""*/)  const     {;}
58     virtual void PreReadAll();
59     virtual void Reset()                                   {;}
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;}
72     virtual UInt_t   GetPeriodNumber()       const         {return 0;}
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
82     virtual UInt_t    GetOrbitNumber()        const {return 0;}
83     virtual UShort_t  GetBunchCrossNumber()   const {return 0;}
84     
85     virtual UInt_t    GetEventType()          const {return 0;}
86
87     virtual ULong64_t GetTriggerMask()        const {return 0;}
88     virtual UChar_t   GetTriggerCluster()     const {return 0;}
89     virtual Double_t  GetZDCN1Energy()        const {return 0.;}
90     virtual Double_t  GetZDCP1Energy()        const {return 0.;}
91     virtual Double_t  GetZDCN2Energy()        const {return 0.;}
92     virtual Double_t  GetZDCP2Energy()        const {return 0.;}
93     virtual Double_t  GetZDCEMEnergy(Int_t /*i*/) 
94                                               const {return 0.;}
95     // Tracks
96     virtual AliVParticle *GetTrack(Int_t i) const;
97     virtual Int_t     GetNumberOfTracks()    const {return fNparticles;}
98     virtual Int_t     GetNumberOfV0s()       const {return -1;}
99     virtual Int_t     GetNumberOfCascades()  const {return -1;}
100     // Vertex
101     virtual const AliVVertex *GetPrimaryVertex() const;
102     
103     //
104     // MC Specific methods
105     //
106     // Getters
107     AliStack*    Stack()   {return fStack;}
108     AliHeader*   Header()  {return fHeader;}
109     AliGenEventHeader* GenEventHeader() const;
110     // Services
111     virtual void      ConnectTreeE (TTree* tree);
112     virtual void      ConnectTreeK (TTree* tree);
113     virtual void      ConnectTreeTR(TTree* tree);
114     virtual void      Clean();
115     virtual void      InitEvent();
116     virtual void      FinishEvent();
117     virtual Int_t     GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
118     virtual void      DrawCheck(Int_t i, Int_t search);
119     virtual void      AddSubsidiaryEvent(AliMCEvent* event);
120     virtual Int_t     GetNumberOfPrimaries() {return fNprimaries;}
121     virtual Int_t     GetPrimaryOffset()    const {return fPrimaryOffset;}
122     virtual Int_t     GetSecondaryOffset()  const {return fSecondaryOffset;}    
123     virtual void      SetPrimaryOffset(Int_t ioff)    {fPrimaryOffset = ioff;}
124     virtual void      SetSecondaryOffset(Int_t ioff)  {fSecondaryOffset = ioff;}    
125     virtual Bool_t    IsPhysicalPrimary(Int_t i);
126     virtual Int_t     BgLabelToIndex(Int_t label);
127     static  Int_t     BgLabelOffset() {return fgkBgLabelOffset;}
128     virtual Bool_t    IsFromBGEvent(Int_t index);
129     
130     // External particle array
131     virtual void      SetParticleArray(TClonesArray* mcParticles) 
132         {fMCParticles = mcParticles; fNparticles = fMCParticles->GetEntries(); fExternal = kTRUE;}
133     
134     //Following needed only for mixed event
135   virtual Int_t        EventIndex(Int_t)       const {return 0;}
136   virtual Int_t        EventIndexForCaloCluster(Int_t) const {return 0;}
137   virtual Int_t        EventIndexForPHOSCell(Int_t)    const {return 0;}
138   virtual Int_t        EventIndexForEMCALCell(Int_t)   const {return 0;} 
139   AliCentrality*       GetCentrality()  {return 0;} 
140   AliEventplane*       GetEventplane()  {return 0;} 
141
142   virtual AliVVZERO    *GetVZEROData() const {return 0;}
143     
144 private:
145     virtual void      ReorderAndExpandTreeTR();
146     virtual Int_t     FindIndexAndEvent(Int_t oldidx, AliMCEvent*& event) const;
147     
148 private: 
149     // Stanndard implementation for ESD production
150     AliStack         *fStack;            // Current pointer to stack
151     TClonesArray     *fMCParticles;      // Pointer to list of particles
152     TObjArray        *fMCParticleMap;    // Map of MC Particles
153     AliHeader        *fHeader;           // Current pointer to header
154     TClonesArray     *fTRBuffer;         // Track reference buffer    
155     TClonesArray     *fTrackReferences;  // Array of track references
156     TTree            *fTreeTR;           // Pointer to Track Reference Tree
157     TTree            *fTmpTreeTR;        // Temporary tree TR to read old format
158     TFile            *fTmpFileTR;        // Temporary file with TreeTR to read old format
159     Int_t             fNprimaries;       // Number of primaries
160     Int_t             fNparticles;       // Number of particles
161     TList            *fSubsidiaryEvents; // List of possible subsidiary events (for example merged underlying event) 
162     Int_t             fPrimaryOffset;    // Offset for primaries
163     Int_t             fSecondaryOffset;  // Offset for secondaries
164     Bool_t            fExternal;         // True if external particle array
165     static   Int_t        fgkBgLabelOffset;  // Standard branch name    
166     mutable  AliVVertex*  fVertex;           // MC Vertex
167     Int_t             fNBG;              //! Background particles in current event
168     
169     ClassDef(AliMCEvent, 2)              // AliVEvent realisation for MC data
170 };
171
172
173 #endif 
174