54 #include <pybind11/pybind11.h>
55 #include <pybind11/stl.h>
63 namespace ActsExamples {
68 namespace py = pybind11;
69 using namespace pybind11::literals;
71 using namespace ActsExamples;
74 template <ActsExamples::CsvBFieldWriter::CoordinateType CType,
bool Gr
id>
75 void register_csv_bfield_writer_binding(
76 pybind11::class_<ActsExamples::CsvBFieldWriter>& w) {
78 std::string(CType == ActsExamples::CsvBFieldWriter::CoordinateType::XYZ
88 py::arg(
"config"), py::arg(
"level"));
100 namespace Acts::Python {
102 auto [
m, mex] = ctx.
get(
"main",
"examples");
106 "ObjPropagationStepsWriter", collection,
outputDir, outputScalor,
110 auto c = py::class_<ViewConfig>(
m,
"ViewConfig").def(py::init<>());
128 auto w = py::class_<Writer, std::shared_ptr<Writer>>(
129 mex,
"ObjTrackingGeometryWriter")
130 .def(py::init<const Writer::Config&, Acts::Logging::Level>(),
131 py::arg(
"config"), py::arg(
"level"))
136 auto c = py::class_<Writer::Config>(w,
"Config").def(py::init<>());
151 py::class_<PlotHelpers::Binning>(mex,
"Binning")
152 .def(py::init<std::string, int, double, double>(),
"title"_a,
"bins"_a,
156 py::class_<EffPlotTool::Config>(mex,
"EffPlotToolConfig")
157 .def(
py::init<std::map<std::string, PlotHelpers::Binning>>(),
160 py::class_<FakeRatePlotTool::Config>(mex,
"FakeRatePlotToolConfig")
161 .def(
py::init<std::map<std::string, PlotHelpers::Binning>>(),
164 py::class_<DuplicationPlotTool::Config>(mex,
"DuplicationPlotToolConfig")
165 .def(
py::init<std::map<std::string, PlotHelpers::Binning>>(),
171 "RootPropagationStepsWriter", collection,
filePath,
179 "TrackFinderPerformanceWriter", inputProtoTracks,
187 filePath, resPlotToolConfig, effPlotToolConfig,
188 trackSummaryPlotToolConfig);
193 fileMode, effPlotToolConfig, duplicationPlotToolConfig);
197 inputTrackParameters, inputProtoTracks,
inputParticles, inputSimHits,
202 "RootMaterialTrackWriter", collection,
filePath,
203 fileMode, treeName, recalculateTotals, prePostStep,
204 storeSurface, storeVolume, collapseInteractions);
209 py::class_<Writer>(mex,
"RootBFieldWriter")
216 py::arg(
"config"), py::arg(
"level"));
218 py::enum_<Writer::GridType>(w,
"GridType")
219 .
value(
"rz", Writer::GridType::rz)
220 .value(
"xyz", Writer::GridType::xyz);
222 auto c = py::class_<Writer::Config>(w,
"Config").def(py::init<>());
239 auto w = py::class_<Writer, IWriter, std::shared_ptr<Writer>>(
240 mex,
"RootMeasurementWriter")
241 .def(py::init<const Writer::Config&, Acts::Logging::Level>(),
242 py::arg(
"config"), py::arg(
"level"));
244 auto c = py::class_<Writer::Config>(w,
"Config").def(py::init<>());
246 c.def(
"addBoundIndicesFromDigiConfig",
265 py::class_<IMaterialWriter, std::shared_ptr<IMaterialWriter>>(
266 mex,
"IMaterialWriter");
270 auto w = py::class_<Writer, IMaterialWriter, std::shared_ptr<Writer>>(
271 mex,
"RootMaterialWriter")
272 .def(py::init<const Writer::Config&, Acts::Logging::Level>(),
273 py::arg(
"config"), py::arg(
"level"))
274 .def(
"write", py::overload_cast<const Acts::TrackingGeometry&>(
277 auto c = py::class_<Writer::Config>(w,
"Config").def(py::init<>());
309 "RootPlanarClusterWriter", inputClusters,
310 inputSimHits,
filePath, fileMode, treeName,
314 "RootSimHitWriter", inputSimHits,
filePath,
318 "RootSpacepointWriter", inputSpacepoints,
filePath,
334 inputAllTruthParticles, inputSelectedTruthParticles, inputTrackParameters,
337 fileMode, minTrackVtxMatchFraction, truthMatchProbMin, useTracks);
342 outputStem, outputPrecision);
345 "CsvMeasurementWriter", inputMeasurements,
346 inputClusters, inputMeasurementSimHitsMap,
350 "CsvPlanarClusterWriter", inputClusters,
351 inputSimHits,
outputDir, outputPrecision,
355 "CsvSimHitWriter", inputSimHits,
outputDir,
356 outputStem, outputPrecision);
359 "CsvSpacepointWriter", inputSpacepoints,
outputDir,
370 writeBoundary, writeSurfaceGrid, writeLayerVolume, writePerEvent);
375 filePath, fileMode, effPlotToolConfig,
376 fakeRatePlotToolConfig, duplicationPlotToolConfig,
377 trackSummaryPlotToolConfig, duplicatedPredictor);
381 "RootNuclearInteractionParametersWriter", inputSimulationProcesses,
382 filePath, fileMode, interactionProbabilityBins, momentumBins,
383 invariantMassBins, multiplicityMax, writeOptionalHistograms,
387 "CsvTrackParameterWriter", inputTrackParameters,
392 "CsvProtoTrackWriter", inputSpacepoints,
398 auto w = py::class_<Writer>(mex,
"CsvBFieldWriter");
400 py::enum_<Writer::CoordinateType>(w,
"CoordinateType")
401 .
value(
"rz", Writer::CoordinateType::RZ)
402 .value(
"xyz", Writer::CoordinateType::XYZ);
404 register_csv_bfield_writer_binding<Writer::CoordinateType::XYZ, true>(w);
405 register_csv_bfield_writer_binding<Writer::CoordinateType::XYZ, false>(w);
406 register_csv_bfield_writer_binding<Writer::CoordinateType::RZ, true>(w);
407 register_csv_bfield_writer_binding<Writer::CoordinateType::RZ, false>(w);