PandaRoot
PndStack.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndStack header file -----
15 // ----- Created 10/08/04 by D. Bertini / V. Friese -----
16 // -------------------------------------------------------------------------
17 
40 #ifndef PNDSTACK_H
41 #define PNDSTACK_H
42 
43 #include "PndDetectorList.h"
44 #include "FairGenericStack.h"
45 
46 #include "TClonesArray.h"
47 #include "TVirtualMCStack.h"
48 
49 #include <map>
50 #include <stack>
51 
52 enum { kDoneBit = 1 };
53 
54 class PndStack : public FairGenericStack {
55 
56  public:
60  PndStack(Int_t size = 100);
61 
63  virtual ~PndStack();
64 
80  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,
81  Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is);
82 
83  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,
84  Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is, Int_t secondParentId);
85 
91  virtual TParticle *PopNextTrack(Int_t &iTrack);
92 
98  virtual TParticle *PopPrimaryForTracking(Int_t iPrim);
99 
104  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
105 
109  virtual Int_t GetNtrack() const { return fNParticles; }
110 
114  virtual Int_t GetNprimary() const { return fNPrimaries; }
115 
119  virtual TParticle *GetCurrentTrack() const;
120 
124  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
125 
129  virtual Int_t GetCurrentParentTrackNumber() const;
130 
132  virtual void AddParticle(TParticle *part);
133 
135  virtual void FillTrackArray();
136 
138  virtual void UpdateTrackIndex(TRefArray *detArray);
139 
141  virtual void Reset();
142 
144  virtual void Register();
145 
149  virtual void Print(Int_t iVerbose = 0) const;
150 
152  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
153  void SetMinPoints(Int_t min) { fMinPoints = min; }
154  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
155  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
156  void SetPersistence(Bool_t choice) { fPersistence = choice; }
157 
161  void AddPoint(DetectorId iDet);
162 
167  void AddPoint(DetectorId iDet, Int_t iTrack);
168 
170  TParticle *GetParticle(Int_t trackId) const;
171  TClonesArray *GetListOfParticles() { return fParticles; }
172 
173  private:
175  std::stack<TParticle *> fStack;
176 
180  TClonesArray *fParticles;
181 
183  TClonesArray *fTracks;
184 
186  std::map<Int_t, Bool_t> fStoreMap;
187  std::map<Int_t, Bool_t>::iterator fStoreIter;
188 
190  std::map<Int_t, Int_t> fIndexMap;
191  std::map<Int_t, Int_t>::iterator fIndexIter;
192 
194  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
195 
197  Int_t fCurrentTrack;
198  Int_t fNPrimaries;
199  Int_t fNParticles;
200  Int_t fNTracks;
201  Int_t fIndex;
202 
204  Bool_t fStoreSecondaries;
205  Int_t fMinPoints;
206  Double32_t fEnergyCut;
207  Bool_t fStoreMothers;
208  Bool_t fPersistence;
209 
211  void SelectTracks();
212  void SetGeneratorFlags(Int_t myid);
213 
214  PndStack(const PndStack &L);
215  PndStack &operator=(const PndStack &) { return *this; };
216 
217  ClassDef(PndStack, 1)
218 };
219 
220 #endif
void StoreMothers(Bool_t choice=kTRUE)
Definition: PndStack.h:155
virtual void FillTrackArray()
#define choice(c1, c2, c3)
Definition: PndCAMath.h:143
TClonesArray * GetListOfParticles()
Definition: PndStack.h:171
virtual void Register()
virtual void UpdateTrackIndex(TRefArray *detArray)
virtual TParticle * PopNextTrack(Int_t &iTrack)
virtual ~PndStack()
void SetMinPoints(Int_t min)
Definition: PndStack.h:153
void AddPoint(DetectorId iDet)
virtual void SetCurrentTrack(Int_t iTrack)
Definition: PndStack.h:104
void SetEnergyCut(Double_t eMin)
Definition: PndStack.h:154
virtual void AddParticle(TParticle *part)
virtual Int_t GetNprimary() const
Definition: PndStack.h:114
virtual Int_t GetCurrentTrackNumber() const
Definition: PndStack.h:124
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:36
void SetPersistence(Bool_t choice)
Definition: PndStack.h:156
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
virtual Int_t GetNtrack() const
Definition: PndStack.h:109
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:152
virtual Int_t GetCurrentParentTrackNumber() const
DetectorId
virtual void Print(Int_t iVerbose=0) const
virtual void Reset()
double pz[39]
Definition: pipisigmas.h:25