30 #include <pybind11/pybind11.h>
31 #include <pybind11/stl.h>
33 namespace py = pybind11;
34 using namespace ActsExamples;
36 namespace Acts::Python {
38 auto [
m, mex] = ctx.
get(
"main",
"examples");
40 py::class_<IContextDecorator, std::shared_ptr<IContextDecorator>>(
41 mex,
"IContextDecorator")
49 auto gd = py::class_<GenericDetector, std::shared_ptr<GenericDetector>>(
50 mex,
"GenericDetector")
55 std::shared_ptr<const Acts::IMaterialDecorator>>(
58 py::class_<Config>(gd,
"Config")
60 .def_readwrite(
"buildLevel", &Config::buildLevel)
61 .def_readwrite(
"surfaceLogLevel", &Config::surfaceLogLevel)
62 .def_readwrite(
"layerLogLevel", &Config::layerLogLevel)
63 .def_readwrite(
"volumeLogLevel", &Config::volumeLogLevel)
64 .def_readwrite(
"buildProto", &Config::buildProto);
72 py::class_<TelescopeDetector, std::shared_ptr<TelescopeDetector>>(
73 mex,
"TelescopeDetector")
78 const std::shared_ptr<const Acts::IMaterialDecorator>&>(
81 py::class_<Config>(td,
"Config")
85 .def_readwrite(
"offsets", &Config::offsets)
88 .def_readwrite(
"surfaceType", &Config::surfaceType)
96 auto d = py::class_<AlignedDetector, std::shared_ptr<AlignedDetector>>(
97 mex,
"AlignedDetector")
102 std::shared_ptr<const Acts::IMaterialDecorator>>(
105 auto c = py::class_<Config, GenericDetector::Config>(d,
"Config")
121 py::enum_<Config::Mode>(
c,
"Mode")
122 .
value(
"Internal", Config::Mode::Internal)
123 .value(
"External", Config::Mode::External);
129 auto d = py::class_<TGeoDetector, std::shared_ptr<TGeoDetector>>(
135 std::shared_ptr<const Acts::IMaterialDecorator>>(
138 py::class_<Options::Interval>(mex,
"Interval")
140 .def(
py::init<std::optional<double>, std::optional<double>>())
144 auto c = py::class_<Config>(d,
"Config").def(py::init<>());
150 py::enum_<Config::SubVolume>(
c,
"SubVolume")
151 .
value(
"Negative", Config::SubVolume::Negative)
152 .value(
"Central", Config::SubVolume::Central)
153 .value(
"Positive", Config::SubVolume::Positive);
155 py::enum_<Acts::BinningType>(
c,
"BinningType")
159 auto volume = py::class_<Config::Volume>(
c,
"Volume").def(py::init<>());
188 using type = decltype(
v);
189 py::class_<Config::LayerTriplet<type>>(
c, name.c_str())
191 .def(py::init<type>())
192 .def(py::init<type, type, type>())
193 .def_readwrite(
"negative", &Config::LayerTriplet<type>::negative)
194 .def_readwrite(
"central", &Config::LayerTriplet<type>::central)
195 .def_readwrite(
"positive", &Config::LayerTriplet<type>::positive)
196 .def(
"at", py::overload_cast<Config::SubVolume>(
200 regTriplet(
"LayerTripletBool",
true);
202 regTriplet(
"LayerTripletVectorString", std::vector<std::string>{});
204 regTriplet(
"LayerTripletDouble",
double{5.5});
205 regTriplet(
"LayerTripletVectorBinning",
206 std::vector<std::pair<int, Acts::BinningType>>{});