2#include <structmember.h>
4#include <boost/python.hpp>
22 if (tracker == NULL) {
24 "ParallelTTracker was NULL"));
30 outOfBounds = tracker->getFieldValue(
R, t, B, E);
31 boost::python::tuple value = boost::python::make_tuple(outOfBounds,
42 if (tracker == NULL) {
44 "ParallelCyclotronTracker was NULL"));
46 boost::python::tuple value = boost::python::make_tuple(1,
47 -1, -1, -1, -1, -1, -1);
62 std::string err =
"Could not find a ring object - maybe a "
63 "RingDefinition was not defined or KeepAlive was False";
69 int outOfBounds = ring->
apply(
R, P, t, E, B);
70 boost::python::tuple value = boost::python::make_tuple(outOfBounds,
71 B[0]/10., B[1]/10., B[2]/10.,
77 Ring* ring =
const_cast<Ring*
>(Ring::getLastLockedRing());
83 if (trackerT != NULL) {
87 if (trackerCycl != NULL) {
91 "Could not find a Ring, ParallelTTracker or ParallelCyclotronTracker"));
98 py::def(
"get_field_value",
100 py::args(
"x",
"y",
"z",
"t"),
void registerExceptions()
py::object get_field_value_cyclotron(double x, double y, double z, double t, ParallelCyclotronTracker *tracker)
BOOST_PYTHON_MODULE(field)
py::object get_field_value_ring(double x, double y, double z, double t, Ring *ring)
py::object get_field_value_parallelt(double x, double y, double z, double t, ParallelTTracker *tracker)
std::string field_docstring
py::object get_field_value(double x, double y, double z, double t)
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
static std::shared_ptr< Tracker > getTracker()
The base class for all OPAL exceptions.