Belle II Software  release-05-02-19
SteppingAction.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2011 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Guofu Cao, Andreas Moll *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef STEPPINGACTION_H_
12 #define STEPPINGACTION_H_
13 
14 #include <globals.hh>
15 #include <G4UserSteppingAction.hh>
16 
17 #include <vector>
18 
19 namespace Belle2 {
25  namespace Simulation {
26 
31  class SteppingAction : public G4UserSteppingAction {
32 
33  public:
34 
39 
43  virtual ~SteppingAction();
44 
48  void setMaxNumberSteps(int maxSteps) { m_maxNumberSteps = maxSteps; };
49 
51  void setStoreTrajectories(bool store) { m_storeTrajectories = store; }
52 
57  void setAbsorbersR(const std::vector<float>& vec) { m_absorbers = vec; };
58 
62  virtual void UserSteppingAction(const G4Step* step);
63 
64 
65  protected:
66 
67  int m_maxNumberSteps;
69  bool m_storeTrajectories = false;
70  std::vector<float> m_absorbers;
73  };
74 
75  } // end namespace Simulation
76 
78 } // end namespace Belle2
79 
80 #endif /* STEPPINGACTION_H_ */
Belle2::Simulation::SteppingAction::setMaxNumberSteps
void setMaxNumberSteps(int maxSteps)
Sets the maximum number of steps before a track is stopped and killed.
Definition: SteppingAction.h:56
Belle2::Simulation::SteppingAction::UserSteppingAction
virtual void UserSteppingAction(const G4Step *step)
The method will be called at each step during simulation.
Definition: SteppingAction.cc:40
Belle2::Simulation::SteppingAction::setStoreTrajectories
void setStoreTrajectories(bool store)
Sets the trajectory option to enable storing of the simulated particle trajectories.
Definition: SteppingAction.h:59
Belle2::Simulation::SteppingAction::~SteppingAction
virtual ~SteppingAction()
Destructor.
Definition: SteppingAction.cc:34
Belle2::Simulation::SteppingAction::m_absorbers
std::vector< float > m_absorbers
The absorbers defined at given radii where tracks across them will be destroyed.
Definition: SteppingAction.h:78
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Simulation::SteppingAction::m_storeTrajectories
bool m_storeTrajectories
if true, check if the track has attached trajectory info and append step information if necessary
Definition: SteppingAction.h:77
Belle2::Simulation::SteppingAction::setAbsorbersR
void setAbsorbersR(const std::vector< float > &vec)
Sets the radii of absorbers for killing tracks across them.
Definition: SteppingAction.h:65
Belle2::Simulation::SteppingAction::SteppingAction
SteppingAction()
Constructor.
Definition: SteppingAction.cc:23
Belle2::Simulation::SteppingAction::m_maxNumberSteps
int m_maxNumberSteps
The maximum number of steps before the track transportation is stopped and the track is killed.
Definition: SteppingAction.h:75