BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSIMClass.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
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 BDSIMCLASS_H
20#define BDSIMCLASS_H
21
22class BDSBunch;
27class BDSOutput;
28class BDSParser;
29class BDSRunManager;
30class G4VModularPhysicsList;
31
32#include "G4String.hh"
33
50class BDSIM
51{
52public:
55 BDSIM();
56
60
62 int Initialise(int argc, char** argv, bool usualPrintOut=true);
63
65 BDSIM(int argc, char** argv, bool usualPrintOut=true);
66
68 ~BDSIM();
69
72 inline bool Initialised() const {return initialised;};
73
74 inline int InitialisationResult() const {return initialisationResult;}
75
79 void BeamOn(int nGenerate=-1);
80
83 void RegisterUserComponent(const G4String& componentTypeName,
84 BDSComponentConstructor* componentConstructor);
85
88 void GeneratePrimariesOnly(const BDSGlobalConstants* globals);
89
91 void RegisterUserPhysicsList(G4VModularPhysicsList* userPhysicsListIn) {userPhysicsList = userPhysicsListIn;}
92 G4VModularPhysicsList* UserPhysicsList() const {return userPhysicsList;}
93
94private:
96 int Initialise();
97
103 char** argvCache;
104
111 G4VModularPhysicsList* userPhysicsList;
114};
115
116#endif
The base class for bunch distribution generators.
Definition BDSBunch.hh:47
Interface class the developer should derive to construct their element.
Factory for user specified accelerator components.
Class that constructs a Geant4 model of an accelerator.
A class that holds global options and constants.
Interface class to use BDSIM.
Definition BDSIMClass.hh:51
BDSRunManager * runManager
Cache of main objects in BDSIM.
BDSOutput * bdsOutput
Cache of main objects in BDSIM.
bool Initialised() const
Definition BDSIMClass.hh:72
G4VModularPhysicsList * UserPhysicsList() const
Access user physics list.
Definition BDSIMClass.hh:92
void RegisterUserComponent(const G4String &componentTypeName, BDSComponentConstructor *componentConstructor)
void BeamOn(int nGenerate=-1)
int Initialise()
The main function where everything is constructed.
~BDSIM()
The destructor opens the geometry in Geant4 and deletes everything.
BDSComponentFactoryUser * userComponentFactory
Optional user registered component factory.
BDSBunch * bdsBunch
Cache of main objects in BDSIM.
bool ignoreSIGINT
For cmake testing.
Definition BDSIMClass.hh:98
void GeneratePrimariesOnly(const BDSGlobalConstants *globals)
BDSDetectorConstruction * realWorld
Cache of main objects in BDSIM.
int initialisationResult
Possible to not finish initialisation but have completed ok - flag for this.
G4VModularPhysicsList * userPhysicsList
Optional user registered physics list.
int argcCache
Cache of argc.
void RegisterUserPhysicsList(G4VModularPhysicsList *userPhysicsListIn)
Provide a physics list that will be used inplace of the BDSIM generate one.
Definition BDSIMClass.hh:91
char ** argvCache
Cache of argv.
bool usualPrintOut
Whether to allow the usual cout output.
Definition BDSIMClass.hh:99
BDSParser * parser
Cache of main objects in BDSIM.
bool initialised
Whether initialisation was completed safely.
Output base class that defines interface for all output types.
Definition BDSOutput.hh:73
Const entry to parser objects.
Definition BDSParser.hh:37
Wrapper from G4RunManager that provides more output.