SND@LHC Software
Loading...
Searching...
No Matches
ShipStack.h
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- ShipStack header file -----
3// -------------------------------------------------------------------------
4
5
25#ifndef ShipStack_H
26#define ShipStack_H
27
28#include "FairGenericStack.h" // for FairGenericStack
29
30#include "ShipDetectorList.h" // for DetectorId
31
32#include "Rtypes.h" // for Int_t, Double_t, Bool_t, etc
33#include "TMCProcess.h" // for TMCProcess
34
35#include <map> // for map, map<>::iterator
36#include <stack> // for stack
37#include <utility> // for pair
38
39class TClonesArray;
40class TParticle;
41class TRefArray;
42class FairLogger;
43
44enum {kDoneBit=1};
45
46class ShipStack : public FairGenericStack
47{
48
49 public:
50
54 ShipStack(Int_t size = 100);
55
56
58 virtual ~ShipStack();
59
60
76 virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
77 Double_t px, Double_t py, Double_t pz,
78 Double_t e, Double_t vx, Double_t vy,
79 Double_t vz, Double_t time, Double_t polx,
80 Double_t poly, Double_t polz, TMCProcess proc,
81 Int_t& ntr, Double_t weight, Int_t is);
82
83 virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
84 Double_t px, Double_t py, Double_t pz,
85 Double_t e, Double_t vx, Double_t vy,
86 Double_t vz, Double_t time, Double_t polx,
87 Double_t poly, Double_t polz, TMCProcess proc,
88 Int_t& ntr, Double_t weight, Int_t is,Int_t secondParentId);
89
90
91
92
98 virtual TParticle* PopNextTrack(Int_t& iTrack);
99
100
106 virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
107
108
113 virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
114
115
119 virtual Int_t GetNtrack() const { return fNParticles; }
120
121
125 virtual Int_t GetNprimary() const { return fNPrimaries; }
126
127
131 virtual TParticle* GetCurrentTrack() const;
132
133
137 virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
138
139
143 virtual Int_t GetCurrentParentTrackNumber() const;
144
145
147 virtual void AddParticle(TParticle* part);
148
149
151 virtual void FillTrackArray();
152
153
155 virtual void UpdateTrackIndex(TRefArray* detArray=0);
156
157
159 virtual void Reset();
160
161
163 virtual void Register();
164
165
169 virtual void Print(Int_t iVerbose=0) const;
170
171
173 void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
174 void SetMinPoints(Int_t min) { fMinPoints = min; }
175 void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
176 void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
177
178
182 void AddPoint(DetectorId iDet);
183
184
189 void AddPoint(DetectorId iDet, Int_t iTrack);
190
191
193 TParticle* GetParticle(Int_t trackId) const;
194 TClonesArray* GetListOfParticles() { return fParticles; }
195
196
197
198 private:
199
201 std::stack<TParticle*> fStack;
202
203
207 TClonesArray* fParticles;
208
209
211 TClonesArray* fTracks;
212
213
215 std::map<Int_t, Bool_t> fStoreMap;
216 std::map<Int_t, Bool_t>::iterator fStoreIter;
217
218
220 std::map<Int_t, Int_t> fIndexMap;
221 std::map<Int_t, Int_t>::iterator fIndexIter;
222
223
225 std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
226
227
232 Int_t fNTracks;
233 Int_t fIndex;
234
235
239 Double32_t fEnergyCut;
241
242
244 void SelectTracks();
245
248
249 ClassDef(ShipStack,1)
250
251
252};
253
254
255
256
257
258
259#endif
DetectorId
@ kDoneBit
Definition ShipStack.h:44
Int_t fMinPoints
Definition ShipStack.h:238
virtual TParticle * PopNextTrack(Int_t &iTrack)
Bool_t fStoreMothers
Definition ShipStack.h:240
void AddPoint(DetectorId iDet)
virtual void SetCurrentTrack(Int_t iTrack)
Definition ShipStack.h:113
std::map< std::pair< Int_t, Int_t >, Int_t > fPointsMap
Definition ShipStack.h:225
ShipStack & operator=(const ShipStack &)
virtual void Reset()
Int_t fNTracks
Number of entries in fParticles.
Definition ShipStack.h:232
void StoreSecondaries(Bool_t choice=kTRUE)
Definition ShipStack.h:173
std::map< Int_t, Int_t > fIndexMap
Definition ShipStack.h:220
ShipStack(const ShipStack &)
void StoreMothers(Bool_t choice=kTRUE)
Definition ShipStack.h:176
TParticle * GetParticle(Int_t trackId) const
Int_t fIndex
Number of entries in fTracks.
Definition ShipStack.h:233
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 proc, Int_t &ntr, Double_t weight, Int_t is)
Definition ShipStack.cxx:69
virtual TParticle * GetCurrentTrack() const
virtual Int_t GetNtrack() const
Definition ShipStack.h:119
virtual void Register()
TClonesArray * GetListOfParticles()
Definition ShipStack.h:194
virtual void Print(Int_t iVerbose=0) const
std::map< Int_t, Bool_t >::iterator fStoreIter
Definition ShipStack.h:216
Double32_t fEnergyCut
Definition ShipStack.h:239
virtual Int_t GetCurrentTrackNumber() const
Definition ShipStack.h:137
TClonesArray * fTracks
Definition ShipStack.h:211
virtual void UpdateTrackIndex(TRefArray *detArray=0)
Bool_t fStoreSecondaries
Used for merging.
Definition ShipStack.h:237
virtual ~ShipStack()
Definition ShipStack.cxx:56
Int_t fNParticles
Number of primary particles.
Definition ShipStack.h:231
virtual Int_t GetNprimary() const
Definition ShipStack.h:125
std::map< Int_t, Bool_t > fStoreMap
Definition ShipStack.h:215
virtual void FillTrackArray()
void SetMinPoints(Int_t min)
Definition ShipStack.h:174
void SetEnergyCut(Double_t eMin)
Definition ShipStack.h:175
virtual Int_t GetCurrentParentTrackNumber() const
Int_t fNPrimaries
Index of current track.
Definition ShipStack.h:230
std::stack< TParticle * > fStack
Definition ShipStack.h:201
std::map< Int_t, Int_t >::iterator fIndexIter
Definition ShipStack.h:221
TClonesArray * fParticles
Definition ShipStack.h:207
void SelectTracks()
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
Int_t fCurrentTrack
Definition ShipStack.h:229
virtual void AddParticle(TParticle *part)