BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Data Structures | Enumerations | Functions | Variables
BDS Namespace Reference

Return either G4Tubs or G4CutTubs depending on flat face. More...

Data Structures

struct  ActionAngleCoord
 Simple struct for storing action/angle pairs to aid readability. Implementation detail. More...
 
class  EllipsePointGenerator
 Class for generating points uniformly on ellipse perimeters via interpolation. Part of implementation. More...
 
struct  FourPoints
 
struct  non_alpha
 Logical not for isalpha UnaryPredicate as needed for string manipulations. More...
 
struct  PhaseSpaceCoord
 Simple struct for storing position/momentum pairs to aid readability. Implementation detail. More...
 
struct  TrajectoryOptions
 
struct  TwissPair
 Simple struct for storing Twiss alpha/beta pairs to aid readability. Implementation detail. More...
 

Enumerations

enum class  StringStripType { leading , trailing , both }
 

Functions

PhaseSpaceCoord PhaseSpaceCoordFromActionAngle (ActionAngleCoord aa, const TwissPair &tp)
 
BDSExtent MaximumCombinedExtent (const BDSExtent &first, const BDSExtent &second)
 Returns the extent which is the greatest extent in all six directions. More...
 
BDSTrajectoryFilter BDSTrajectoryFilterEnumOfIndex (int i)
 
std::vector< G4TwoVector > * LoadAperturePoints (const G4String &fileName, const G4String &unit="")
 
BDSApertureType DetermineApertureType (G4String apertureType)
 function that gives corresponding enum value for string (case-insensitive) More...
 
G4VSolid * AppropriateTubs (const G4String &name, G4double innerRadius, G4double outerRadius, G4double halfLength, G4double startAngle, G4double sweepAngle, const G4ThreeVector &inputFaceNormal, const G4ThreeVector &outputFaceNormal, G4bool flatFaces)
 
BDSArrayReflectionType DetermineArrayReflectionType (G4String arrayReflectionType)
 Function that gives corresponding enum value for string (case-insensitive) More...
 
BDSArrayReflectionTypeSet DetermineArrayReflectionTypeSet (const G4String &arrayReflectionType)
 Return a std::set of reflection types. Split string on white space. More...
 
G4bool ProblemWithArrayReflectionCombination (const BDSArrayReflectionTypeSet &setIn, G4String *details=nullptr)
 Return true if there's a conceptual conflict with the set of field reflections requested. More...
 
BDSBeamlineBuildBLMs (const std::vector< GMAD::BLMPlacement > &blmPlacements, const BDSBeamline *parentBeamLine)
 
BDSBeamlineBuildEndPieceBeamline (const BDSBeamline *beamline, const G4bool circularMachine)
 
BDSBeamlineBuildPlacementGeometry (const std::vector< GMAD::Placement > &placements, const BDSBeamline *parentBeamLine, BDSComponentFactory *componentFactory)
 
BDSBeamPipeType DetermineBeamPipeType (G4String apertureType)
 Function that gives corresponding enum value for string (case-insensitive). More...
 
BDSAcceleratorComponentBuildSBendLine (const G4String &elementName, const GMAD::Element *element, BDSMagnetStrength *st, G4double brho, const BDSIntegratorSet *integratorSet, G4double incomingFaceAngle, G4double outgoingFaceAngle, G4bool buildFringeFields, const GMAD::Element *prevElement, const GMAD::Element *nextElement)
 
BDSLineBuildRBendLine (const G4String &elementName, const GMAD::Element *element, const GMAD::Element *prevElement, const GMAD::Element *nextElement, G4double brho, BDSMagnetStrength *st, const BDSIntegratorSet *integratorSet, G4double incomingFaceAngle, G4double outgoingFaceAngle, G4bool buildFringeFields)
 
G4int CalculateNSBendSegments (G4double length, G4double angle, G4double incomingFaceAngle=0, G4double outgoingFaceAngle=0, G4double aperturePrecision=1.0)
 
BDSMagnetBuildDipoleFringe (const GMAD::Element *element, G4double angleIn, G4double angleOut, const G4String &name, BDSMagnetStrength *st, G4double brho, const BDSIntegratorSet *integratorSet, BDSFieldType dipoleFieldType)
 
BDSMagnetBuildSingleSBend (const GMAD::Element *element, const G4String &name, G4double arcLength, G4double angle, G4double angleIn, G4double angleOut, const BDSMagnetStrength *strength, G4double brho, const BDSIntegratorSet *integratorSet, G4bool yokeOnLeft, const BDSFieldInfo *outerFieldIn)
 Function to return a single sector bend section. More...
 
void UpdateSegmentAngles (G4int index, G4int nSBends, G4double semiAngle, G4double incomingFaceAngle, G4double outgoingFaceAngle, G4double &segmentAngleIn, G4double &segmentAngleOut)
 
BDSMagnetStrengthGetFringeMagnetStrength (const GMAD::Element *element, const BDSMagnetStrength *st, G4double fringeAngle, G4double e1, G4double e2, G4double fintx, G4bool entranceOrExit)
 
BDSIntegratorType GetDipoleIntegratorType (const BDSIntegratorSet *integratorSet, const GMAD::Element *element)
 
G4bool ZeroStrengthDipole (const BDSMagnetStrength *st)
 Return whether finite angle or field for a dipole. More...
 
BDSBLMType DetermineBLMType (G4String blmType)
 function that gives corresponding enum value for string (case-insensitive) More...
 
template<typename T >
std::vector< G4double > CumulativeDistances (T pairs)
 
BDSBunchType DetermineBunchType (G4String distrType)
 Function that gives corresponding enum value for string (case-insensitive). More...
 
BDSCavityType DetermineCavityType (G4String cavityType)
 function to determine the enum type of the cavity geometry (case-insensitive) More...
 
BDSCrystalType DetermineCrystalType (G4String crystalType)
 function to determine the enum type of the cavity geometry (case-insensitive) More...
 
BDSDimensionType DetermineDimensionType (G4String dimensionType)
 Determine the output format to be used from the input string. More...
 
BDSEventGeneratorFileType DetermineEventGeneratorFileType (G4String distrType)
 Function that gives corresponding enum value for string (case-insensitive). More...
 
BDSFieldClassType DetermineFieldClassType (BDSFieldType fieldType)
 Function that gives the corresponding enum value for a field type enum. More...
 
BDSFieldFormat DetermineFieldFormat (G4String fieldformat)
 Function that gives corresponding enum value for string (case-insensitive) More...
 
G4int NDimensionsOfFieldFormat (const BDSFieldFormat &ff)
 Report the number of dimensions for that format. More...
 
std::vector< BDSFourVector< G4double > > LoadFieldQueryPoints (const G4String &fileName, std::vector< G4String > *columnNamesIn)
 
BDSFieldType DetermineFieldType (G4String fieldType)
 Function that gives corresponding enum value for string (case-insensitive) More...
 
G4String PreprocessGDML (const G4String &file, const G4String &prefix, G4bool preprocessSchema=true)
 
G4String PreprocessGDMLSchemaOnly (const G4String &file)
 
G4String GDMLSchemaLocation ()
 Get GDML Schema location included with BDSIM. More...
 
std::pair< BDSExtent, BDSExtentDetermineExtents (const G4VSolid *solid)
 
std::pair< BDSExtent, BDSExtentInspectDisplacedSolid (const G4VSolid *solidIn)
 Inspect a G4DisplacedSolid. More...
 
std::pair< BDSExtent, BDSExtentInspectSubtractionSolid (const G4VSolid *solidIn)
 
std::pair< BDSExtent, BDSExtentInspectIntersectionSolid (const G4VSolid *solidIn)
 Inspect a G4IntersectionSolid. More...
 
std::pair< BDSExtent, BDSExtentInspectUnionSolid (const G4VSolid *solidIn)
 Inspect a G4UnionSolid. More...
 
std::pair< BDSExtent, BDSExtentInspectBox (const G4VSolid *solidIn)
 Inspect a G4Box. More...
 
std::pair< BDSExtent, BDSExtentInspectTubs (const G4VSolid *solidIn)
 Inspect a G4Tubs. More...
 
std::pair< BDSExtent, BDSExtentInspectCutTubs (const G4VSolid *solidIn)
 Inspect a G4CutTubs. More...
 
std::pair< BDSExtent, BDSExtentInspectEllipticalTube (const G4VSolid *solidIn)
 Inspect a G4EllipticalTube. More...
 
BDSGeometryType DetermineGeometryType (G4String geometryType)
 function that gives corresponding enum value for string (case-insensitive) More...
 
G4double FringeFieldCorrection (BDSMagnetStrength const *strength, G4bool entranceOrExit)
 Function to calculate the value of the fringe field correction term. More...
 
G4double SecondFringeFieldCorrection (BDSMagnetStrength const *strength, G4bool entranceOrExit)
 Function to calculate the value of the second fringe field correction term. More...
 
BDSIntegratorSetType DetermineIntegratorSetType (G4String integratorSet)
 Function that gives corresponding enum value for string (case-insensitive) More...
 
BDSIntegratorType DetermineIntegratorType (G4String integratorType)
 Function that determines enum from string (case-insensitive). More...
 
template<class T >
mag (const T &v)
 
template<template< class > class BDSFieldValue, class V >
mag (const BDSFieldValue< V > &v)
 Specialisation for a 3-vector field value. More...
 
template<class T >
Linear1D (const T p[2], G4double x)
 
template<class T >
Linear2D (const T p[2][2], G4double x, G4double y)
 Linear interpolation in 2 dimensions. More...
 
template<class T >
Linear3D (const T p[2][2][2], G4double x, G4double y, G4double z)
 Linear interpolation in 3 dimensions. More...
 
template<class T >
Linear4D (const T p[2][2][2][2], G4double x, G4double y, G4double z, G4double t)
 Linear interpolation in 4 dimensions. More...
 
template<class T >
Cubic1D (const T p[4], G4double x)
 
template<class T >
Cubic2D (const T p[4][4], G4double x, G4double y)
 Cubic interpolation in 2 dimensions. More...
 
template<class T >
Cubic3D (const T p[4][4][4], G4double x, G4double y, G4double z)
 Cubic interpolation in 3 dimensions. More...
 
template<class T >
Cubic4D (const T p[4][4][4][4], G4double x, G4double y, G4double z, G4double t)
 Cubic interpolation in 4 dimensions. More...
 
template<class T >
double Linear1DMagOnly (const T p[2], G4double x)
 Linear interpolation of the magnitude in 1 dimension. More...
 
template<class T >
double Linear2DMagOnly (const T p[2][2], G4double x, G4double y)
 Linear interpolation of the magnitude in 2 dimensions. More...
 
template<class T >
double Linear3DMagOnly (const T p[2][2][2], G4double x, G4double y, G4double z)
 Linear interpolation of the magnitude in 3 dimensions. More...
 
template<class T >
double Linear4DMagOnly (const T p[2][2][2][2], G4double x, G4double y, G4double z, G4double t)
 Linear interpolation of the magnitude in 4 dimensions. More...
 
template<class T >
Linear1DMag (const T p[2], G4double x)
 Linear interpolation in 1 dimension including magnitude interpolation. More...
 
template<class T >
Linear2DMag (const T p[2][2], G4double x, G4double y)
 Linear interpolation in 2 dimensions including magnitude interpolation. More...
 
template<class T >
Linear3DMag (const T p[2][2][2], G4double x, G4double y, G4double z)
 Linear interpolation in 3 dimensions including magnitude interpolation. More...
 
template<class T >
Linear4DMag (const T p[2][2][2][2], G4double x, G4double y, G4double z, G4double t)
 Linear interpolation in 4 dimensions including magnitude interpolation. More...
 
BDSInterpolatorType DetermineInterpolatorType (G4String interpolatorType)
 Function that determines enum from string (case-insensitive). More...
 
G4int NDimensionsOfInterpolatorType (const BDSInterpolatorType &it)
 Report the number of dimensions for that interpolator type. More...
 
G4bool InterpolatorTypeIsAuto (BDSInterpolatorType typeIn)
 Return true if the type is one containing 'auto'. More...
 
BDSInterpolatorType InterpolatorTypeSpecificFromAuto (G4int nDimension, BDSInterpolatorType autoType)
 
BDSMagnetGeometryType DetermineMagnetGeometryType (G4String geometryType)
 function to determine the enum type of the magnet geometry (case-insensitive) More...
 
BDSOutputType DetermineOutputType (G4String outputType)
 Determine the output format to be used from the input string. More...
 
std::vector< BDSParallelWorldInfoNumberOfExtraWorldsRequired ()
 
std::vector< G4VUserParallelWorld * > ConstructAndRegisterParallelWorlds (G4VUserDetectorConstruction *massWorld, G4bool buildSamplerWorld, G4bool buildPlacementFieldsWorld)
 
std::vector< G4ParallelWorldPhysics * > ConstructParallelWorldPhysics (const std::vector< G4VUserParallelWorld * > &worlds)
 Construct the parallel physics process for each sampler world. More...
 
void RegisterSamplerPhysics (const std::vector< G4ParallelWorldPhysics * > &processes, G4VModularPhysicsList *physicsList)
 Register each parallel physics process to the main physics list. More...
 
void AddIStore (const std::vector< G4VUserParallelWorld * > &worlds)
 Get store, and prepare importance sampling for importance geometry sampler. More...
 
void RegisterImportanceBiasing (const std::vector< G4VUserParallelWorld * > &worlds, G4VModularPhysicsList *physicsList)
 Create importance geometry sampler and register importance biasing with physics list. More...
 
BDSParallelWorldImportanceGetImportanceSamplingWorld (const std::vector< G4VUserParallelWorld * > &worlds)
 Get importance sampling world from list of all parallel worlds. More...
 
G4bool IsIon (const G4ParticleDefinition *particle)
 Whether a particle is an ion. A proton is counted NOT as an ion. More...
 
G4bool IsIon (const G4DynamicParticle *paritlce)
 Calls IsIon above but also a proton with any bound electrons is considered an ion. More...
 
G4VModularPhysicsList * BuildPhysics (const G4String &physicsList, G4int verbosity=1)
 
G4int NBeamParametersSet (const GMAD::Beam &beamDefinition, const std::set< std::string > &keys)
 Count how many out of the set of keys in a beam instance are set. More...
 
void ConflictingParametersSet (const GMAD::Beam &beamDefinition, const std::set< std::string > &keys, G4int nSet, G4bool warnZeroParamsSet=true, const G4String &unitString="")
 Throw an exception if too few or too many parameters are set for the supplied keys. More...
 
void ConstructDesignAndBeamParticle (const GMAD::Beam &beamDefinition, G4double ffact, BDSParticleDefinition *&designParticle, BDSParticleDefinition *&beamParticle, G4bool &beamDifferentFromDesignParticle)
 
BDSParticleDefinitionConstructParticleDefinition (const G4String &particleNameIn, G4double totalEnergyIn, G4double kineticEnergyIn, G4double momentumIn, G4double ffact=1)
 
void ConstructBeamParticleG4 (const G4String &name)
 Ensure required beam particle has been constructed for Geant4 purposes. More...
 
void ConstructMinimumParticleSet ()
 
void ConstructExtendedParticleSet ()
 
void PrintPrimaryParticleProcesses (const G4String &primaryParticleName)
 
void PrintDefinedParticles ()
 
G4GenericBiasingPhysics * BuildAndAttachBiasWrapper (const GMAD::FastList< GMAD::PhysicsBiasing > &biases)
 
G4VModularPhysicsList * ChannellingPhysicsComplete (G4bool useEMD=false, G4bool regular=false, G4bool em4=false, G4bool emss=false)
 Build the physics required for channelling to work correctly. More...
 
void SetRangeCuts (G4VModularPhysicsList *physicsList, G4int verbosity=1)
 
void CheckAndSetEnergyValidityRange ()
 
void FixGeant105ThreshholdsForBeamParticle (const BDSParticleDefinition *particleDefinition)
 Apply FixGeant105ThreshholdsForParticle to the beam particle definition. More...
 
void FixGeant105ThreshholdsForParticle (const G4ParticleDefinition *particleDefinition)
 
void ChangeLooperParameters (const G4ParticleDefinition *particleDef)
 Taken from Geant4 field01 example. Set low values.
 
std::pair< G4Transportation *, G4CoupledTransportation * > FindTransportation (const G4ParticleDefinition *particleDef)
 Taken from Geant4 field01 example. Get the two possible transportation processes. More...
 
BDSSamplerType DetermineSamplerType (G4String samplerType)
 
BDSScorerType DetermineScorerType (G4String scorerType)
 function to determine the enum type of the cavity geometry (case-insensitive) More...
 
G4Transform3D CalculateTeleporterDelta (const BDSBeamline *beamline, G4double &teleporterLength)
 
BDSTunnelType DetermineTunnelType (G4String tunnelType)
 Function to determine the enum type of the tunnel (case-insensitive) More...
 
G4bool StrContains (const G4String &str, const G4String &test)
 Utility function to simplify lots of syntax changes for pedantic g4 changes. More...
 
G4int StrCompare (const G4String &str, const G4String &, G4String::caseCompare mode=G4String::ignoreCase)
 Utility function to simplify lots of syntax changes for pedantic g4 changes. More...
 
G4String LowerCase (const G4String &str)
 Utility function to simplify lots of syntax changes for pedantic g4 changes.
 
G4String StrStrip (const G4String &str, char ch, StringStripType stripType=StringStripType::both)
 Utility function to simplify lots of syntax changes for pedantic g4 changes. More...
 
G4String PrepareSafeName (G4String name)
 Remove white space and special characters in the name. More...
 
G4int CalculateOrientation (G4double angle)
 
std::pair< G4ThreeVector, G4ThreeVector > CalculateFaces (G4double angleInIn, G4double angleOutIn)
 Calculate input and output normal vector. More...
 
void EnsureInLimits (G4double &value, G4double lowerLimit, G4double upperLimit)
 
G4bool FileExists (const G4String &filename)
 Checks if filename exists. More...
 
G4bool DirectoryExists (const G4String &path)
 Check if directory exists. More...
 
std::string GetCurrentDir ()
 Get the current dir the program was executed from. More...
 
std::string GetBDSIMExecPath ()
 
G4String GetFullPath (G4String filename, bool excludeNameFromPath=false, bool useCWDForPrefix=false)
 
void SplitPathAndFileName (const G4String &filePath, G4String &path, G4String &filename)
 
void SplitFileAndExtension (const G4String &fileName, G4String &file, G4String &extension)
 Split a filename.ext into filename and extension. Extension includes '.'. More...
 
void HandleAborts (int signal_number)
 
G4bool IsFinite (G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())
 
G4bool IsFinite (const G4ThreeVector &variable, G4double tolerance=std::numeric_limits< double >::epsilon())
 Apply IsFinite to each component of a 3-vector. More...
 
G4bool NonZero (G4double value)
 Test whether a number is non-zero - ie abs(number) > minimum number. More...
 
G4bool IsFiniteStrength (G4double variable)
 
G4bool IsInteger (const char *s, int &convertedInteger)
 Check if character array is an integer, and returns the integer by reference. More...
 
G4bool IsNumber (const char *s, double &convertedNumber)
 Check if character array is an integer, and returns the double by reference. More...
 
template<typename T >
G4int Sign (T val)
 
G4String BoolToString (G4bool in)
 
void PrintRotationMatrix (G4RotationMatrix *rm, G4String keyName="unknown")
 
G4bool Geant4EnvironmentIsSet ()
 Check if the geant4 environmental variables necessary for a run are set. More...
 
void CheckHighPrecisionDataExists (const G4String &physicsListName)
 
void CheckLowEnergyNeutronDataExists (const G4String &phhysicsListName)
 
std::vector< G4String > SplitOnWhiteSpace (const G4String &input)
 Split a string on whitespace and return a vector of these 'words'. More...
 
G4TwoVector Rotate (const G4TwoVector &vec, const G4double &angle)
 Rotate a two vector in polar coordinates by an angle. More...
 
G4bool WillIntersect (const G4ThreeVector &incomingNormal, const G4ThreeVector &outgoingNormal, const G4double &zSeparation, const BDSExtent &incomingExtent, const BDSExtent &outgoingExtent)
 
G4bool WillIntersect (const G4double &angleIn, const G4double &angleOut, const G4double &horizontalWidth, const G4double &length)
 
G4double GetZOfPointOnPlane (const G4ThreeVector &normal, G4double x, G4double y)
 
G4ThreeVector RotateToReferenceFrame (G4ThreeVector faceNormal, G4double fullAngle)
 
std::pair< G4String, G4String > SplitOnColon (const G4String &formatAndPath)
 
G4UserLimits * CreateUserLimits (G4UserLimits *defaultUL, G4double length, G4double fraction=1.6)
 
G4double GetMemoryUsage ()
 Get the current memory usage. More...
 
std::map< G4String, G4String > GetUserParametersMap (const G4String &userParameters, char delimiter=':')
 Take one long string and split on space and then on colon. "key1:value1 key2:value2" etc. More...
 
template<typename K , typename V >
MapGetWithDefault (const std::map< K, V > &m, const K &key, const V &defaultValue)
 
G4int VerboseEventStop (G4int verboseEventStart, G4int verboseEventContinueFor)
 
G4bool VerboseThisEvent (G4int eventIndex, G4int eventStart, G4int eventStop)
 Logic of whether this event should be verbose or not. Code here so it's not duplicated. More...
 
G4double Rigidity (G4double momentumMagnitude, G4double charge)
 Calculate the rigidity for a total momentum and charge. More...
 
G4bool StartsWith (const std::string &expression, const std::string &prefix)
 Return true if a string "expression" starts with "prefix". More...
 
G4bool EndsWith (const std::string &expression, const std::string &suffix)
 Return true if a string "expression" ends with "suffix". More...
 
G4double CalculateSafeAngledVolumeLength (G4double angleIn, G4double angleOut, G4double length, G4double containerWidth, G4double containerHeight=0)
 Calculate safe length of an angled volume so it fills the length of its container. More...
 
G4double CalculateSafeAngledVolumeLength (G4ThreeVector inputfaceIn, G4ThreeVector outputfaceIn, G4double length, G4double containerWidth, G4double containerHeight=0)
 Overloaded method to process G4ThreeVectors instead of angles. More...
 
void Warning (const G4String &message)
 
void Warning (const G4String &methodName, const G4String &message)
 
template<typename A , typename B >
std::pair< B, A > flip_pair (const std::pair< A, B > &p)
 
template<typename A , typename B >
std::multimap< B, A > flip_map (const std::map< A, B > &src)
 
G4double ParseEnergyUnit (const G4String &fmt)
 
G4double ParseLengthUnit (const G4String &fmt)
 
G4double ParseAngleUnit (const G4String &fmt)
 
G4double ParseTimeUnit (const G4String &fmt)
 
const BDSIntegratorSetIntegratorSet (G4String set)
 Return the appropriate set of integrators to use for each magnet type. More...
 
const BDSIntegratorSetIntegratorSet (BDSIntegratorSetType set)
 Return the appropriate set of integrators to use for each magnet type. More...
 
G4double GetParameterValueDouble (G4String spec, G4String name)
 Get parameter value from the specification ('spec') string. More...
 
G4String GetParameterValueString (G4String spec, G4String name)
 Get parameter value from the specification ('spec') string. More...
 
G4int GetParameterValueInt (G4String spec, G4String name)
 Get parameter value from the specification ('spec') string. More...
 

Variables

const BDSIntegratorSetintegratorsBDSIMOne
 
const BDSIntegratorSetintegratorsBDSIMTwo
 
const BDSIntegratorSetintegratorsBDSIMMatrix
 Mad-x style tracking. More...
 
const BDSIntegratorSetintegratorsBDSIMMatrixFringeScaling
 
const BDSIntegratorSetintegratorsGeant4
 
const BDSIntegratorSetintegratorsGeant4DP
 
static const G4double cOverGeV = CLHEP::c_light / CLHEP::GeV
 speed of light / 1 GeV, used for scaling in brho calculation More...
 
static const int NTrajectoryFilters = 9
 

Detailed Description

Return either G4Tubs or G4CutTubs depending on flat face.

General warning that prints a message and hangs briefly.

Various utility functions that have no specific place - for example string manipulations, and checking.

Holder for trajectory storage options.

Utility function to always instantiate the right solid to avoid getting an exception from Geant4.

Author
Laurie Nevay
Laurie Nevay

Functions are part of the BDS namespace

Author
Laurie Nevay

Enumeration Type Documentation

◆ StringStripType

enum class BDS::StringStripType
strong

Because Geant4 is removing this we need to maintain it to have backwards compatibility, sadly polluting BDSIM.

Definition at line 69 of file BDSUtilities.hh.

Function Documentation

◆ AddIStore()

void BDS::AddIStore ( const std::vector< G4VUserParallelWorld * > &  worlds)

Get store, and prepare importance sampling for importance geometry sampler.

Definition at line 174 of file BDSParallelWorldUtilities.cc.

References BDSParallelWorldImportance::AddIStore(), and GetImportanceSamplingWorld().

Referenced by BDSIM::Initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppropriateTubs()

G4VSolid * BDS::AppropriateTubs ( const G4String &  name,
G4double  innerRadius,
G4double  outerRadius,
G4double  halfLength,
G4double  startAngle,
G4double  sweepAngle,
const G4ThreeVector &  inputFaceNormal,
const G4ThreeVector &  outputFaceNormal,
G4bool  flatFaces 
)

Definition at line 27 of file BDSAppropriateTubs.cc.

◆ BDSTrajectoryFilterEnumOfIndex()

BDSTrajectoryFilter BDS::BDSTrajectoryFilterEnumOfIndex ( int  i)

Definition at line 41 of file BDSTrajectoryFilter.cc.

◆ BoolToString()

G4String BDS::BoolToString ( G4bool  in)
inline

Definition at line 161 of file BDSUtilities.hh.

◆ BuildAndAttachBiasWrapper()

G4GenericBiasingPhysics * BDS::BuildAndAttachBiasWrapper ( const GMAD::FastList< GMAD::PhysicsBiasing > &  biases)

Definition at line 463 of file BDSPhysicsUtilities.cc.

◆ BuildBLMs()

BDSBeamline * BDS::BuildBLMs ( const std::vector< GMAD::BLMPlacement > &  blmPlacements,
const BDSBeamline parentBeamLine 
)

Construct a BDSBeamline instance of blms. The parent beam line is required for making placements w.r.t. it.

Here we're assuming the length is along z which may not be true, but close enough for this purpose as we rely only on the centre position.

Definition at line 56 of file BDSBeamlineBLMBuilder.cc.

References BDSBeamline::AddBeamlineElement(), BDSGeometryFactory::BuildGeometry(), BDSDetectorConstruction::CreatePlacementTransform(), BDSScorerFactory::CreateScorer(), BDSExtent::DZ(), BDSGeometryComponent::GetExtent(), BDSGeometryComponent::GetName(), BDSParser::GetScorers(), BDSAcceleratorComponent::Initialise(), BDSBLMRegistry::Instance(), BDSGeometryFactory::Instance(), BDSParser::Instance(), IsFinite(), BDSScorerInfo::name, BDSSDManager::RegisterPrimitiveScorerNames(), and SplitOnWhiteSpace().

Referenced by BDSDetectorConstruction::Construct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildDipoleFringe()

BDSMagnet * BDS::BuildDipoleFringe ( const GMAD::Element element,
G4double  angleIn,
G4double  angleOut,
const G4String &  name,
BDSMagnetStrength st,
G4double  brho,
const BDSIntegratorSet integratorSet,
BDSFieldType  dipoleFieldType 
)

Thin magnet for dipole fringe field. Is beampipe only, no outer magnet.

Definition at line 787 of file BDSBendBuilder.cc.

References BDSBeamPipeInfo::beamPipeType, BDSComponentFactory::CreateFieldTransform(), BDSComponentFactory::PrepareBeamPipeInfo(), and BDSComponentFactory::PrepareMagnetOuterInfo().

Referenced by BuildRBendLine(), and BuildSBendLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildEndPieceBeamline()

BDSBeamline * BDS::BuildEndPieceBeamline ( const BDSBeamline beamline,
const G4bool  circularMachine 
)

◆ BuildPhysics()

G4VModularPhysicsList * BDS::BuildPhysics ( const G4String &  physicsList,
G4int  verbosity = 1 
)

Detect whether we're using a Geant4 provided physics list or whether we'll use the BDSIM modular physics and construct it.

Definition at line 110 of file BDSPhysicsUtilities.cc.

References ChannellingPhysicsComplete(), CheckAndSetEnergyValidityRange(), ConstructMinimumParticleSet(), GetFullPath(), BDSGlobalConstants::Instance(), LowerCase(), SetRangeCuts(), and StrContains().

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildPlacementGeometry()

BDSBeamline * BDS::BuildPlacementGeometry ( const std::vector< GMAD::Placement > &  placements,
const BDSBeamline parentBeamLine,
BDSComponentFactory componentFactory 
)

Construct a BDSBeamline instance with all external geometry. The geometry is constructed using the geometry factory (and owned by it) but the beam line is necessary for extent calculation for the world. The parent beam line is required for making placements w.r.t. it.

Here we're assuming the length is along z which may not be true, but close enough for this purpose as we rely only on the centre position.

Definition at line 52 of file BDSBeamlinePlacementBuilder.cc.

References BDSBeamline::AddBeamlineElement(), BDSGeometryFactory::BuildGeometry(), BDSComponentFactory::CreateComponent(), BDSDetectorConstruction::CreatePlacementTransform(), BDSExtent::DZ(), BDSAcceleratorComponent::GetChordLength(), BDSGeometryComponent::GetContainerSolid(), BDSGeometryComponent::GetExtent(), BDSMaterials::GetMaterial(), BDSAcceleratorComponent::GetName(), BDSParser::GetPlacementElement(), BDSAcceleratorComponent::HasAField(), BDSAcceleratorComponent::Initialise(), BDSFieldFactory::Instance(), BDSGeometryFactory::Instance(), BDSGlobalConstants::Instance(), BDSMaterials::Instance(), BDSParser::Instance(), BDSFieldInfo::NameOfParserDefinition(), BDSAcceleratorModel::RegisterPlacementFieldPlacements(), BDSAcceleratorComponent::SetField(), and BDSAcceleratorComponent::SetFieldUsePlacementWorldTransform().

Referenced by BDSDetectorConstruction::Construct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildRBendLine()

BDSLine * BDS::BuildRBendLine ( const G4String &  elementName,
const GMAD::Element element,
const GMAD::Element prevElement,
const GMAD::Element nextElement,
G4double  brho,
BDSMagnetStrength st,
const BDSIntegratorSet integratorSet,
G4double  incomingFaceAngle,
G4double  outgoingFaceAngle,
G4bool  buildFringeFields 
)

◆ BuildSBendLine()

BDSAcceleratorComponent * BDS::BuildSBendLine ( const G4String &  elementName,
const GMAD::Element element,
BDSMagnetStrength st,
G4double  brho,
const BDSIntegratorSet integratorSet,
G4double  incomingFaceAngle,
G4double  outgoingFaceAngle,
G4bool  buildFringeFields,
const GMAD::Element prevElement,
const GMAD::Element nextElement 
)

This calculates and constructs a BDSLine* of BDSMagnet*. The bend is split into multiple wedges. If a small or zero poleface angle is specified, the end wedges will have faces angled as appropriate, the remaining wedges will re-use a single identical 'central' wedge several times. For a stronger angled poleface, the faces of each wedge fade in/out from the poleface to the cental wedge in the middle. Thin fringefield elements are placed at the beginning and end of the beamline if required.

Definition at line 52 of file BDSBendBuilder.cc.

References BDSLine::AddComponent(), BuildDipoleFringe(), BuildSingleSBend(), CalculateNSBendSegments(), BDSComponentFactory::CheckBendLengthAngleWidthCombo(), BDSComponentFactory::CreateFieldTransform(), GMAD::Element::e1, GMAD::Element::e2, GMAD::Element::fint, GMAD::Element::fintx, GetDipoleIntegratorType(), GMAD::Element::hgap, BDSGlobalConstants::Instance(), IsFinite(), BDSIntegratorSet::IsMatrixIntegratorSet(), GMAD::Element::l, BDSComponentFactory::PrepareBeamPipeInfo(), BDSComponentFactory::PrepareHorizontalWidth(), BDSComponentFactory::PrepareMagnetOuterFieldInfo(), BDSComponentFactory::PrepareMagnetOuterInfo(), GMAD::Element::type, BDSComponentFactory::YokeOnLeft(), and ZeroStrengthDipole().

Here is the call graph for this function:

◆ BuildSingleSBend()

BDSMagnet * BDS::BuildSingleSBend ( const GMAD::Element element,
const G4String &  name,
G4double  arcLength,
G4double  angle,
G4double  angleIn,
G4double  angleOut,
const BDSMagnetStrength strength,
G4double  brho,
const BDSIntegratorSet integratorSet,
G4bool  yokeOnLeft,
const BDSFieldInfo outerFieldIn 
)

Function to return a single sector bend section.

Definition at line 489 of file BDSBendBuilder.cc.

References BDSComponentFactory::CreateFieldTransform(), GetDipoleIntegratorType(), IsFinite(), BDSComponentFactory::PrepareBeamPipeInfo(), BDSComponentFactory::PrepareMagnetOuterInfo(), and ZeroStrengthDipole().

Referenced by BuildSBendLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalculateFaces()

std::pair< G4ThreeVector, G4ThreeVector > BDS::CalculateFaces ( G4double  angleInIn,
G4double  angleOutIn 
)

Calculate input and output normal vector.

orientation -1,0,1 value - always use |angle| with trigonometric and then multiply by this factor, 0 by default

Definition at line 139 of file BDSUtilities.cc.

References CalculateOrientation().

Referenced by BDSCurvilinearFactory::CreateCurvilinearVolume(), BDSMagnetOuterFactoryLHC::CreateLHCDipole(), BDSMagnetOuterFactoryCylindrical::CreateRectangularBend(), BDSMagnetOuterFactoryCylindrical::CreateSectorBend(), BDSTunnelFactoryBase::CreateTunnelSectionAngledInOut(), and BDSComponentFactory::PrepareBeamPipeInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalculateNSBendSegments()

G4int BDS::CalculateNSBendSegments ( G4double  length,
G4double  angle,
G4double  incomingFaceAngle = 0,
G4double  outgoingFaceAngle = 0,
G4double  aperturePrecision = 1.0 
)

Utility function to calculate the number of segments an sbend should be split into. Based on aperture error tolerance - default is 1mm.

Definition at line 825 of file BDSBendBuilder.cc.

References BDSGlobalConstants::Instance().

Referenced by BuildSBendLine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CalculateOrientation()

G4int BDS::CalculateOrientation ( G4double  angle)

Calculate the +- 1 orientation multiplier for absolute angles seems trivial, but used in a lot of places so put in one place

Definition at line 134 of file BDSUtilities.cc.

Referenced by CalculateFaces(), and BDSMagnetOuterFactoryLHC::CreateLHCDipole().

Here is the caller graph for this function:

◆ CalculateSafeAngledVolumeLength() [1/2]

G4double BDS::CalculateSafeAngledVolumeLength ( G4double  angleIn,
G4double  angleOut,
G4double  length,
G4double  containerWidth,
G4double  containerHeight = 0 
)

◆ CalculateSafeAngledVolumeLength() [2/2]

G4double BDS::CalculateSafeAngledVolumeLength ( G4ThreeVector  inputfaceIn,
G4ThreeVector  outputfaceIn,
G4double  length,
G4double  containerWidth,
G4double  containerHeight = 0 
)

Overloaded method to process G4ThreeVectors instead of angles.

Definition at line 669 of file BDSUtilities.cc.

References CalculateSafeAngledVolumeLength().

Here is the call graph for this function:

◆ CalculateTeleporterDelta()

G4Transform3D BDS::CalculateTeleporterDelta ( const BDSBeamline beamline,
G4double &  teleporterLength 
)

Calculate the difference between the beginning and end of a beam line. Writes the length to the argument passed by reference.

Definition at line 87 of file BDSTeleporter.cc.

References BDSBeamline::back(), BDSSamplerPlane::ChordLength(), BDSBeamline::empty(), BDSBeamline::front(), BDSBeamlineElement::GetReferencePositionEnd(), and BDSBeamline::PaddingLength().

Referenced by BDSDetectorConstruction::BuildBeamline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChannellingPhysicsComplete()

G4VModularPhysicsList * BDS::ChannellingPhysicsComplete ( G4bool  useEMD = false,
G4bool  regular = false,
G4bool  em4 = false,
G4bool  emss = false 
)

Build the physics required for channelling to work correctly.

Definition at line 503 of file BDSPhysicsUtilities.cc.

References BDSGlobalConstants::Instance().

Referenced by BuildPhysics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckAndSetEnergyValidityRange()

void BDS::CheckAndSetEnergyValidityRange ( )

Check if the user has requested a changed energy validity range and set the appropriate variables in the G4ProductionCutsTable.

Definition at line 592 of file BDSPhysicsUtilities.cc.

References BDSGlobalConstants::Instance(), and IsFinite().

Referenced by BuildPhysics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckHighPrecisionDataExists()

void BDS::CheckHighPrecisionDataExists ( const G4String &  physicsListName)

Check if the optional G4PARTICLEHPDATA exists in the environment. Will print out error and exit if no variable found. Physics list argument used for feedback purposes.

Definition at line 410 of file BDSUtilities.cc.

Referenced by BDSModularPhysicsList::IonBinary(), BDSModularPhysicsList::IonINCLXX(), and BDSModularPhysicsList::IonPHP().

Here is the caller graph for this function:

◆ CheckLowEnergyNeutronDataExists()

void BDS::CheckLowEnergyNeutronDataExists ( const G4String &  phhysicsListName)

Check if the optional Low Energy Neutron Data set exists via the environmental variable G4LENDDATA. Physics list argument used for feedback purposes.

Definition at line 424 of file BDSUtilities.cc.

Referenced by BDSModularPhysicsList::EmExtra(), BDSModularPhysicsList::HadronicElasticLEND(), and BDSModularPhysicsList::ShieldingLEND().

Here is the caller graph for this function:

◆ ConflictingParametersSet()

void BDS::ConflictingParametersSet ( const GMAD::Beam beamDefinition,
const std::set< std::string > &  keys,
G4int  nSet,
G4bool  warnZeroParamsSet = true,
const G4String &  unitString = "" 
)

Throw an exception if too few or too many parameters are set for the supplied keys.

Definition at line 222 of file BDSPhysicsUtilities.cc.

References GMAD::Beam::get_value().

Referenced by ConstructDesignAndBeamParticle(), BDSBunch::SetEmittances(), and BDSBunch::SetOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConstructAndRegisterParallelWorlds()

std::vector< G4VUserParallelWorld * > BDS::ConstructAndRegisterParallelWorlds ( G4VUserDetectorConstruction *  massWorld,
G4bool  buildSamplerWorld,
G4bool  buildPlacementFieldsWorld 
)

Construct the default and any extra parallel worlds required and register them to the main mass world argument. Returns the vector of worlds that required a physics process so that their boundaries are respected in tracking.

Definition at line 78 of file BDSParallelWorldUtilities.cc.

References BDSGlobalConstants::Instance(), and NumberOfExtraWorldsRequired().

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConstructBeamParticleG4()

void BDS::ConstructBeamParticleG4 ( const G4String &  name)

Ensure required beam particle has been constructed for Geant4 purposes.

Definition at line 366 of file BDSPhysicsUtilities.cc.

Referenced by ConstructParticleDefinition().

Here is the caller graph for this function:

◆ ConstructDesignAndBeamParticle()

void BDS::ConstructDesignAndBeamParticle ( const GMAD::Beam beamDefinition,
G4double  ffact,
BDSParticleDefinition *&  designParticle,
BDSParticleDefinition *&  beamParticle,
G4bool &  beamDifferentFromDesignParticle 
)

Construct the design and beam particle definitions. Even if these are the same, unique objects are created for and must be deleted elsewhere. Two pointers are passed by reference that will be updated with the allocated objects. The Boolean by reference argument is to tell whether they definitions (although unique objects) define the same particle.

Definition at line 244 of file BDSPhysicsUtilities.cc.

References GMAD::BeamBase::beamEnergy, GMAD::BeamBase::beamKineticEnergy, GMAD::BeamBase::beamMomentum, GMAD::BeamBase::beamParticleName, ConflictingParametersSet(), ConstructParticleDefinition(), GMAD::BeamBase::E0, GMAD::BeamBase::Ek0, NBeamParametersSet(), GMAD::BeamBase::P0, and GMAD::BeamBase::particle.

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConstructExtendedParticleSet()

void BDS::ConstructExtendedParticleSet ( )

Construct all leptons, pi+- K+- K. Utility function for when we expect other possible beam particles.

Definition at line 434 of file BDSPhysicsUtilities.cc.

Referenced by BDSIM::Initialise().

Here is the caller graph for this function:

◆ ConstructMinimumParticleSet()

void BDS::ConstructMinimumParticleSet ( )

Construct the minimum particle set required (gamma, electron, positron, proton and anti-proton.

Definition at line 416 of file BDSPhysicsUtilities.cc.

Referenced by BuildPhysics(), and BDSModularPhysicsList::ConstructParticle().

Here is the caller graph for this function:

◆ ConstructParallelWorldPhysics()

std::vector< G4ParallelWorldPhysics * > BDS::ConstructParallelWorldPhysics ( const std::vector< G4VUserParallelWorld * > &  worlds)

Construct the parallel physics process for each sampler world.

Definition at line 159 of file BDSParallelWorldUtilities.cc.

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the caller graph for this function:

◆ ConstructParticleDefinition()

BDSParticleDefinition * BDS::ConstructParticleDefinition ( const G4String &  particleNameIn,
G4double  totalEnergyIn,
G4double  kineticEnergyIn,
G4double  momentumIn,
G4double  ffact = 1 
)

Construct particle definition. Ensure that particle is instantiated from a Geant4 point of view. 'ffact' is typically 1 or -1 used to flip the sign of the rigidity for difference between convention and what's required. Only one of totalEnergy, kineticEnergy and momentum should be non-zero.

cache this here in case the particle definition isn't available until during a run

Definition at line 292 of file BDSPhysicsUtilities.cc.

References ConstructBeamParticleG4(), LowerCase(), and PrintDefinedParticles().

Referenced by ConstructDesignAndBeamParticle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateUserLimits()

G4UserLimits * BDS::CreateUserLimits ( G4UserLimits *  defaultUL,
G4double  length,
G4double  fraction = 1.6 
)

Create a user limits instance based on a default with a new step length limit of the length parameter. Check the max step length in the defaultUL and use the shorter of the two. Note the G4UserLimits instance is not const although it could be as the accessors in that class are not const. Fraction is the fraction of the length that max step will be because if it's exactly the length of an object, it can prove problematic to resolve the outgoing surface - better to give some margin.

Definition at line 591 of file BDSUtilities.cc.

Referenced by BDSAcceleratorComponent::BuildUserLimits(), BDSBeamPipeFactoryCircularVacuum::CommonFinalConstruction(), BDSFieldFactory::PrepareFieldDefinitions(), BDSBeamPipeFactoryBase::SetUserLimits(), BDSCavityFactoryBase::SetUserLimits(), BDSCrystalFactory::SetUserLimits(), and BDSFieldInfo::UpdateUserLimitsLengthMaximumStepSize().

Here is the caller graph for this function:

◆ Cubic1D()

template<class T >
T BDS::Cubic1D ( const T  p[4],
G4double  x 
)

Cubic interpolation in 1 dimension. The "p" is the real value to be interpolated. 'x' must be on the interval [0,1], ie normalised.

Definition at line 91 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator1DCubic::GetInterpolatedValueT().

Here is the caller graph for this function:

◆ Cubic2D()

template<class T >
T BDS::Cubic2D ( const T  p[4][4],
G4double  x,
G4double  y 
)

Cubic interpolation in 2 dimensions.

Definition at line 99 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator2DCubic::GetInterpolatedValueT().

Here is the caller graph for this function:

◆ Cubic3D()

template<class T >
T BDS::Cubic3D ( const T  p[4][4][4],
G4double  x,
G4double  y,
G4double  z 
)

Cubic interpolation in 3 dimensions.

Definition at line 113 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator3DCubic::GetInterpolatedValueT().

Here is the caller graph for this function:

◆ Cubic4D()

template<class T >
T BDS::Cubic4D ( const T  p[4][4][4][4],
G4double  x,
G4double  y,
G4double  z,
G4double  t 
)

Cubic interpolation in 4 dimensions.

Definition at line 128 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator4DCubic::GetInterpolatedValueT().

Here is the caller graph for this function:

◆ CumulativeDistances()

template<typename T >
std::vector< G4double > BDS::CumulativeDistances ( pairs)

Definition at line 89 of file BDSBunchHaloFlatSigma.hh.

◆ DetermineApertureType()

BDSApertureType BDS::DetermineApertureType ( G4String  apertureType)

function that gives corresponding enum value for string (case-insensitive)

Definition at line 46 of file BDSApertureType.cc.

References LowerCase().

Referenced by BDSApertureInfo::BDSApertureInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineArrayReflectionType()

BDSArrayReflectionType BDS::DetermineArrayReflectionType ( G4String  arrayReflectionType)

Function that gives corresponding enum value for string (case-insensitive)

Definition at line 51 of file BDSArrayReflectionType.cc.

References LowerCase().

Referenced by DetermineArrayReflectionTypeSet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineArrayReflectionTypeSet()

BDSArrayReflectionTypeSet BDS::DetermineArrayReflectionTypeSet ( const G4String &  arrayReflectionType)

Return a std::set of reflection types. Split string on white space.

Definition at line 86 of file BDSArrayReflectionType.cc.

References DetermineArrayReflectionType(), and SplitOnWhiteSpace().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineBeamPipeType()

BDSBeamPipeType BDS::DetermineBeamPipeType ( G4String  apertureType)

Function that gives corresponding enum value for string (case-insensitive).

Definition at line 46 of file BDSBeamPipeType.cc.

References LowerCase(), and StrContains().

Referenced by BDSBeamPipeInfo::BDSBeamPipeInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineBLMType()

BDSBLMType BDS::DetermineBLMType ( G4String  blmType)

function that gives corresponding enum value for string (case-insensitive)

Definition at line 39 of file BDSBLMType.cc.

References LowerCase().

Referenced by BDSBLMFactory::CreateBLM().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineBunchType()

BDSBunchType BDS::DetermineBunchType ( G4String  distrType)

Function that gives corresponding enum value for string (case-insensitive).

Definition at line 55 of file BDSBunchType.cc.

References LowerCase().

Referenced by BDSBunchFactory::CreateBunch(), BDSBunchComposite::SetOptions(), and BDSBunchCompositeSDE::SetOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineCavityType()

BDSCavityType BDS::DetermineCavityType ( G4String  cavityType)

function to determine the enum type of the cavity geometry (case-insensitive)

Definition at line 39 of file BDSCavityType.cc.

References LowerCase().

Referenced by BDSComponentFactory::PrepareCavityModels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineCrystalType()

BDSCrystalType BDS::DetermineCrystalType ( G4String  crystalType)

function to determine the enum type of the cavity geometry (case-insensitive)

Definition at line 39 of file BDSCrystalType.cc.

References LowerCase().

Referenced by BDSComponentFactory::PrepareCrystals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineDimensionType()

BDSDimensionType BDS::DetermineDimensionType ( G4String  dimensionType)

Determine the output format to be used from the input string.

Definition at line 40 of file BDSDimensionType.cc.

References LowerCase().

Referenced by BDSFieldLoaderBDSIM< T >::Load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineEventGeneratorFileType()

BDSEventGeneratorFileType BDS::DetermineEventGeneratorFileType ( G4String  distrType)

Function that gives corresponding enum value for string (case-insensitive).

Definition at line 42 of file BDSEventGeneratorFileType.cc.

References LowerCase().

Referenced by BDSHepMC3Reader::BDSHepMC3Reader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineExtents()

std::pair< BDSExtent, BDSExtent > BDS::DetermineExtents ( const G4VSolid *  solid)

Utility function to inspect a solid and determine it's outer (and posssibly inner) extent by casting to it's solid class. Delegates to below methods which may use this method themselves for recursion in booleans.

Definition at line 45 of file BDSGeometryInspector.cc.

References InspectBox(), InspectCutTubs(), InspectDisplacedSolid(), InspectEllipticalTube(), InspectIntersectionSolid(), InspectSubtractionSolid(), InspectTubs(), and InspectUnionSolid().

Referenced by BDSGeometryFactoryGDML::Build(), InspectDisplacedSolid(), InspectIntersectionSolid(), InspectSubtractionSolid(), and InspectUnionSolid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineFieldClassType()

BDSFieldClassType BDS::DetermineFieldClassType ( BDSFieldType  fieldType)

Function that gives the corresponding enum value for a field type enum.

Definition at line 34 of file BDSFieldClassType.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by BDSFieldFactory::CreateField().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineFieldFormat()

BDSFieldFormat BDS::DetermineFieldFormat ( G4String  fieldformat)

Function that gives corresponding enum value for string (case-insensitive)

Definition at line 44 of file BDSFieldFormat.cc.

References LowerCase().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineFieldType()

BDSFieldType BDS::DetermineFieldType ( G4String  fieldType)

Function that gives corresponding enum value for string (case-insensitive)

Definition at line 88 of file BDSFieldType.cc.

References LowerCase().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineGeometryType()

BDSGeometryType BDS::DetermineGeometryType ( G4String  geometryType)

function that gives corresponding enum value for string (case-insensitive)

Definition at line 38 of file BDSGeometryType.cc.

References LowerCase().

Referenced by BDSGeometryFactory::BuildGeometry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineIntegratorSetType()

BDSIntegratorSetType BDS::DetermineIntegratorSetType ( G4String  integratorSet)

Function that gives corresponding enum value for string (case-insensitive)

Definition at line 44 of file BDSIntegratorSetType.cc.

References LowerCase().

Referenced by BDSGlobalConstants::BDSGlobalConstants(), and IntegratorSet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineIntegratorType()

BDSIntegratorType BDS::DetermineIntegratorType ( G4String  integratorType)

Function that determines enum from string (case-insensitive).

Definition at line 90 of file BDSIntegratorType.cc.

References LowerCase().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineInterpolatorType()

BDSInterpolatorType BDS::DetermineInterpolatorType ( G4String  interpolatorType)

Function that determines enum from string (case-insensitive).

Definition at line 57 of file BDSInterpolatorType.cc.

References LowerCase().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineMagnetGeometryType()

BDSMagnetGeometryType BDS::DetermineMagnetGeometryType ( G4String  geometryType)

function to determine the enum type of the magnet geometry (case-insensitive)

Definition at line 45 of file BDSMagnetGeometryType.cc.

References LowerCase(), and StrContains().

Referenced by BDSGlobalConstants::BDSGlobalConstants(), and BDSComponentFactory::MagnetGeometryType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineOutputType()

BDSOutputType BDS::DetermineOutputType ( G4String  outputType)

Determine the output format to be used from the input string.

Definition at line 37 of file BDSOutputType.cc.

References LowerCase().

Referenced by BDSGlobalConstants::BDSGlobalConstants().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineSamplerType()

BDSSamplerType BDS::DetermineSamplerType ( G4String  samplerType)

Definition at line 42 of file BDSSamplerType.cc.

◆ DetermineScorerType()

BDSScorerType BDS::DetermineScorerType ( G4String  scorerType)

function to determine the enum type of the cavity geometry (case-insensitive)

Definition at line 53 of file BDSScorerType.cc.

References LowerCase().

Referenced by BDSScorerInfo::BDSScorerInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DetermineTunnelType()

BDSTunnelType BDS::DetermineTunnelType ( G4String  tunnelType)

Function to determine the enum type of the tunnel (case-insensitive)

Definition at line 42 of file BDSTunnelType.cc.

References LowerCase().

Referenced by BDSTunnelInfo::BDSTunnelInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DirectoryExists()

G4bool BDS::DirectoryExists ( const G4String &  path)

Check if directory exists.

Definition at line 171 of file BDSUtilities.cc.

Referenced by BDSTemporaryFiles::InitialiseTempDir().

Here is the caller graph for this function:

◆ EndsWith()

G4bool BDS::EndsWith ( const std::string &  expression,
const std::string &  suffix 
)
inline

Return true if a string "expression" ends with "suffix".

Definition at line 271 of file BDSUtilities.hh.

◆ EnsureInLimits()

void BDS::EnsureInLimits ( G4double &  value,
G4double  lowerLimit,
G4double  upperLimit 
)

Ensure a variable passed by reference is capped within lowerLimit and upperLimit. If it's outside these it is defaulted to those limit values.

Definition at line 156 of file BDSUtilities.cc.

Referenced by BDSColours::DefineColour().

Here is the caller graph for this function:

◆ FileExists()

G4bool BDS::FileExists ( const G4String &  filename)

◆ FindTransportation()

std::pair< G4Transportation *, G4CoupledTransportation * > BDS::FindTransportation ( const G4ParticleDefinition *  particleDef)

Taken from Geant4 field01 example. Get the two possible transportation processes.

Definition at line 672 of file BDSPhysicsUtilities.cc.

Referenced by FixGeant105ThreshholdsForParticle().

Here is the caller graph for this function:

◆ FixGeant105ThreshholdsForBeamParticle()

void BDS::FixGeant105ThreshholdsForBeamParticle ( const BDSParticleDefinition particleDefinition)

Apply FixGeant105ThreshholdsForParticle to the beam particle definition.

Definition at line 635 of file BDSPhysicsUtilities.cc.

References FixGeant105ThreshholdsForParticle(), and BDSParticleDefinition::ParticleDefinition().

Here is the call graph for this function:

◆ FixGeant105ThreshholdsForParticle()

void BDS::FixGeant105ThreshholdsForParticle ( const G4ParticleDefinition *  particleDefinition)

Set 1keV, 10keV and 1500 for warning energy, important energy and number of trials in Geant4's looping thresholds.

Definition at line 641 of file BDSPhysicsUtilities.cc.

References FindTransportation().

Referenced by FixGeant105ThreshholdsForBeamParticle(), BDSBunchSixTrackLink::UpdateGeant4ParticleDefinition(), BDSBunch::UpdateIonDefinition(), and BDSBunchSixTrackLink::UpdateIonDefinition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flip_map()

template<typename A , typename B >
std::multimap< B, A > BDS::flip_map ( const std::map< A, B > &  src)

Definition at line 47 of file PerEntryHistogramSet.hh.

◆ flip_pair()

template<typename A , typename B >
std::pair< B, A > BDS::flip_pair ( const std::pair< A, B > &  p)

Nice flip pair and map from https://stackoverflow.com/questions/5056645/sorting-stdmap-using-value to order the map of <pdg ID to integral> so we can get the top N histograms.

Definition at line 43 of file PerEntryHistogramSet.hh.

◆ FringeFieldCorrection()

G4double BDS::FringeFieldCorrection ( BDSMagnetStrength const *  strength,
G4bool  entranceOrExit 
)

Function to calculate the value of the fringe field correction term.

Definition at line 370 of file BDSIntegratorDipoleFringe.cc.

◆ GDMLSchemaLocation()

G4String BDS::GDMLSchemaLocation ( )

Get GDML Schema location included with BDSIM.

Definition at line 109 of file BDSGDMLPreprocessor.cc.

References GetBDSIMExecPath().

Here is the call graph for this function:

◆ Geant4EnvironmentIsSet()

G4bool BDS::Geant4EnvironmentIsSet ( )

Check if the geant4 environmental variables necessary for a run are set.

Definition at line 372 of file BDSUtilities.cc.

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the caller graph for this function:

◆ GetBDSIMExecPath()

std::string BDS::GetBDSIMExecPath ( )

Returns path from which BDSIM is executed supports linux/unix and mac OS

Definition at line 191 of file BDSUtilities.cc.

Referenced by GDMLSchemaLocation(), BDSTemporaryFiles::InitialiseTempDir(), and BDSVisManager::StartSession().

Here is the caller graph for this function:

◆ GetCurrentDir()

std::string BDS::GetCurrentDir ( )

Get the current dir the program was executed from.

Definition at line 178 of file BDSUtilities.cc.

Referenced by GetFullPath(), and BDSExecOptions::GetPath().

Here is the caller graph for this function:

◆ GetDipoleIntegratorType()

BDSIntegratorType BDS::GetDipoleIntegratorType ( const BDSIntegratorSet integratorSet,
const GMAD::Element element 
)

Function to get the integrator type. Test for finite K1 and returns dipole or dipolequadrupole integrator as appropriate.

Definition at line 850 of file BDSBendBuilder.cc.

References BDSIntegratorSet::Integrator(), IsFinite(), and GMAD::Element::k1.

Referenced by BuildRBendLine(), BuildSBendLine(), and BuildSingleSBend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFringeMagnetStrength()

BDSMagnetStrength * BDS::GetFringeMagnetStrength ( const GMAD::Element element,
const BDSMagnetStrength st,
G4double  fringeAngle,
G4double  e1,
G4double  e2,
G4double  fintx,
G4bool  entranceOrExit 
)

Definition at line 866 of file BDSBendBuilder.cc.

◆ GetFullPath()

G4String BDS::GetFullPath ( G4String  filename,
bool  excludeNameFromPath = false,
bool  useCWDForPrefix = false 
)

Get the full absolute directory path where a file can be found. Option excludeNameFromPath: if true will return only the path without the filename appended to exclude the filename from path. Option useCWDForPrefix: if the path is relative, then we would normally prepend the absolute path of the main input file so it's relative to that but with an absolute path. However, we may want to do this relative to the executable directory of the program. If this option is on, it'll be CWD.

Definition at line 213 of file BDSUtilities.cc.

References GetCurrentDir(), BDSGlobalConstants::Instance(), and SplitPathAndFileName().

Referenced by BDSPrimaryGeneratorAction::BDSPrimaryGeneratorAction(), BDSPSCellFluxScaled3D::BDSPSCellFluxScaled3D(), BDSPSPopulationScaled::BDSPSPopulationScaled(), BDSPTCOneTurnMap::BDSPTCOneTurnMap(), BDSGeometryFactorySQL::Build(), BDSGeometryFactory::BuildGeometry(), BuildPhysics(), BDSCrystalFactory::CommonConstruction(), BDSParallelWorldImportance::Construct(), LoadAperturePoints(), LoadFieldQueryPoints(), BDSFieldFactory::PrepareFieldDefinitions(), BDSBunchPtc::SetDistrFile(), and BDSBunchUserFile< T >::SetOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetImportanceSamplingWorld()

BDSParallelWorldImportance * BDS::GetImportanceSamplingWorld ( const std::vector< G4VUserParallelWorld * > &  worlds)

Get importance sampling world from list of all parallel worlds.

Definition at line 195 of file BDSParallelWorldUtilities.cc.

Referenced by AddIStore(), and RegisterImportanceBiasing().

Here is the caller graph for this function:

◆ GetMemoryUsage()

G4double BDS::GetMemoryUsage ( )

Get the current memory usage.

Definition at line 608 of file BDSUtilities.cc.

◆ GetParameterValueDouble()

G4double BDS::GetParameterValueDouble ( G4String  spec,
G4String  name 
)

Get parameter value from the specification ('spec') string.

Definition at line 438 of file BDSUtilities.cc.

References GetParameterValueString().

Here is the call graph for this function:

◆ GetParameterValueInt()

G4int BDS::GetParameterValueInt ( G4String  spec,
G4String  name 
)

Get parameter value from the specification ('spec') string.

Definition at line 446 of file BDSUtilities.cc.

References GetParameterValueString().

Here is the call graph for this function:

◆ GetParameterValueString()

G4String BDS::GetParameterValueString ( G4String  spec,
G4String  name 
)

Get parameter value from the specification ('spec') string.

Definition at line 454 of file BDSUtilities.cc.

Referenced by GetParameterValueDouble(), and GetParameterValueInt().

Here is the caller graph for this function:

◆ GetUserParametersMap()

std::map< G4String, G4String > BDS::GetUserParametersMap ( const G4String &  userParameters,
char  delimiter = ':' 
)

Take one long string and split on space and then on colon. "key1:value1 key2:value2" etc.

Definition at line 626 of file BDSUtilities.cc.

Referenced by BDSFieldFactory::PrepareFieldStrengthFromParameters().

Here is the caller graph for this function:

◆ GetZOfPointOnPlane()

G4double BDS::GetZOfPointOnPlane ( const G4ThreeVector &  normal,
G4double  x,
G4double  y 
)

Given an x and y coordinate, calculate what the z coordinate must be to lie on the plane defined by the supplied normal vector - assumes plane intercepts 0,0,0. Used in WillIntersect.

Definition at line 548 of file BDSUtilities.cc.

Referenced by WillIntersect().

Here is the caller graph for this function:

◆ HandleAborts()

void BDS::HandleAborts ( int  signal_number)

Try to catch abort signals. This is not guaranteed to work. Main goal is to close output stream / files.

Try to catch abort signals. This is not guaranteed to work. Main goal is to close output stream / files.

Definition at line 293 of file BDSUtilities.cc.

Referenced by BDSIM::BeamOn(), and BDSIMLink::BeamOn().

Here is the caller graph for this function:

◆ InspectBox()

std::pair< BDSExtent, BDSExtent > BDS::InspectBox ( const G4VSolid *  solidIn)

Inspect a G4Box.

Definition at line 147 of file BDSGeometryInspector.cc.

References BDSGlobalConstants::Instance().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectCutTubs()

std::pair< BDSExtent, BDSExtent > BDS::InspectCutTubs ( const G4VSolid *  solidIn)

Inspect a G4CutTubs.

Definition at line 180 of file BDSGeometryInspector.cc.

References BDSGlobalConstants::Instance().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectDisplacedSolid()

std::pair< BDSExtent, BDSExtent > BDS::InspectDisplacedSolid ( const G4VSolid *  solidIn)

Inspect a G4DisplacedSolid.

Definition at line 71 of file BDSGeometryInspector.cc.

References DetermineExtents(), and BDSExtent::Translate().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectEllipticalTube()

std::pair< BDSExtent, BDSExtent > BDS::InspectEllipticalTube ( const G4VSolid *  solidIn)

Inspect a G4EllipticalTube.

Definition at line 213 of file BDSGeometryInspector.cc.

References BDSGlobalConstants::Instance().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectIntersectionSolid()

std::pair< BDSExtent, BDSExtent > BDS::InspectIntersectionSolid ( const G4VSolid *  solidIn)

Inspect a G4IntersectionSolid.

Definition at line 111 of file BDSGeometryInspector.cc.

References DetermineExtents(), and BDSExtent::TransverselyLessThan().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectSubtractionSolid()

std::pair< BDSExtent, BDSExtent > BDS::InspectSubtractionSolid ( const G4VSolid *  solidIn)

Inpsect a G4SubtractionSolid. Convention: solid B is assumed to represent the inner extent of the solid.

Definition at line 90 of file BDSGeometryInspector.cc.

References DetermineExtents(), and BDSExtent::TransverselyLessThan().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectTubs()

std::pair< BDSExtent, BDSExtent > BDS::InspectTubs ( const G4VSolid *  solidIn)

Inspect a G4Tubs.

Definition at line 164 of file BDSGeometryInspector.cc.

References BDSGlobalConstants::Instance().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InspectUnionSolid()

std::pair< BDSExtent, BDSExtent > BDS::InspectUnionSolid ( const G4VSolid *  solidIn)

Inspect a G4UnionSolid.

Definition at line 129 of file BDSGeometryInspector.cc.

References DetermineExtents(), and BDSExtent::TransverselyLessThan().

Referenced by DetermineExtents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IntegratorSet() [1/2]

const BDSIntegratorSet * BDS::IntegratorSet ( BDSIntegratorSetType  set)

Return the appropriate set of integrators to use for each magnet type.

Definition at line 238 of file BDSIntegratorSet.cc.

References integratorsBDSIMMatrix, and BDSTypeSafeEnum< def, inner >::underlying().

Here is the call graph for this function:

◆ IntegratorSet() [2/2]

const BDSIntegratorSet * BDS::IntegratorSet ( G4String  set)

Return the appropriate set of integrators to use for each magnet type.

Definition at line 233 of file BDSIntegratorSet.cc.

References DetermineIntegratorSetType(), and IntegratorSet().

Referenced by IntegratorSet().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterpolatorTypeIsAuto()

G4bool BDS::InterpolatorTypeIsAuto ( BDSInterpolatorType  typeIn)

Return true if the type is one containing 'auto'.

Definition at line 130 of file BDSInterpolatorType.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InterpolatorTypeSpecificFromAuto()

BDSInterpolatorType BDS::InterpolatorTypeSpecificFromAuto ( G4int  nDimension,
BDSInterpolatorType  autoType 
)

Return a specific inteprolator type from the appropriate auto one in combination with the number of dimensions. e.g. 3, cubicauto -> cubic3d.

Definition at line 146 of file BDSInterpolatorType.cc.

Referenced by BDSFieldLoader::LoadMagField(), and BDSFieldFactory::PrepareFieldDefinitions().

Here is the caller graph for this function:

◆ IsFinite() [1/2]

G4bool BDS::IsFinite ( const G4ThreeVector &  variable,
G4double  tolerance = std::numeric_limits<double>::epsilon() 
)

Apply IsFinite to each component of a 3-vector.

Definition at line 327 of file BDSUtilities.cc.

References IsFinite().

Here is the call graph for this function:

◆ IsFinite() [2/2]

G4bool BDS::IsFinite ( G4double  value,
G4double  tolerance = std::numeric_limits<double>::epsilon() 
)

Return true if value is consistent with 0. This is done by checking the difference between the value and 0 is within 'tolerance', which is by default the minimum difference from zero, epsilon (~1e-15). If a very small but finite number is a possibility, a different tolerance should be used.

Definition at line 311 of file BDSUtilities.cc.

Referenced by BDSBeamline::AddSingleComponent(), BDSIntegratorDipoleRodrigues2::AdvanceHelixForSpiralling(), BDSLinkOpaqueBox::Angled(), BDSCurvilinearBuilder::Angled(), BDSAcceleratorComponent::AngledInputFace(), BDSAcceleratorComponent::AngledOutputFace(), BDSComponentFactory::AngleFromField(), BDSIntegratorDipoleFringe::BaseStepper(), BDSAcceleratorComponent::BDSAcceleratorComponent(), BDSApertureInfo::BDSApertureInfo(), BDSBeamPipeInfo::BDSBeamPipeInfo(), BDSFieldESinusoid::BDSFieldESinusoid(), BDSFieldMagDipole::BDSFieldMagDipole(), BDSFieldMagSolenoidSheet::BDSFieldMagSolenoidSheet(), BDSSamplerCylinder::BDSSamplerCylinder(), BDSTunnelBuilder::BreakTunnel(), BDSCollimator::Build(), BDSCollimatorCrystal::Build(), BDSUndulator::Build(), BDSCollimatorJaw::Build(), BDSDetectorConstruction::BuildBeamline(), BuildBLMs(), BDSUndulator::BuildContainerLogicalVolume(), BDSMagnet::BuildOuterField(), BuildRBendLine(), BDSParallelWorldSampler::BuildSampler(), BuildSBendLine(), BDSShield::BuildShield(), BuildSingleSBend(), BDSComponentFactory::CalculateAngleAndFieldRBend(), BDSComponentFactory::CalculateAngleAndFieldSBend(), BDSParticleDefinition::CalculateRigidity(), CalculateSafeAngledVolumeLength(), BDSFieldMagSolenoidSheet::CEL(), CheckAndSetEnergyValidityRange(), BDSFieldQuery::CheckNStepsAndRange(), BDSParser::CheckOptions(), BDSCollimator::CheckParameters(), BDSCollimatorElliptical::CheckParameters(), BDSCollimatorJaw::CheckParameters(), BDSApertureInfo::CheckRequiredParametersSet(), BDSBeamPipeInfo::CheckRequiredParametersSet(), BDSCollimator::CollimatorUserLimits(), BDSCurvilinearBuilder::CreateBridgeSection(), BDSComponentFactory::CreateComponent(), BDSCrystalFactory::CreateCrystalCylinder(), BDSCrystalFactory::CreateCrystalTorus(), BDSCurvilinearBuilder::CreateCurvilinearElement(), BDSCurvilinearFactory::CreateCurvilinearVolume(), BDSScorerFactory::CreateFilter(), BDSOutput::CreateHistograms(), BDSMagnetOuterFactoryLHC::CreateLHCDipole(), BDSDetectorConstruction::CreatePlacementTransform(), BDSMagnetOuterFactoryCylindrical::CreateRectangularBend(), BDSMagnetOuterFactoryCylindrical::CreateSectorBend(), BDSComponentFactory::CreateTiltOffset(), BDSCurvilinearBuilder::CurvilinearRadius(), BDSComponentFactory::FieldFromAngle(), BDSParallelWorldImportance::GetCellImportanceValue(), GetDipoleIntegratorType(), BDSBeamline::GetGlobalEuclideanTransform(), BDSComponentFactory::GetKickValue(), BDSBeamPipe::GetVolumesForField(), BDSAuxiliaryNavigator::GlobalToCurvilinear(), BDSTiltOffset::HasFiniteOffset(), BDSTiltOffset::HasFiniteTilt(), BDSHepMC3Reader::HepMC2G4(), BDSComponentFactory::IncomingFaceAngle(), BDSIM::Initialise(), IsFinite(), IsFiniteStrength(), BDSIntegratorMultipoleThin::OneStep(), BDSComponentFactory::OutgoingFaceAngle(), BDSParallelWorldSampler::Place(), BDSLinkOpaqueBox::PlaceOutputSampler(), BDSComponentFactory::PrepareCavityModelInfoForElement(), BDSComponentFactory::PrepareCavityStrength(), BDSFieldFactory::PrepareFieldDefinitions(), BDSComponentFactory::PrepareMagnetStrengthForMultipoles(), BDSSDSampler::ProcessHits(), BDSSDSamplerCylinder::ProcessHits(), BDSSDSamplerSphere::ProcessHits(), BDSSDEnergyDeposition::ProcessHits(), BDSSDEnergyDepositionGlobal::ProcessHits(), BDSSDThinThing::ProcessHitsOrdered(), BDSSDEnergyDeposition::ProcessHitsTrack(), BDSSDEnergyDepositionGlobal::ProcessHitsTrack(), BDSROOTSamplerReader::ReadSingleEvent(), BDSBunchEventGenerator::ReferenceBeamMomentumOffset(), RotateToReferenceFrame(), BDSAcceleratorComponent::Sagitta(), BDSBunch::SetEmittances(), BDSParticleDefinition::SetEnergies(), BDSBunch::SetOptions(), BDSBunchSigmaMatrix::SetOptions(), BDSDetectorConstruction::SideToLocalOffset(), BDSBunchUserFile< T >::SkipLines(), BDSIntegratorDipoleQuadrupole::Stepper(), BDSIntegratorEulerOld::Stepper(), BDSIntegratorKickerThin::Stepper(), BDSTrajectoryPoint::StoreExtrasLink(), BDSTunnelFactoryRectAboveGround::TestInputParameters(), BDSExtent::Tilted(), BDSCollimatorCrystal::TransverseOffsetToEdge(), BDSDetectorConstruction::UpdateSamplerDiameterAndCountSamplers(), WillIntersect(), BDSComponentFactory::YokeOnLeft(), and ZeroStrengthDipole().

◆ IsFiniteStrength()

G4bool BDS::IsFiniteStrength ( G4double  variable)

Test if a number is above a certain tolerance for tracking strength purposes. Currently at 1e-50 as potential can be small and squared. Uses IsFinite() with 1e-50 as tolerance.

Definition at line 322 of file BDSUtilities.cc.

References IsFinite().

Referenced by BDSIntegratorEulerOld::AdvanceChord(), BDSIntegratorDipoleRodrigues::AdvanceHelix(), BDSIntegratorDipoleFringe::BaseStepper(), BDSFieldMagMultipole::GetField(), BDSIntegratorDipoleQuadrupole::Stepper(), BDSIntegratorG4RK4MinStep::Stepper(), BDSIntegratorQuadrupole::Stepper(), BDSIntegratorSolenoid::Stepper(), BDSIntegratorDipoleRodrigues2::Stepper(), BDSIntegratorKickerThin::Stepper(), BDSIntegratorMultipoleThin::Stepper(), and BDSIntegratorEuler::Stepper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsInteger()

G4bool BDS::IsInteger ( const char *  s,
int &  convertedInteger 
)

Check if character array is an integer, and returns the integer by reference.

Definition at line 336 of file BDSUtilities.cc.

Referenced by BDSExecOptions::Parse().

Here is the caller graph for this function:

◆ IsIon() [1/2]

G4bool BDS::IsIon ( const G4DynamicParticle *  paritlce)

Calls IsIon above but also a proton with any bound electrons is considered an ion.

Definition at line 105 of file BDSPhysicsUtilities.cc.

References IsIon().

Here is the call graph for this function:

◆ IsIon() [2/2]

G4bool BDS::IsIon ( const G4ParticleDefinition *  particle)

Whether a particle is an ion. A proton is counted NOT as an ion.

Definition at line 100 of file BDSPhysicsUtilities.cc.

Referenced by BDSLinkStackingAction::ClassifyNewTrack(), IsIon(), BDSSDSamplerLink::ProcessHits(), and BDSTrajectoryPoint::StoreExtrasIon().

Here is the caller graph for this function:

◆ IsNumber()

G4bool BDS::IsNumber ( const char *  s,
double &  convertedNumber 
)

Check if character array is an integer, and returns the double by reference.

Definition at line 350 of file BDSUtilities.cc.

Referenced by BDSExecOptions::Parse().

Here is the caller graph for this function:

◆ Linear1D()

template<class T >
T BDS::Linear1D ( const T  p[2],
G4double  x 
)

Linear interpolation in 1 dimension. The "p" is the real value to be interpolated. 'x' must be on the interval [0,1], ie normalised.

Definition at line 45 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator1DLinear::GetInterpolatedValueT(), and Linear1DMag().

Here is the caller graph for this function:

◆ Linear1DMag()

template<class T >
T BDS::Linear1DMag ( const T  p[2],
G4double  x 
)

Linear interpolation in 1 dimension including magnitude interpolation.

Definition at line 192 of file BDSInterpolatorRoutines.hh.

References Linear1D(), Linear1DMagOnly(), and mag().

Referenced by BDSInterpolator1DLinearMag::GetInterpolatedValueT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear1DMagOnly()

template<class T >
double BDS::Linear1DMagOnly ( const T  p[2],
G4double  x 
)

Linear interpolation of the magnitude in 1 dimension.

Definition at line 144 of file BDSInterpolatorRoutines.hh.

References mag().

Referenced by Linear1DMag(), Linear2DMagOnly(), Linear3DMagOnly(), and Linear4DMagOnly().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear2D()

template<class T >
T BDS::Linear2D ( const T  p[2][2],
G4double  x,
G4double  y 
)

Linear interpolation in 2 dimensions.

Definition at line 51 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator2DLinear::GetInterpolatedValueT(), and Linear2DMag().

Here is the caller graph for this function:

◆ Linear2DMag()

template<class T >
T BDS::Linear2DMag ( const T  p[2][2],
G4double  x,
G4double  y 
)

Linear interpolation in 2 dimensions including magnitude interpolation.

Definition at line 206 of file BDSInterpolatorRoutines.hh.

References Linear2D(), Linear2DMagOnly(), and mag().

Referenced by BDSInterpolator2DLinearMag::GetInterpolatedValueT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear2DMagOnly()

template<class T >
double BDS::Linear2DMagOnly ( const T  p[2][2],
G4double  x,
G4double  y 
)

Linear interpolation of the magnitude in 2 dimensions.

Definition at line 153 of file BDSInterpolatorRoutines.hh.

References Linear1DMagOnly().

Referenced by Linear2DMag(), and Linear3DMagOnly().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear3D()

template<class T >
T BDS::Linear3D ( const T  p[2][2][2],
G4double  x,
G4double  y,
G4double  z 
)

Linear interpolation in 3 dimensions.

Definition at line 63 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator3DLinear::GetInterpolatedValueT(), and Linear3DMag().

Here is the caller graph for this function:

◆ Linear3DMag()

template<class T >
T BDS::Linear3DMag ( const T  p[2][2][2],
G4double  x,
G4double  y,
G4double  z 
)

Linear interpolation in 3 dimensions including magnitude interpolation.

Definition at line 221 of file BDSInterpolatorRoutines.hh.

References Linear3D(), Linear3DMagOnly(), and mag().

Referenced by BDSInterpolator3DLinearMag::GetInterpolatedValueT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear3DMagOnly()

template<class T >
double BDS::Linear3DMagOnly ( const T  p[2][2][2],
G4double  x,
G4double  y,
G4double  z 
)

Linear interpolation of the magnitude in 3 dimensions.

Definition at line 165 of file BDSInterpolatorRoutines.hh.

References Linear1DMagOnly(), and Linear2DMagOnly().

Referenced by Linear3DMag(), and Linear4DMagOnly().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear4D()

template<class T >
T BDS::Linear4D ( const T  p[2][2][2][2],
G4double  x,
G4double  y,
G4double  z,
G4double  t 
)

Linear interpolation in 4 dimensions.

Definition at line 76 of file BDSInterpolatorRoutines.hh.

Referenced by BDSInterpolator4DLinear::GetInterpolatedValueT(), and Linear4DMag().

Here is the caller graph for this function:

◆ Linear4DMag()

template<class T >
T BDS::Linear4DMag ( const T  p[2][2][2][2],
G4double  x,
G4double  y,
G4double  z,
G4double  t 
)

Linear interpolation in 4 dimensions including magnitude interpolation.

Definition at line 237 of file BDSInterpolatorRoutines.hh.

References Linear4D(), Linear4DMagOnly(), and mag().

Referenced by BDSInterpolator4DLinearMag::GetInterpolatedValueT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Linear4DMagOnly()

template<class T >
double BDS::Linear4DMagOnly ( const T  p[2][2][2][2],
G4double  x,
G4double  y,
G4double  z,
G4double  t 
)

Linear interpolation of the magnitude in 4 dimensions.

Definition at line 178 of file BDSInterpolatorRoutines.hh.

References Linear1DMagOnly(), and Linear3DMagOnly().

Referenced by Linear4DMag().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadAperturePoints()

std::vector< G4TwoVector > * BDS::LoadAperturePoints ( const G4String &  fileName,
const G4String &  unit = "" 
)

Detect whether gzipped file or not, instantiate right template and load the data. This will expand the path to the full one and check it exists and throw an exception if it doesn't.

Definition at line 125 of file BDSAperturePointsLoader.cc.

References BDSAperturePointsCache::CacheFile(), FileExists(), BDSAperturePointsCache::FindCachedFile(), GetFullPath(), BDSAperturePointsCache::Instance(), BDSAperturePointsLoader< T >::Load(), and LowerCase().

Referenced by BDSBeamPipeFactoryPointsFile::GeneratePoints().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadFieldQueryPoints()

std::vector< BDSFourVector< G4double > > BDS::LoadFieldQueryPoints ( const G4String &  fileName,
std::vector< G4String > *  columnNamesIn 
)

Detect whether gzipped file or not, instantiate right template and load the data. This will expand the path to the full one and check it exists and throw an exception if it doesn't.

Definition at line 183 of file BDSFieldLoaderQueryPoints.cc.

References FileExists(), and GetFullPath().

Referenced by BDSDetectorConstruction::PrepareFieldQueries().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mag() [1/2]

template<template< class > class BDSFieldValue, class V >
V BDS::mag ( const BDSFieldValue< V > &  v)

Specialisation for a 3-vector field value.

Definition at line 40 of file BDSInterpolatorRoutines.hh.

References BDSThreeVector< T >::mag().

Here is the call graph for this function:

◆ mag() [2/2]

template<class T >
T BDS::mag ( const T &  v)

Define a magnitude function that will work for numeric types but also for a field value (3 vector).

Definition at line 37 of file BDSInterpolatorRoutines.hh.

Referenced by Linear1DMag(), Linear1DMagOnly(), Linear2DMag(), Linear3DMag(), and Linear4DMag().

Here is the caller graph for this function:

◆ MapGetWithDefault()

template<typename K , typename V >
V BDS::MapGetWithDefault ( const std::map< K, V > &  m,
const K &  key,
const V &  defaultValue 
)

Generic function to get an item from a map with a default value and not throw an exception from unsafe access. Saves writing the searching code everywhere. Based on: https://stackoverflow.com/questions/2333728/stdmap-default-value

Definition at line 245 of file BDSUtilities.hh.

Referenced by BDSAcceleratorModel::BeamlineIsMassWorld(), and BDSOutput::FillScorerHitsIndividual().

Here is the caller graph for this function:

◆ MaximumCombinedExtent()

BDSExtent BDS::MaximumCombinedExtent ( const BDSExtent first,
const BDSExtent second 
)

Returns the extent which is the greatest extent in all six directions.

Definition at line 248 of file BDSExtent.cc.

References BDSExtent::XNeg(), BDSExtent::XPos(), BDSExtent::YNeg(), BDSExtent::YPos(), BDSExtent::ZNeg(), and BDSExtent::ZPos().

Referenced by BDSDetectorConstruction::SideToLocalOffset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NBeamParametersSet()

G4int BDS::NBeamParametersSet ( const GMAD::Beam beamDefinition,
const std::set< std::string > &  keys 
)

Count how many out of the set of keys in a beam instance are set.

Definition at line 213 of file BDSPhysicsUtilities.cc.

References GMAD::Beam::HasBeenSet().

Referenced by ConstructDesignAndBeamParticle(), BDSBunch::SetEmittances(), and BDSBunch::SetOptions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NDimensionsOfFieldFormat()

G4int BDS::NDimensionsOfFieldFormat ( const BDSFieldFormat ff)

Report the number of dimensions for that format.

Definition at line 76 of file BDSFieldFormat.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by BDSFieldLoader::LoadMagField(), and BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NDimensionsOfInterpolatorType()

G4int BDS::NDimensionsOfInterpolatorType ( const BDSInterpolatorType it)

Report the number of dimensions for that interpolator type.

Definition at line 99 of file BDSInterpolatorType.cc.

References BDSTypeSafeEnum< def, inner >::underlying().

Referenced by BDSFieldFactory::PrepareFieldDefinitions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NonZero()

G4bool BDS::NonZero ( G4double  value)

Test whether a number is non-zero - ie abs(number) > minimum number.

Definition at line 317 of file BDSUtilities.cc.

◆ NumberOfExtraWorldsRequired()

std::vector< BDSParallelWorldInfo > BDS::NumberOfExtraWorldsRequired ( )

The number of curvilinear and sampler worlds required. This is not curvilinear + curvilinear bridge. This is over and above the one for the main beam line. Note, an extra beam line, if it exists, will require a curvilinear world, but not necessarily a sampler world.

Definition at line 52 of file BDSParallelWorldUtilities.cc.

References BDSParser::GetPlacements(), and BDSParser::Instance().

Referenced by ConstructAndRegisterParallelWorlds().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseAngleUnit()

G4double BDS::ParseAngleUnit ( const G4String &  fmt)

Utility function to parse variable and unit string. These are meant for passing to CheckAndParseUnits.

Definition at line 559 of file BDSBunchUserFile.cc.

References ParseAngleUnit(), and BDSBunchUserFile< T >::Doublet::unit.

Referenced by ParseAngleUnit(), and BDSBunchUserFile< T >::ParseFileFormat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseEnergyUnit()

G4double BDS::ParseEnergyUnit ( const G4String &  fmt)

Utility function to parse variable and unit string. These are meant for passing to CheckAndParseUnits.

Definition at line 533 of file BDSBunchUserFile.cc.

References ParseEnergyUnit(), and BDSBunchUserFile< T >::Doublet::unit.

Referenced by ParseEnergyUnit(), and BDSBunchUserFile< T >::ParseFileFormat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseLengthUnit()

G4double BDS::ParseLengthUnit ( const G4String &  fmt)

Utility function to parse variable and unit string. These are meant for passing to CheckAndParseUnits.

Definition at line 546 of file BDSBunchUserFile.cc.

References ParseLengthUnit(), and BDSBunchUserFile< T >::Doublet::unit.

Referenced by BDSBunchUserFile< T >::ParseFileFormat(), and ParseLengthUnit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ParseTimeUnit()

G4double BDS::ParseTimeUnit ( const G4String &  fmt)

Utility function to parse variable and unit string. These are meant for passing to CheckAndParseUnits.

Definition at line 571 of file BDSBunchUserFile.cc.

References ParseTimeUnit(), and BDSBunchUserFile< T >::Doublet::unit.

Referenced by BDSBunchUserFile< T >::ParseFileFormat(), and ParseTimeUnit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PhaseSpaceCoordFromActionAngle()

PhaseSpaceCoord BDS::PhaseSpaceCoordFromActionAngle ( ActionAngleCoord  aa,
const TwissPair tp 
)

Definition at line 41 of file BDSBunchHaloFlatSigma.cc.

◆ PrepareSafeName()

G4String BDS::PrepareSafeName ( G4String  name)

Remove white space and special characters in the name.

Definition at line 124 of file BDSUtilities.cc.

◆ PreprocessGDML()

G4String BDS::PreprocessGDML ( const G4String &  file,
const G4String &  prefix,
G4bool  preprocessSchema = true 
)

Definition at line 50 of file BDSGDMLPreprocessor.cc.

◆ PreprocessGDMLSchemaOnly()

G4String BDS::PreprocessGDMLSchemaOnly ( const G4String &  file)

Definition at line 63 of file BDSGDMLPreprocessor.cc.

◆ PrintDefinedParticles()

void BDS::PrintDefinedParticles ( )

Print all constructed particle names. Note, this should only be done after the physics lists are fully constructed.

Definition at line 492 of file BDSPhysicsUtilities.cc.

Referenced by ConstructParticleDefinition(), BDSIM::Initialise(), BDSIMLink::Initialise(), and BDSBunchEventGenerator::ParseAcceptedParticleIDs().

Here is the caller graph for this function:

◆ PrintPrimaryParticleProcesses()

void BDS::PrintPrimaryParticleProcesses ( const G4String &  primaryParticleName)

Print all the processes by name as registered to the primary particle type. Note, this should only be done after the physics lists are fully constructed.

Definition at line 444 of file BDSPhysicsUtilities.cc.

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the caller graph for this function:

◆ PrintRotationMatrix()

void BDS::PrintRotationMatrix ( G4RotationMatrix *  rm,
G4String  keyName = "unknown" 
)

Print out details of a rotation matrix - the matrix itself, unit vectors. Optional keyname to identify in output stream

Definition at line 364 of file BDSUtilities.cc.

Referenced by BDSTunnelBuilder::BuildTunnelSections().

Here is the caller graph for this function:

◆ ProblemWithArrayReflectionCombination()

G4bool BDS::ProblemWithArrayReflectionCombination ( const BDSArrayReflectionTypeSet &  setIn,
G4String *  details = nullptr 
)

Return true if there's a conceptual conflict with the set of field reflections requested.

Definition at line 95 of file BDSArrayReflectionType.cc.

Referenced by BDSFieldLoader::CreateOperators().

Here is the caller graph for this function:

◆ RegisterImportanceBiasing()

void BDS::RegisterImportanceBiasing ( const std::vector< G4VUserParallelWorld * > &  worlds,
G4VModularPhysicsList *  physicsList 
)

Create importance geometry sampler and register importance biasing with physics list.

Definition at line 184 of file BDSParallelWorldUtilities.cc.

References GetImportanceSamplingWorld(), and BDSParallelWorldImportance::GetWorldVolume().

Referenced by BDSIM::Initialise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterSamplerPhysics()

void BDS::RegisterSamplerPhysics ( const std::vector< G4ParallelWorldPhysics * > &  processes,
G4VModularPhysicsList *  physicsList 
)

Register each parallel physics process to the main physics list.

Definition at line 167 of file BDSParallelWorldUtilities.cc.

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the caller graph for this function:

◆ Rigidity()

G4double BDS::Rigidity ( G4double  momentumMagnitude,
G4double  charge 
)

Calculate the rigidity for a total momentum and charge.

Definition at line 663 of file BDSUtilities.cc.

References cOverGeV.

Referenced by BDSSDSampler::ProcessHits(), BDSSDSamplerCylinder::ProcessHits(), BDSSDSamplerSphere::ProcessHits(), and BDSTrajectoryPoint::StoreExtrasLink().

Here is the caller graph for this function:

◆ Rotate()

G4TwoVector BDS::Rotate ( const G4TwoVector &  vec,
const G4double &  angle 
)

Rotate a two vector in polar coordinates by an angle.

Definition at line 486 of file BDSUtilities.cc.

Referenced by BDSMagnetOuterFactoryPolesBase::CreateDipoleC(), and BDSMagnetOuterFactoryPolesBase::CreateDipoleH().

Here is the caller graph for this function:

◆ RotateToReferenceFrame()

G4ThreeVector BDS::RotateToReferenceFrame ( G4ThreeVector  faceNormal,
G4double  fullAngle 
)

Rotate a face normal vector for a given component to that of the reference trajectory on that face. This takes the component full angle and assumes the component changes the angle continuously between its faces and therefore half of this angle is used for the rotation.

Definition at line 562 of file BDSUtilities.cc.

References IsFinite().

Referenced by BDSMagnet::BuildBeampipe(), and BDSMagnet::BuildOuter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SecondFringeFieldCorrection()

G4double BDS::SecondFringeFieldCorrection ( BDSMagnetStrength const *  strength,
G4bool  entranceOrExit 
)

Function to calculate the value of the second fringe field correction term.

Definition at line 391 of file BDSIntegratorDipoleFringe.cc.

◆ SetRangeCuts()

void BDS::SetRangeCuts ( G4VModularPhysicsList *  physicsList,
G4int  verbosity = 1 
)

Set the range cuts on a physics list. This is split into a separate function to allow it to be applied to physics lists both from BDSIM's modular physics list and other sources with the same mechanism.

Definition at line 547 of file BDSPhysicsUtilities.cc.

References BDSGlobalConstants::Instance().

Referenced by BuildPhysics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Sign()

template<typename T >
G4int BDS::Sign ( val)

Definition at line 158 of file BDSUtilities.hh.

◆ SplitFileAndExtension()

void BDS::SplitFileAndExtension ( const G4String &  fileName,
G4String &  file,
G4String &  extension 
)

Split a filename.ext into filename and extension. Extension includes '.'.

Definition at line 276 of file BDSUtilities.cc.

Referenced by BDSTemporaryFiles::CreateTemporaryFile().

Here is the caller graph for this function:

◆ SplitOnColon()

std::pair< G4String, G4String > BDS::SplitOnColon ( const G4String &  formatAndPath)

Split a format and file path string around the ":" character. This format is used for geometry and field maps

Definition at line 571 of file BDSUtilities.cc.

Referenced by BDSHepMC3Reader::BDSHepMC3Reader(), BDSROOTSamplerReader::BDSROOTSamplerReader(), BDSGeometryFactory::BuildGeometry(), BDSBeamPipeInfo::CheckAndSetPointsInfo(), BDSBunchFactory::CreateBunch(), and BDSFieldFactory::PrepareFieldDefinitions().

Here is the caller graph for this function:

◆ SplitOnWhiteSpace()

std::vector< G4String > BDS::SplitOnWhiteSpace ( const G4String &  input)

Split a string on whitespace and return a vector of these 'words'.

Definition at line 472 of file BDSUtilities.cc.

Referenced by BDSScorerInfo::BDSScorerInfo(), BuildBLMs(), BDSDetectorConstruction::BuildPhysicsBias(), BDSDetectorConstruction::BuildWorld(), BDSDetectorConstruction::ConstructScoringMeshes(), DetermineArrayReflectionTypeSet(), and BDSAperturePointsLoader< T >::Load().

Here is the caller graph for this function:

◆ SplitPathAndFileName()

void BDS::SplitPathAndFileName ( const G4String &  filePath,
G4String &  path,
G4String &  filename 
)

Split a full file path into the path and file components. The path ends with '/'.

Definition at line 259 of file BDSUtilities.cc.

Referenced by BDSTemporaryFiles::CreateTemporaryFile(), GetFullPath(), and BDSGDMLPreprocessor::PreprocessFile().

Here is the caller graph for this function:

◆ StartsWith()

G4bool BDS::StartsWith ( const std::string &  expression,
const std::string &  prefix 
)
inline

Return true if a string "expression" starts with "prefix".

Definition at line 266 of file BDSUtilities.hh.

Referenced by BDSMaterials::CacheMaterialsFromGDML(), and BDSBeamline::GetElement().

Here is the caller graph for this function:

◆ StrCompare()

G4int BDS::StrCompare ( const G4String &  str,
const G4String &  test,
G4String::caseCompare  mode = G4String::ignoreCase 
)

Utility function to simplify lots of syntax changes for pedantic g4 changes.

Definition at line 75 of file BDSUtilities.cc.

◆ StrContains()

G4bool BDS::StrContains ( const G4String &  str,
const G4String &  test 
)

◆ StrStrip()

G4String BDS::StrStrip ( const G4String &  str,
char  ch,
StringStripType  stripType = StringStripType::both 
)

Utility function to simplify lots of syntax changes for pedantic g4 changes.

Definition at line 98 of file BDSUtilities.cc.

Referenced by BDSDetectorConstruction::BuildCrossSectionBias().

Here is the caller graph for this function:

◆ UpdateSegmentAngles()

void BDS::UpdateSegmentAngles ( G4int  index,
G4int  nSBends,
G4double  semiAngle,
G4double  incomingFaceAngle,
G4double  outgoingFaceAngle,
G4double &  segmentAngleIn,
G4double &  segmentAngleOut 
)

Definition at line 447 of file BDSBendBuilder.cc.

◆ VerboseEventStop()

G4int BDS::VerboseEventStop ( G4int  verboseEventStart,
G4int  verboseEventContinueFor 
)

Calculate the event number to stop at given a start and number to do. Saturates at the maximum number of an int.

Definition at line 645 of file BDSUtilities.cc.

Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().

Here is the caller graph for this function:

◆ VerboseThisEvent()

G4bool BDS::VerboseThisEvent ( G4int  eventIndex,
G4int  eventStart,
G4int  eventStop 
)

Logic of whether this event should be verbose or not. Code here so it's not duplicated.

Definition at line 656 of file BDSUtilities.cc.

Referenced by BDSLinkTrackingAction::PreUserTrackingAction(), BDSTrackingAction::PreUserTrackingAction(), and BDSSteppingAction::UserSteppingAction().

Here is the caller graph for this function:

◆ Warning() [1/2]

void BDS::Warning ( const G4String &  message)

Definition at line 26 of file BDSWarning.cc.

◆ Warning() [2/2]

void BDS::Warning ( const G4String &  methodName,
const G4String &  message 
)

Definition at line 32 of file BDSWarning.cc.

◆ WillIntersect() [1/2]

G4bool BDS::WillIntersect ( const G4double &  angleIn,
const G4double &  angleOut,
const G4double &  horizontalWidth,
const G4double &  length 
)

Checking for "cutted crossed Z planes" for a cylinder with angled faces. This utility only works in one dimension unlike the other one with the same name and vector arguments.

Definition at line 533 of file BDSUtilities.cc.

◆ WillIntersect() [2/2]

G4bool BDS::WillIntersect ( const G4ThreeVector &  incomingNormal,
const G4ThreeVector &  outgoingNormal,
const G4double &  zSeparation,
const BDSExtent incomingExtent,
const BDSExtent outgoingExtent 
)

Check if two planes will overlap - as defined by their UNIT normal vectors at 0,0,0 and the z separation of the two. Incoming is assumed to have a positive z component and outgoing a -ve z component in this convention.

Definition at line 493 of file BDSUtilities.cc.

References GetZOfPointOnPlane(), IsFinite(), BDSExtent::XNeg(), BDSExtent::XPos(), BDSExtent::YNeg(), and BDSExtent::YPos().

Referenced by BDSBeamline::AddSingleComponent(), BuildEndPieceBeamline(), BDSBeamPipeFactoryBase::CheckAngledVolumeCanBeBuilt(), and BDSMagnetOuterFactoryPolesBase::DipoleCommonPreConstruction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ZeroStrengthDipole()

G4bool BDS::ZeroStrengthDipole ( const BDSMagnetStrength st)

Return whether finite angle or field for a dipole.

Definition at line 45 of file BDSBendBuilder.cc.

References IsFinite().

Referenced by BuildRBendLine(), BuildSBendLine(), and BuildSingleSBend().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cOverGeV

const G4double BDS::cOverGeV = CLHEP::c_light / CLHEP::GeV
static

speed of light / 1 GeV, used for scaling in brho calculation

Definition at line 30 of file BDSPhysicalConstants.hh.

Referenced by BDSParticleDefinition::CalculateRigidity(), BDSHepMC3Reader::HepMC2G4(), BDSROOTSamplerReader::ReadSingleEvent(), and Rigidity().

◆ integratorsBDSIMMatrix

const BDSIntegratorSet* BDS::integratorsBDSIMMatrix
Initial value:
=
new BDSIntegratorSet(BDSIntegratorType::solenoid,
BDSIntegratorType::dipolematrix,
BDSIntegratorType::dipolematrix,
BDSIntegratorType::quadrupole,
BDSIntegratorType::euler,
BDSIntegratorType::euler,
BDSIntegratorType::euler,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::dipolefringe,
BDSIntegratorType::multipolethin,
BDSIntegratorType::g4rk4minimumstep,
BDSIntegratorType::rmatrixthin,
BDSIntegratorType::paralleltransport,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::cavityfringe)
Which integrator to use for each type of magnet / field object.

Mad-x style tracking.

Definition at line 133 of file BDSIntegratorSet.cc.

Referenced by IntegratorSet().

◆ integratorsBDSIMMatrixFringeScaling

const BDSIntegratorSet* BDS::integratorsBDSIMMatrixFringeScaling
Initial value:
=
new BDSIntegratorSet(BDSIntegratorType::solenoid,
BDSIntegratorType::dipolematrix,
BDSIntegratorType::dipolematrix,
BDSIntegratorType::quadrupole,
BDSIntegratorType::euler,
BDSIntegratorType::euler,
BDSIntegratorType::euler,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::dipolefringescaling,
BDSIntegratorType::multipolethin,
BDSIntegratorType::g4rk4minimumstep,
BDSIntegratorType::rmatrixthin,
BDSIntegratorType::paralleltransport,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::cavityfringe)

Definition at line 157 of file BDSIntegratorSet.cc.

◆ integratorsBDSIMOne

const BDSIntegratorSet* BDS::integratorsBDSIMOne
Initial value:
=
new BDSIntegratorSet(BDSIntegratorType::solenoid,
BDSIntegratorType::dipolerodrigues,
BDSIntegratorType::dipolematrix,
BDSIntegratorType::quadrupole,
BDSIntegratorType::sextupole,
BDSIntegratorType::octupole,
BDSIntegratorType::decapole,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::dipolefringe,
BDSIntegratorType::multipolethin,
BDSIntegratorType::g4rk4minimumstep,
BDSIntegratorType::rmatrixthin,
BDSIntegratorType::paralleltransport,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::cavityfringe)

Definition at line 83 of file BDSIntegratorSet.cc.

◆ integratorsBDSIMTwo

const BDSIntegratorSet* BDS::integratorsBDSIMTwo
Initial value:
=
new BDSIntegratorSet(BDSIntegratorType::solenoid,
BDSIntegratorType::dipolerodrigues2,
BDSIntegratorType::dipolematrix,
BDSIntegratorType::quadrupole,
BDSIntegratorType::euler,
BDSIntegratorType::euler,
BDSIntegratorType::euler,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::dipolefringe,
BDSIntegratorType::multipolethin,
BDSIntegratorType::g4rk4minimumstep,
BDSIntegratorType::rmatrixthin,
BDSIntegratorType::paralleltransport,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::cavityfringe)

Definition at line 108 of file BDSIntegratorSet.cc.

◆ integratorsGeant4

const BDSIntegratorSet* BDS::integratorsGeant4
Initial value:
=
new BDSIntegratorSet(BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::dipolefringe,
BDSIntegratorType::multipolethin,
BDSIntegratorType::g4rk4minimumstep,
BDSIntegratorType::rmatrixthin,
BDSIntegratorType::paralleltransport,
BDSIntegratorType::g4classicalrk4,
BDSIntegratorType::cavityfringe)

Definition at line 181 of file BDSIntegratorSet.cc.

◆ integratorsGeant4DP

const BDSIntegratorSet* BDS::integratorsGeant4DP
Initial value:
=
new BDSIntegratorSet(BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::dipolefringe,
BDSIntegratorType::multipolethin,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::rmatrixthin,
BDSIntegratorType::paralleltransport,
BDSIntegratorType::g4dormandprince745,
BDSIntegratorType::cavityfringe)

Definition at line 206 of file BDSIntegratorSet.cc.

◆ NTrajectoryFilters

const int BDS::NTrajectoryFilters = 9
static

Definition at line 45 of file BDSTrajectoryFilter.hh.