BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Const entry to parser objects. More...
#include <BDSParser.hh>
Public Member Functions | |
BDSParser ()=delete | |
No default constructor. | |
virtual | ~BDSParser () |
Destructor. More... | |
const GMAD::Options & | GetOptions () const |
Return options. More... | |
const GMAD::OptionsBase * | GetOptionsBase () const |
Return bare options base class. More... | |
const GMAD::Beam & | GetBeam () const |
Return beam. More... | |
GMAD::Beam & | GetBeam () |
Return beam non-const. Required when loading a file and need to change beam parameters to match. More... | |
const GMAD::BeamBase * | GetBeamBase () const |
Return bare beam base class. More... | |
void | AmalgamateOptions (const GMAD::Options &optionsIn) |
Amalgamate the input options with the ones stored in the parser. More... | |
void | AmalgamateBeam (const GMAD::Beam &beamIn, bool recreate) |
Amalgamate the input beam definition with the ones stored in teh parser. More... | |
void | CheckOptions () |
Check options for consistency. This also checks the beam options. More... | |
const GMAD::FastList< GMAD::Element > & | GetSequence (const std::string &name) |
Return sequence. More... | |
const GMAD::Element * | GetElement (const std::string &name) |
std::vector< GMAD::Atom > | GetAtoms () const |
Return the vector of atom objects. More... | |
const GMAD::Element * | GetPlacementElement (const std::string &name) |
const GMAD::FastList< GMAD::PhysicsBiasing > & | GetBiasing () const |
Return biasing list. More... | |
const std::vector< GMAD::PhysicsBiasing > | GetBiasingVector () const |
std::vector< GMAD::CavityModel > | GetCavityModels () const |
Return cavity model list. More... | |
std::vector< GMAD::NewColour > | GetColours () const |
Return colour model list. More... | |
std::vector< GMAD::Crystal > | GetCrystals () const |
Return crystal model list. More... | |
std::vector< GMAD::Field > | GetFields () const |
Return the vector of field objects. More... | |
std::vector< GMAD::Material > | GetMaterials () const |
Return material list. More... | |
std::vector< GMAD::Placement > | GetPlacements () const |
Return the vector of placement objects. More... | |
std::vector< GMAD::Query > | GetQuery () const |
Query list. More... | |
std::vector< GMAD::Region > | GetRegions () const |
Return region list. More... | |
std::vector< GMAD::SamplerPlacement > | GetSamplerPlacements () const |
Return sampler placement list. More... | |
std::vector< GMAD::Scorer > | GetScorers () const |
Return scorer list. More... | |
std::vector< GMAD::ScorerMesh > | GetScorerMesh () const |
Return scorermesh list. More... | |
std::vector< GMAD::BLMPlacement > | GetBLMs () const |
Return blm list. More... | |
std::vector< GMAD::Aperture > | GetApertures () const |
Return aperture list. More... | |
Static Public Member Functions | |
static BDSParser * | Instance (const std::string &filename) |
Constructor method. More... | |
static BDSParser * | Instance () |
Access method. More... | |
static bool | IsInitialised () |
Returns if parser is initialised. More... | |
Protected Member Functions | |
BDSParser (const std::string &filename) | |
Constructor from filename. More... | |
Static Private Attributes | |
static BDSParser * | instance = nullptr |
Instance. More... | |
Additional Inherited Members | |
![]() | |
Parser ()=delete | |
No default constructor. | |
virtual | ~Parser () |
Destructor. More... | |
void | quit () |
Exit method. More... | |
void | write_table (std::string *name, ElementType type, bool isLine=false) |
Method that transfers parameters to element properties. More... | |
void | expand_line (FastList< Element > &target, const std::string &name, std::string start="", std::string end="") |
void | expand_line (const std::string &name, std::string start, std::string end) |
Expand the main beamline as defined by the use command. More... | |
const FastList< Element > & | get_sequence (const std::string &name) |
int | add_sampler_partIDSet (std::list< int > *samplerPartIDListIn) |
void | add_sampler (const std::string &name, int count, ElementType type, std::string samplerType, std::list< int > *samplerPartIDListIn=nullptr) |
insert a sampler into beamline_list More... | |
template<class C , class Container = FastList<C>> | |
void | Add () |
Insert global object of parser class C in Container class. More... | |
template<class C , class Container = FastList<C>> | |
void | Add (bool unique, const std::string &className) |
template<class C > | |
C & | GetGlobal () |
Get global object of parser class C. | |
template<class C , class Container = FastList<C>> | |
Container & | GetList () |
Get list for parser class C. | |
const std::set< std::set< int > > & | GetSamplerFilters () const |
const std::map< int, std::set< int > > & | GetSamplerFilterIDToSet () const |
Element & | find_element (const std::string &element_name) |
find element More... | |
const Element & | find_element (const std::string &element_name) const |
find element (const) More... | |
const Element * | find_element_safe (const std::string &element_name) const |
find element by pointer - nullptr if not found - searches element_list More... | |
const Element * | find_placement_element_safe (const std::string &element_name) const |
search placement_element More... | |
double | property_lookup (const std::string &element_name, const std::string &property_name) const |
access property of Element with element_name More... | |
void | add_element_temp (const std::string &name, int number, bool pushfront, ElementType linetype) |
add element to temporary element sequence tmp_list More... | |
int | copy_element_to_params (const std::string &elementName) |
copy properties from Element into params, returns element type as integer, returs _NONE if not found More... | |
bool | InvalidSymbolName (const std::string &s, std::string &errorReason) |
Symtab * | symcreate (const std::string &s) |
create new parser symbol More... | |
Symtab * | symlook (const std::string &s) |
look up parser symbol More... | |
void | ClearParams () |
template<class C , typename T > | |
void | SetValue (std::string property, T value) |
Set value for parser class. More... | |
template<class C > | |
double | GetValue (std::string property) |
Get value for parser class (only for doubles) More... | |
template<typename T > | |
std::list< T > * | ArrayToList (Array *) |
template<typename T > | |
void | ExtendValue (const std::string &property, T value) |
Add value to be extended to object. | |
void | Overwrite (const std::string &objectName) |
Overwrite object with current values. More... | |
void | AddVariable (std::string *name) |
Add variable memory to variable list for memory management. More... | |
bool | TryPrintingObject (const std::string &objectName) const |
const FastList< Element > & | GetBeamline () const |
template<> | |
Beam & | GetGlobal () |
template<> | |
FastList< Region > & | GetList () |
template<> | |
FastList< NewColour > & | GetList () |
template<> | |
FastList< Crystal > & | GetList () |
template<> | |
FastList< Field > & | GetList () |
template<> | |
FastList< Query > & | GetList () |
template<> | |
FastList< Atom > & | GetList () |
template<> | |
FastList< Material > & | GetList () |
template<> | |
FastList< Tunnel > & | GetList () |
template<> | |
FastList< CavityModel > & | GetList () |
template<> | |
FastList< Scorer > & | GetList () |
template<> | |
FastList< ScorerMesh > & | GetList () |
template<> | |
FastList< Placement > & | GetList () |
template<> | |
FastList< PhysicsBiasing > & | GetList () |
template<> | |
FastList< SamplerPlacement > & | GetList () |
template<> | |
FastList< BLMPlacement > & | GetList () |
template<> | |
FastList< Aperture > & | GetList () |
template<> | |
void | ExtendValue (const std::string &property, double value) |
template<> | |
void | ExtendValue (const std::string &property, std::string value) |
template<> | |
void | ExtendValue (const std::string &property, Array *value) |
template<> | |
void | Add (bool unique, const std::string &className) |
void | Store (double value) |
Add value to front of temporary list. More... | |
void | Store (const std::string &name) |
Add value to front of temporary list. More... | |
void | FillArray (Array *) |
void | FillString (Array *) |
void | PrintBeamline () const |
Print methods. More... | |
void | PrintElements () const |
Print methods. More... | |
void | PrintOptions () const |
Print methods. More... | |
Parser (std::string filename) | |
Constructor from filename. More... | |
![]() | |
static Parser * | Instance (const std::string &filename) |
Constructor method. More... | |
static Parser * | Instance () |
Access method. More... | |
![]() | |
std::string | current_line |
Name of beamline. More... | |
std::string | current_start |
Name of beamline. More... | |
std::string | current_end |
Name of beamline. More... | |
Beam | beam |
Beam instance;. More... | |
Options | options |
General options. More... | |
FastList< Element > | beamline_list |
Beamline. More... | |
FastList< Atom > | atom_list |
List of parser defined atoms. More... | |
FastList< NewColour > | colour_list |
List of parser defined colours. More... | |
FastList< Crystal > | crystal_list |
FastList< Field > | field_list |
List of parser defined fields. More... | |
FastList< Material > | material_list |
List of parser defined materials. More... | |
FastList< Query > | query_list |
List of parser defined query objects. More... | |
FastList< Region > | region_list |
List of parser defined regions. More... | |
FastList< Tunnel > | tunnel_list |
List of parser defined tunnels. More... | |
FastList< PhysicsBiasing > | xsecbias_list |
List of parser defined cross section biasing objects. More... | |
FastList< Placement > | placement_list |
List of parser defined placements. More... | |
FastList< CavityModel > | cavitymodel_list |
List of parser defined rf cavity models. More... | |
FastList< SamplerPlacement > | samplerplacement_list |
List of parser defined sampler placements. More... | |
FastList< Scorer > | scorer_list |
FastList< ScorerMesh > | scorermesh_list |
FastList< Aperture > | aperture_list |
List of parser defined apertures. More... | |
FastList< BLMPlacement > | blm_list |
List of parser defined blms. More... | |
|
virtual |
|
explicitprotected |
Constructor from filename.
Definition at line 59 of file BDSParser.cc.
void BDSParser::AmalgamateBeam | ( | const GMAD::Beam & | beamIn, |
bool | recreate | ||
) |
Amalgamate the input beam definition with the ones stored in teh parser.
Definition at line 65 of file BDSParser.cc.
References GMAD::Beam::Amalgamate(), and GMAD::Parser::beam.
Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().
void BDSParser::AmalgamateOptions | ( | const GMAD::Options & | optionsIn | ) |
Amalgamate the input options with the ones stored in the parser.
Definition at line 76 of file BDSParser.cc.
References GMAD::Options::Amalgamate(), GMAD::Parser::options, and GMAD::OptionsBase::recreate.
Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().
void BDSParser::CheckOptions | ( | ) |
Check options for consistency. This also checks the beam options.
Definition at line 84 of file BDSParser.cc.
References GMAD::Parser::beam, GMAD::OptionsBase::beamlineS, BDS::IsFinite(), GMAD::OptionsBase::nGenerate, GMAD::Parser::options, and GMAD::BeamBase::S0.
Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().
|
inline |
Return aperture list.
Definition at line 135 of file BDSParser.hh.
References GMAD::Parser::aperture_list.
|
inline |
Return the vector of atom objects.
Definition at line 88 of file BDSParser.hh.
References GMAD::Parser::atom_list.
Referenced by BDSMaterials::PrepareRequiredMaterials().
|
inline |
Return beam non-const. Required when loading a file and need to change beam parameters to match.
Definition at line 59 of file BDSParser.hh.
References GMAD::Parser::beam.
|
inline |
Return beam.
Definition at line 56 of file BDSParser.hh.
References GMAD::Parser::beam.
Referenced by BDSIM::Initialise(), and BDSIMLink::Initialise().
|
inline |
Return bare beam base class.
Definition at line 62 of file BDSParser.hh.
References GMAD::Parser::beam.
Referenced by BDSIM::Initialise().
|
inline |
Return biasing list.
Definition at line 95 of file BDSParser.hh.
References GMAD::Parser::xsecbias_list.
Referenced by BDSDetectorConstruction::BuildPhysicsBias(), and BDSIM::Initialise().
|
inline |
Definition at line 96 of file BDSParser.hh.
|
inline |
|
inline |
Return cavity model list.
Definition at line 99 of file BDSParser.hh.
References GMAD::Parser::cavitymodel_list.
|
inline |
Return colour model list.
Definition at line 102 of file BDSParser.hh.
References GMAD::Parser::colour_list.
|
inline |
Return crystal model list.
Definition at line 105 of file BDSParser.hh.
References GMAD::Parser::crystal_list.
|
inline |
Return an element definition. Returns nullptr if not found. Note the element_list is emptied after parsing.
Definition at line 85 of file BDSParser.hh.
References GMAD::Parser::find_element_safe().
|
inline |
Return the vector of field objects.
Definition at line 108 of file BDSParser.hh.
References GMAD::Parser::field_list.
|
inline |
Return material list.
Definition at line 111 of file BDSParser.hh.
References GMAD::Parser::material_list.
Referenced by BDSMaterials::PrepareRequiredMaterials().
|
inline |
Return options.
Definition at line 50 of file BDSParser.hh.
References GMAD::Parser::options.
Referenced by BDSDetectorConstruction::BuildPhysicsBias(), BDSMaterials::DefineVacuums(), BDSIM::Initialise(), and BDSIMLink::Initialise().
|
inline |
Return bare options base class.
Definition at line 53 of file BDSParser.hh.
References GMAD::Parser::options.
Referenced by BDSIM::Initialise().
|
inline |
Return a placement element definition. Returns nullptr if not found. Only searches elements used in the placement.
Definition at line 92 of file BDSParser.hh.
References GMAD::Parser::find_placement_element_safe().
Referenced by BDS::BuildPlacementGeometry().
|
inline |
Return the vector of placement objects.
Definition at line 114 of file BDSParser.hh.
References GMAD::Parser::placement_list.
Referenced by BDSDetectorConstruction::BuildBeamlines(), BDSDetectorConstruction::CountPlacementFields(), and BDS::NumberOfExtraWorldsRequired().
|
inline |
Query list.
Definition at line 117 of file BDSParser.hh.
References GMAD::Parser::query_list.
Referenced by BDSDetectorConstruction::PrepareFieldQueries().
|
inline |
Return region list.
Definition at line 120 of file BDSParser.hh.
References GMAD::Parser::region_list.
|
inline |
Return sampler placement list.
Definition at line 123 of file BDSParser.hh.
References GMAD::Parser::samplerplacement_list.
Referenced by BDSDetectorConstruction::CalculateExtentOfSamplerPlacements(), BDSParallelWorldSampler::Construct(), and BDSDetectorConstruction::UpdateSamplerDiameterAndCountSamplers().
|
inline |
Return scorermesh list.
Definition at line 129 of file BDSParser.hh.
Referenced by BDSDetectorConstruction::CalculateExtentOfScorerMeshes(), and BDSDetectorConstruction::ConstructScoringMeshes().
|
inline |
Return scorer list.
Definition at line 126 of file BDSParser.hh.
Referenced by BDS::BuildBLMs(), and BDSDetectorConstruction::ConstructScoringMeshes().
|
inline |
Return sequence.
Definition at line 81 of file BDSParser.hh.
References GMAD::Parser::get_sequence().
Referenced by BDSDetectorConstruction::BuildBeamlines().
|
static |
Access method.
Definition at line 28 of file BDSParser.cc.
References instance.
Referenced by BDSFieldFactory::BDSFieldFactory(), BDSDetectorConstruction::BuildBeamlines(), BDS::BuildBLMs(), BDSDetectorConstruction::BuildPhysicsBias(), BDS::BuildPlacementGeometry(), BDSDetectorConstruction::CalculateExtentOfSamplerPlacements(), BDSDetectorConstruction::CalculateExtentOfScorerMeshes(), BDSDetectorConstruction::Construct(), BDSParallelWorldSampler::Construct(), BDSDetectorConstruction::ConstructScoringMeshes(), BDSDetectorConstruction::CountPlacementFields(), BDSMaterials::DefineVacuums(), BDSIM::Initialise(), BDSIMLink::Initialise(), BDSDetectorConstruction::InitialiseApertures(), BDSDetectorConstruction::InitialiseRegions(), BDSGlobalConstants::Instance(), BDS::NumberOfExtraWorldsRequired(), BDSComponentFactory::PrepareCavityModels(), BDSComponentFactory::PrepareColours(), BDSComponentFactory::PrepareCrystals(), BDSDetectorConstruction::PrepareExtraSamplerSDs(), BDSDetectorConstruction::PrepareFieldQueries(), BDSMaterials::PrepareRequiredMaterials(), and BDSDetectorConstruction::UpdateSamplerDiameterAndCountSamplers().
|
static |
Constructor method.
Definition at line 38 of file BDSParser.cc.
References BDSParser(), and instance.
|
static |
Returns if parser is initialised.
Definition at line 49 of file BDSParser.cc.
References instance.
Referenced by BDSMaterials::DefineVacuums().
|
staticprivate |
Instance.
Definition at line 143 of file BDSParser.hh.
Referenced by Instance(), IsInitialised(), and ~BDSParser().