CbmRoot
Loading...
Searching...
No Matches
CbmStack.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Denis Bertini, Florian Uhlig [committer], Volker Friese */
4
5// -------------------------------------------------------------------------
6// ----- CbmStack header file -----
7// ----- Created 10/08/04 by D. Bertini / V. Friese -----
8// -------------------------------------------------------------------------
9
10
34#ifndef CBMSTACK_H
35#define CBMSTACK_H
36
37
38#include "CbmDefs.h"
39#include "CbmStackFilter.h"
40
41#include "FairGenericStack.h"
42
43#include <map>
44#include <memory>
45#include <stack>
46
47class TClonesArray;
48
49
50class CbmStack : public FairGenericStack {
51
52public:
56 CbmStack(Int_t size = 100);
57
58
60 virtual ~CbmStack();
61
62
85 virtual void PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px, Double_t py, Double_t pz,
86 Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly,
87 Double_t polz, TMCProcess process, Int_t& ntr, Double_t weight, Int_t status);
88
89
118 virtual void PushTrack(Int_t toBeDone, Int_t parentId, Int_t pdgCode, Double_t px, Double_t py, Double_t pz,
119 Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly,
120 Double_t polz, TMCProcess proc, Int_t& ntr, Double_t weight, Int_t is,
121 Int_t generatorParentID);
122
123
131 virtual TParticle* PopNextTrack(Int_t& iTrack);
132
133
141 virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
142
143
148 virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
149
150
154 virtual Int_t GetNtrack() const { return fNParticles; }
155
156
160 virtual Int_t GetNprimary() const { return fNPrimaries; }
161
162
166 virtual TParticle* GetCurrentTrack() const;
167
168
172 virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
173
174
178 virtual Int_t GetCurrentParentTrackNumber() const;
179
180
182 virtual void AddParticle(TParticle* part);
183
184
186 virtual void FillTrackArray();
187
188
190 virtual void UpdateTrackIndex(TRefArray* detArray);
191
192
194 virtual void Reset();
195
196
198 virtual void Register();
199
200
204 virtual void Print(Option_t* = "") const;
205
206
208 void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
209 void SetMinPoints(Int_t min) { fMinPoints = min; }
210 void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
211 void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
212
213
215 void SetFilter(std::unique_ptr<CbmStackFilter>& filter)
216 {
217 fFilter.reset();
218 fFilter = std::move(filter);
219 }
220
221
225 void AddPoint(ECbmModuleId iDet);
226
227
232 void AddPoint(ECbmModuleId iDet, Int_t iTrack);
233
234
236 TParticle* GetParticle(Int_t trackId) const;
237 TClonesArray* GetListOfParticles() { return fParticles; }
238
240 void DoTracking(Bool_t doTracking = kTRUE) { fdoTracking = doTracking; }
241
242
243private:
245 std::stack<TParticle*> fStack;
246
247
248 std::unique_ptr<CbmStackFilter> fFilter;
249
250
254 TClonesArray* fParticles;
255
256
258 TClonesArray* fTracks;
259
260
262 std::map<Int_t, Int_t> fIndexMap;
263 std::map<Int_t, Int_t>::iterator fIndexIter;
264
265
267 std::map<std::pair<Int_t, ECbmModuleId>, Int_t> fPointsMap;
268
269
274 Int_t fNTracks;
275 Int_t fIndex;
276
277
281 Double32_t fEnergyCut;
283
285 Bool_t fdoTracking;
286
289
290 ClassDef(CbmStack, 3)
291};
292
293
294#endif
ECbmModuleId
Definition CbmDefs.h:39
friend fscal min(fscal x, fscal y)
static constexpr size_t size()
Definition KfSimdPseudo.h:2
Int_t fCurrentTrack
Definition CbmStack.h:271
Int_t fNParticles
Number of primary particles.
Definition CbmStack.h:273
void AddPoint(ECbmModuleId iDet)
Definition CbmStack.cxx:331
virtual TParticle * PopNextTrack(Int_t &iTrack)
Definition CbmStack.cxx:129
void StoreSecondaries(Bool_t choice=kTRUE)
Definition CbmStack.h:208
CbmStack(const CbmStack &)
global switch for geant propagation
void DoTracking(Bool_t doTracking=kTRUE)
Definition CbmStack.h:240
virtual Int_t GetCurrentParentTrackNumber() const
Definition CbmStack.cxx:356
Int_t fIndex
Number of entries in fTracks.
Definition CbmStack.h:275
Int_t fNPrimaries
Index of current track.
Definition CbmStack.h:272
virtual Int_t GetNtrack() const
Definition CbmStack.h:154
Bool_t fStoreSecondaries
Used for merging.
Definition CbmStack.h:279
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:73
std::map< std::pair< Int_t, ECbmModuleId >, Int_t > fPointsMap
Definition CbmStack.h:267
void StoreMothers(Bool_t choice=kTRUE)
Definition CbmStack.h:211
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
Definition CbmStack.cxx:156
void SetMinPoints(Int_t min)
Definition CbmStack.h:209
Int_t fMinPoints
Definition CbmStack.h:280
virtual ~CbmStack()
Definition CbmStack.cxx:58
virtual void Reset()
Definition CbmStack.cxx:295
virtual void AddParticle(TParticle *part)
Definition CbmStack.cxx:186
virtual TParticle * GetCurrentTrack() const
Definition CbmStack.cxx:176
void SetEnergyCut(Double_t eMin)
Definition CbmStack.h:210
TParticle * GetParticle(Int_t trackId) const
Definition CbmStack.cxx:368
virtual Int_t GetNprimary() const
Definition CbmStack.h:160
std::map< Int_t, Int_t >::iterator fIndexIter
Definition CbmStack.h:263
Double32_t fEnergyCut
Definition CbmStack.h:281
virtual void FillTrackArray()
Definition CbmStack.cxx:198
Int_t fNTracks
Number of entries in fParticles.
Definition CbmStack.h:274
CbmStack(Int_t size=100)
Definition CbmStack.cxx:32
std::map< Int_t, Int_t > fIndexMap
Definition CbmStack.h:262
TClonesArray * GetListOfParticles()
Definition CbmStack.h:237
virtual Int_t GetCurrentTrackNumber() const
Definition CbmStack.h:172
Bool_t fdoTracking
Definition CbmStack.h:285
CbmStack & operator=(const CbmStack &)
TClonesArray * fParticles
Stack filter class.
Definition CbmStack.h:254
virtual void UpdateTrackIndex(TRefArray *detArray)
Definition CbmStack.cxx:245
virtual void SetCurrentTrack(Int_t iTrack)
Definition CbmStack.h:148
virtual void Print(Option_t *="") const
Definition CbmStack.cxx:316
void SetFilter(std::unique_ptr< CbmStackFilter > &filter)
Set the stack filter class.
Definition CbmStack.h:215
virtual void Register()
Definition CbmStack.cxx:311
std::stack< TParticle * > fStack
Definition CbmStack.h:245
std::unique_ptr< CbmStackFilter > fFilter
Definition CbmStack.h:248
TClonesArray * fTracks
Definition CbmStack.h:258
Bool_t fStoreMothers
Definition CbmStack.h:282