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 - 2023.
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
58 int Initialise(int argc, char** argv, bool usualPrintOut=true);
59
61 BDSIM(int argc, char** argv, bool usualPrintOut=true);
62
64 ~BDSIM();
65
68 inline bool Initialised() const {return initialised;};
69
70 inline int InitialisationResult() const {return initialisationResult;}
71
75 void BeamOn(int nGenerate=-1);
76
79 void RegisterUserComponent(const G4String& componentTypeName,
80 BDSComponentConstructor* componentConstructor);
81
84 void GeneratePrimariesOnly(const BDSGlobalConstants* globals);
85
87 void RegisterUserPhysicsList(G4VModularPhysicsList* userPhysicsListIn) {userPhysicsList = userPhysicsListIn;}
88 G4VModularPhysicsList* UserPhysicsList() const {return userPhysicsList;}
89
90private:
92 int Initialise();
93
99 char** argvCache;
100
107 G4VModularPhysicsList* userPhysicsList;
110};
111
112#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.
Definition: BDSIMClass.hh:105
BDSOutput * bdsOutput
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:103
bool Initialised() const
Definition: BDSIMClass.hh:68
G4VModularPhysicsList * UserPhysicsList() const
Access user physics list.
Definition: BDSIMClass.hh:88
void RegisterUserComponent(const G4String &componentTypeName, BDSComponentConstructor *componentConstructor)
Definition: BDSIMClass.cc:455
void BeamOn(int nGenerate=-1)
Definition: BDSIMClass.cc:369
BDSIM()
Definition: BDSIMClass.cc:82
int Initialise()
The main function where everything is constructed.
Definition: BDSIMClass.cc:125
~BDSIM()
The destructor opens the geometry in Geant4 and deletes everything.
Definition: BDSIMClass.cc:412
BDSComponentFactoryUser * userComponentFactory
Optional user registered component factory.
Definition: BDSIMClass.hh:106
BDSBunch * bdsBunch
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:104
bool ignoreSIGINT
For cmake testing.
Definition: BDSIMClass.hh:94
void GeneratePrimariesOnly(const BDSGlobalConstants *globals)
Definition: BDSIMClass.cc:467
BDSDetectorConstruction * realWorld
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:108
int initialisationResult
Possible to not finish initialisation but have completed ok - flag for this.
Definition: BDSIMClass.hh:97
G4VModularPhysicsList * userPhysicsList
Optional user registered physics list.
Definition: BDSIMClass.hh:107
int argcCache
Cache of argc.
Definition: BDSIMClass.hh:98
void RegisterUserPhysicsList(G4VModularPhysicsList *userPhysicsListIn)
Provide a physics list that will be used inplace of the BDSIM generate one.
Definition: BDSIMClass.hh:87
char ** argvCache
Cache of argv.
Definition: BDSIMClass.hh:99
bool usualPrintOut
Whether to allow the usual cout output.
Definition: BDSIMClass.hh:95
BDSParser * parser
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:102
bool initialised
Whether initialisation was completed safely.
Definition: BDSIMClass.hh:96
Output base class that defines interface for all output types.
Definition: BDSOutput.hh:73
Const entry to parser objects.
Definition: BDSParser.hh:36
Wrapper from G4RunManager that provides more output.