17 #include "ACTFW/EventData/DataContainers.hpp"
64 :
Base(cfg.collection,
"JsonSpacePointWriter", level), m_cfg(cfg) {
66 throw std::invalid_argument(
"Missing input collection");
77 std::ofstream os(path, std::ofstream::out | std::ofstream::trunc);
79 throw std::ios_base::failure(
"Could not open '" + path +
"' to write");
82 os << std::setprecision(m_cfg.outputPrecision);
85 bool firstVolume =
true;
86 for (
auto& volumeData : spacePoints) {
87 geo_id_value volumeID = volumeData.first;
91 os <<
" \"SpacePoints_" << volumeID <<
"\" : [\n";
93 bool firstPoint =
true;
94 for (
auto& layerData : volumeData.second) {
95 for (
auto& moduleData : layerData.second) {
96 for (
auto&
data : moduleData.second) {
101 os <<
" [" <<
data.x() <<
", " <<
data.y() <<
", " <<
data.z()