er  dev
ERStack.h
1 // -------------------------------------------------------------------------
2 // ----- ERStack header file -----
3 // ----- Created 11/12/15 by V.Schetinin -----
4 // -------------------------------------------------------------------------
5 
6 
29 #ifndef ERStack_H
30 #define ERStack_H
31 
32 
33 #include "ERDetectorList.h"
34 #include "FairGenericStack.h"
35 
36 #include <map>
37 #include <stack>
38 
39 class TClonesArray;
40 
41 class ERStack : public FairGenericStack
42 {
43 
44  public:
45 
49  ERStack(Int_t size = 100);
50 
51 
53  virtual ~ERStack();
54 
55  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
56  Double_t px, Double_t py, Double_t pz,
57  Double_t e, Double_t vx, Double_t vy,
58  Double_t vz, Double_t time, Double_t polx,
59  Double_t poly, Double_t polz, TMCProcess proc,
60  Int_t& ntr, Double_t weight, Int_t is);
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,Int_t secondparentID);
82 
83 
89  virtual TParticle* PopNextTrack(Int_t& iTrack);
90 
91 
97  virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
98 
99 
104  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
105 
106 
110  virtual Int_t GetNtrack() const { return fNParticles; }
111 
112 
116  virtual Int_t GetNprimary() const { return fNPrimaries; }
117 
118 
122  virtual TParticle* GetCurrentTrack() const;
123 
124 
128  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
129 
130 
134  virtual Int_t GetCurrentParentTrackNumber() const;
135 
136 
138  virtual void AddParticle(TParticle* part);
139 
140 
142  virtual void FillTrackArray();
143 
144 
146  virtual void UpdateTrackIndex(TRefArray* detArray);
147 
148 
150  virtual void Reset();
151 
152 
154  virtual void Register();
155 
156 
160  virtual void Print(Int_t iVerbose=0) const;
161 
162 
164  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
165  void SetMinPoints(Int_t min) { fMinPoints = min; }
166  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
167  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
168 
169 
173  void AddPoint(DetectorId iDet);
174 
175 
180  void AddPoint(DetectorId iDet, Int_t iTrack);
181 
182 
184  TParticle* GetParticle(Int_t trackId) const;
185  TClonesArray* GetListOfParticles() { return fParticles; }
186 
187 
188 
189  private:
190 
191 
193  std::stack<TParticle*> fStack;
194 
195 
199  TClonesArray* fParticles;
200 
201 
203  TClonesArray* fTracks;
204 
205 
207  std::map<Int_t, Bool_t> fStoreMap;
208  std::map<Int_t, Bool_t>::iterator fStoreIter;
209 
210 
212  std::map<Int_t, Int_t> fIndexMap;
213  std::map<Int_t, Int_t>::iterator fIndexIter;
214 
215 
217  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
218 
219 
222  Int_t fNPrimaries;
223  Int_t fNParticles;
224  Int_t fNTracks;
225  Int_t fIndex;
226 
227 
230  Int_t fMinPoints;
231  Double32_t fEnergyCut;
232  Bool_t fStoreMothers;
233 
234 
236  void SelectTracks();
237 
238  ERStack(const ERStack&);
239  ERStack& operator=(const ERStack&);
240 
241  ClassDef(ERStack,1)
242 
243 
244 };
245 
246 #endif
std::map< Int_t, Int_t > fIndexMap
Definition: ERStack.h:212
virtual Int_t GetCurrentTrackNumber() const
Definition: ERStack.h:128
void AddPoint(DetectorId iDet)
Definition: ERStack.cxx:360
void SelectTracks()
Definition: ERStack.cxx:413
virtual void Print(Int_t iVerbose=0) const
Definition: ERStack.cxx:343
TClonesArray * fParticles
Definition: ERStack.h:199
Int_t fNPrimaries
Index of current track.
Definition: ERStack.h:222
std::map< std::pair< Int_t, Int_t >, Int_t > fPointsMap
Definition: ERStack.h:217
virtual ~ERStack()
Definition: ERStack.cxx:54
virtual TParticle * PopNextTrack(Int_t &iTrack)
Definition: ERStack.cxx:130
virtual void AddParticle(TParticle *part)
Definition: ERStack.cxx:200
virtual void Reset()
Definition: ERStack.cxx:319
virtual TParticle * GetCurrentTrack() const
Definition: ERStack.cxx:185
std::map< Int_t, Bool_t > fStoreMap
Definition: ERStack.h:207
virtual Int_t GetNprimary() const
Definition: ERStack.h:116
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: ERStack.h:164
Bool_t fStoreSecondaries
Used for merging.
Definition: ERStack.h:229
virtual void UpdateTrackIndex(TRefArray *detArray)
Definition: ERStack.cxx:261
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
Definition: ERStack.cxx:159
Int_t fIndex
Number of entries in fTracks.
Definition: ERStack.h:225
Int_t fCurrentTrack
Definition: ERStack.h:221
TParticle * GetParticle(Int_t trackId) const
Definition: ERStack.cxx:398
std::stack< TParticle * > fStack
Definition: ERStack.h:193
virtual Int_t GetNtrack() const
Definition: ERStack.h:110
virtual void SetCurrentTrack(Int_t iTrack)
Definition: ERStack.h:104
Int_t fNParticles
Number of primary particles.
Definition: ERStack.h:223
virtual void FillTrackArray()
Definition: ERStack.cxx:214
TClonesArray * fTracks
Definition: ERStack.h:203
virtual void Register()
Definition: ERStack.cxx:334
virtual Int_t GetCurrentParentTrackNumber() const
Definition: ERStack.cxx:386
Int_t fNTracks
Number of entries in fParticles.
Definition: ERStack.h:224
ERStack(Int_t size=100)
Definition: ERStack.cxx:26