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#pragma once
10
11#include <globals.hh>
12#include <G4UserSteppingAction.hh>
13
14#include <vector>
15
16class G4Track;
17
18namespace Belle2 {
23
24 namespace Simulation {
25
30 class SteppingAction : public G4UserSteppingAction {
31
32 public:
33
38
42 virtual ~SteppingAction();
43
47 void setMaxNumberSteps(int maxSteps) { m_maxNumberSteps = maxSteps; };
48
50 void setStoreTrajectories(bool store) { m_storeTrajectories = store; }
51
56 void setAbsorbersR(const std::vector<float>& vec) { m_absorbers = vec; };
57
61 virtual void UserSteppingAction(const G4Step* step);
62
63
64 protected:
65
68 bool m_storeTrajectories = false;
69 std::vector<float> m_absorbers;
70
71 private:
72
74 void writeVREventStep(const G4Step*, const G4Track*);
75
77 bool m_writeSimSteps{false};
78
79 };
80
81 } // end namespace Simulation
82
84} // end namespace Belle2
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.
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.