BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSRunAction.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSRUNACTION_H
20#define BDSRUNACTION_H
21
22#include "globals.hh" // geant4 types / globals
23#include "G4UserRunAction.hh"
24
25#include <chrono>
26#include <ctime>
27#include <string>
28
29class BDSBunch;
30class BDSEventAction;
31class BDSEventInfo;
32class BDSOutput;
33class G4Run;
34
43class BDSRunAction: public G4UserRunAction
44{
45public:
46 BDSRunAction(BDSOutput* outputIn,
47 BDSBunch* bunchGeneratorIn,
48 G4bool usingIonsIn,
49 BDSEventAction* eventActionIn,
50 G4String trajectorySamplerIDIn);
51 virtual ~BDSRunAction();
52
53 virtual void BeginOfRunAction(const G4Run*);
54 virtual void EndOfRunAction(const G4Run*);
55
56private:
57 BDSRunAction() = delete;
58
62
67 void SetTrajectorySamplerIDs() const;
68
71 void CheckTrajectoryOptions() const;
72
74 time_t starttime;
75 std::string seedStateAtStart;
76 BDSEventInfo* info;
78 const G4bool usingIons;
79 std::clock_t cpuStartTime;
82};
83
84#endif
85
The base class for bunch distribution generators.
Definition: BDSBunch.hh:47
Process information at the event level.
Interface to store event information use G4 hooks.
Definition: BDSEventInfo.hh:42
Output base class that defines interface for all output types.
Definition: BDSOutput.hh:73
Control over the beginning and end of run actions.
Definition: BDSRunAction.hh:44
void SetTrajectorySamplerIDs() const
BDSBunch * bunchGenerator
Cache of bunch generator.
Definition: BDSRunAction.hh:77
std::clock_t cpuStartTime
Start time of run.
Definition: BDSRunAction.hh:79
BDSEventAction * eventAction
Event action for updating information at start of run.
Definition: BDSRunAction.hh:80
G4String trajectorySamplerID
Copy of option.
Definition: BDSRunAction.hh:81
std::string seedStateAtStart
Seed state at start of the run.
Definition: BDSRunAction.hh:75
void CheckTrajectoryOptions() const
void PrintAllProcessesForAllParticles() const
const G4bool usingIons
Cache of whether ions are being used (for particle table writing out).
Definition: BDSRunAction.hh:78
BDSOutput * output
Cache of output instance. Not owned by this class.
Definition: BDSRunAction.hh:73