BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSTrackingAction.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSTRACKINGACTION_H
19#define BDSTRACKINGACTION_H
20
21#include "BDSTrajectoryOptions.hh"
22
23#include "G4Types.hh"
24#include "globals.hh" // geant4 types / globals
25#include "G4UserTrackingAction.hh"
26
27class BDSEventAction;
29class G4Track;
30
35class BDSTrackingAction: public G4UserTrackingAction
36{
37public:
38 BDSTrackingAction(G4bool batchMode,
39 G4bool storeTrajectoryIn,
40 const BDS::TrajectoryOptions& storeTrajectoryOptionsIn,
41 BDSEventAction* eventActionIn,
42 G4int verboseSteppingEventStartIn,
43 G4int verboseSteppingEventStopIn,
44 G4bool verboseSteppingPrimaryOnlyIn,
45 G4int verboseSteppingLevelIn,
46 BDSPolarizationState* defaultPolarisationIn = nullptr);
47
48 virtual ~BDSTrackingAction();
49
51 virtual void PreUserTrackingAction(const G4Track* track);
52
54 virtual void PostUserTrackingAction(const G4Track* track);
55
56private:
59
62 const G4bool interactive;
63
64 const G4bool storeTrajectory;
66
69
70 G4int verboseSteppingEventStart;
71 G4int verboseSteppingEventStop;
72 G4bool verboseSteppingPrimaryOnly;
73 G4int verboseSteppingLevel;
74 BDSPolarizationState* defaultPolarisation;
75};
76
77#endif
Process information at the event level.
Polarization state to pass to processes.
Action to decide whether or not to store trajectory information.
virtual void PreUserTrackingAction(const G4Track *track)
Used to decide whether or not to store trajectories.
virtual void PostUserTrackingAction(const G4Track *track)
Detect whether track is a primary and if so whether it ended in a collimator.
BDSTrackingAction()=delete
No default constructor required.
BDSEventAction * eventAction
Cache of trajectory options.
const BDS::TrajectoryOptions storeTrajectoryOptions
Cache of flag from global constants to control storing all trajectories.