21#include "BDSHitSamplerLink.hh"
22#include "BDSLinkRunAction.hh"
39class G4VModularPhysicsList;
68 double minimumKineticEnergy = 0,
69 bool protonsAndIonsOnly =
true);
86 void BeamOn(
int nGenerate=-1);
88 void SelectLinkElement(
const std::string& elementName,
bool debug =
false);
89 void SelectLinkElement(
int index,
bool debug =
false);
93 const std::string& materialName,
95 double halfApertureLeft,
96 double halfApertureRight,
100 double jawTiltLeft = 0.0,
101 double jawTiltRight = 0.0,
102 bool buildLeftJaw =
true,
103 bool buildRightJaw =
true,
104 bool isACrystal =
false,
105 double crystalAngle = 0,
106 bool sampleIn =
false);
109 void ClearSamplerHits() {
runAction->ClearSamplerHits();}
111 int GetCurrentMaximumSixTrackParticleID()
const;
112 void SetCurrentMaximumExternalParticleID(
int currentMaximumExternalParticleID);
114 inline G4int NSecondariesToReturn()
const {
return runAction ?
runAction->NSecondariesToReturn() : 0;}
115 inline G4int NPrimariesToReturn()
const {
return runAction ?
runAction->NPrimariesToReturn() : 0;}
134 int Initialise(
double minimumKineticEnergy = 0,
135 bool protonsAndIonsOnly =
true);
153 std::vector<BDSParticleExternal*> externalParticles;
154 std::map<std::string, int> nameToElementIndex;
155 std::map<int, int> linkIDToBeamlineIndex;
The base class for bunch distribution generators.
Interface class the developer should derive to construct their element.
Factory for user specified accelerator components.
Interface class to use BDSIM with trackers.
G4VModularPhysicsList * UserPhysicsList() const
Access user physics list.
G4VModularPhysicsList * userPhysicsList
Optional user registered physics list.
bool initialised
Whether initialisation was completed safely.
int AddLinkCollimatorJaw(const std::string &collimatorName, const std::string &materialName, double length, double halfApertureLeft, double halfApertureRight, double rotation, double xOffset, double yOffset, double jawTiltLeft=0.0, double jawTiltRight=0.0, bool buildLeftJaw=true, bool buildRightJaw=true, bool isACrystal=false, double crystalAngle=0, bool sampleIn=false)
Use standard C++ types as expected to be used externally.
int initialisationResult
Possible to not finish initialisation but have completed ok - flag for this.
void RegisterUserPhysicsList(G4VModularPhysicsList *userPhysicsListIn)
Provide a physics list that will be used inplace of the BDSIM generate one.
int GetLinkIndex(const std::string &elementName) const
Get the internal index of a component by name.
BDSLinkRunAction * runAction
Cache of main object in BDSIM.
G4RunManager * runManager
Cache of main object in BDSIM.
int Initialise(int argc, char **argv, bool usualPrintOut=true, double minimumKineticEnergy=0, bool protonsAndIonsOnly=true)
Initialise everything given these arguments. The minimumKinetic energy should be in GeV.
BDSLinkDetectorConstruction * construction
Cache of main object in BDSIM.
int argcCache
Cache of argc.
BDSBunch * bdsBunch
Cache of main object in BDSIM.
BDSParser * parser
Cache of main object in BDSIM.
char ** argvCache
Cache of argv.
~BDSIMLink()
The destructor opens the geometry in Geant4 and deletes everything.
BDSOutput * bdsOutput
Cache of main object in BDSIM.
bool ignoreSIGINT
For cmake testing.
bool usualPrintOut
Whether to allow the usual cout output.
double GetArcLengthOfLinkElement(int beamlineIndex) const
Access the length of a component. If bad name or ID given, -1 will be returned.
int currentElementIndex
Element to track in.
double GetChordLengthOfLinkElement(int beamlineIndex) const
Access the length of a component. If bad name or ID given, -1 will be returned.
void BeamOn(int nGenerate=-1)
A BDSAcceleratorComponent wrapper for BDSLinkOpaqueBox.
Construction of the geometry in the case of a link model.
Simplified run action to hold link hits.
Output base class that defines interface for all output types.
Const entry to parser objects.
A set of particle coordinates including energy and weight.
Wrapper for particle definition.
A set of particle coordinates from an external interface.