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 
28 #ifndef PNDSTACK_H
29 #define PNDSTACK_H
30 
31 #include "PndDetectorList.h"
32 #include "FairGenericStack.h"
33 
34 #include "TClonesArray.h"
35 #include "TVirtualMCStack.h"
36 
37 #include <map>
38 #include <stack>
39 
40 enum { kDoneBit = 1 };
41 
42 class PndStack : public FairGenericStack {
43 
44  public:
48  PndStack(Int_t size = 100);
49 
51  virtual ~PndStack();
52 
68  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,
69  Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is);
70 
71  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,
72  Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is, Int_t secondParentId);
73 
79  virtual TParticle *PopNextTrack(Int_t &iTrack);
80 
86  virtual TParticle *PopPrimaryForTracking(Int_t iPrim);
87 
92  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
93 
97  virtual Int_t GetNtrack() const { return fNParticles; }
98 
102  virtual Int_t GetNprimary() const { return fNPrimaries; }
103 
107  virtual TParticle *GetCurrentTrack() const;
108 
112  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
113 
117  virtual Int_t GetCurrentParentTrackNumber() const;
118 
120  virtual void AddParticle(TParticle *part);
121 
123  virtual void FillTrackArray();
124 
126  virtual void UpdateTrackIndex(TRefArray *detArray);
127 
129  virtual void Reset();
130 
132  virtual void Register();
133 
137  virtual void Print(Int_t iVerbose = 0) const;
138 
140  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
141  void SetMinPoints(Int_t min) { fMinPoints = min; }
142  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
143  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
144  void SetPersistence(Bool_t choice) { fPersistence = choice; }
145 
149  void AddPoint(DetectorId iDet);
150 
155  void AddPoint(DetectorId iDet, Int_t iTrack);
156 
158  TParticle *GetParticle(Int_t trackId) const;
159  TClonesArray *GetListOfParticles() { return fParticles; }
160 
161  private:
163  std::stack<TParticle *> fStack;
164 
168  TClonesArray *fParticles;
169 
171  TClonesArray *fTracks;
172 
174  std::map<Int_t, Bool_t> fStoreMap;
175  std::map<Int_t, Bool_t>::iterator fStoreIter;
176 
178  std::map<Int_t, Int_t> fIndexMap;
179  std::map<Int_t, Int_t>::iterator fIndexIter;
180 
182  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
183 
185  Int_t fCurrentTrack;
186  Int_t fNPrimaries;
187  Int_t fNParticles;
188  Int_t fNTracks;
189  Int_t fIndex;
190 
192  Bool_t fStoreSecondaries;
193  Int_t fMinPoints;
194  Double32_t fEnergyCut;
195  Bool_t fStoreMothers;
196  Bool_t fPersistence;
197 
199  void SelectTracks();
200  void SetGeneratorFlags(Int_t myid);
201 
202  PndStack(const PndStack &L);
203  PndStack &operator=(const PndStack &) { return *this; };
204 
205  ClassDef(PndStack, 1)
206 };
207 
208 #endif
void StoreMothers(Bool_t choice=kTRUE)
Definition: PndStack.h:143
virtual void FillTrackArray()
#define choice(c1, c2, c3)
Definition: PndCAMath.h:131
TClonesArray * GetListOfParticles()
Definition: PndStack.h:159
virtual void Register()
virtual void UpdateTrackIndex(TRefArray *detArray)
virtual TParticle * PopNextTrack(Int_t &iTrack)
virtual ~PndStack()
void SetMinPoints(Int_t min)
Definition: PndStack.h:141
void AddPoint(DetectorId iDet)
virtual void SetCurrentTrack(Int_t iTrack)
Definition: PndStack.h:92
void SetEnergyCut(Double_t eMin)
Definition: PndStack.h:142
virtual void AddParticle(TParticle *part)
virtual Int_t GetNprimary() const
Definition: PndStack.h:102
virtual Int_t GetCurrentTrackNumber() const
Definition: PndStack.h:112
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:24
void SetPersistence(Bool_t choice)
Definition: PndStack.h:144
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
virtual Int_t GetNtrack() const
Definition: PndStack.h:97
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)
PndStack(Int_t size=100)
TParticle * GetParticle(Int_t trackId) const
virtual TParticle * GetCurrentTrack() const
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: PndStack.h:140
virtual Int_t GetCurrentParentTrackNumber() const
DetectorId
virtual void Print(Int_t iVerbose=0) const
virtual void Reset()
double pz[39]
Definition: pipisigmas.h:13