52 "The \"PARTICLEMATTERINTERACTION\" statement defines data for "
53 "the particle matter interaction handler on an element."),
56 (
"TYPE",
"Specifies the particle matter interaction handler.",
57 {
"SCATTERING",
"BEAMSTRIPPING"});
60 (
"MATERIAL",
"The material of the surface.",
77 (
"ENABLERUTHERFORD",
"Enable large angle scattering",
true);
80 (
"LOWENERGYTHR",
"Lower Energy threshold for energy loss calculation [MeV]. Default = 0.01 MeV", 0.01);
83 defParticleMatterInteraction->
builtin =
true;
86 defParticleMatterInteraction->
update();
89 delete defParticleMatterInteraction;
98 handler_m(parent->handler_m)
128 if (parmatint == 0) {
130 "ParticleMatterInteraction \"" + name +
"\" not found.");
142 static const std::map<std::string, ParticleMatterInteraction::InteractionType> stringInteractionType_s = {
149 throw OpalException(
"ParticleMatterInteraction::getInteractionType",
150 "The attribute \"TYPE\" isn't set for \"PARTICLEMATTERINTERACTION\"!");
152 type_m = stringInteractionType_s.at(type);
173 throw OpalException(
"ParticleMatterInteraction::initParticleMatterInteractionHandler",
174 "Invalid \"TYPE\" of \"PARTICLEMATTERINTERACTION\" command");
177 *gmsg << *
this <<
endl;
186 os <<
"* ************* P A R T I C L E M A T T E R I N T E R A C T I O N **************** " <<
std::endl;
187 os <<
"* PARTICLEMATTERINTERACTION " <<
getOpalName() <<
'\n'
195 os <<
"* ********************************************************************************** " <<
std::endl;
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
static OpalData * getInstance()
bool builtin
Built-in flag.
void setOpalName(const std::string &name)
Set object name.
The base class for all OPAL objects.
std::string getString(const Attribute &attr)
Get string value.
void define(Object *newObject)
Define a new object.
std::string boolToUpperString(const bool &b)
virtual void update()
Update the PARTICLEMATTERINTERACTION data.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
virtual const std::string & getName() const
Get element name.
Inform & endl(Inform &inf)
ElementBase * getElement()
bool getBool(const Attribute &attr)
Return logical value.
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
void updateElement(ElementBase *element)
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
The base class for all OPAL exceptions.
virtual void execute()
Check the PARTICLEMATTERINTERACTION data.
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
void initParticleMatterInteractionHandler(ElementBase &element)
const std::string & getOpalName() const
Return object name.
std::vector< Attribute > itsAttr
The object attributes.
void getInteractionType()
void updateElement(ElementBase *newref)
double getReal(const Attribute &attr)
Return real value.
ParticleMatterInteractionHandler * handler_m
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
The base class for all OPAL definitions.
ParticleMatterInteraction()
Exemplar constructor.
Object * find(const std::string &name)
Find entry.
void print(std::ostream &os) const
Print the object.
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
virtual ~ParticleMatterInteraction()