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\"!");
173 throw OpalException(
"ParticleMatterInteraction::initParticleMatterInteractionHandler",
174 "Invalid \"TYPE\" of \"PARTICLEMATTERINTERACTION\" command");
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;
Inform & endl(Inform &inf)
Attribute makeBool(const std::string &name, const std::string &help)
Make logical attribute.
double getReal(const Attribute &attr)
Return real value.
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
bool getBool(const Attribute &attr)
Return logical value.
std::string getString(const Attribute &attr)
Get string value.
std::string boolToUpperString(const bool &b)
boost::function< boost::tuple< double, bool >(arguments_t)> type
The base class for all OPAL definitions.
The base class for all OPAL objects.
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
const std::string & getOpalName() const
Return object name.
void setOpalName(const std::string &name)
Set object name.
std::vector< Attribute > itsAttr
The object attributes.
bool builtin
Built-in flag.
Object * find(const std::string &name)
Find entry.
static OpalData * getInstance()
void define(Object *newObject)
Define a new object.
virtual const std::string & getName() const
Get element name.
void updateElement(ElementBase *newref)
ElementBase * getElement()
virtual void execute()
Check the PARTICLEMATTERINTERACTION data.
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
virtual void update()
Update the PARTICLEMATTERINTERACTION data.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
virtual ~ParticleMatterInteraction()
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
ParticleMatterInteractionHandler * handler_m
ParticleMatterInteraction()
Exemplar constructor.
void initParticleMatterInteractionHandler(ElementBase &element)
void print(std::ostream &os) const
Print the object.
void updateElement(ElementBase *element)
void getInteractionType()
The base class for all OPAL exceptions.