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");
134 "OutputPlane had negative width");
142 "OutputPlane had negative height");
150 "OutputPlane had negative radius");
165 if (algorithm ==
"RK4") {
167 }
else if (algorithm ==
"INTERPOLATION") {
void setHorizontalExtent(double width)
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Tps< T > sqrt(const Tps< T > &x)
Square root.
virtual OpalOutputPlane * clone(const std::string &name)
Make clone.
void setVerticalExtent(double z)
std::string getString(const Attribute &attr)
Get string value.
void setCentre(Vector_t centre)
Vektor< double, 3 > Vector_t
std::vector< double > getRealArray(const Attribute &attr)
Get array value.
Attribute makeRealArray(const std::string &name, const std::string &help)
Create real array attribute.
void setElement(ElementBase *)
Assign new CLASSIC element.
virtual void update()
Fill in all registered attributes.
void setAlgorithm(algorithm alg)
T euclidean_norm(const Vector< T > &)
Euclidean norm.
The base class for all OPAL exceptions.
const std::string docstring
void setTolerance(double tolerance)
void setOutputFN(std::string fn)
Set output filename.
Attribute makePredefinedString(const std::string &name, const std::string &help, const std::initializer_list< std::string > &predefinedStrings)
Make predefined string attribute.
ElementBase * getElement() const
Return the embedded CLASSIC element.
void setRadialExtent(double r)
virtual ~OpalOutputPlane()
std::vector< Attribute > itsAttr
The object attributes.
double getReal(const Attribute &attr)
Return real value.
void setRecentre(int willRecentre)
void setVerboseLevel(int verbose)
constexpr double e
The value of .
Interface for output plane element.
virtual void updateUnknown(ElementBase *)
Transmit the ``unknown'' (not known to OPAL) attributes to CLASSIC.
Lyndon Lucas Luigi Barone Email luigi csse uwa edu au for any queries regarding usage bugs improvements This code includes a high performance implementation of the WFG algorithm
PETE_TUTree< FnFloor, typename T::PETE_Expr_t > floor(const PETE_Expr< T > &l)
virtual void update()
Update the embedded CLASSIC element.
void registerOwnership() const
void setNormal(Vector_t normal)
OpalOutputPlane()
Exemplar constructor.