Line data Source code
1 : //-*- Mode: C++ -*-
2 :
3 : // $Id: $
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 :
22 : #include "AliGenPythiaEventHeader.h"
23 : #include "AliMCEvent.h"
24 : #include "AliAODJet.h"
25 : #include "AliStack.h"
26 : #include "AliHeader.h"
27 :
28 : #include "AliHLTLogging.h"
29 :
30 : /**
31 : * @class AliHLTMCEvent
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.
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 :
44 : class AliHLTMCEvent : public TObject, public AliHLTLogging {
45 :
46 : public:
47 :
48 : /*
49 : * ---------------------------------------------------------------------------------
50 : * Constructor / Destructor
51 : * ---------------------------------------------------------------------------------
52 : */
53 :
54 : /** standard constructor */
55 : AliHLTMCEvent();
56 :
57 : /** standard constructor */
58 : AliHLTMCEvent( Bool_t applyParticleCuts );
59 :
60 : /** destructor */
61 : virtual ~AliHLTMCEvent();
62 :
63 : /*
64 : * ---------------------------------------------------------------------------------
65 : * Setter - public
66 : * ---------------------------------------------------------------------------------
67 : */
68 :
69 : /** Apply particle cuts to the this event */
70 0 : void ApplyParticleCuts() { fHasParticleCuts = kTRUE; }
71 :
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
76 : */
77 : Int_t FillMCEvent( AliStack *stack, AliHeader *header );
78 :
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 );
84 :
85 : /*
86 : * ---------------------------------------------------------------------------------
87 : * Getter
88 : * ---------------------------------------------------------------------------------
89 : */
90 :
91 : // -- Particles
92 : // --------------
93 :
94 : /** Get number of particles
95 : * @return number of particles
96 : */
97 0 : 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 :
110 : /** Get Index of current particle
111 : * @return Index of current particle
112 : */
113 0 : Int_t GetIndex() { return fCurrentParticleIndex; }
114 :
115 : /** Check if particle cuts have been applied */
116 0 : Bool_t HasParticleCuts() { return fHasParticleCuts; }
117 :
118 : // -- Generated jets
119 : // -------------------
120 :
121 : /** Get number of generated jets
122 : * @return number of generated jets
123 : */
124 0 : 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
129 : */
130 : AliAODJet* GenJet( Int_t iJet ) const;
131 :
132 : /** Return next generated jet
133 : * @return ptr on success, NULL on failure
134 : */
135 : AliAODJet* NextGenJet() ;
136 :
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 :
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 :
206 : /*
207 : * ---------------------------------------------------------------------------------
208 : * Members - private
209 : * ---------------------------------------------------------------------------------
210 : */
211 :
212 : // -- Particles
213 : // --------------
214 :
215 : /** Current particle */
216 : Int_t fCurrentParticleIndex; // see above
217 :
218 : /** Number of particles */
219 : Int_t fNParticles; // see above
220 :
221 : /** Stack of particles [TParticle]*/
222 : TClonesArray *fStack; // see above
223 :
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 :
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 :
246 8 : ClassDef(AliHLTMCEvent, 1)
247 :
248 : };
249 : #endif
250 :
|