22 using namespace Acts::UnitLiterals;
39 double trk1Weight = 0;
46 inline std::tuple<Vertex<BoundTrackParameters>, std::vector<VertexInfo>,
47 std::vector<BoundTrackParameters>>
49 const 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;
72 std::getline(beamspotData,
line);
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);
91 std::getline(tracksData,
line);
92 while (tracksData && std::getline(tracksData,
line)) {
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]);
120 tracks.emplace_back(perigeeSurface, params,
std::move(covMat),
125 std::getline(verticesData,
line);
126 while (verticesData && std::getline(verticesData,
line)) {
128 std::vector<std::string> row{
129 std::sregex_token_iterator(
line.begin(),
line.end(), comma, -1),
130 std::sregex_token_iterator()};
133 pos << std::stod(row[0]) * (1_mm), std::stod(row[1]) * (1_mm),
134 std::stod(row[2]) * (1_mm);
136 cov << std::stod(row[3]), std::stod(row[4]), std::stod(row[5]),
137 std::stod(row[6]), std::stod(row[7]), std::stod(row[8]),
138 std::stod(row[9]), std::stod(row[10]), std::stod(row[11]);
142 vertexInfo.
nTracks = std::stoi(row[12]);
144 vertexInfo.
trk1Comp = std::stod(row[14]);
145 vertexInfo.
trk1Chi2 = std::stod(row[15]);
146 vertices.push_back(vertexInfo);