BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSIMClass.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 BDSIMCLASS_H
20#define BDSIMCLASS_H
21
22class BDSBunch;
26class BDSOutput;
27class BDSParser;
28class BDSRunManager;
29class G4VModularPhysicsList;
30
31#include "G4String.hh"
32
49class BDSIM
50{
51public:
54 BDSIM();
55
57 int Initialise(int argc, char** argv, bool usualPrintOut=true);
58
60 BDSIM(int argc, char** argv, bool usualPrintOut=true);
61
63 ~BDSIM();
64
67 inline bool Initialised() const {return initialised;};
68
69 inline int InitialisationResult() const {return initialisationResult;}
70
74 void BeamOn(int nGenerate=-1);
75
78 void RegisterUserComponent(const G4String& componentTypeName,
79 BDSComponentConstructor* componentConstructor);
80
82 void RegisterUserPhysicsList(G4VModularPhysicsList* userPhysicsListIn) {userPhysicsList = userPhysicsListIn;}
83 G4VModularPhysicsList* UserPhysicsList() const {return userPhysicsList;}
84
85private:
87 int Initialise();
88
94 char** argvCache;
95
102 G4VModularPhysicsList* userPhysicsList;
105};
106
107#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.
Interface class to use BDSIM.
Definition: BDSIMClass.hh:50
BDSRunManager * runManager
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:100
BDSOutput * bdsOutput
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:98
bool Initialised() const
Definition: BDSIMClass.hh:67
G4VModularPhysicsList * UserPhysicsList() const
Access user physics list.
Definition: BDSIMClass.hh:83
void RegisterUserComponent(const G4String &componentTypeName, BDSComponentConstructor *componentConstructor)
Definition: BDSIMClass.cc:514
void BeamOn(int nGenerate=-1)
Definition: BDSIMClass.cc:428
BDSIM()
Definition: BDSIMClass.cc:83
int Initialise()
The main function where everything is constructed.
Definition: BDSIMClass.cc:126
~BDSIM()
The destructor opens the geometry in Geant4 and deletes everything.
Definition: BDSIMClass.cc:471
BDSComponentFactoryUser * userComponentFactory
Optional user registered component factory.
Definition: BDSIMClass.hh:101
BDSBunch * bdsBunch
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:99
bool ignoreSIGINT
For cmake testing.
Definition: BDSIMClass.hh:89
BDSDetectorConstruction * realWorld
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:103
int initialisationResult
Possible to not finish initialisation but have completed ok - flag for this.
Definition: BDSIMClass.hh:92
G4VModularPhysicsList * userPhysicsList
Optional user registered physics list.
Definition: BDSIMClass.hh:102
int argcCache
Cache of argc.
Definition: BDSIMClass.hh:93
void RegisterUserPhysicsList(G4VModularPhysicsList *userPhysicsListIn)
Provide a physics list that will be used inplace of the BDSIM generate one.
Definition: BDSIMClass.hh:82
char ** argvCache
Cache of argv.
Definition: BDSIMClass.hh:94
bool usualPrintOut
Whether to allow the usual cout output.
Definition: BDSIMClass.hh:90
BDSParser * parser
Cache of main objects in BDSIM.
Definition: BDSIMClass.hh:97
bool initialised
Whether initialisation was completed safely.
Definition: BDSIMClass.hh:91
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.