Belle II Software development
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
17class G4Track;
18
19namespace 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
69 bool m_storeTrajectories = false;
70 std::vector<float> m_absorbers;
72 private:
73
75 void writeVREventStep(const G4Step*, const G4Track*);
76
78 bool m_writeSimSteps{false};
79
80 };
81
82 } // end namespace Simulation
83
85} // end namespace Belle2
86
87#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.
bool m_writeSimSteps
Flag for writing out the simulation steps.
void setStoreTrajectories(bool store)
Sets the trajectory option to enable storing of the simulated particle trajectories.
void writeVREventStep(const G4Step *, const G4Track *)
Method to write (almost) each G4Step to the VR event file.
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.