Fixes for bug #52499: Field polarities inconsistiency
[u/mrichter/AliRoot.git] / STEER / AliMCEvent.h
CommitLineData
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>
415d9f5c 19
20#include <AliVEvent.h>
21#include "AliVHeader.h"
22#include "AliMCParticle.h"
23
24class AliStack;
25class AliHeader;
26class AliGenEventHeader;
27
28class TClonesArray;
93836e1b 29class TList;
415d9f5c 30
31class AliMCEvent : public AliVEvent {
32
33public:
34
35 AliMCEvent();
36 virtual ~AliMCEvent() {;}
37 AliMCEvent(const AliMCEvent& mcEvnt);
38 AliMCEvent& operator=(const AliMCEvent& mcEvnt);
39 //
40 // Methods implementing the interface
41 //
42 // Services
43 virtual void AddObject(TObject* /*obj*/) {;}
44 virtual TObject* FindListObject(const char */*name*/) {return 0;}
45 virtual TList* GetList() const {return 0;}
46 virtual void CreateStdContent() {;}
47 virtual void GetStdContent() {;}
1d0dd492 48 virtual void ReadFromTree(TTree * /*tree*/, Option_t* /*opt*/) {;}
f12d42ce 49 virtual void WriteToTree(TTree* /*tree*/) const {;}
415d9f5c 50
51 virtual void SetStdNames() {;}
52 virtual void Print(Option_t */*option=""*/) const {;}
53
54
55 // Header
56 virtual AliVHeader* GetHeader() const {return 0;}
57
58 // Delegated methods for fESDRun or AODHeader
59
60 virtual void SetRunNumber(Int_t /*n*/) {;}
61 virtual void SetPeriodNumber(UInt_t /*n*/) {;}
62 virtual void SetMagneticField(Double_t /*mf*/) {;}
63
64
65 virtual Int_t GetRunNumber() const {return 0;}
66 virtual UInt_t GetPeriodNumber() const {return 0;}
67 virtual Double_t GetMagneticField() const {return 0.;}
68
69 // Setters not needed
70 virtual void SetOrbitNumber(UInt_t /*n*/) {;}
71 virtual void SetBunchCrossNumber(UShort_t /*n*/) {;}
72 virtual void SetEventType(UInt_t /*eventType*/) {;}
73 virtual void SetTriggerMask(ULong64_t /*n*/) {;}
74 virtual void SetTriggerCluster(UChar_t /*n*/) {;}
75
76 virtual UInt_t GetOrbitNumber() const {return 0;}
77 virtual UShort_t GetBunchCrossNumber() const {return 0;}
78
eee13e8d 79 virtual UInt_t GetEventType() const {return 0;}
415d9f5c 80
a85132e7 81 virtual ULong64_t GetTriggerMask() const {return 0;}
82 virtual UChar_t GetTriggerCluster() const {return 0;}
83 virtual Double_t GetZDCN1Energy() const {return 0.;}
84 virtual Double_t GetZDCP1Energy() const {return 0.;}
85 virtual Double_t GetZDCN2Energy() const {return 0.;}
86 virtual Double_t GetZDCP2Energy() const {return 0.;}
eee13e8d 87 virtual Double_t GetZDCEMEnergy(Int_t /*i*/)
88 const {return 0.;}
415d9f5c 89 // Tracks
90 virtual AliMCParticle *GetTrack(Int_t i) const;
91 virtual Int_t GetNumberOfTracks() const {return fNparticles;}
c1b93f02 92 virtual Int_t GetNumberOfV0s() const {return -1;}
bc0379e5 93 virtual Int_t GetNumberOfCascades() const {return -1;}
415d9f5c 94
95 //
96 // MC Specific methods
97 //
98 // Getters
99 AliStack* Stack() {return fStack;}
100 AliHeader* Header() {return fHeader;}
101 AliGenEventHeader* GenEventHeader();
102 // Services
103 virtual void ConnectTreeE (TTree* tree);
104 virtual void ConnectTreeK (TTree* tree);
105 virtual void ConnectTreeTR(TTree* tree);
106 virtual void Clean();
93836e1b 107 virtual void InitEvent();
415d9f5c 108 virtual void FinishEvent();
109 virtual Int_t GetParticleAndTR(Int_t i, TParticle*& particle, TClonesArray*& trefs);
110 virtual void DrawCheck(Int_t i, Int_t search);
93836e1b 111 virtual void AddSubsidiaryEvent(AliMCEvent* event);
112 virtual Int_t GetNumberOfPrimaries() {return fNprimaries;}
113 virtual Int_t GetPrimaryOffset() const {return fPrimaryOffset;}
114 virtual Int_t GetSecondaryOffset() const {return fSecondaryOffset;}
115 virtual void SetPrimaryOffset(Int_t ioff) {fPrimaryOffset = ioff;}
116 virtual void SetSecondaryOffset(Int_t ioff) {fSecondaryOffset = ioff;}
117 virtual Bool_t IsPhysicalPrimary(Int_t i);
118 virtual Int_t BgLabelToIndex(Int_t label);
119 static Int_t BgLabelOffset() {return fgkBgLabelOffset;}
120
415d9f5c 121private:
122 virtual void ReorderAndExpandTreeTR();
93836e1b 123 virtual Int_t FindIndexAndEvent(Int_t oldidx, AliMCEvent*& event) const;
124private:
125 AliStack *fStack; // Current pointer to stack
126 TClonesArray *fMCParticles; // Pointer to list of particles
127 TRefArray *fMCParticleMap; // Map of MC Particles
128 AliHeader *fHeader; // Current pointer to header
129 TClonesArray *fTRBuffer; // Track reference buffer
130 TClonesArray *fTrackReferences; // Array of track references
131 TTree *fTreeTR; // Pointer to Track Reference Tree
132 TTree *fTmpTreeTR; // Temporary tree TR to read old format
133 TFile *fTmpFileTR; // Temporary file with TreeTR to read old format
134 Int_t fNprimaries; // Number of primaries
135 Int_t fNparticles; // Number of particles
136 TList *fSubsidiaryEvents; // List of possible subsidiary events (for example merged underlying event)
137 Int_t fPrimaryOffset; // Offset for primaries
138 Int_t fSecondaryOffset; // Offset for secondaries
139 static Int_t fgkBgLabelOffset; // Standard branch name
e337635e 140 ClassDef(AliMCEvent, 1) // AliVEvent realisation for MC data
415d9f5c 141};
142
143
144#endif
145