FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MyProjStack.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // -------------------------------------------------------------------------
10 // ----- MyProjStack header file -----
11 // ----- M. Al-Turany June 2014 -----
12 // -------------------------------------------------------------------------
13 
32 #ifndef MyProjStack_H
33 #define MyProjStack_H
34 
35 #include "FairGenericStack.h" // for FairGenericStack
36 #include "MyProjDetectorList.h" // for DetectorId
37 
38 #include <Rtypes.h> // for Int_t, Double_t, Bool_t, etc
39 #include <TMCProcess.h> // for TMCProcess
40 #include <map> // for map, map<>::iterator
41 #include <stack> // for stack
42 #include <utility> // for pair
43 
44 class TClonesArray;
45 class TParticle;
46 class TRefArray;
47 
48 class MyProjStack : public FairGenericStack
49 {
50 
51  public:
55  MyProjStack(Int_t size = 100);
56 
58  virtual ~MyProjStack();
59 
75  virtual void PushTrack(Int_t toBeDone,
76  Int_t parentID,
77  Int_t pdgCode,
78  Double_t px,
79  Double_t py,
80  Double_t pz,
81  Double_t e,
82  Double_t vx,
83  Double_t vy,
84  Double_t vz,
85  Double_t time,
86  Double_t polx,
87  Double_t poly,
88  Double_t polz,
89  TMCProcess proc,
90  Int_t& ntr,
91  Double_t weight,
92  Int_t is);
93 
94  virtual void PushTrack(Int_t toBeDone,
95  Int_t parentID,
96  Int_t pdgCode,
97  Double_t px,
98  Double_t py,
99  Double_t pz,
100  Double_t e,
101  Double_t vx,
102  Double_t vy,
103  Double_t vz,
104  Double_t time,
105  Double_t polx,
106  Double_t poly,
107  Double_t polz,
108  TMCProcess proc,
109  Int_t& ntr,
110  Double_t weight,
111  Int_t is,
112  Int_t secondParentId);
113 
119  virtual TParticle* PopNextTrack(Int_t& iTrack);
120 
126  virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
127 
132  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
133 
137  virtual Int_t GetNtrack() const { return fNParticles; }
138 
142  virtual Int_t GetNprimary() const { return fNPrimaries; }
143 
147  virtual TParticle* GetCurrentTrack() const;
148 
152  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
153 
157  virtual Int_t GetCurrentParentTrackNumber() const;
158 
160  virtual void AddParticle(TParticle* part);
161 
163  virtual void FillTrackArray();
164 
166  virtual void UpdateTrackIndex(TRefArray* detArray = 0);
167 
169  virtual void Reset();
170 
172  virtual void Register();
173 
177  virtual void Print(Int_t iVerbose = 0) const;
178 
180  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
181  void SetMinPoints(Int_t min) { fMinPoints = min; }
182  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
183  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
184 
188  void AddPoint(DetectorId iDet);
189 
194  void AddPoint(DetectorId iDet, Int_t iTrack);
195 
197  TParticle* GetParticle(Int_t trackId) const;
198  TClonesArray* GetListOfParticles() { return fParticles; }
199 
201  virtual FairGenericStack* CloneStack() const { return new MyProjStack(*this); }
202 
203  private:
205  std::stack<TParticle*> fStack;
206 
210  TClonesArray* fParticles;
211 
213  TClonesArray* fTracks;
214 
216  std::map<Int_t, Bool_t> fStoreMap;
217  std::map<Int_t, Bool_t>::iterator fStoreIter;
218 
220  std::map<Int_t, Int_t> fIndexMap;
221  std::map<Int_t, Int_t>::iterator fIndexIter;
222 
224  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
225 
227  Int_t fCurrentTrack;
228  Int_t fNPrimaries;
229  Int_t fNParticles;
230  Int_t fNTracks;
231  Int_t fIndex;
232 
234  Bool_t fStoreSecondaries;
235  Int_t fMinPoints;
236  Double32_t fEnergyCut;
237  Bool_t fStoreMothers;
238 
240  void SelectTracks();
241 
242  MyProjStack(const MyProjStack&);
243  MyProjStack& operator=(const MyProjStack&);
244 
245  ClassDef(MyProjStack, 1);
246 };
247 
248 #endif
DetectorId
void SetMinPoints(Int_t min)
Definition: MyProjStack.h:181
void SetEnergyCut(Double_t eMin)
Definition: MyProjStack.h:182
virtual void FillTrackArray()
virtual void SetCurrentTrack(Int_t iTrack)
Definition: MyProjStack.h:132
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
TClonesArray * GetListOfParticles()
Definition: MyProjStack.h:198
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: MyProjStack.h:180
virtual FairGenericStack * CloneStack() const
Definition: MyProjStack.h:201
virtual Int_t GetNprimary() const
Definition: MyProjStack.h:142
virtual Int_t GetCurrentTrackNumber() const
Definition: MyProjStack.h:152
virtual TParticle * PopNextTrack(Int_t &iTrack)
TParticle * GetParticle(Int_t trackId) const
virtual void Register()
virtual TParticle * GetCurrentTrack() const
virtual Int_t GetNtrack() const
Definition: MyProjStack.h:137
virtual void Print(Int_t iVerbose=0) const
virtual void AddParticle(TParticle *part)
void StoreMothers(Bool_t choice=kTRUE)
Definition: MyProjStack.h:183
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: MyProjStack.cxx:96
virtual ~MyProjStack()
Definition: MyProjStack.cxx:83
virtual void UpdateTrackIndex(TRefArray *detArray=0)
virtual Int_t GetCurrentParentTrackNumber() const
void AddPoint(DetectorId iDet)
virtual void Reset()
MyProjStack(Int_t size=100)
Definition: MyProjStack.cxx:38