2#include <structmember.h>
6#include <boost/python.hpp>
16std::string(
"Get the field value at a point in the field map.\n\n")+
17std::string(
" x: x position [m]\n")+
18std::string(
" y: y position [m]\n")+
19std::string(
" z: z position [m]\n")+
20std::string(
" t: time [ns]\n")+
21std::string(
"Returns a tuple containing 6 values:\n")+
22std::string(
" out of bounds: 1 if the event was out of the field map\n")+
23std::string(
" boundary, else 0.\n")+
24std::string(
" Bx: x magnetic field [T]\n")+
25std::string(
" By: y magnetic field [T]\n")+
26std::string(
" Bz: z magnetic field [T]\n")+
27std::string(
" Ex: x electric field\n")+
28std::string(
" Ey: y electric field\n")+
29std::string(
" Ez: z electric field\n");
32 Ring* ring =
const_cast<Ring*
>(Ring::getLastLockedRing());
34 std::string err =
"Could not find a ring object - maybe a "+
35 std::string(
"RingDefinition was not defined or KeepAlive was False");
42 int outOfBounds = ring->
apply(
R, P, t, E, B);
43 boost::python::tuple value = boost::python::make_tuple(outOfBounds,
44 B[0]/10., B[1]/10., B[2]/10.,
52 boost::python::def(
"get_field_value",
54 boost::python::args(
"x",
"y",
"z",
"t"),
const char * module_docstring
BOOST_PYTHON_MODULE(boost_field)
std::string get_field_value_docstring
boost::python::object get_field_value(double x, double y, double z, double t)
Ring describes a ring type geometry for tracking.
virtual bool apply(const size_t &id, const double &t, Vector_t &E, Vector_t &B) override