18#include "physicsbiasing.h"
37 publish(
"processList", &PhysicsBiasing::processList);
54 std::cout <<
"physicsbiasing: " << std::endl
55 <<
"name " <<
name <<
" " << std::endl
56 <<
"particle " <<
particle <<
" " << std::endl
57 <<
"process " <<
process <<
" " << std::endl
59 for (
const auto& i :
factor) std::cout << i <<
" ";
60 std::cout << std::endl <<
"flag ";
61 for (
const auto& i :
flag) std::cout <<
static_cast<int>(i) <<
" ";
62 std::cout << std::endl;
68 std::cout <<
"parser> Setting value " << std::setw(25) << std::left <<
property << value << std::endl;
71 if (property==
"flag") {
flag.push_back(
static_cast<PhysicsBiasingType
>((
int)value));
return;}
72 if (property==
"xsecfact") {
factor.push_back(value);
return;}
74 std::cerr <<
"Error: parser> unknown physicsbiasing option \"" <<
property <<
"\" with value " << value << std::endl;
78 std::rethrow_exception(std::current_exception());
85 for (
const auto& i : value->GetData())
86 {
flag.push_back(
static_cast<PhysicsBiasingType
>((
int)i));}
88 else if (property==
"xsecfact")
90 else if (property==
"factor")
92 else if (property==
"processList")
96 std::cerr <<
"Error: parser> unknown physicsbiasing option \"" <<
property <<
"\" with value ";
97 for (
const auto& i : value->GetData())
98 {std::cout << i <<
" ";}
100 std::cout << std::endl;
104 std::rethrow_exception(std::current_exception());
111 std::cout <<
"parser> Setting value " << std::setw(25) << std::left <<
property << value << std::endl;
114 if (property==
"name")
116 else if (property==
"particle")
118 else if ((property==
"proc") || (property==
"process"))
124 {processList.push_back(tok);}
129 std::cerr <<
"Error: parser> unknown physicsbiasing option \"" <<
property
130 <<
"\" with value " << value << std::endl;
134 std::rethrow_exception(std::current_exception());
138#if __cplusplus >= 201703L
140 std::list<std::variant<bool, int, double, std::string>> retval;
142 if(property==
"processList")
144 retval.resize(processList.size());
145 std::copy(processList.begin(),processList.end(), retval.begin());
147 else if(property==
"factor")
149 retval.resize(
factor.size());
152 else if(property==
"flag")
156 retval.push_back((
int)e);
161 std::cerr <<
"Error: parser> unknown PhysicsBiasing property \"" <<
property <<
"\", or doesn't expect vector type" << std::endl;
Representation of arrays used in tokens.
void set_vector(Container< std::string, std::allocator< std::string > > &dst) const
Copy symbols into STL string containers.
std::vector< double > factor
factors corresponding to process
void set_value(const std::string &property, double value, bool bExit=true)
set methods by property name, numeric values
PhysicsBiasing()
constructor
void print() const
print some properties
std::vector< PhysicsBiasingType > flag
flag which particles are biased
std::string particle
particle name
void PublishMembers()
publish members
std::list< std::variant< bool, int, double, std::string > > get_value_array(const std::string &)
Get method for lists.
std::string process
geant4 process: single string, but can have multiple processes separated with a space
void publish(const std::string &name, T C::*mp)
Make pointer to member from class C and type T with accessible with a name.
Parser namespace for GMAD language. Combination of Geant4 and MAD.