AliESDCaloCluster.cxx,.h: Removed fM11 and related getter and setter,
[u/mrichter/AliRoot.git] / STEER / AliAODEvent.h
CommitLineData
df9db588 1#ifndef AliAODEvent_H
2#define AliAODEvent_H
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//-------------------------------------------------------------------------
9// AOD base class
10// Author: Markus Oldenburg, CERN
11//-------------------------------------------------------------------------
12
13#include <TBuffer.h>
14#include <TClonesArray.h>
15#include <TList.h>
8ff33247 16#include <TTree.h>
df9db588 17#include <TNamed.h>
18
08e4c457 19#include "AliVEvent.h"
20#include "AliVParticle.h"
df9db588 21#include "AliAODHeader.h"
22#include "AliAODTrack.h"
23#include "AliAODVertex.h"
3dd9f9e3 24#include "AliAODv0.h"
821f8f1d 25#include "AliAODTracklets.h"
3dd9f9e3 26#include "AliAODJet.h"
27#include "AliAODCaloCells.h"
28#include "AliAODCaloCluster.h"
29#include "AliAODPmdCluster.h"
30#include "AliAODFmdCluster.h"
df9db588 31
8ff33247 32class TTree;
5c1dc41f 33class TFolder;
ec4af4c1 34
08e4c457 35class AliAODEvent : public AliVEvent {
df9db588 36
37 public :
08e4c457 38 enum AODListIndex_t {kAODHeader,
39 kAODTracks,
40 kAODVertices,
3dd9f9e3 41 kAODv0,
08e4c457 42 kAODTracklets,
3dd9f9e3 43 kAODJets,
37792174 44 kAODEmcalCells,
45 kAODPhosCells,
3dd9f9e3 46 kAODCaloClusters,
47 kAODFmdClusters,
48 kAODPmdClusters,
08e4c457 49 kAODListN
50 };
51
df9db588 52 AliAODEvent();
53 virtual ~AliAODEvent();
54
5c1dc41f 55 AliAODEvent(const AliAODEvent& aodevent);
56 AliAODEvent& operator=(const AliAODEvent& aodevent);
df9db588 57
58 void AddObject(TObject *obj);
4b3de353 59 void RemoveObject(TObject *obj);
08e4c457 60 TObject *FindListObject(const char *objName) ;
df9db588 61 TList *GetList() const { return fAODObjects; }
62
63 // -- Header
08e4c457 64 AliAODHeader *GetHeader() const { return fHeader; }
df9db588 65 void AddHeader(const AliAODHeader* hdx)
635db10f 66 {
67 delete fHeader; fHeader = new AliAODHeader(*hdx);
68 (fAODObjects->FirstLink())->SetObject(fHeader);
69 }
df9db588 70
08e4c457 71 // setters and getters for header information
72 void SetRunNumber(Int_t n) {if (fHeader) fHeader->SetRunNumber(n);}
73 void SetPeriodNumber(UInt_t n){if (fHeader) fHeader->SetPeriodNumber(n);}
74 void SetOrbitNumber(UInt_t n) {if (fHeader) fHeader->SetOrbitNumber(n);}
75 void SetBunchCrossNumber(UShort_t n) {if (fHeader) fHeader->SetBunchCrossNumber(n);}
76 void SetMagneticField(Double_t mf){if (fHeader) fHeader->SetMagneticField(mf);}
77
78 Int_t GetRunNumber() const {return fHeader ? fHeader->GetRunNumber() : -999;}
79 UInt_t GetPeriodNumber() const {return fHeader ? fHeader->GetPeriodNumber() : 0;}
80 UInt_t GetOrbitNumber() const {return fHeader ? fHeader->GetOrbitNumber() : 0;}
81 UShort_t GetBunchCrossNumber() const {return fHeader ? fHeader->GetBunchCrossNumber() : 0;}
82 Double_t GetMagneticField() const {return fHeader ? fHeader->GetMagneticField() : -999.;}
83
84 void SetEventType(UInt_t eventType){fHeader->SetEventType(eventType);}
85 void SetTriggerMask(ULong64_t n) {fHeader->SetTriggerMask(n);}
86 void SetTriggerCluster(UChar_t n) {fHeader->SetTriggerCluster(n);}
87
88 UInt_t GetEventType() const { return fHeader ? fHeader->GetEventType() : 0;}
89 ULong64_t GetTriggerMask() const {return fHeader ? fHeader->GetTriggerMask() : 0;}
90 UChar_t GetTriggerCluster() const {return fHeader ? fHeader->GetTriggerCluster() : 0;}
91
92 Double_t GetZDCN1Energy() const { return fHeader ? fHeader->GetZDCN1Energy() : -999.; }
93 Double_t GetZDCP1Energy() const { return fHeader ? fHeader->GetZDCP1Energy() : -999.; }
94 Double_t GetZDCN2Energy() const { return fHeader ? fHeader->GetZDCN2Energy() : -999.; }
95 Double_t GetZDCP2Energy() const { return fHeader ? fHeader->GetZDCP2Energy() : -999.; }
a85132e7 96 Double_t GetZDCEMEnergy(Int_t i) const { return fHeader ? fHeader->GetZDCEMEnergy(i) : -999.; }
08e4c457 97
df9db588 98 // -- Tracks
99 TClonesArray *GetTracks() const { return fTracks; }
100 Int_t GetNTracks() const { return fTracks->GetEntriesFast(); }
08e4c457 101 Int_t GetNumberOfTracks() const { return GetNTracks(); }
102 AliAODTrack *GetTrack(Int_t nTrack) const { return (AliAODTrack*)fTracks->UncheckedAt(nTrack); }
103 Int_t AddTrack(const AliAODTrack* trk)
104 {new((*fTracks)[fTracks->GetEntriesFast()]) AliAODTrack(*trk); return fTracks->GetEntriesFast()-1;}
fb41236c 105 Int_t GetMuonTracks(TRefArray *muonTracks) const;
df9db588 106
107 // -- Vertex
108 TClonesArray *GetVertices() const { return fVertices; }
109 Int_t GetNVertices() const { return fVertices->GetEntriesFast(); }
08e4c457 110 AliAODVertex *GetVertex(Int_t nVertex) const { return (AliAODVertex*)fVertices->UncheckedAt(nVertex); }
111 Int_t AddVertex(const AliAODVertex* vtx)
112 {new((*fVertices)[fVertices->GetEntriesFast()]) AliAODVertex(*vtx); return fVertices->GetEntriesFast()-1;}
5c2fdfa2 113
3dd9f9e3 114 // primary vertex
115 virtual AliAODVertex *GetPrimaryVertex() const { return GetVertex(0); }
df9db588 116
3dd9f9e3 117 // V0
118 TClonesArray *GetV0s() const { return fV0s; }
119 Int_t GetNV0s() const { return fV0s->GetEntriesFast(); }
120 AliAODv0 *GetV0(Int_t nV0) const { return (AliAODv0*)fV0s->UncheckedAt(nV0); }
121 Int_t AddV0(const AliAODv0* v0)
122 {new((*fV0s)[fV0s->GetEntriesFast()]) AliAODv0(*v0); return fV0s->GetEntriesFast()-1;}
123
124 // -- EMCAL and PHOS Cluster
125 TClonesArray *GetCaloClusters() const { return fCaloClusters; }
126 Int_t GetNCaloClusters() const { return fCaloClusters->GetEntriesFast(); }
127 AliAODCaloCluster *GetCaloCluster(Int_t nCluster) const { return (AliAODCaloCluster*)fCaloClusters->UncheckedAt(nCluster); }
128 Int_t AddCaloCluster(const AliAODCaloCluster* clus)
129 {new((*fCaloClusters)[fCaloClusters->GetEntriesFast()]) AliAODCaloCluster(*clus); return fCaloClusters->GetEntriesFast()-1;}
130
78902954 131 Int_t GetEMCALClusters(TRefArray *clusters) const;
132 Int_t GetPHOSClusters(TRefArray *clusters) const;
133
134
3dd9f9e3 135 // -- FMD Cluster
136 TClonesArray *GetFmdClusters() const { return fFmdClusters; }
137 Int_t GetNFmdClusters() const { return fFmdClusters->GetEntriesFast(); }
138 AliAODFmdCluster *GetFmdCluster(Int_t nCluster) const { return (AliAODFmdCluster*)fFmdClusters->UncheckedAt(nCluster); }
139 Int_t AddFmdCluster(const AliAODFmdCluster* clus)
140 {new((*fFmdClusters)[fFmdClusters->GetEntriesFast()]) AliAODFmdCluster(*clus); return fFmdClusters->GetEntriesFast()-1;}
141
142 // -- PMD Cluster
143 TClonesArray *GetPmdClusters() const { return fPmdClusters; }
144 Int_t GetNPmdClusters() const { return fPmdClusters->GetEntriesFast(); }
145 AliAODPmdCluster *GetPmdCluster(Int_t nCluster) const { return (AliAODPmdCluster*)fPmdClusters->UncheckedAt(nCluster); }
146 Int_t AddPmdCluster(const AliAODPmdCluster* clus)
147 {new((*fPmdClusters)[fPmdClusters->GetEntriesFast()]) AliAODPmdCluster(*clus); return fPmdClusters->GetEntriesFast()-1;}
df9db588 148
149 // -- Jet
150 TClonesArray *GetJets() const { return fJets; }
151 Int_t GetNJets() const { return fJets->GetEntriesFast(); }
08e4c457 152 AliAODJet *GetJet(Int_t nJet) const { return (AliAODJet*)fJets->UncheckedAt(nJet); }
153 Int_t AddJet(const AliAODJet* vtx)
154 {new((*fJets)[fJets->GetEntriesFast()]) AliAODJet(*vtx); return fJets->GetEntriesFast()-1;}
df9db588 155
821f8f1d 156 // -- Tracklets
157 AliAODTracklets *GetTracklets() const { return fTracklets; }
158
3dd9f9e3 159 // -- Calorimeter Cells
e649177a 160 AliAODCaloCells *GetEMCALCells() const { return fEmcalCells; }
161 AliAODCaloCells *GetPHOSCells() const { return fPhosCells; }
3dd9f9e3 162
df9db588 163 // -- Services
ec4af4c1 164 void CreateStdContent();
08e4c457 165 void SetStdNames();
ec4af4c1 166 void GetStdContent();
5c1dc41f 167 void CreateStdFolders();
3dd9f9e3 168 void ResetStd(Int_t trkArrSize = 0,
169 Int_t vtxArrSize = 0,
170 Int_t v0ArrSize = 0,
171 Int_t jetSize = 0,
172 Int_t caloClusSize = 0,
173 Int_t fmdClusSize = 0,
174 Int_t pmdClusSize = 0);
ec4af4c1 175 void ClearStd();
8ff33247 176 void ReadFromTree(TTree *tree);
08e4c457 177 const void WriteToTree(TTree* tree) const {tree->Branch(fAODObjects);}
178
179 void Print(Option_t *option="") const;
c8e4f399 180 void MakeEntriesReferencable();
181 static void AssignIDtoCollection(TCollection* col);
08e4c457 182 private :
df9db588 183
5c1dc41f 184 TList *fAODObjects; // list of AODObjects
185 TFolder *fAODFolder; // folder structure of branches
186
df9db588 187 // standard content
3dd9f9e3 188 AliAODHeader *fHeader; //! event information
189 TClonesArray *fTracks; //! charged tracks
190 TClonesArray *fVertices; //! vertices
191 TClonesArray *fV0s; //! V0s
192 AliAODTracklets *fTracklets; //! SPD tracklets
193 TClonesArray *fJets; //! jets
37792174 194 AliAODCaloCells *fEmcalCells; //! EMCAL calorimenter cells
195 AliAODCaloCells *fPhosCells; //! PHOS calorimenter cells
3dd9f9e3 196 TClonesArray *fCaloClusters; //! calorimeter clusters
197 TClonesArray *fFmdClusters; //! FMDclusters
198 TClonesArray *fPmdClusters; //! PMDclusters
821f8f1d 199
08e4c457 200 static const char* fAODListName[kAODListN]; //!
201
5c1dc41f 202 ClassDef(AliAODEvent, 4);
df9db588 203};
204
205#endif