ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtStack.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 version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // -------------------------------------------------------------------------
10 // ----- AtStack header file -----
11 // ----- M. Al-Turany June 2014 -----
12 // -------------------------------------------------------------------------
13 
32 #ifndef AtStack_H
33 #define AtStack_H
34 
35 #include "AtDetectorList.h" // for DetectorId
36 
37 #include <FairGenericStack.h> // for FairGenericStack
38 
39 #include <Rtypes.h> // for Int_t, Double_t, Bool_t, etc
40 #include <TMCProcess.h> // for TMCProcess
41 
42 #include <map> // for map, map<>::iterator
43 #include <stack> // for stack
44 #include <utility> // for pair
45 
46 class TClonesArray;
47 class TParticle;
48 class TRefArray;
49 class FairLogger;
50 class TBuffer;
51 class TClass;
52 class TMemberInspector;
53 
54 class AtStack : public FairGenericStack {
55 
56 public:
60  AtStack(Int_t size = 100);
61 
63  virtual ~AtStack();
64 
80  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz,
81  Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx,
82  Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is);
83 
84  virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz,
85  Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx,
86  Double_t poly, Double_t polz, TMCProcess proc, Int_t &ntr, Double_t weight, Int_t is,
87  Int_t secondParentId);
88 
94  virtual TParticle *PopNextTrack(Int_t &iTrack);
95 
101  virtual TParticle *PopPrimaryForTracking(Int_t iPrim);
102 
107  virtual void SetCurrentTrack(Int_t iTrack) { fCurrentTrack = iTrack; }
108 
112  virtual Int_t GetNtrack() const { return fNParticles; }
113 
117  virtual Int_t GetNprimary() const { return fNPrimaries; }
118 
122  virtual TParticle *GetCurrentTrack() const;
123 
127  virtual Int_t GetCurrentTrackNumber() const { return fCurrentTrack; }
128 
132  virtual Int_t GetCurrentParentTrackNumber() const;
133 
135  virtual void AddParticle(TParticle *part);
136 
138  virtual void FillTrackArray();
139 
141  virtual void UpdateTrackIndex(TRefArray *detArray = 0);
142 
144  virtual void Reset();
145 
147  virtual void Register();
148 
152  virtual void Print(Int_t iVerbose = 0) const;
153 
155  void StoreSecondaries(Bool_t choice = kTRUE) { fStoreSecondaries = choice; }
156  void SetMinPoints(Int_t min) { fMinPoints = min; }
157  void SetEnergyCut(Double_t eMin) { fEnergyCut = eMin; }
158  void StoreMothers(Bool_t choice = kTRUE) { fStoreMothers = choice; }
159 
163  void AddPoint(DetectorId iDet);
164 
169  void AddPoint(DetectorId iDet, Int_t iTrack);
170 
172  TParticle *GetParticle(Int_t trackId) const;
173  TClonesArray *GetListOfParticles() { return fParticles; }
174 
175 private:
177  FairLogger *fLogger;
178 
180  std::stack<TParticle *> fStack;
181 
185  TClonesArray *fParticles;
186 
188  TClonesArray *fTracks;
189 
191  std::map<Int_t, Bool_t> fStoreMap;
192  std::map<Int_t, Bool_t>::iterator fStoreIter;
193 
195  std::map<Int_t, Int_t> fIndexMap;
196  std::map<Int_t, Int_t>::iterator fIndexIter;
197 
199  std::map<std::pair<Int_t, Int_t>, Int_t> fPointsMap;
200 
202  Int_t fCurrentTrack;
203  Int_t fNPrimaries;
204  Int_t fNParticles;
205  Int_t fNTracks;
206  Int_t fIndex;
207 
209  Bool_t fStoreSecondaries;
210  Int_t fMinPoints;
211  Double32_t fEnergyCut;
212  Bool_t fStoreMothers;
213 
215  void SelectTracks();
216 
217  AtStack(const AtStack &);
218  AtStack &operator=(const AtStack &);
219 
220  ClassDef(AtStack, 1)
221 };
222 
223 #endif
AtStack::StoreSecondaries
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: AtStack.h:155
AtStack::Print
virtual void Print(Int_t iVerbose=0) const
Definition: AtStack.cxx:308
AtStack::StoreMothers
void StoreMothers(Bool_t choice=kTRUE)
Definition: AtStack.h:158
AtDetectorList.h
AtStack::GetParticle
TParticle * GetParticle(Int_t trackId) const
Definition: AtStack.cxx:364
AtStack::AddParticle
virtual void AddParticle(TParticle *part)
Definition: AtStack.cxx:171
AtStack::UpdateTrackIndex
virtual void UpdateTrackIndex(TRefArray *detArray=0)
Definition: AtStack.cxx:230
AtStack::PopPrimaryForTracking
virtual TParticle * PopPrimaryForTracking(Int_t iPrim)
Definition: AtStack.cxx:137
AtStack::GetCurrentTrackNumber
virtual Int_t GetCurrentTrackNumber() const
Definition: AtStack.h:127
AtStack::Register
virtual void Register()
Definition: AtStack.cxx:301
AtStack::~AtStack
virtual ~AtStack()
Definition: AtStack.cxx:54
DetectorId
DetectorId
Definition: AtDetectorList.h:20
AtStack::PopNextTrack
virtual TParticle * PopNextTrack(Int_t &iTrack)
Definition: AtStack.cxx:111
AtStack::SetMinPoints
void SetMinPoints(Int_t min)
Definition: AtStack.h:156
AtStack::Reset
virtual void Reset()
Definition: AtStack.cxx:286
AtStack::AddPoint
void AddPoint(DetectorId iDet)
Definition: AtStack.cxx:322
AtStack::FillTrackArray
virtual void FillTrackArray()
Definition: AtStack.cxx:182
AtStack::GetCurrentTrack
virtual TParticle * GetCurrentTrack() const
Definition: AtStack.cxx:160
AtStack::SetEnergyCut
void SetEnergyCut(Double_t eMin)
Definition: AtStack.h:157
AtStack::GetCurrentParentTrackNumber
virtual Int_t GetCurrentParentTrackNumber() const
Definition: AtStack.cxx:352
AtStack::GetNprimary
virtual Int_t GetNprimary() const
Definition: AtStack.h:117
AtStack::PushTrack
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: AtStack.cxx:67
AtStack::SetCurrentTrack
virtual void SetCurrentTrack(Int_t iTrack)
Definition: AtStack.h:107
AtStack::GetNtrack
virtual Int_t GetNtrack() const
Definition: AtStack.h:112
AtStack
Definition: AtStack.h:54
AtStack::AtStack
AtStack(Int_t size=100)
Definition: AtStack.cxx:43
AtStack::GetListOfParticles
TClonesArray * GetListOfParticles()
Definition: AtStack.h:173