21#include "BDSHitSamplerLink.hh"
22#include "BDSLinkRunAction.hh"
39class G4VModularPhysicsList;
41#include "parser/element.h"
42#include "parser/elementtype.h"
71 double minimumKineticEnergy = 0,
72 bool protonsAndIonsOnly =
false);
89 void BeamOn(
int nGenerate=-1);
91 void SelectLinkElement(
const std::string& elementName,
bool debug =
false);
92 void SelectLinkElement(
int index,
bool debug =
false);
96 const std::string& materialName,
98 double halfApertureLeft,
99 double halfApertureRight,
103 double jawTiltLeft = 0.0,
104 double jawTiltRight = 0.0,
105 bool buildLeftJaw =
true,
106 bool buildRightJaw =
true,
107 bool isACrystal =
false,
108 double crystalAngle = 0,
109 bool sampleIn =
false);
112 const std::string& materialName,
113 const std::string& tipMaterialName,
116 double halfApertureLeft,
117 double halfApertureRight,
121 double jawTiltLeft = 0.0,
122 double jawTiltRight = 0.0,
123 bool buildLeftJaw =
true,
124 bool buildRightJaw =
true);
129 void ClearSamplerHits() {
runAction->ClearSamplerHits();}
131 int GetCurrentMaximumSixTrackParticleID()
const;
132 void SetCurrentMaximumExternalParticleID(
int currentMaximumExternalParticleID);
134 inline G4int NSecondariesToReturn()
const {
return runAction ?
runAction->NSecondariesToReturn() : 0;}
135 inline G4int NPrimariesToReturn()
const {
return runAction ?
runAction->NPrimariesToReturn() : 0;}
156 int Initialise(
double minimumKineticEnergy = 0,
157 bool protonsAndIonsOnly =
false);
176 std::vector<BDSParticleExternal*> externalParticles;
177 std::map<std::string, int> nameToElementIndex;
178 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.
int Initialise(int argc, char **argv, bool usualPrintOut=true, double minimumKineticEnergy=0, bool protonsAndIonsOnly=false)
Initialise everything given these arguments. The minimumKinetic energy should be in GeV.
G4RunManager * runManager
Cache of main object in BDSIM.
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 AddLinkElement(GMAD::Element &el)
int currentElementIndex
Element to track in.
bool internalBdsBunch
Cache of main object in BDSIM.
double GetChordLengthOfLinkElement(int beamlineIndex) const
Access the length of a component. If bad name or ID given, -1 will be returned.
int AddLinkCollimatorTipJaw(const std::string &collimatorName, const std::string &materialName, const std::string &tipMaterialName, double tipThickness, 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)
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.