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) 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 BDSIMCLASS_H
19#define BDSIMCLASS_H
20
21class BDSBunch;
26class BDSOutput;
27class BDSParser;
28class BDSRunManager;
29class G4VModularPhysicsList;
30
31#include "G4String.hh"
32
49class BDSIM
50{
51public:
54 BDSIM();
55
59
61 int Initialise(int argc, char** argv, bool usualPrintOut=true);
62
64 BDSIM(int argc, char** argv, bool usualPrintOut=true);
65
67 ~BDSIM();
68
71 inline bool Initialised() const {return initialised;};
72
73 inline int InitialisationResult() const {return initialisationResult;}
74
78 void BeamOn(int nGenerate=-1);
79
82 void RegisterUserComponent(const G4String& componentTypeName,
83 BDSComponentConstructor* componentConstructor);
84
87 void GeneratePrimariesOnly(const BDSGlobalConstants* globals);
88
90 void RegisterUserPhysicsList(G4VModularPhysicsList* userPhysicsListIn) {userPhysicsList = userPhysicsListIn;}
91 G4VModularPhysicsList* UserPhysicsList() const {return userPhysicsList;}
92
93private:
95 int Initialise();
96
102 char** argvCache;
103
110 G4VModularPhysicsList* userPhysicsList;
113};
114
115#endif
The base class for bunch distribution generators.
Definition BDSBunch.hh:46
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:50
BDSRunManager * runManager
Cache of main objects in BDSIM.
BDSOutput * bdsOutput
Cache of main objects in BDSIM.
bool Initialised() const
Definition BDSIMClass.hh:71
G4VModularPhysicsList * UserPhysicsList() const
Access user physics list.
Definition BDSIMClass.hh:91
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:97
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:90
char ** argvCache
Cache of argv.
bool usualPrintOut
Whether to allow the usual cout output.
Definition BDSIMClass.hh:98
BDSParser * parser
Cache of main objects in BDSIM.
bool initialised
Whether initialisation was completed safely.
Definition BDSIMClass.hh:99
Output base class that defines interface for all output types.
Definition BDSOutput.hh:72
Const entry to parser objects.
Definition BDSParser.hh:36
Wrapper from G4RunManager that provides more output.