EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndStack.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndStack.h
1 // -------------------------------------------------------------------------
2 // ----- PndStack header file -----
3 // ----- Created 10/08/04 by D. Bertini / V. Friese -----
4 // -------------------------------------------------------------------------
5 
6 
30 #ifndef PNDSTACK_H
31 #define PNDSTACK_H
32 
33 
34 #include "PndDetectorList.h"
35 #include "FairGenericStack.h"
36 
37 #include "TClonesArray.h"
38 #include "TVirtualMCStack.h"
39 
40 #include <map>
41 #include <stack>
42 
43 class PndStack : public FairGenericStack
44 {
45 
46  public:
47 
51  PndStack(Int_t size = 100);
52 
53 
55  virtual ~PndStack();
56 
57 
73  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
74  Double_t px, Double_t py, Double_t pz,
75  Double_t e, Double_t vx, Double_t vy,
76  Double_t vz, Double_t time, Double_t polx,
77  Double_t poly, Double_t polz, TMCProcess proc,
78  Int_t& ntr, Double_t weight, Int_t is);
79 
80  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
81  Double_t px, Double_t py, Double_t pz,
82  Double_t e, Double_t vx, Double_t vy,
83  Double_t vz, Double_t time, Double_t polx,
84  Double_t poly, Double_t polz, TMCProcess proc,
85  Int_t& ntr, Double_t weight, Int_t is,Int_t secondParentId);
86 
87 
93  virtual TParticle* PopNextTrack(Int_t& iTrack);
94 
95 
101  virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
102 
103 
108  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
109 
110 
114  virtual Int_t GetNtrack() const { return fNParticles; }
115 
116 
120  virtual Int_t GetNprimary() const { return fNPrimaries; }
121 
122 
126  virtual TParticle* GetCurrentTrack() const;
127 
128 
132  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
133 
134 
138  virtual Int_t GetCurrentParentTrackNumber() const;
139 
140 
142  virtual void AddParticle(TParticle* part);
143 
144 
146  virtual void FillTrackArray();
147 
148 
150  virtual void UpdateTrackIndex(TRefArray* detArray);
151 
152 
154  virtual void Reset();
155 
156 
158  virtual void Register();
159 
160 
164  virtual void Print(Int_t iVerbose=0) const;
165 
166 
168  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
169  void SetMinPoints(Int_t min) { fMinPoints = min; }
170  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
171  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
172 
173 
177  void AddPoint(DetectorId iDet);
178 
179 
184  void AddPoint(DetectorId iDet, Int_t iTrack);
185 
186 
188  TParticle* GetParticle(Int_t trackId) const;
189  TClonesArray* GetListOfParticles() { return fParticles; }
190 
191 
192 
193  private:
194 
195 
197  std::stack<TParticle*> fStack;
198 
199 
203  TClonesArray* fParticles;
204 
205 
207  TClonesArray* fTracks;
208 
209 
211  std::map<Int_t, Bool_t> fStoreMap;
212  std::map<Int_t, Bool_t>::iterator fStoreIter;
213 
214 
216  std::map<Int_t, Int_t> fIndexMap;
217  std::map<Int_t, Int_t>::iterator fIndexIter;
218 
219 
221  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
222 
223 
226  Int_t fNPrimaries;
227  Int_t fNParticles;
228  Int_t fNTracks;
229  Int_t fIndex;
230 
231 
234  Int_t fMinPoints;
235  Double32_t fEnergyCut;
237 
238 
240  void SelectTracks();
241  void SetGeneratorFlags(Int_t myid);
242 
243  PndStack(const PndStack& L);
244  PndStack& operator= (const PndStack&) {return *this;};
245 
246  ClassDef(PndStack,1)
247 
248 
249 };
250 
251 
252 
253 
254 
255 
256 #endif