BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Public Member Functions | Private Member Functions
GMAD::Beam Class Reference

Beam class. More...

#include <beam.h>

Inheritance diagram for GMAD::Beam:
Inheritance graph
Collaboration diagram for GMAD::Beam:
Collaboration graph

Public Member Functions

 Beam (const GMAD::BeamBase &options)
 
template<typename T >
void set_value (std::string name, T value)
 set methods by property name More...
 
double get_value (std::string name) const
 get method (only for doubles) More...
 
std::string get_value_string (std::string property_name) const
 
void Amalgamate (const Beam &optionsIn, bool override, int startFromEvent=0)
 
bool HasBeenSet (const std::string &name) const
 Whether a parameter has been set using the set_value method or not. More...
 
const std::vector< std::string > & KeysOfSetValues () const
 
- Public Member Functions inherited from GMAD::Published< BeamBase >
bool NameExists (const std::string &name) const
 
Published< BeamBase >::template AttributeMap< T > & attribute_map () const
 

Private Member Functions

void PublishMembers ()
 publish members so these can be looked up from parser More...
 

Additional Inherited Members

- Data Fields inherited from GMAD::BeamBase
int nlinesIgnore
 Ignore first lines in the input bunch file. More...
 
int nlinesSkip
 Number of event lines to skip after the ignore lines. More...
 
double tilt
 tilt of beam applied as rotation about unit local z More...
 
double sigmaT
 bunch length More...
 
double sigmaE
 for the gaussian, elliptic shell, ring distributions More...
 
double sigmaEk
 
double sigmaP
 
bool offsetSampleMean
 
std::vector< std::string > setKeys
 A list of all the keys that have been set in this instance. More...
 
std::string particle
 beam parameters More...
 
std::string beamParticleName
 beam parameters More...
 
double beamEnergy
 beam parameters More...
 
double beamKineticEnergy
 beam parameters More...
 
double beamMomentum
 beam parameters More...
 
std::string distrType
 beam parameters More...
 
std::string xDistrType
 beam parameters More...
 
std::string yDistrType
 beam parameters More...
 
std::string zDistrType
 beam parameters More...
 
std::string spaceDistrType
 beam parameters More...
 
std::string directionDistrType
 beam parameters More...
 
std::string energyDistrType
 beam parameters More...
 
std::string distrFile
 beam parameters More...
 
std::string distrFileFormat
 beam parameters More...
 
bool distrFileFromExecOptions
 Required to know how to build the absolute path properly. More...
 
bool matchDistrFileLength
 beam parameters More...
 
bool removeUnstableWithoutDecay
 beam parameters More...
 
double X0
 initial beam centroid More...
 
double Y0
 initial beam centroid More...
 
double Z0
 initial beam centroid More...
 
double S0
 initial beam centroid More...
 
double Xp0
 initial beam centroid More...
 
double Yp0
 initial beam centroid More...
 
double Zp0
 initial beam centroid More...
 
double T0
 initial beam centroid More...
 
double E0
 initial beam centroid More...
 
double Ek0
 initial beam centroid More...
 
double P0
 initial beam centroid More...
 
double betx
 initial twiss parameters More...
 
double bety
 initial twiss parameters More...
 
double alfx
 initial twiss parameters More...
 
double alfy
 initial twiss parameters More...
 
double emitx
 initial twiss parameters More...
 
double emity
 initial twiss parameters More...
 
double dispx
 initial twiss parameters More...
 
double dispy
 initial twiss parameters More...
 
double dispxp
 initial twiss parameters More...
 
double dispyp
 initial twiss parameters More...
 
double emitNX
 initial twiss parameters More...
 
double emitNY
 initial twiss parameters More...
 
double sigmaX
 for the gaussian beam distribution More...
 
double sigmaXp
 for the gaussian beam distribution More...
 
double sigmaY
 for the gaussian beam distribution More...
 
double sigmaYp
 for the gaussian beam distribution More...
 
double envelopeX
 for the circle/square/box beam distribution More...
 
double envelopeXp
 for the circle/square/box beam distribution More...
 
double envelopeY
 for the circle/square/box beam distribution More...
 
double envelopeYp
 for the circle/square/box beam distribution More...
 
double envelopeZ
 for the circle/square/box beam distribution More...
 
double envelopeZp
 for the circle/square/box beam distribution More...
 
double envelopeT
 for the circle/square/box beam distribution More...
 
double envelopeE
 for the circle/square/box beam distribution More...
 
double envelopeR
 for the circle/square/box beam distribution More...
 
double envelopeRp
 for the circle/square/box beam distribution More...
 
double sigma11
 for the gaussian sigma matrix distribution More...
 
double sigma12
 for the gaussian sigma matrix distribution More...
 
double sigma13
 for the gaussian sigma matrix distribution More...
 
double sigma14
 for the gaussian sigma matrix distribution More...
 
double sigma15
 for the gaussian sigma matrix distribution More...
 
double sigma16
 for the gaussian sigma matrix distribution More...
 
double sigma22
 for the gaussian sigma matrix distribution More...
 
double sigma23
 for the gaussian sigma matrix distribution More...
 
double sigma24
 for the gaussian sigma matrix distribution More...
 
double sigma25
 for the gaussian sigma matrix distribution More...
 
double sigma26
 for the gaussian sigma matrix distribution More...
 
double sigma33
 for the gaussian sigma matrix distribution More...
 
double sigma34
 for the gaussian sigma matrix distribution More...
 
double sigma35
 for the gaussian sigma matrix distribution More...
 
double sigma36
 for the gaussian sigma matrix distribution More...
 
double sigma44
 for the gaussian sigma matrix distribution More...
 
double sigma45
 for the gaussian sigma matrix distribution More...
 
double sigma46
 for the gaussian sigma matrix distribution More...
 
double sigma55
 for the gaussian sigma matrix distribution More...
 
double sigma56
 for the gaussian sigma matrix distribution More...
 
double sigma66
 for the gaussian sigma matrix distribution More...
 
double shellX
 for the elliptic shell distribution More...
 
double shellXp
 for the elliptic shell distribution More...
 
double shellY
 for the elliptic shell distribution More...
 
double shellYp
 for the elliptic shell distribution More...
 
double shellXWidth
 for the elliptic shell distribution More...
 
double shellXpWidth
 for the elliptic shell distribution More...
 
double shellYWidth
 for the elliptic shell distribution More...
 
double shellYpWidth
 for the elliptic shell distribution More...
 
double Rmin
 for the ring beam distribution More...
 
double Rmax
 for the ring beam distribution More...
 
double haloNSigmaXInner
 for the halo distribution More...
 
double haloNSigmaXOuter
 for the halo distribution More...
 
double haloNSigmaYInner
 for the halo distribution More...
 
double haloNSigmaYOuter
 for the halo distribution More...
 
double haloXCutInner
 for the halo distribution More...
 
double haloYCutInner
 for the halo distribution More...
 
double haloXCutOuter
 for the halo distribution More...
 
double haloYCutOuter
 for the halo distribution More...
 
double haloXpCutInner
 for the halo distribution More...
 
double haloYpCutInner
 for the halo distribution More...
 
double haloXpCutOuter
 for the halo distribution More...
 
double haloYpCutOuter
 for the halo distribution More...
 
double haloPSWeightParameter
 for the halo distribution More...
 
std::string haloPSWeightFunction
 for the halo distribution More...
 
double eventGeneratorMinX
 Event generator file filter. More...
 
double eventGeneratorMaxX
 Event generator file filter. More...
 
double eventGeneratorMinY
 Event generator file filter. More...
 
double eventGeneratorMaxY
 Event generator file filter. More...
 
double eventGeneratorMinZ
 Event generator file filter. More...
 
double eventGeneratorMaxZ
 Event generator file filter. More...
 
double eventGeneratorMinXp
 Event generator file filter. More...
 
double eventGeneratorMaxXp
 Event generator file filter. More...
 
double eventGeneratorMinYp
 Event generator file filter. More...
 
double eventGeneratorMaxYp
 Event generator file filter. More...
 
double eventGeneratorMinZp
 Event generator file filter. More...
 
double eventGeneratorMaxZp
 Event generator file filter. More...
 
double eventGeneratorMinRp
 Event generator file filter. More...
 
double eventGeneratorMaxRp
 Event generator file filter. More...
 
double eventGeneratorMinT
 Event generator file filter. More...
 
double eventGeneratorMaxT
 Event generator file filter. More...
 
double eventGeneratorMinEK
 Event generator file filter. More...
 
double eventGeneratorMaxEK
 Event generator file filter. More...
 
std::string eventGeneratorParticles
 Event generator file filter. More...
 
bool eventGeneratorWarnSkippedParticles
 Event generator file filter. More...
 
- Protected Types inherited from GMAD::Published< BeamBase >
using AttributeMap = typename std::unordered_map< std::string, T C::* >
 Define AttributeMap of string and class member pointer. More...
 
- Protected Member Functions inherited from GMAD::Published< BeamBase >
void publish (const std::string &name, T C::*mp)
 Make pointer to member from class C and type T with accessible with a name. More...
 
void set (BeamBase *instance, const BeamBase *instance2, const std::string &name)
 Set member with name of class instance to value of second instance. More...
 
AttributeMap< T > & attribute_map () const
 Access method to static map for type T and class C.
 
get (const BeamBase *instance, const std::string &name) const
 Get method for class C. More...
 
void set (BeamBase *instance, const std::string &name, double value)
 
void set (BeamBase *instance, const std::string &name, GMAD::Array *const &value)
 
void set (BeamBase *instance, const std::string &name, const T &value)
 

Detailed Description

Beam class.

Beam passed with beam command. This inherits the BeamBase class which contains all the members and provides templated filling functions. This separation allows the BeamBase class to be more easily written out to ROOT files or other formats for strong reproducibility in a BDSIM run.

Author
I. Agapov, J. Snuverink

Definition at line 43 of file beam.h.

Constructor & Destructor Documentation

◆ Beam() [1/2]

Beam::Beam ( )

Definition at line 27 of file beam.cc.

◆ Beam() [2/2]

Beam::Beam ( const GMAD::BeamBase options)
explicit

Definition at line 33 of file beam.cc.

Member Function Documentation

◆ Amalgamate()

void Beam::Amalgamate ( const Beam optionsIn,
bool  override,
int  startFromEvent = 0 
)

Take another instance of options and copy the values that have been set (through setKeys, which although private each instance has access to as C++ treats encapsulation at the class level). If override is true, the input option will override the existing one in this instance.

Definition at line 97 of file beam.cc.

References GMAD::BeamBase::nlinesIgnore, GMAD::Published< BeamBase >::set(), and GMAD::BeamBase::setKeys.

Referenced by BDSParser::AmalgamateBeam(), and BDSExecOptions::BDSExecOptions().

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

◆ get_value()

double Beam::get_value ( std::string  name) const

get method (only for doubles)

Definition at line 39 of file beam.cc.

Referenced by BDS::ConflictingParametersSet().

Here is the caller graph for this function:

◆ get_value_string()

std::string Beam::get_value_string ( std::string  property_name) const

Definition at line 63 of file beam.cc.

◆ HasBeenSet()

bool Beam::HasBeenSet ( const std::string &  name) const

Whether a parameter has been set using the set_value method or not.

Definition at line 142 of file beam.cc.

References GMAD::BeamBase::setKeys.

Referenced by BDS::NBeamParametersSet(), and BDSBunchSquare::SetOptions().

Here is the caller graph for this function:

◆ KeysOfSetValues()

const std::vector< std::string > & GMAD::Beam::KeysOfSetValues ( ) const
inline

Definition at line 68 of file beam.h.

◆ PublishMembers()

void Beam::PublishMembers ( )
private

publish members so these can be looked up from parser

Definition at line 151 of file beam.cc.

References GMAD::BeamBase::alfx, GMAD::BeamBase::alfy, GMAD::BeamBase::beamEnergy, GMAD::BeamBase::beamKineticEnergy, GMAD::BeamBase::beamMomentum, GMAD::BeamBase::beamParticleName, GMAD::BeamBase::betx, GMAD::BeamBase::bety, GMAD::BeamBase::directionDistrType, GMAD::BeamBase::dispx, GMAD::BeamBase::dispxp, GMAD::BeamBase::dispy, GMAD::BeamBase::dispyp, GMAD::BeamBase::distrFile, GMAD::BeamBase::distrFileFormat, GMAD::BeamBase::distrFileFromExecOptions, GMAD::BeamBase::distrType, GMAD::BeamBase::E0, GMAD::BeamBase::Ek0, GMAD::BeamBase::emitNX, GMAD::BeamBase::emitNY, GMAD::BeamBase::emitx, GMAD::BeamBase::emity, GMAD::BeamBase::energyDistrType, GMAD::BeamBase::envelopeE, GMAD::BeamBase::envelopeR, GMAD::BeamBase::envelopeRp, GMAD::BeamBase::envelopeT, GMAD::BeamBase::envelopeX, GMAD::BeamBase::envelopeXp, GMAD::BeamBase::envelopeY, GMAD::BeamBase::envelopeYp, GMAD::BeamBase::envelopeZ, GMAD::BeamBase::envelopeZp, GMAD::BeamBase::eventGeneratorMaxEK, GMAD::BeamBase::eventGeneratorMaxRp, GMAD::BeamBase::eventGeneratorMaxX, GMAD::BeamBase::eventGeneratorMaxXp, GMAD::BeamBase::eventGeneratorMaxY, GMAD::BeamBase::eventGeneratorMaxYp, GMAD::BeamBase::eventGeneratorMaxZ, GMAD::BeamBase::eventGeneratorMaxZp, GMAD::BeamBase::eventGeneratorMinEK, GMAD::BeamBase::eventGeneratorMinRp, GMAD::BeamBase::eventGeneratorMinT, GMAD::BeamBase::eventGeneratorMinX, GMAD::BeamBase::eventGeneratorMinXp, GMAD::BeamBase::eventGeneratorMinY, GMAD::BeamBase::eventGeneratorMinYp, GMAD::BeamBase::eventGeneratorMinZ, GMAD::BeamBase::eventGeneratorMinZp, GMAD::BeamBase::eventGeneratorParticles, GMAD::BeamBase::eventGeneratorWarnSkippedParticles, GMAD::BeamBase::haloNSigmaXInner, GMAD::BeamBase::haloNSigmaXOuter, GMAD::BeamBase::haloNSigmaYInner, GMAD::BeamBase::haloNSigmaYOuter, GMAD::BeamBase::haloPSWeightFunction, GMAD::BeamBase::haloPSWeightParameter, GMAD::BeamBase::haloXCutInner, GMAD::BeamBase::haloXCutOuter, GMAD::BeamBase::haloXpCutInner, GMAD::BeamBase::haloXpCutOuter, GMAD::BeamBase::haloYCutInner, GMAD::BeamBase::haloYCutOuter, GMAD::BeamBase::haloYpCutInner, GMAD::BeamBase::haloYpCutOuter, GMAD::BeamBase::matchDistrFileLength, GMAD::BeamBase::nlinesIgnore, GMAD::BeamBase::nlinesSkip, GMAD::BeamBase::P0, GMAD::BeamBase::particle, GMAD::Published< BeamBase >::publish(), GMAD::BeamBase::removeUnstableWithoutDecay, GMAD::BeamBase::Rmax, GMAD::BeamBase::Rmin, GMAD::BeamBase::S0, GMAD::BeamBase::shellX, GMAD::BeamBase::shellXp, GMAD::BeamBase::shellXpWidth, GMAD::BeamBase::shellXWidth, GMAD::BeamBase::shellY, GMAD::BeamBase::shellYp, GMAD::BeamBase::shellYpWidth, GMAD::BeamBase::shellYWidth, GMAD::BeamBase::sigma11, GMAD::BeamBase::sigma12, GMAD::BeamBase::sigma13, GMAD::BeamBase::sigma14, GMAD::BeamBase::sigma15, GMAD::BeamBase::sigma16, GMAD::BeamBase::sigma22, GMAD::BeamBase::sigma23, GMAD::BeamBase::sigma24, GMAD::BeamBase::sigma25, GMAD::BeamBase::sigma26, GMAD::BeamBase::sigma33, GMAD::BeamBase::sigma34, GMAD::BeamBase::sigma35, GMAD::BeamBase::sigma36, GMAD::BeamBase::sigma44, GMAD::BeamBase::sigma45, GMAD::BeamBase::sigma46, GMAD::BeamBase::sigma55, GMAD::BeamBase::sigma56, GMAD::BeamBase::sigma66, GMAD::BeamBase::sigmaE, GMAD::BeamBase::sigmaT, GMAD::BeamBase::sigmaX, GMAD::BeamBase::sigmaXp, GMAD::BeamBase::sigmaY, GMAD::BeamBase::sigmaYp, GMAD::BeamBase::spaceDistrType, GMAD::BeamBase::T0, GMAD::BeamBase::tilt, GMAD::BeamBase::X0, GMAD::BeamBase::xDistrType, GMAD::BeamBase::Xp0, GMAD::BeamBase::Y0, GMAD::BeamBase::yDistrType, GMAD::BeamBase::Yp0, GMAD::BeamBase::Z0, GMAD::BeamBase::zDistrType, and GMAD::BeamBase::Zp0.

Here is the call graph for this function:

◆ set_value()

template<typename T >
void Beam::set_value ( std::string  name,
value 
)

set methods by property name

Definition at line 76 of file beam.h.

References GMAD::Published< BeamBase >::set(), and GMAD::BeamBase::setKeys.

Referenced by BDSExecOptions::Parse().

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

The documentation for this class was generated from the following files: