CbmRoot
CbmStack.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmStack header file -----
3 // ----- Created 10/08/04 by D. Bertini / V. Friese -----
4 // -------------------------------------------------------------------------
5 
6 
30 #ifndef CBMSTACK_H
31 #define CBMSTACK_H
32 
33 
34 #include "CbmDefs.h"
35 #include "CbmStackFilter.h"
36 #include "FairGenericStack.h"
37 
38 #include <map>
39 #include <memory>
40 #include <stack>
41 
42 class TClonesArray;
43 
44 
45 class CbmStack : public FairGenericStack {
46 
47 public:
51  CbmStack(Int_t size = 100);
52 
53 
55  virtual ~CbmStack();
56 
57 
80  virtual void PushTrack(Int_t toBeDone,
81  Int_t parentId,
82  Int_t pdgCode,
83  Double_t px,
84  Double_t py,
85  Double_t pz,
86  Double_t e,
87  Double_t vx,
88  Double_t vy,
89  Double_t vz,
90  Double_t time,
91  Double_t polx,
92  Double_t poly,
93  Double_t polz,
94  TMCProcess process,
95  Int_t& ntr,
96  Double_t weight,
97  Int_t status);
98 
99 
128  virtual void PushTrack(Int_t toBeDone,
129  Int_t parentId,
130  Int_t pdgCode,
131  Double_t px,
132  Double_t py,
133  Double_t pz,
134  Double_t e,
135  Double_t vx,
136  Double_t vy,
137  Double_t vz,
138  Double_t time,
139  Double_t polx,
140  Double_t poly,
141  Double_t polz,
142  TMCProcess proc,
143  Int_t& ntr,
144  Double_t weight,
145  Int_t is,
146  Int_t generatorParentID);
147 
148 
156  virtual TParticle* PopNextTrack(Int_t& iTrack);
157 
158 
166  virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
167 
168 
173  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
174 
175 
179  virtual Int_t GetNtrack() const { return fNParticles; }
180 
181 
185  virtual Int_t GetNprimary() const { return fNPrimaries; }
186 
187 
191  virtual TParticle* GetCurrentTrack() const;
192 
193 
197  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
198 
199 
203  virtual Int_t GetCurrentParentTrackNumber() const;
204 
205 
207  virtual void AddParticle(TParticle* part);
208 
209 
211  virtual void FillTrackArray();
212 
213 
215  virtual void UpdateTrackIndex(TRefArray* detArray);
216 
217 
219  virtual void Reset();
220 
221 
223  virtual void Register();
224 
225 
229  virtual void Print(Option_t* = "") const;
230 
231 
233  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
234  void SetMinPoints(Int_t min) { fMinPoints = min; }
235  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
236  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
237 
238 
240  void SetFilter(std::unique_ptr<CbmStackFilter>& filter) {
241  fFilter.reset();
242  fFilter = std::move(filter);
243  }
244 
245 
249  void AddPoint(ECbmModuleId iDet);
250 
251 
256  void AddPoint(ECbmModuleId iDet, Int_t iTrack);
257 
258 
260  TParticle* GetParticle(Int_t trackId) const;
261  TClonesArray* GetListOfParticles() { return fParticles; }
262 
264  void DoTracking(Bool_t doTracking = kTRUE) { fdoTracking = doTracking; }
265 
266 
267 private:
269  std::stack<TParticle*> fStack;
270 
271 
272  std::unique_ptr<CbmStackFilter> fFilter;
273 
274 
278  TClonesArray* fParticles;
279 
280 
282  TClonesArray* fTracks;
283 
284 
286  std::map<Int_t, Int_t> fIndexMap;
287  std::map<Int_t, Int_t>::iterator fIndexIter;
288 
289 
291  std::map<std::pair<Int_t, ECbmModuleId>, Int_t> fPointsMap;
292 
293 
296  Int_t fNPrimaries;
297  Int_t fNParticles;
298  Int_t fNTracks;
299  Int_t fIndex;
300 
301 
304  Int_t fMinPoints;
305  Double32_t fEnergyCut;
307 
309  Bool_t fdoTracking;
310 
313 
314  ClassDef(CbmStack, 3)
315 };
316 
317 
318 #endif
CbmStack::fNTracks
Int_t fNTracks
Number of entries in fParticles.
Definition: CbmStack.h:298
CbmStack::fIndexMap
std::map< Int_t, Int_t > fIndexMap
Definition: CbmStack.h:286
CbmStack::fStoreMothers
Bool_t fStoreMothers
Definition: CbmStack.h:306
CbmStack::fPointsMap
std::map< std::pair< Int_t, ECbmModuleId >, Int_t > fPointsMap
Definition: CbmStack.h:291
CbmStack::GetCurrentTrack
virtual TParticle * GetCurrentTrack() const
Definition: CbmStack.cxx:221
CbmStack::fEnergyCut
Double32_t fEnergyCut
Definition: CbmStack.h:305
CbmStack::CbmStack
CbmStack(Int_t size=100)
Definition: CbmStack.cxx:28
CbmStack::PopNextTrack
virtual TParticle * PopNextTrack(Int_t &iTrack)
Definition: CbmStack.cxx:179
CbmStack::GetListOfParticles
TClonesArray * GetListOfParticles()
Definition: CbmStack.h:261
ECbmModuleId
ECbmModuleId
Definition: CbmDefs.h:33
CbmStack::Reset
virtual void Reset()
Definition: CbmStack.cxx:346
CbmStack::~CbmStack
virtual ~CbmStack()
Definition: CbmStack.cxx:52
CbmStack::fTracks
TClonesArray * fTracks
Definition: CbmStack.h:282
CbmStackFilter.h
CbmStack::fNPrimaries
Int_t fNPrimaries
Index of current track.
Definition: CbmStack.h:296
CbmStack::SetFilter
void SetFilter(std::unique_ptr< CbmStackFilter > &filter)
Set the stack filter class.
Definition: CbmStack.h:240
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmStack::FillTrackArray
virtual void FillTrackArray()
Definition: CbmStack.cxx:241
CbmStack::GetNprimary
virtual Int_t GetNprimary() const
Definition: CbmStack.h:185
CbmStack::StoreMothers
void StoreMothers(Bool_t choice=kTRUE)
Definition: CbmStack.h:236
CbmStack::AddPoint
void AddPoint(ECbmModuleId iDet)
Definition: CbmStack.cxx:383
CbmStack::fFilter
std::unique_ptr< CbmStackFilter > fFilter
Definition: CbmStack.h:272
CbmStack::fCurrentTrack
Int_t fCurrentTrack
Definition: CbmStack.h:295
CbmStack::DoTracking
void DoTracking(Bool_t doTracking=kTRUE)
Definition: CbmStack.h:264
CbmStack::GetCurrentTrackNumber
virtual Int_t GetCurrentTrackNumber() const
Definition: CbmStack.h:197
CbmStack::PopPrimaryForTracking
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
Definition: CbmStack.cxx:205
CbmStack::GetNtrack
virtual Int_t GetNtrack() const
Definition: CbmStack.h:179
CbmStack::UpdateTrackIndex
virtual void UpdateTrackIndex(TRefArray *detArray)
Definition: CbmStack.cxx:291
CbmStack::SetEnergyCut
void SetEnergyCut(Double_t eMin)
Definition: CbmStack.h:235
CbmStack::fNParticles
Int_t fNParticles
Number of primary particles.
Definition: CbmStack.h:297
CbmStack::fStoreSecondaries
Bool_t fStoreSecondaries
Used for merging.
Definition: CbmStack.h:303
CbmStack::StoreSecondaries
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: CbmStack.h:233
CbmStack::fIndex
Int_t fIndex
Number of entries in fTracks.
Definition: CbmStack.h:299
CbmStack::GetParticle
TParticle * GetParticle(Int_t trackId) const
Definition: CbmStack.cxx:420
CbmStack::Register
virtual void Register()
Definition: CbmStack.cxx:361
CbmStack::SetCurrentTrack
virtual void SetCurrentTrack(Int_t iTrack)
Definition: CbmStack.h:173
CbmStack::CbmStack
CbmStack(const CbmStack &)
global switch for geant propagation
CbmStack::fStack
std::stack< TParticle * > fStack
Definition: CbmStack.h:269
CbmStack::AddParticle
virtual void AddParticle(TParticle *part)
Definition: CbmStack.cxx:230
CbmStack::fdoTracking
Bool_t fdoTracking
Definition: CbmStack.h:309
CbmStack::PushTrack
virtual void PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess process, Int_t &ntr, Double_t weight, Int_t status)
Add a track to the stack (TVirtualMCStack)
Definition: CbmStack.cxx:66
CbmStack::fParticles
TClonesArray * fParticles
Stack filter class.
Definition: CbmStack.h:278
CbmStack::Print
virtual void Print(Option_t *="") const
Definition: CbmStack.cxx:368
CbmStack::SetMinPoints
void SetMinPoints(Int_t min)
Definition: CbmStack.h:234
CbmStack
Definition: CbmStack.h:45
CbmStack::fMinPoints
Int_t fMinPoints
Definition: CbmStack.h:304
CbmStack::GetCurrentParentTrackNumber
virtual Int_t GetCurrentParentTrackNumber() const
Definition: CbmStack.cxx:408
CbmStack::fIndexIter
std::map< Int_t, Int_t >::iterator fIndexIter
Definition: CbmStack.h:287
CbmStack::operator=
CbmStack & operator=(const CbmStack &)
CbmDefs.h