]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/BASE/util/AliHLTMCEvent.h
adding component for the generation of streamer info for objects in the HLTOUT
[u/mrichter/AliRoot.git] / HLT / BASE / util / AliHLTMCEvent.h
CommitLineData
b16d48a7 1//-*- Mode: C++ -*-
2
805aa9da 3// $Id: $
b16d48a7 4
5#ifndef ALIHLTMCEVENT_H
6#define ALIHLTMCEVENT_H
7
8/* This file is property of and copyright by the ALICE HLT Project *
9 * ALICE Experiment at CERN, All rights reserved. *
10 * See cxx source for full Copyright notice */
11
12/** @file AliHLTMCEvent.h
13 @author Jochen Thaeder
14 @date
15 @brief Container class for an AliMCEvent
16*/
17
18#include "TObject.h"
19#include "TParticle.h"
20#include "TClonesArray.h"
21
7aac8168 22#include "AliGenPythiaEventHeader.h"
b16d48a7 23#include "AliMCEvent.h"
7aac8168 24#include "AliAODJet.h"
25#include "AliStack.h"
26#include "AliHeader.h"
27
28#include "AliHLTLogging.h"
b16d48a7 29
30/**
31 * @class AliHLTMCEvent
7aac8168 32 * Container class for off-line AliMCEvent, as the class AliMCEvent
33 * is coupled to TTrees and can not be easily copied and send via
34 * the HLT chain.
b16d48a7 35 *
36 * This class as the complete functionality as the off-line class,
37 * only the ones needed so far.
38 *
39 * There is no extra "stack" class, the stack is included in this class
40 * a TClonesArray of TParticles
41 *
42 */
43
805aa9da 44class AliHLTMCEvent : public TObject, public AliHLTLogging {
b16d48a7 45
46public:
47
48 /*
49 * ---------------------------------------------------------------------------------
50 * Constructor / Destructor
51 * ---------------------------------------------------------------------------------
52 */
7aac8168 53
b16d48a7 54 /** standard constructor */
55 AliHLTMCEvent();
7aac8168 56
57 /** destructor */
58 virtual ~AliHLTMCEvent();
b16d48a7 59
7aac8168 60 /*
61 * ---------------------------------------------------------------------------------
62 * Setter - public
63 * ---------------------------------------------------------------------------------
b16d48a7 64 */
7aac8168 65
66 /** Fill the off-line MC event in to this class
67 * @param stack ptr to AliStack
68 * @param header ptr to AliHeader
69 * @return 0 on sucess, <0 on error
b16d48a7 70 */
7aac8168 71 Int_t FillMCEvent( AliStack *stack, AliHeader *header );
b16d48a7 72
7aac8168 73 /** Fill the off-line MC event in to this class
74 * @param pMCEvent ptr to off-line AliMCEvent
75 * @return 0 on sucess, <0 on error
76 */
77 Int_t FillMCEvent( AliMCEvent *pMCEvent );
b16d48a7 78
79 /*
80 * ---------------------------------------------------------------------------------
81 * Getter
82 * ---------------------------------------------------------------------------------
83 */
84
7aac8168 85 // -- Particles
86 // --------------
87
b16d48a7 88 /** Get number of particles
89 * @return number of particles
90 */
91 Int_t GetNumberOfTracks() const { return fNParticles; }
92
93 /** Return particle at index iParticle
94 * @param iParticle Particle index in local stack
95 * @return ptr on success, NULL on failure
96 */
97 TParticle* Particle( Int_t iParticle );
98
99 /** Return next particle
100 * @return ptr on success, NULL on failure
101 */
102 TParticle* NextParticle();
103
f6b5f1b1 104 /** Get Index of current particle
105 * @return Index of current particle
106 */
107 Int_t GetIndex() { return fCurrentParticleIndex; }
108
7aac8168 109 // -- Generated jets
110 // -------------------
111
112 /** Get number of generated jets
113 * @return number of generated jets
b16d48a7 114 */
7aac8168 115 Int_t GetNumberOfGenJets() const { return fNGenJets; }
116
117 /** Return generated jets at index iJet
118 * @param iJet Generated jet index in local array
119 * @return ptr on success, NULL on failure
b16d48a7 120 */
7aac8168 121 AliAODJet* GenJet( Int_t iJet ) const;
b16d48a7 122
7aac8168 123 /** Return next generated jet
124 * @return ptr on success, NULL on failure
b16d48a7 125 */
7aac8168 126 AliAODJet* NextGenJet() ;
127
b16d48a7 128 /*
129 * ---------------------------------------------------------------------------------
130 * Helper
131 * ---------------------------------------------------------------------------------
132 */
133
134 /** Compress the TClonesArray fStack */
135 void Compress();
136
137 /** Reset index for next particle */
138 void Reset();
139
140 ///////////////////////////////////////////////////////////////////////////////////
141
142private:
143
144 /** copy constructor prohibited */
145 AliHLTMCEvent (const AliHLTMCEvent&);
146
147 /** assignment operator prohibited */
148 AliHLTMCEvent& operator= (const AliHLTMCEvent&);
149
7aac8168 150 /*
151 * ---------------------------------------------------------------------------------
152 * Setter - private
153 * ---------------------------------------------------------------------------------
154 */
155
156 // -- Particles
157 // --------------
158
159 /** Fill the particles in into the local stack
160 * @param stack ptr to off-line AliStack
161 * @return 0 on sucess, <0 on error
162 */
163 Int_t FillMCTracks( AliStack *stack );
164
165 /** Add a particle to this container
166 * @param particle ptr to TParticle classs
167 */
168 void AddParticle( const TParticle* particle);
169
170 // -- Generated jets
171 // -------------------
172
173 /** Fill the jets into local array
174 * @param stack ptr to off-line AliGenPythiaEventHeader
175 * @return 0 on sucess, <0 on error
176 */
177 Int_t FillMCJets( AliGenPythiaEventHeader* header );
178
179 /** Add a jet to his container
180 * @param stack ptr to off-line AliGenPythiaEventHeader
181 * @param iterJet idx of jet in event
182 */
183 void AddGenJet( AliGenPythiaEventHeader* header, Int_t iterJet );
184
185 /*
186 * ---------------------------------------------------------------------------------
187 * Pythia jets - private
188 * ---------------------------------------------------------------------------------
189 */
190
191 /** Retrieve pythia event header out of an AliMCEvent
192 * @param mcEvent ptr to AliMCEvent
193 * @return ptr on sucess, NULL on error
194 */
195 AliGenPythiaEventHeader* GetPythiaEventHeader(AliMCEvent *mcEvent);
196
b16d48a7 197 /*
198 * ---------------------------------------------------------------------------------
199 * Members - private
200 * ---------------------------------------------------------------------------------
201 */
202
7aac8168 203 // -- Particles
204 // --------------
b16d48a7 205
206 /** Current particle */
207 Int_t fCurrentParticleIndex; // see above
208
7aac8168 209 /** Number of particles */
210 Int_t fNParticles; // see above
b16d48a7 211
7aac8168 212 /** Stack of particles [TParticle]*/
b16d48a7 213 TClonesArray *fStack; // see above
214
7aac8168 215 // -- Generated jets
216 // -------------------
217
218 /** Current generated jet */
219 Int_t fCurrentGenJetIndex; // see above
220
221 /** Number of generated jets */
222 Int_t fNGenJets; // see above
223
224 /** Array of generated jets [AliAODJet]*/
225 TClonesArray *fGenJets; // see above
226
b16d48a7 227 ClassDef(AliHLTMCEvent, 1)
228
229};
230#endif
231