55 throw std::invalid_argument(
"Invalid space point input collection");
62 handle->initialize(spName);
70 std::make_unique<Acts::SeedFilter<SimSpacePoint>>(
78 std::ifstream input_ifstream(
82 std::unique_ptr<Acts::FasTrackConnector> input_fastrack =
83 std::make_unique<Acts::FasTrackConnector>(input_ifstream);
85 mGNNgeo = std::make_unique<Acts::TrigFTF_GNN_Geometry<SimSpacePoint>>(
94 std::vector<Acts::FTF_SP<SimSpacePoint>> FTF_spacePoints =
95 Make_FTF_spacePoints(ctx,
m_cfg.ACTS_FTF_Map);
97 for (
auto sp : FTF_spacePoints) {
99 <<
" FTF_id: " << sp.FTF_ID <<
" z: " << sp.SP->z()
100 <<
" r: " << sp.SP->r() <<
" ACTS volume: "
101 << sp.SP->sourceLinks()
113 std::function<std::pair<Acts::Vector3, Acts::Vector2>(
118 return std::make_pair(
position, variance);
131 m_cfg.seedFinderOptions, FTF_spacePoints, create_coordinates);
138 std::map<std::pair<int, int>, std::pair<int, int>>
140 map<std::pair<int, int>, std::pair<int, int>> ACTS_FTF;
142 m_cfg.layerMappingFile);
144 std::vector<std::vector<std::string>> parsedCsv;
145 while (std::getline(data, line)) {
146 std::stringstream lineStream(line);
148 std::vector<std::string> parsedRow;
149 while (std::getline(lineStream, cell,
',')) {
150 parsedRow.push_back(cell);
153 parsedCsv.push_back(parsedRow);
156 for (
auto i : parsedCsv) {
157 int ACTS_vol = stoi(
i[0]);
158 int ACTS_lay = stoi(
i[1]);
159 int ACTS_mod = stoi(
i[2]);
160 int FTF = stoi(
i[5]);
161 int eta_mod = stoi(
i[6]);
162 int ACTS_joint = ACTS_vol * 100 + ACTS_lay;
163 ACTS_FTF.insert({{ACTS_joint, ACTS_mod}, {FTF, eta_mod}});
169 std::vector<Acts::FTF_SP<ActsExamples::SimSpacePoint>>
172 std::map<std::pair<int, int>, std::pair<int, int>> map)
const {
174 std::vector<const ActsExamples::SimSpacePoint *> spacePoints;
175 std::vector<Acts::FTF_SP<ActsExamples::SimSpacePoint>> FTF_spacePoints;
176 FTF_spacePoints.reserve(
177 m_inputSpacePoints.size());
180 for (
const auto &isp : m_inputSpacePoints) {
181 for (
const auto &spacePoint : (*isp)(ctx)) {
183 spacePoints.push_back(&spacePoint);
187 const auto &source_link = spacePoint.sourceLinks();
188 const auto &index_source_link =
192 if (source_link.empty()) {
197 int ACTS_vol_id = index_source_link.geometryId().volume();
198 int ACTS_lay_id = index_source_link.geometryId().layer();
199 int ACTS_mod_id = index_source_link.geometryId().sensitive();
202 if (ACTS_vol_id == 2 or ACTS_vol_id == 22 or ACTS_vol_id == 23 or
209 auto ACTS_joint_id = ACTS_vol_id * 100 + ACTS_lay_id;
210 auto key = std::make_pair(
213 auto Find = map.find(key);
217 key = std::make_pair(ACTS_joint_id, ACTS_mod_id);
218 Find = map.find(key);
222 if (Find == map.end()) {
224 << ACTS_vol_id <<
" and layer id: " << ACTS_lay_id);
234 ACTS_WARNING(
"No assigned FTF ID for key for volume id: "
235 << ACTS_vol_id <<
" and layer id: " << ACTS_lay_id);
239 int eta_mod = Find->second.second;
240 int combined_id = FTF_id * 1000 + eta_mod;
243 FTF_spacePoints.emplace_back(&spacePoint, FTF_id, combined_id);
246 ACTS_VERBOSE(
"Space points successfully assigned FTF ID");
248 return FTF_spacePoints;
251 std::vector<Acts::TrigInDetSiLayer>
253 std::vector<Acts::TrigInDetSiLayer> input_vector;
254 std::vector<size_t> count_vector;
256 m_cfg.trackingGeometry->visitSurfaces([
this, &input_vector, &count_vector](
259 auto ACTS_vol_id = geoid.
volume();
260 auto ACTS_lay_id = geoid.
layer();
276 if (min_bound_global(0) >
277 max_bound_global(0)) {
278 min_bound_global.swap(max_bound_global);
282 float minBound = 100000.0;
283 float maxBound = -100000.0;
286 auto ACTS_joint_id = ACTS_vol_id * 100 + ACTS_lay_id;
288 std::make_pair(ACTS_joint_id,
290 auto Find =
m_cfg.ACTS_FTF_Map.find(key);
291 int FTF_id = Find->second.first;
295 key = std::make_pair(ACTS_joint_id, mod_id);
296 Find =
m_cfg.ACTS_FTF_Map.find(key);
297 FTF_id = Find->second.first;
301 int eta_mod = Find->second.second;
304 if (79 < FTF_id && FTF_id < 85) {
306 }
else if (89 < FTF_id && FTF_id < 99) {
312 if (barrel_ec == 0) {
313 rc = sqrt(center(0) * center(0) +
314 center(1) * center(1));
316 if (min_bound_global(2) < minBound) {
317 minBound = min_bound_global(2);
319 if (max_bound_global(2) > maxBound) {
320 maxBound = max_bound_global(2);
325 float min = sqrt(min_bound_global(0) * min_bound_global(0) +
326 min_bound_global(1) * min_bound_global(1));
327 float max = sqrt(max_bound_global(0) * max_bound_global(0) +
328 max_bound_global(1) * max_bound_global(1));
329 if (min < minBound) {
332 if (max > maxBound) {
337 int combined_id = FTF_id * 1000 + eta_mod;
339 find_if(input_vector.begin(), input_vector.end(),
340 [combined_id](
auto n) {
return n.m_subdet == combined_id; });
341 if (current_index != input_vector.end()) {
343 input_vector[
index].m_refCoord += rc;
344 input_vector[
index].m_minBound += minBound;
345 input_vector[
index].m_maxBound += maxBound;
346 count_vector[
index] += 1;
352 input_vector.push_back(new_FTF_ID);
353 count_vector.push_back(
357 if (
m_cfg.fill_module_csv) {
359 fout.open(
"ACTS_modules.csv",
363 fout << ACTS_vol_id <<
", "
364 << ACTS_lay_id <<
", "
369 << sqrt(center(0) * center(0) + center(1) * center(1))
374 for (
long unsigned int i = 0;
i < input_vector.size();
i++) {
375 input_vector[
i].m_refCoord = input_vector[
i].m_refCoord / count_vector[
i];