EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbmStack.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CbmStack.h
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 "CbmDetectorList.h"
35 #include "FairGenericStack.h"
36 
37 #include <map>
38 #include <stack>
39 
40 class TClonesArray;
41 
42 class CbmStack : public FairGenericStack
43 {
44 
45  public:
46 
50  CbmStack(Int_t size = 100);
51 
52 
54  virtual ~CbmStack();
55 
56  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
57  Double_t px, Double_t py, Double_t pz,
58  Double_t e, Double_t vx, Double_t vy,
59  Double_t vz, Double_t time, Double_t polx,
60  Double_t poly, Double_t polz, TMCProcess proc,
61  Int_t& ntr, Double_t weight, Int_t is);
77  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
78  Double_t px, Double_t py, Double_t pz,
79  Double_t e, Double_t vx, Double_t vy,
80  Double_t vz, Double_t time, Double_t polx,
81  Double_t poly, Double_t polz, TMCProcess proc,
82  Int_t& ntr, Double_t weight, Int_t is,Int_t secondparentID);
83 
84 
90  virtual TParticle* PopNextTrack(Int_t& iTrack);
91 
92 
98  virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
99 
100 
105  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
106 
107 
111  virtual Int_t GetNtrack() const { return fNParticles; }
112 
113 
117  virtual Int_t GetNprimary() const { return fNPrimaries; }
118 
119 
123  virtual TParticle* GetCurrentTrack() const;
124 
125 
129  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
130 
131 
135  virtual Int_t GetCurrentParentTrackNumber() const;
136 
137 
139  virtual void AddParticle(TParticle* part);
140 
141 
143  virtual void FillTrackArray();
144 
145 
147  virtual void UpdateTrackIndex(TRefArray* detArray);
148 
149 
151  virtual void Reset();
152 
153 
155  virtual void Register();
156 
157 
161  virtual void Print(Int_t iVerbose=0) const;
162 
163 
165  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
166  void SetMinPoints(Int_t min) { fMinPoints = min; }
167  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
168  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
169 
170 
174  void AddPoint(DetectorId iDet);
175 
176 
181  void AddPoint(DetectorId iDet, Int_t iTrack);
182 
183 
185  TParticle* GetParticle(Int_t trackId) const;
186  TClonesArray* GetListOfParticles() { return fParticles; }
187 
188 
189 
190  private:
191 
192 
194  std::stack<TParticle*> fStack;
195 
196 
200  TClonesArray* fParticles;
201 
202 
204  TClonesArray* fTracks;
205 
206 
208  std::map<Int_t, Bool_t> fStoreMap;
209  std::map<Int_t, Bool_t>::iterator fStoreIter;
210 
211 
213  std::map<Int_t, Int_t> fIndexMap;
214  std::map<Int_t, Int_t>::iterator fIndexIter;
215 
216 
218  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
219 
220 
223  Int_t fNPrimaries;
224  Int_t fNParticles;
225  Int_t fNTracks;
226  Int_t fIndex;
227 
228 
231  Int_t fMinPoints;
232  Double32_t fEnergyCut;
234 
235 
237  void SelectTracks();
238 
239  CbmStack(const CbmStack&);
240  CbmStack& operator=(const CbmStack&);
241 
242  ClassDef(CbmStack,1)
243 
244 
245 };
246 
247 
248 
249 
250 
251 
252 #endif