FairRoot/PandaRoot
PndStack.h
Go to the documentation of this file.
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 enum {kDoneBit=1};
44 
45 class PndStack : public FairGenericStack
46 {
47 
48  public:
49 
53  PndStack(Int_t size = 100);
54 
55 
57  virtual ~PndStack();
58 
59 
75  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
76  Double_t px, Double_t py, Double_t pz,
77  Double_t e, Double_t vx, Double_t vy,
78  Double_t vz, Double_t time, Double_t polx,
79  Double_t poly, Double_t polz, TMCProcess proc,
80  Int_t& ntr, Double_t weight, Int_t is);
81 
82  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
83  Double_t px, Double_t py, Double_t pz,
84  Double_t e, Double_t vx, Double_t vy,
85  Double_t vz, Double_t time, Double_t polx,
86  Double_t poly, Double_t polz, TMCProcess proc,
87  Int_t& ntr, Double_t weight, Int_t is,Int_t secondParentId);
88 
89 
95  virtual TParticle* PopNextTrack(Int_t& iTrack);
96 
97 
103  virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
104 
105 
110  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
111 
112 
116  virtual Int_t GetNtrack() const { return fNParticles; }
117 
118 
122  virtual Int_t GetNprimary() const { return fNPrimaries; }
123 
124 
128  virtual TParticle* GetCurrentTrack() const;
129 
130 
134  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
135 
136 
140  virtual Int_t GetCurrentParentTrackNumber() const;
141 
142 
144  virtual void AddParticle(TParticle* part);
145 
146 
148  virtual void FillTrackArray();
149 
150 
152  virtual void UpdateTrackIndex(TRefArray* detArray);
153 
154 
156  virtual void Reset();
157 
158 
160  virtual void Register();
161 
162 
166  virtual void Print(Int_t iVerbose=0) const;
167 
168 
171  void SetMinPoints(Int_t min) { fMinPoints = min; }
172  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
175 
176 
180  void AddPoint(DetectorId iDet);
181 
182 
187  void AddPoint(DetectorId iDet, Int_t iTrack);
188 
189 
191  TParticle* GetParticle(Int_t trackId) const;
192  TClonesArray* GetListOfParticles() { return fParticles; }
193 
194 
195 
196  private:
197 
198 
200  std::stack<TParticle*> fStack;
201 
202 
206  TClonesArray* fParticles;
207 
208 
210  TClonesArray* fTracks;
211 
212 
214  std::map<Int_t, Bool_t> fStoreMap;
215  std::map<Int_t, Bool_t>::iterator fStoreIter;
216 
217 
219  std::map<Int_t, Int_t> fIndexMap;
220  std::map<Int_t, Int_t>::iterator fIndexIter;
221 
222 
224  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
225 
226 
229  Int_t fNPrimaries;
230  Int_t fNParticles;
231  Int_t fNTracks;
232  Int_t fIndex;
233 
234 
237  Int_t fMinPoints;
238  Double32_t fEnergyCut;
241 
242 
244  void SelectTracks();
245  void SetGeneratorFlags(Int_t myid);
246 
247  PndStack(const PndStack& L);
248  PndStack& operator= (const PndStack&) {return *this;};
249 
250  ClassDef(PndStack,1)
251 
252 
253 };
254 
255 
256 
257 
258 
259 
260 #endif
TClonesArray * fTracks
Definition: PndStack.h:210
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
Definition: PndStack.cxx:144
virtual Int_t GetCurrentParentTrackNumber() const
Definition: PndStack.cxx:432
std::map< std::pair< Int_t, Int_t >, Int_t > fPointsMap
Definition: PndStack.h:224
void StoreMothers(Bool_t choice=kTRUE)
Definition: PndStack.h:173
#define choice(c1, c2, c3)
Definition: PndCAMath.h:75
TClonesArray * GetListOfParticles()
Definition: PndStack.h:192
virtual TParticle * PopNextTrack(Int_t &iTrack)
Definition: PndStack.cxx:116
virtual Int_t GetNtrack() const
Definition: PndStack.h:116
virtual Int_t GetNprimary() const
Definition: PndStack.h:122
TParticle * GetParticle(Int_t trackId) const
Definition: PndStack.cxx:442
Bool_t fStoreMothers
Definition: PndStack.h:239
Bool_t fPersistence
Definition: PndStack.h:240
void SetMinPoints(Int_t min)
Definition: PndStack.h:171
Int_t fIndex
Number of entries in fTracks.
Definition: PndStack.h:232
Bool_t fStoreSecondaries
Used for merging.
Definition: PndStack.h:236
void AddPoint(DetectorId iDet)
Definition: PndStack.cxx:408
virtual void Print(Int_t iVerbose=0) const
Definition: PndStack.cxx:393
std::map< Int_t, Int_t >::iterator fIndexIter
Definition: PndStack.h:220
Int_t fMinPoints
Definition: PndStack.h:237
std::map< Int_t, Bool_t >::iterator fStoreIter
Definition: PndStack.h:215
virtual void SetCurrentTrack(Int_t iTrack)
Definition: PndStack.h:110
void SetEnergyCut(Double_t eMin)
Definition: PndStack.h:172
std::map< Int_t, Bool_t > fStoreMap
Definition: PndStack.h:214
void SetGeneratorFlags(Int_t myid)
Definition: PndStack.cxx:248
Double_t
std::stack< TParticle * > fStack
Definition: PndStack.h:200
Int_t fNTracks
Number of entries in fParticles.
Definition: PndStack.h:231
virtual TParticle * GetCurrentTrack() const
Definition: PndStack.cxx:173
std::map< Int_t, Int_t > fIndexMap
Definition: PndStack.h:219
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
PndStack & operator=(const PndStack &)
Definition: PndStack.h:248
static int is
Definition: ranlxd.cxx:374
void SetPersistence(Bool_t choice)
Definition: PndStack.h:174
Int_t fNParticles
Number of primary particles.
Definition: PndStack.h:230
virtual void UpdateTrackIndex(TRefArray *detArray)
Definition: PndStack.cxx:303
virtual void FillTrackArray()
Definition: PndStack.cxx:198
PndStack(Int_t size=100)
Definition: PndStack.cxx:27
Double32_t fEnergyCut
Definition: PndStack.h:238
Int_t iVerbose
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: PndStack.cxx:57
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: PndStack.h:170
Int_t fNPrimaries
Index of current track.
Definition: PndStack.h:229
virtual void Reset()
Definition: PndStack.cxx:371
virtual void AddParticle(TParticle *part)
Definition: PndStack.cxx:186
TClonesArray * fParticles
Definition: PndStack.h:206
virtual Int_t GetCurrentTrackNumber() const
Definition: PndStack.h:134
void SelectTracks()
Definition: PndStack.cxx:454
double pz[39]
Definition: pipisigmas.h:14
virtual void Register()
Definition: PndStack.cxx:385
virtual ~PndStack()
Definition: PndStack.cxx:42
Int_t fCurrentTrack
Definition: PndStack.h:228