22 using namespace Acts::UnitLiterals;
46 inline std::tuple<Vertex<BoundTrackParameters>, std::vector<VertexInfo>,
47 std::vector<BoundTrackParameters>>
49 std::string fileBase =
"vertexing_event_mu20") {
50 const auto beamspotDataPath =
53 const auto verticesDataPath =
56 const std::regex comma(
",");
59 std::ifstream beamspotData(beamspotDataPath);
60 std::ifstream tracksData(tracksDataPath);
61 std::ifstream verticesData(verticesDataPath);
66 std::shared_ptr<PerigeeSurface> perigeeSurface;
67 std::vector<BoundTrackParameters> tracks;
68 std::vector<VertexInfo> vertices;
73 while (beamspotData &&
std::getline(beamspotData, line)) {
75 std::vector<std::string> row{
76 std::sregex_token_iterator(line.begin(), line.end(), comma, -1),
77 std::sregex_token_iterator()};
81 beamspotPos << std::stod(row[0]) * (1_mm), std::stod(row[1]) * (1_mm),
82 std::stod(row[2]) * (1_mm);
83 beamspotCov << std::stod(row[3]), 0, 0, 0, std::stod(row[4]), 0, 0, 0,
87 perigeeSurface = Surface::makeShared<PerigeeSurface>(beamspotPos);
94 std::vector<std::string> row{
95 std::sregex_token_iterator(line.begin(), line.end(), comma, -1),
96 std::sregex_token_iterator()};
99 params << std::stod(row[0]), std::stod(row[1]), std::stod(row[2]),
100 std::stod(row[3]), std::stod(row[4]) * 1. / (1_MeV), std::stod(row[5]);
102 covMat << std::stod(row[6]), std::stod(row[7]), std::stod(row[8]),
103 std::stod(row[9]), std::stod(row[10]) * 1. / (1_MeV),
104 std::stod(row[11]), std::stod(row[7]), std::stod(row[12]),
105 std::stod(row[13]), std::stod(row[14]),
106 std::stod(row[15]) * 1. / (1_MeV), std::stod(row[16]),
107 std::stod(row[8]), std::stod(row[13]), std::stod(row[17]),
108 std::stod(row[18]), std::stod(row[19]) * 1. / (1_MeV),
109 std::stod(row[20]), std::stod(row[9]), std::stod(row[14]),
110 std::stod(row[18]), std::stod(row[21]),
111 std::stod(row[22]) * 1. / (1_MeV), std::stod(row[23]),
112 std::stod(row[10]) * 1. / (1_MeV), std::stod(row[15]) * 1. / (1_MeV),
113 std::stod(row[19]) * 1. / (1_MeV), std::stod(row[22]) * 1. / (1_MeV),
114 std::stod(row[24]) * 1. / (1_MeV * 1_MeV),
115 std::stod(row[25]) * 1. / (1_MeV), std::stod(row[11]),
116 std::stod(row[16]), std::stod(row[20]), std::stod(row[23]),
117 std::stod(row[25]) * 1. / (1_MeV), std::stod(row[26]);
119 tracks.emplace_back(perigeeSurface, params, std::move(covMat));
124 while (verticesData &&
std::getline(verticesData, line)) {
126 std::vector<std::string> row{
127 std::sregex_token_iterator(line.begin(), line.end(), comma, -1),
128 std::sregex_token_iterator()};
131 pos << std::stod(row[0]) * (1_mm), std::stod(row[1]) * (1_mm),
132 std::stod(row[2]) * (1_mm);
134 cov << std::stod(row[3]), std::stod(row[4]), std::stod(row[5]),
135 std::stod(row[6]), std::stod(row[7]), std::stod(row[8]),
136 std::stod(row[9]), std::stod(row[10]), std::stod(row[11]);
140 vertexInfo.
nTracks = std::stoi(row[12]);
142 vertexInfo.
trk1Comp = std::stod(row[14]);
143 vertexInfo.
trk1Chi2 = std::stod(row[15]);
144 vertices.push_back(vertexInfo);
147 return std::make_tuple(beamspotConstraint, vertices, tracks);