]>
Commit | Line | Data |
---|---|---|
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 | 44 | class AliHLTMCEvent : public TObject, public AliHLTLogging { |
b16d48a7 | 45 | |
46 | public: | |
47 | ||
48 | /* | |
49 | * --------------------------------------------------------------------------------- | |
50 | * Constructor / Destructor | |
51 | * --------------------------------------------------------------------------------- | |
52 | */ | |
7aac8168 | 53 | |
b16d48a7 | 54 | /** standard constructor */ |
55 | AliHLTMCEvent(); | |
396e75ed | 56 | |
57 | /** standard constructor */ | |
58 | AliHLTMCEvent( Bool_t applyParticleCuts ); | |
7aac8168 | 59 | |
60 | /** destructor */ | |
61 | virtual ~AliHLTMCEvent(); | |
b16d48a7 | 62 | |
7aac8168 | 63 | /* |
64 | * --------------------------------------------------------------------------------- | |
65 | * Setter - public | |
66 | * --------------------------------------------------------------------------------- | |
b16d48a7 | 67 | */ |
7aac8168 | 68 | |
396e75ed | 69 | /** Apply particle cuts to the this event */ |
70 | void ApplyParticleCuts() { fHasParticleCuts = kTRUE; } | |
71 | ||
7aac8168 | 72 | /** Fill the off-line MC event in to this class |
73 | * @param stack ptr to AliStack | |
74 | * @param header ptr to AliHeader | |
75 | * @return 0 on sucess, <0 on error | |
b16d48a7 | 76 | */ |
7aac8168 | 77 | Int_t FillMCEvent( AliStack *stack, AliHeader *header ); |
b16d48a7 | 78 | |
7aac8168 | 79 | /** Fill the off-line MC event in to this class |
80 | * @param pMCEvent ptr to off-line AliMCEvent | |
81 | * @return 0 on sucess, <0 on error | |
82 | */ | |
83 | Int_t FillMCEvent( AliMCEvent *pMCEvent ); | |
b16d48a7 | 84 | |
85 | /* | |
86 | * --------------------------------------------------------------------------------- | |
87 | * Getter | |
88 | * --------------------------------------------------------------------------------- | |
89 | */ | |
90 | ||
7aac8168 | 91 | // -- Particles |
92 | // -------------- | |
93 | ||
b16d48a7 | 94 | /** Get number of particles |
95 | * @return number of particles | |
96 | */ | |
97 | Int_t GetNumberOfTracks() const { return fNParticles; } | |
98 | ||
99 | /** Return particle at index iParticle | |
100 | * @param iParticle Particle index in local stack | |
101 | * @return ptr on success, NULL on failure | |
102 | */ | |
103 | TParticle* Particle( Int_t iParticle ); | |
104 | ||
105 | /** Return next particle | |
106 | * @return ptr on success, NULL on failure | |
107 | */ | |
108 | TParticle* NextParticle(); | |
109 | ||
f6b5f1b1 | 110 | /** Get Index of current particle |
111 | * @return Index of current particle | |
112 | */ | |
113 | Int_t GetIndex() { return fCurrentParticleIndex; } | |
114 | ||
396e75ed | 115 | /** Check if particle cuts have been applied */ |
116 | Bool_t HasParticleCuts() { return fHasParticleCuts; } | |
117 | ||
7aac8168 | 118 | // -- Generated jets |
119 | // ------------------- | |
120 | ||
121 | /** Get number of generated jets | |
122 | * @return number of generated jets | |
b16d48a7 | 123 | */ |
7aac8168 | 124 | Int_t GetNumberOfGenJets() const { return fNGenJets; } |
125 | ||
126 | /** Return generated jets at index iJet | |
127 | * @param iJet Generated jet index in local array | |
128 | * @return ptr on success, NULL on failure | |
b16d48a7 | 129 | */ |
7aac8168 | 130 | AliAODJet* GenJet( Int_t iJet ) const; |
b16d48a7 | 131 | |
7aac8168 | 132 | /** Return next generated jet |
133 | * @return ptr on success, NULL on failure | |
b16d48a7 | 134 | */ |
7aac8168 | 135 | AliAODJet* NextGenJet() ; |
136 | ||
b16d48a7 | 137 | /* |
138 | * --------------------------------------------------------------------------------- | |
139 | * Helper | |
140 | * --------------------------------------------------------------------------------- | |
141 | */ | |
142 | ||
143 | /** Compress the TClonesArray fStack */ | |
144 | void Compress(); | |
145 | ||
146 | /** Reset index for next particle */ | |
147 | void Reset(); | |
148 | ||
149 | /////////////////////////////////////////////////////////////////////////////////// | |
150 | ||
151 | private: | |
152 | ||
153 | /** copy constructor prohibited */ | |
154 | AliHLTMCEvent (const AliHLTMCEvent&); | |
155 | ||
156 | /** assignment operator prohibited */ | |
157 | AliHLTMCEvent& operator= (const AliHLTMCEvent&); | |
158 | ||
7aac8168 | 159 | /* |
160 | * --------------------------------------------------------------------------------- | |
161 | * Setter - private | |
162 | * --------------------------------------------------------------------------------- | |
163 | */ | |
164 | ||
165 | // -- Particles | |
166 | // -------------- | |
167 | ||
168 | /** Fill the particles in into the local stack | |
169 | * @param stack ptr to off-line AliStack | |
170 | * @return 0 on sucess, <0 on error | |
171 | */ | |
172 | Int_t FillMCTracks( AliStack *stack ); | |
173 | ||
174 | /** Add a particle to this container | |
175 | * @param particle ptr to TParticle classs | |
176 | */ | |
177 | void AddParticle( const TParticle* particle); | |
178 | ||
179 | // -- Generated jets | |
180 | // ------------------- | |
181 | ||
182 | /** Fill the jets into local array | |
183 | * @param stack ptr to off-line AliGenPythiaEventHeader | |
184 | * @return 0 on sucess, <0 on error | |
185 | */ | |
186 | Int_t FillMCJets( AliGenPythiaEventHeader* header ); | |
187 | ||
188 | /** Add a jet to his container | |
189 | * @param stack ptr to off-line AliGenPythiaEventHeader | |
190 | * @param iterJet idx of jet in event | |
191 | */ | |
192 | void AddGenJet( AliGenPythiaEventHeader* header, Int_t iterJet ); | |
193 | ||
194 | /* | |
195 | * --------------------------------------------------------------------------------- | |
196 | * Pythia jets - private | |
197 | * --------------------------------------------------------------------------------- | |
198 | */ | |
199 | ||
200 | /** Retrieve pythia event header out of an AliMCEvent | |
201 | * @param mcEvent ptr to AliMCEvent | |
202 | * @return ptr on sucess, NULL on error | |
203 | */ | |
204 | AliGenPythiaEventHeader* GetPythiaEventHeader(AliMCEvent *mcEvent); | |
205 | ||
b16d48a7 | 206 | /* |
207 | * --------------------------------------------------------------------------------- | |
208 | * Members - private | |
209 | * --------------------------------------------------------------------------------- | |
210 | */ | |
211 | ||
7aac8168 | 212 | // -- Particles |
213 | // -------------- | |
b16d48a7 | 214 | |
215 | /** Current particle */ | |
216 | Int_t fCurrentParticleIndex; // see above | |
217 | ||
7aac8168 | 218 | /** Number of particles */ |
219 | Int_t fNParticles; // see above | |
b16d48a7 | 220 | |
7aac8168 | 221 | /** Stack of particles [TParticle]*/ |
b16d48a7 | 222 | TClonesArray *fStack; // see above |
223 | ||
7aac8168 | 224 | // -- Generated jets |
225 | // ------------------- | |
226 | ||
227 | /** Current generated jet */ | |
228 | Int_t fCurrentGenJetIndex; // see above | |
229 | ||
230 | /** Number of generated jets */ | |
231 | Int_t fNGenJets; // see above | |
232 | ||
233 | /** Array of generated jets [AliAODJet]*/ | |
234 | TClonesArray *fGenJets; // see above | |
235 | ||
396e75ed | 236 | // -- Status Flags |
237 | // ----------------- | |
238 | ||
239 | /** Particle cuts have been applied | |
240 | * - Is primary | |
241 | * - Is final state | |
242 | * - Is known to PDG datebase | |
243 | */ | |
244 | Bool_t fHasParticleCuts; // see above | |
245 | ||
b16d48a7 | 246 | ClassDef(AliHLTMCEvent, 1) |
247 | ||
248 | }; | |
249 | #endif | |
250 |