Belle II Software  release-08-01-10
SteppingAction.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef STEPPINGACTION_H_
10 #define STEPPINGACTION_H_
11 
12 #include <globals.hh>
13 #include <G4UserSteppingAction.hh>
14 
15 #include <vector>
16 
17 namespace Belle2 {
23  namespace Simulation {
24 
29  class SteppingAction : public G4UserSteppingAction {
30 
31  public:
32 
37 
41  virtual ~SteppingAction();
42 
46  void setMaxNumberSteps(int maxSteps) { m_maxNumberSteps = maxSteps; };
47 
49  void setStoreTrajectories(bool store) { m_storeTrajectories = store; }
50 
55  void setAbsorbersR(const std::vector<float>& vec) { m_absorbers = vec; };
56 
60  virtual void UserSteppingAction(const G4Step* step);
61 
62 
63  protected:
64 
67  bool m_storeTrajectories = false;
68  std::vector<float> m_absorbers;
71  };
72 
73  } // end namespace Simulation
74 
76 } // end namespace Belle2
77 
78 #endif /* STEPPINGACTION_H_ */
The Class for the stepping action.
std::vector< float > m_absorbers
The absorbers defined at given radii where tracks across them will be destroyed.
void setAbsorbersR(const std::vector< float > &vec)
Sets the radii of absorbers for killing tracks across them.
void setStoreTrajectories(bool store)
Sets the trajectory option to enable storing of the simulated particle trajectories.
virtual void UserSteppingAction(const G4Step *step)
The method will be called at each step during simulation.
virtual ~SteppingAction()
Destructor.
int m_maxNumberSteps
The maximum number of steps before the track transportation is stopped and the track is killed.
bool m_storeTrajectories
if true, check if the track has attached trajectory info and append step information if necessary
void setMaxNumberSteps(int maxSteps)
Sets the maximum number of steps before a track is stopped and killed.
Abstract base class for different kinds of events.