File indexing completed on 2025-01-18 09:13:04
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012
0013 #include <fstream>
0014
0015 namespace ActsFatras {
0016
0017
0018 struct DigitizationCsvOutput {
0019
0020
0021
0022
0023
0024 void writeLine(std::ostream& outf, const Acts::Vector2& p0,
0025 const Acts::Vector2& p1) const {
0026 outf << "l," << p0.x() << "," << p0.y() << "," << p1.x() << "," << p1.y()
0027 << "\n";
0028 };
0029
0030
0031
0032
0033
0034
0035
0036 void writeArc(std::ostream& outf, double r, double phiMin,
0037 double phiMax) const {
0038 outf << "a," << r << "," << r << "," << phiMin << "," << phiMax << "\n";
0039 };
0040
0041
0042
0043
0044
0045 void writePolygon(std::ostream& outf,
0046 const std::vector<Acts::Vector2>& vertices,
0047 const Acts::Vector2& shift = Acts::Vector2(0., 0.)) const {
0048 auto nvertices = vertices.size();
0049 for (unsigned long iv = 1; iv < nvertices; ++iv) {
0050 writeLine(outf, vertices[iv - 1] + shift, vertices[iv] + shift);
0051 }
0052 writeLine(outf, vertices[nvertices - 1] + shift, vertices[0] + shift);
0053 };
0054 };
0055
0056 }