BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSRunAction.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 BDSRUNACTION_H
19#define BDSRUNACTION_H
20
21#include "globals.hh" // geant4 types / globals
22#include "G4UserRunAction.hh"
23
24#include <chrono>
25#include <ctime>
26#include <string>
27
28class BDSBunch;
29class BDSEventAction;
30class BDSEventInfo;
31class BDSOutput;
32class G4Run;
33
42class BDSRunAction: public G4UserRunAction
43{
44public:
45 BDSRunAction(BDSOutput* outputIn,
46 BDSBunch* bunchGeneratorIn,
47 G4bool usingIonsIn,
48 BDSEventAction* eventActionIn,
49 const G4String& trajectorySamplerIDIn);
50 virtual ~BDSRunAction();
51
52 virtual void BeginOfRunAction(const G4Run*);
53 virtual void EndOfRunAction(const G4Run*);
54
55private:
56 BDSRunAction() = delete;
57
61
66 void SetTrajectorySamplerIDs() const;
67
70 void CheckTrajectoryOptions() const;
71
73 time_t starttime;
74 std::string seedStateAtStart;
75 BDSEventInfo* info;
77 const G4bool usingIons;
78 std::clock_t cpuStartTime;
81 unsigned long long int nEventsRequested;
82};
83
84#endif
85
The base class for bunch distribution generators.
Definition BDSBunch.hh:46
Process information at the event level.
Interface to store event information use G4 hooks.
Output base class that defines interface for all output types.
Definition BDSOutput.hh:72
Control over the beginning and end of run actions.
void SetTrajectorySamplerIDs() const
BDSBunch * bunchGenerator
Cache of bunch generator.
std::clock_t cpuStartTime
Start time of run.
BDSEventAction * eventAction
Event action for updating information at start of run.
G4String trajectorySamplerID
Copy of option.
std::string seedStateAtStart
Seed state at start of the run.
void CheckTrajectoryOptions() const
void PrintAllProcessesForAllParticles() const
const G4bool usingIons
Cache of whether ions are being used (for particle table writing out).
BDSOutput * output
Cache of output instance. Not owned by this class.
unsigned long long int nEventsRequested
Cache of ngenerate.