BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
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
 
double get_value (std::string name) const
 get method (only for doubles)
 
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.
 
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
 

Additional Inherited Members

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

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::bunchFrequency, GMAD::BeamBase::bunchPeriod, 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::distrFileLoop, GMAD::BeamBase::distrFileLoopNTimes, GMAD::BeamBase::distrFileMatchLength, 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::eventGeneratorNEventsSkip, GMAD::BeamBase::eventGeneratorParticles, GMAD::BeamBase::eventGeneratorWarnSkippedParticles, GMAD::BeamBase::eventsPerBunch, 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::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, GMAD::BeamBase::zFromT, 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: