32 #include <dfe/dfe_io_dsv.hpp>
39 :
WriterT(config.inputClusters,
"CsvPlanarClusterWriter", level),
43 throw std::invalid_argument(
"Missing simulated hits input collection");
46 throw std::invalid_argument(
"Missing tracking geometry");
57 const auto& simHits = m_inputSimHits(ctx);
67 dfe::NamedTupleCsvWriter<HitData> writerHits(pathHits,
m_cfg.outputPrecision);
68 dfe::NamedTupleCsvWriter<CellDataLegacy> writerCells(pathCells,
69 m_cfg.outputPrecision);
70 dfe::NamedTupleCsvWriter<TruthHitData> writerTruth(pathTruth,
71 m_cfg.outputPrecision);
79 for (
auto [moduleGeoId, moduleClusters] :
groupByModule(clusters)) {
81 m_cfg.trackingGeometry->findSurface(moduleGeoId);
82 if (surfacePtr ==
nullptr) {
83 ACTS_ERROR(
"Could not find surface for " << moduleGeoId);
84 return ProcessCode::ABORT;
90 for (
const auto&
entry : moduleClusters) {
104 writerHits.append(hit);
114 writerCells.append(cell);
122 for (
auto idx : sl.indices()) {
123 auto it = simHits.nth(
idx);
124 if (
it == simHits.end()) {
125 ACTS_FATAL(
"Simulation hit with index " <<
idx <<
" does not exist");
126 return ProcessCode::ABORT;
129 const auto& simHit = *
it;
142 const auto delta4 = simHit.momentum4After() - simHit.momentum4Before();
148 truth.
index = simHit.index();
149 writerTruth.append(truth);