22 std::string(
"The \"OUTPUTPLANE\" element writes out position at which")+
23 std::string(
"trajectories cross a given plane.");
29 (
"CENTRE",
"3-vector position of the plane centre [m]");
31 (
"NORMAL",
"3-vector normal to the plane");
33 (
"REFERENCE_ALIGNMENT_PARTICLE",
34 "Set to a particle number (usually 0, the reference particle). "
35 "The first time that the particle crosses the reference plane, then "
36 "the plane will be moved to centre on that particle and point in S of the particle.", -1);
38 (
"TOLERANCE",
"Tolerance on position of track intercept [m]", 1
e-6);
40 (
"WIDTH",
"Full width of the output plane [m], defined in the lab coordinate system (*not* the output plane coordinate system).");
42 (
"HEIGHT",
"Full height of the output plane [m], defined in the lab coordinate system (*not* the output plane coordinate system)");
44 (
"RADIUS",
"Maximum distance from centre of plane for crossings [m].");
47 "The algorithm used to step from the track point to the plane", {
"INTERPOLATION",
"RK4"},
"RK4");
49 (
"XSTART",
"Define a plane with horizontal extent [m] from XSTART to XEND and vertical extent from YSTART to YEND", 0.0);
51 (
"YSTART",
"Define a plane with horizontal extent [m] from XSTART to XEND and vertical extent from YSTART to YEND", 1.0);
53 (
"XEND",
"Define a plane with horizontal extent [m] from XSTART to XEND and vertical extent from YSTART to YEND", 0.0);
55 (
"YEND",
"Define a plane with horizontal extent [m] from XSTART to XEND and vertical extent from YSTART to YEND", 0.0);
58 "Set to PROBE to define the plane using XSTART, XEND, YSTART, YEND or CENTRE_NORMAL to define the plane using centre and normal", {
"CENTRE_NORMAL",
"PROBE"},
"PROBE");
60 "Set to 0 for minimal output up to 4 to output diagnostics on every track step. Output is sent to OPAL", 0);
90 if (placementStyle ==
"CENTRE_NORMAL") {
92 if (centreVec.size() != 3) {
94 "OutputPlane centre should be a 3-vector");
96 centre =
Vector_t(centreVec[0], centreVec[1], centreVec[2]);
98 if (normalVec.size() != 3) {
100 "OutputPlane normal should be a 3-vector");
102 normal =
Vector_t(normalVec[0], normalVec[1], normalVec[2]);
105 "OutputPlane normal was not defined or almost zero");
107 }
else if (placementStyle ==
"PROBE") {
119 double width =
std::sqrt(normal[0]*normal[0]+normal[1]*normal[1]);
120 if (width < tolerance) {
122 "OutputPlane had very small width or size was not defined");
127 "Did not recognise OutputPlane placement style '"+placementStyle+
"'");
137 "OutputPlane had negative width");
145 "OutputPlane had negative height");
153 "OutputPlane had negative radius");
168 if (algorithm ==
"RK4") {
170 }
else if (algorithm ==
"INTERPOLATION") {
Tps< T > sqrt(const Tps< T > &x)
Square root.
T euclidean_norm(const Vector< T > &)
Euclidean norm.
const std::string docstring
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
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.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
std::string getString(const Attribute &attr)
Get string value.
constexpr double e
The value of.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setElement(ElementBase *)
Assign new CLASSIC element.
std::vector< Attribute > itsAttr
The object attributes.
void setOutputFN(std::string fn)
Set output filename.
void setAlgorithm(algorithm alg)
Set the algorithm used to interpolate from step to the plane.
void setVerticalExtent(double z)
Set the vertical extent from the plane centre.
void setCentre(Vector_t centre)
Set the centre of the plane.
void setNormal(Vector_t normal)
Set the normal to the plane.
void setTolerance(double tolerance)
Set the tolerance, used when finding intersection with the plane.
void setRadialExtent(double r)
Set the radial extent from the centre.
void setVerboseLevel(int verbose)
Set the verbose level.
void setHorizontalExtent(double width)
Set the horizontal extent from the plane centre.
void setRecentre(int willRecentre)
Set the index of the recentring particle.
virtual void updateUnknown(ElementBase *)
Transmit the `‘unknown’' (not known to OPAL) attributes to CLASSIC.
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const
Interface for output plane element.
OpalOutputPlane()
Exemplar constructor.
virtual ~OpalOutputPlane()
@ REFERENCE_ALIGNMENT_PARTICLE
virtual void update()
Fill in all registered attributes.
virtual OpalOutputPlane * clone(const std::string &name)
Make clone.
The base class for all OPAL exceptions.
Vektor< double, 3 > Vector_t