2#include <structmember.h>
6#include <pybind11/pybind11.h>
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");
31std::tuple<int, double, double, double, double, double, double>
33 Ring* ring =
const_cast<Ring*
>(Ring::getLastLockedRing());
35 std::string err =
"Could not find a ring object - maybe a "+
36 std::string(
"RingDefinition was not defined or KeepAlive was False");
43 int outOfBounds = ring->
apply(
R, P, t, E, B);
45 std::tuple<int, double, double, double, double, double, double> value = {
46 outOfBounds, B[0]/10., B[1]/10., B[2]/10., E[0], E[1], E[2]
std::tuple< int, double, double, double, double, double, double > get_field_value(double x, double y, double z, double t)
const char * module_docstring
PYBIND11_MODULE(bind_field, module)
std::string get_field_value_docstring
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