39double Beam::get_value(std::string property_name)
const
43 {value = get<double>(
this,property_name);}
44 catch (
const std::runtime_error&)
47 {value = (double)get<int>(
this,property_name);}
48 catch (
const std::runtime_error&)
51 {value = (double)get<long>(
this,property_name);}
52 catch (
const std::runtime_error&)
54 std::cerr <<
"beam.cc> Error: unknown property \"" << property_name
55 <<
"\" (only works on numerical properties)" << std::endl;
63std::string Beam::get_value_string(std::string property_name)
const
66 double value = get<double>(
this, property_name);
67 std::ostringstream strs;
73 int value = get<int>(
this, property_name);
74 std::ostringstream strs;
80 std::string value = get<std::string>(
this, property_name);
85 bool value = get<bool>(
this, property_name);
86 std::ostringstream strs;
87 strs << std::boolalpha << value;
91 {std::cerr <<
"Error " << property_name << std::endl; exit(1);}
101 for (
auto const& key : beamIn.
setKeys)
105 set(
this, &beamIn, key);
108 catch (
const std::runtime_error&)
110 std::cerr <<
"Error: Amalgamate unknown beam parameter \"" << key <<
"\"" << std::endl;
120 for (
auto const& key : beamIn.
setKeys)
123 auto result = std::find(ok.begin(), ok.end(), key);
124 if (result == ok.end())
128 set(
this, &beamIn, key);
131 catch (
const std::runtime_error&)
133 std::cerr <<
"Error: Amalgamate unknown beam parameter \"" << key <<
"\""
209 publish(
"sigmaEk", &Beam::sigmaEk);
210 publish(
"sigmaP", &Beam::sigmaP);
310 publish(
"offsetSampleMean", &Beam::offsetSampleMean);
Options for a beam distribution.
double dispy
initial twiss parameters
double alfy
initial twiss parameters
std::string particle
beam parameters
double eventGeneratorMaxYp
Event generator file filter.
double sigma45
for the gaussian sigma matrix distribution
double eventGeneratorMaxXp
Event generator file filter.
double sigmaE
for the gaussian, elliptic shell, ring distributions
double emity
initial twiss parameters
double haloXCutOuter
for the halo distribution
double bunchFrequency
Bunch offsets in time.
double sigma16
for the gaussian sigma matrix distribution
double haloNSigmaYInner
for the halo distribution
double beamKineticEnergy
beam parameters
double envelopeRp
for the circle/square/box beam distribution
double eventGeneratorMaxEK
Event generator file filter.
double haloXpCutOuter
for the halo distribution
double sigmaX
for the gaussian beam distribution
std::string distrFileFormat
beam parameters
double beamEnergy
beam parameters
double envelopeZp
for the circle/square/box beam distribution
bool eventGeneratorWarnSkippedParticles
Event generator file filter.
double shellXp
for the elliptic shell distribution
double sigma66
for the gaussian sigma matrix distribution
double haloXCutInner
for the halo distribution
double envelopeZ
for the circle/square/box beam distribution
double sigma35
for the gaussian sigma matrix distribution
double sigma44
for the gaussian sigma matrix distribution
double haloYpCutInner
for the halo distribution
double emitNY
initial twiss parameters
double envelopeE
for the circle/square/box beam distribution
double eventGeneratorMaxZp
Event generator file filter.
double sigmaXp
for the gaussian beam distribution
double eventGeneratorMinYp
Event generator file filter.
double sigma13
for the gaussian sigma matrix distribution
int eventsPerBunch
Bunch offsets in time.
double sigma34
for the gaussian sigma matrix distribution
double betx
initial twiss parameters
std::string distrFile
beam parameters
double eventGeneratorMinEK
Event generator file filter.
std::string directionDistrType
beam parameters
double haloYCutOuter
for the halo distribution
double sigmaYp
for the gaussian beam distribution
double haloNSigmaXInner
for the halo distribution
bool distrFileFromExecOptions
Required to know how to build the absolute path properly.
double dispxp
initial twiss parameters
double envelopeYp
for the circle/square/box beam distribution
double eventGeneratorMaxZ
Event generator file filter.
double eventGeneratorMinY
Event generator file filter.
double sigma12
for the gaussian sigma matrix distribution
double Ek0
initial beam centroid
std::string spaceDistrType
beam parameters
double haloNSigmaYOuter
for the halo distribution
std::string beamParticleName
beam parameters
bool distrFileLoop
beam parameters
bool removeUnstableWithoutDecay
beam parameters
double sigma26
for the gaussian sigma matrix distribution
double haloYCutInner
for the halo distribution
double tilt
tilt of beam applied as rotation about unit local z
double sigma25
for the gaussian sigma matrix distribution
double shellXpWidth
for the elliptic shell distribution
std::string distrType
beam parameters
double sigma36
for the gaussian sigma matrix distribution
int eventGeneratorNEventsSkip
Event generator file filter.
double sigma46
for the gaussian sigma matrix distribution
double eventGeneratorMaxRp
Event generator file filter.
int nlinesIgnore
Ignore first lines in the input bunch file.
double emitNX
initial twiss parameters
double eventGeneratorMinZ
Event generator file filter.
double envelopeR
for the circle/square/box beam distribution
double S0
initial beam centroid
double eventGeneratorMinXp
Event generator file filter.
double shellYp
for the elliptic shell distribution
double dispyp
initial twiss parameters
double sigma14
for the gaussian sigma matrix distribution
bool zFromT
for the circle/square/box beam distribution
double bunchPeriod
Bunch offsets in time.
double sigma23
for the gaussian sigma matrix distribution
double sigma11
for the gaussian sigma matrix distribution
double eventGeneratorMinZp
Event generator file filter.
double envelopeX
for the circle/square/box beam distribution
double shellX
for the elliptic shell distribution
double P0
initial beam centroid
std::string zDistrType
beam parameters
double haloNSigmaXOuter
for the halo distribution
std::vector< std::string > setKeys
A list of all the keys that have been set in this instance.
double dispx
initial twiss parameters
double alfx
initial twiss parameters
double emitx
initial twiss parameters
std::string eventGeneratorParticles
Event generator file filter.
double sigmaT
bunch length
double sigma22
for the gaussian sigma matrix distribution
double bety
initial twiss parameters
std::string yDistrType
beam parameters
double Zp0
initial beam centroid
double Rmax
for the ring beam distribution
double envelopeXp
for the circle/square/box beam distribution
int distrFileLoopNTimes
beam parameters
double Z0
initial beam centroid
double sigma33
for the gaussian sigma matrix distribution
std::string energyDistrType
beam parameters
double eventGeneratorMaxY
Event generator file filter.
double eventGeneratorMinT
Event generator file filter.
double sigma15
for the gaussian sigma matrix distribution
double envelopeY
for the circle/square/box beam distribution
double haloPSWeightParameter
for the halo distribution
double sigma55
for the gaussian sigma matrix distribution
double sigma56
for the gaussian sigma matrix distribution
double X0
initial beam centroid
double eventGeneratorMaxX
Event generator file filter.
double envelopeT
for the circle/square/box beam distribution
int nlinesSkip
Number of event lines to skip after the ignore lines.
double eventGeneratorMinRp
Event generator file filter.
bool distrFileMatchLength
beam parameters
double beamMomentum
beam parameters
double Xp0
initial beam centroid
double sigma24
for the gaussian sigma matrix distribution
double eventGeneratorMinX
Event generator file filter.
std::string xDistrType
beam parameters
double shellY
for the elliptic shell distribution
double Yp0
initial beam centroid
std::string haloPSWeightFunction
for the halo distribution
double shellYpWidth
for the elliptic shell distribution
double haloXpCutInner
for the halo distribution
double Y0
initial beam centroid
double haloYpCutOuter
for the halo distribution
double Rmin
for the ring beam distribution
double T0
initial beam centroid
double sigmaY
for the gaussian beam distribution
double shellXWidth
for the elliptic shell distribution
double shellYWidth
for the elliptic shell distribution
double E0
initial beam centroid
void PublishMembers()
publish members so these can be looked up from parser
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.
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 std::string &name, double value)
Parser namespace for GMAD language. Combination of Geant4 and MAD.