29 #include <dfe/dfe_io_dsv.hpp>
36 :
WriterT(config.inputMeasurements,
"CsvMeasurementWriter", level),
40 throw std::invalid_argument(
41 "Missing hit-to-simulated-hits map input collection");
57 const auto& measurementSimHitsMap = m_inputMeasurementSimHitsMap(ctx);
67 dfe::NamedTupleCsvWriter<MeasurementData> writerMeasurements(
68 pathMeasurements,
m_cfg.outputPrecision);
70 std::optional<dfe::NamedTupleCsvWriter<CellData>> writerCells{std::nullopt};
71 if (not
m_cfg.inputClusters.empty()) {
73 "Set up writing of clusters from collection: " <<
m_cfg.inputClusters);
74 clusters = m_inputClusters(ctx);
78 dfe::NamedTupleCsvWriter<CellData>{pathCells,
m_cfg.outputPrecision};
81 dfe::NamedTupleCsvWriter<MeasurementSimHitLink> writerMeasurementSimHitMap(
82 pathMeasurementSimHitMap,
m_cfg.outputPrecision);
91 <<
" measurements in this event.");
93 for (
Index measIdx = 0
u; measIdx < measurements.size(); ++measIdx) {
94 const auto& measurement = measurements[measIdx];
96 auto simHitIndices =
makeRange(measurementSimHitsMap.equal_range(measIdx));
97 for (
auto [
_, simHitIdx] : simHitIndices) {
98 writerMeasurementSimHitMap.append({measIdx, simHitIdx});
104 m.sourceLink().template get<IndexSourceLink>().geometryId();
111 auto parameters = (
m.expander() *
m.parameters()).eval();
119 (
m.expander() *
m.covariance() *
m.expander().transpose()).eval();
125 for (
unsigned int ipar = 0;
127 if (
m.contains(static_cast<Acts::BoundIndices>(ipar))) {
132 writerMeasurements.append(meas);
135 if (not clusters.empty() && writerCells) {
136 auto cluster = clusters[measIdx];
139 for (
auto&
c : cluster.channels) {
144 cell.
value =
c.activation;
145 writerCells->append(cell);