ATLAS Offline Software
FPGATrackSimReportingAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include <format>
7 
8 FPGATrackSim::FPGATrackSimReportingAlg::FPGATrackSimReportingAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {
9 }
10 
12 {
13  ATH_CHECK(m_xAODPixelClusterContainerKeys.initialize());
14  ATH_CHECK(m_xAODStripClusterContainerKeys.initialize());
15  ATH_CHECK(m_xAODSpacePointContainerKeys.initialize());
16  ATH_CHECK(m_FPGARoadsKey.initialize(!m_isDataPrep));
17  ATH_CHECK(m_FPGAProtoTrackCollections.initialize(!m_isDataPrep));
18  ATH_CHECK(m_FPGATracksKey.initialize(!m_isDataPrep));
19  ATH_CHECK(m_ActsTrackCollections.initialize());
20  ATH_CHECK(m_ActsSeedCollections.initialize());
21  ATH_CHECK(m_ActsSeedParamCollections.initialize());
22 
23  ATH_CHECK(m_ActsInspectionTool.retrieve());
24  return StatusCode::SUCCESS;
25 }
26 
28 {
29  // Process xAOD Pixel Clusters
30  std::vector<SG::ReadHandle<xAOD::PixelClusterContainer>> xAODPixelClusterContainers = m_xAODPixelClusterContainerKeys.makeHandles(ctx);
31  for (SG::ReadHandle<xAOD::PixelClusterContainer>& clusterContainer : xAODPixelClusterContainers)
32  {
33  if (!clusterContainer.isValid()) {
34  ATH_MSG_WARNING("SG key not available " << clusterContainer.key());
35  continue;
36  }
37  processxAODClusters<xAOD::PixelCluster>(clusterContainer);
38  }
39  // Process xAOD Strip Clusters
40  std::vector<SG::ReadHandle<xAOD::StripClusterContainer>> xAODStripClusterContainers = m_xAODStripClusterContainerKeys.makeHandles(ctx);
41  for (SG::ReadHandle<xAOD::StripClusterContainer>& clusterContainer : xAODStripClusterContainers)
42  {
43  if (!clusterContainer.isValid()) {
44  ATH_MSG_WARNING("SG key not available " << clusterContainer.key());
45  continue;
46  }
47  processxAODClusters<xAOD::StripCluster>(clusterContainer);
48  }
49  // Process xAOD SpacePoints
50  std::vector<SG::ReadHandle<xAOD::SpacePointContainer>> xAODSpacePointContainers = m_xAODSpacePointContainerKeys.makeHandles(ctx);
51  for (SG::ReadHandle<xAOD::SpacePointContainer>& spContainer : xAODSpacePointContainers)
52  {
53  if (!spContainer.isValid()) {
54  ATH_MSG_WARNING("SG key not available " << spContainer.key());
55  }
56  else {processxAODSpacePoints(spContainer);}
57  }
58  if (!m_isDataPrep.value()) {
59  // Process FPGATrackSim Roads
60  SG::ReadHandle<FPGATrackSimRoadCollection> FPGATrackSimRoads(m_FPGARoadsKey, ctx);
61  if (FPGATrackSimRoads.isValid()) {
62  processFPGARoads(FPGATrackSimRoads);
63  }
64  else ATH_MSG_WARNING("Could not find FPGA Roads Collection with key " << FPGATrackSimRoads.key());
65 
66 
67  // Process FPGATrackSim Tracks
68  SG::ReadHandle<FPGATrackSimTrackCollection> FPGATrackSimTracks(m_FPGATracksKey, ctx);
69  if (FPGATrackSimTracks.isValid()) {
70  processFPGATracks(FPGATrackSimTracks);
71  }
72  else ATH_MSG_WARNING("Could not find FPGA Track Collection with key " << FPGATrackSimTracks.key());
73 
74  // Process FPGATrackSim Prototracks
75  std::vector<SG::ReadHandle<ActsTrk::ProtoTrackCollection>> FPGATrackSimProtoTracks = m_FPGAProtoTrackCollections.makeHandles(ctx);
76  for (SG::ReadHandle<ActsTrk::ProtoTrackCollection>& prototrackContainer : FPGATrackSimProtoTracks)
77  {
78  if (!prototrackContainer.isValid()) {
79  ATH_MSG_WARNING("SG key not available " << prototrackContainer.key());
80  continue;
81  }
82  processFPGAPrototracks(prototrackContainer);
83  }
84  } // if it's not the data preparation chain
85  // Process Acts tracks
86  std::vector<SG::ReadHandle<ActsTrk::TrackContainer>> FPGAActsTracks = m_ActsTrackCollections.makeHandles(ctx);
87  for (SG::ReadHandle<ActsTrk::TrackContainer>& actsTrackContainer : FPGAActsTracks)
88  {
89  if (actsTrackContainer.cptr()) ATH_MSG_DEBUG("Proccessing " << actsTrackContainer.key());
90  else continue;
91  // initialize the ReadHandle pair if necessarys
92  m_allActsTracks.try_emplace(actsTrackContainer.key(), std::vector<FPGATrackSimActsEventTracks>{});
93 
94  // fetch acts tracks
95  m_allActsTracks[actsTrackContainer.key()].push_back(m_ActsInspectionTool->getActsTracks(*(actsTrackContainer.cptr())));
96 
97  // initialize ReadHandle stats map for all tracks if necessary
98  m_actsTrackStats.try_emplace(actsTrackContainer.key(), std::map<uint32_t, std::vector<uint32_t>>{});
99 
100  m_actsTrackStats[actsTrackContainer.key()].emplace(
101  Acts::TrackStateFlag::OutlierFlag, std::vector<uint32_t>{});
102  m_actsTrackStats[actsTrackContainer.key()].emplace(
103  Acts::TrackStateFlag::HoleFlag, std::vector<uint32_t>{});
104  m_actsTrackStats[actsTrackContainer.key()].emplace(
105  Acts::TrackStateFlag::MeasurementFlag, std::vector<uint32_t>{});
106 
107  for (const auto& track : m_allActsTracks[actsTrackContainer.key()].back()) {
108  uint32_t t_nOutliers = 0, t_nMeasurements = 0, t_nHoles = 0;
109  for (const auto& measurement : track->trackMeasurements)
110  {
111  if (measurement->outlierFlag) ++t_nOutliers;
112  if (measurement->measurementFlag) ++t_nMeasurements;
113  if (measurement->holeFlag) ++t_nHoles;
114  }
115  m_actsTrackStats[actsTrackContainer.key()][Acts::TrackStateFlag::OutlierFlag].push_back(t_nOutliers);
116  m_actsTrackStats[actsTrackContainer.key()][Acts::TrackStateFlag::HoleFlag].push_back(t_nHoles);
117  m_actsTrackStats[actsTrackContainer.key()][Acts::TrackStateFlag::MeasurementFlag].push_back(t_nMeasurements);
118  }
119  if (m_printoutForEveryEvent) ATH_MSG_INFO("ACTS tracks in " << actsTrackContainer.key() << m_ActsInspectionTool->getPrintoutActsEventTracks(m_allActsTracks[actsTrackContainer.key()].back()));
120  }
121 
122  std::vector<SG::ReadHandle<ActsTrk::SeedContainer>> FPGAActsSeeds = m_ActsSeedCollections.makeHandles(ctx);
123 
124  for (SG::ReadHandle<ActsTrk::SeedContainer>& actsTrackContainer : FPGAActsSeeds)
125  {
126  if (!actsTrackContainer.isValid()) {
127  ATH_MSG_WARNING("SG key not available " << actsTrackContainer.key());
128  continue;
129  }
130  processFPGASeeds(actsTrackContainer);
131  }
132 
133 
134  std::vector<SG::ReadHandle<ActsTrk::BoundTrackParametersContainer>> FPGAActsSeedsParam = m_ActsSeedParamCollections.makeHandles(ctx);
135 
136  for (SG::ReadHandle<ActsTrk::BoundTrackParametersContainer>& actsTrackContainer : FPGAActsSeedsParam)
137  {
138  if (!actsTrackContainer.isValid()) {
139  ATH_MSG_WARNING("SG key not available " << actsTrackContainer.key());
140  continue;
141  }
142  processFPGASeedsParam(actsTrackContainer);
143  }
144 
145  return StatusCode::SUCCESS;
146 }
147 
149 {
150  ATH_MSG_INFO("Printing statistics for FPGA objects");
151 
152  if (!m_isDataPrep.value()) {
153  // Printing summary for clusters/FPGATracks
154  std::string summaryTableFPGATracks = "\n"
155  "Number of measurements for FPGA Tracks\n"
156  "|-----------------------------------|\n"
157  "| | min | max | Avg |\n"
158  "|-----------------------------------|\n";
159 
160  if (not m_pixelClustersPerFPGATrack.empty()) {
161  summaryTableFPGATracks += std::format("| Pixels | {:>4} | {:>4} | {:>10.2f} |\n",
162  *std::min_element(m_pixelClustersPerFPGATrack.begin(), m_pixelClustersPerFPGATrack.end()),
163  *std::max_element(m_pixelClustersPerFPGATrack.begin(), m_pixelClustersPerFPGATrack.end()),
164  std::accumulate(m_pixelClustersPerFPGATrack.begin(), m_pixelClustersPerFPGATrack.end(), 0.0) / m_pixelClustersPerFPGATrack.size());
165  }
166  else summaryTableFPGATracks += std::format("| Pixels | ---- | ---- | inf |\n");
167 
168  if (not m_stripClustersPerFPGATrack.empty()) {
169  summaryTableFPGATracks += std::format("| Strips | {:>4} | {:>4} | {:>10.2f} |\n",
170  *std::min_element(m_stripClustersPerFPGATrack.begin(), m_stripClustersPerFPGATrack.end()),
171  *std::max_element(m_stripClustersPerFPGATrack.begin(), m_stripClustersPerFPGATrack.end()),
172  std::accumulate(m_stripClustersPerFPGATrack.begin(), m_stripClustersPerFPGATrack.end(), 0.0) / m_stripClustersPerFPGATrack.size());
173  }
174  else summaryTableFPGATracks += std::format("| Strips | ---- | ---- | inf |\n");
175 
176  summaryTableFPGATracks += "|-----------------------------------|";
177  ATH_MSG_INFO( summaryTableFPGATracks );
178 
179 
180  // Printing summary for clusters/prototracks
181  std::string summaryTableFPGAPrototracks = std::format("\n"
182  "Number of measurements for FPGA Prototracks\n"
183  "|-----------------------------------|\n"
184  "| | min | max | Avg |\n"
185  "|-----------------------------------|\n");
186 
187  if (not m_pixelClustersPerPrototrack.empty()) {
188  summaryTableFPGAPrototracks += std::format("| Pixels | {:>4} | {:>4} | {:>10.2f} |\n",
189  *std::min_element(m_pixelClustersPerPrototrack.begin(), m_pixelClustersPerPrototrack.end()),
190  *std::max_element(m_pixelClustersPerPrototrack.begin(), m_pixelClustersPerPrototrack.end()),
191  std::accumulate(m_pixelClustersPerPrototrack.begin(), m_pixelClustersPerPrototrack.end(), 0.0) / m_pixelClustersPerPrototrack.size());
192  }
193  else summaryTableFPGAPrototracks += std::format("| Pixels | ---- | ---- | inf |\n");
194 
195  if (not m_stripClustersPerPrototrack.empty()) {
196  summaryTableFPGAPrototracks += std::format("| Strips | {:>4} | {:>4} | {:>10.2f} |\n",
197  *std::min_element(m_stripClustersPerPrototrack.begin(), m_stripClustersPerPrototrack.end()),
198  *std::max_element(m_stripClustersPerPrototrack.begin(), m_stripClustersPerPrototrack.end()),
199  std::accumulate(m_stripClustersPerPrototrack.begin(), m_stripClustersPerPrototrack.end(), 0.0) / m_stripClustersPerPrototrack.size());
200  }
201  else summaryTableFPGAPrototracks += std::format("| Strips | ---- | ---- | inf |\n");
202 
203  summaryTableFPGAPrototracks += "|-----------------------------------|";
204  ATH_MSG_INFO( summaryTableFPGAPrototracks );
205  }
206 
207  ATH_MSG_INFO(m_ActsInspectionTool->getPrintoutStatistics(m_actsTrackStats));
208  return StatusCode::SUCCESS;
209 }
210 
211 template <class XAOD_CLUSTER>
213 {
214  if (m_printoutForEveryEvent) printxAODClusters(clusterContainer);
215 }
216 
217 template <class XAOD_CLUSTER>
219 {
220  std::string mainTable = "\n"
221  "|=========================================================================================|\n"
222  "| # | Global coordinates | Hash ID | Identifier |\n"
223  "| | x | y | z | | |\n"
224  "|-----------------------------------------------------------------------------------------|\n";
225  unsigned int counter = 0;
226  for (const auto& cluster : *clusterContainer)
227  {
228  ++counter;
229  mainTable += std::format("| {:>6} | {:>12} | {:>12} | {:>12} | {:>12} | {:>18} |\n",
230  counter,
231  cluster->globalPosition().x(),
232  cluster->globalPosition().y(),
233  cluster->globalPosition().z(),
234  cluster->identifierHash(),
235  cluster->identifier());
236  }
237  mainTable += "|=========================================================================================|";
238  ATH_MSG_INFO("Printout of xAOD clusters coming from " << clusterContainer.key() << mainTable );
239 }
240 
241 
243 {
244  if (m_printoutForEveryEvent) printxAODSpacePoints(spContainer);
245 }
246 
248 {
249  std::string mainTable = "\n"
250  "|============================================================================|\n"
251  "| # | Global coordinates | element ID list |\n"
252  "| | x | y | z | |\n"
253  "|----------------------------------------------------------------------------|\n";
254  unsigned int counter = 0;
255  for (const auto sp : *spContainer)
256  {
257  ++counter;
258  mainTable += std::format("| {:>6} | {:>12} | {:>12} | {:>12} | {:>9}, {:>9} |\n",
259  counter,
260  sp->globalPosition().x(),
261  sp->globalPosition().y(),
262  sp->globalPosition().z(),
263  sp->elementIdList()[0],
264  sp->elementIdList().size() == 2 ? sp->elementIdList()[1] : 0);
265  }
266  mainTable += "|=========================================================================================|";
267  ATH_MSG_INFO("Printout of xAOD space points coming from " << spContainer.key() << mainTable );
268 }
269 
270 
272 {
273  if (m_printoutForEveryEvent) printFPGASeeds(spContainer);
274 }
275 
277 {
278  std::string mainTable = "\n"
279  "|=====================================================================================|\n"
280  "| # | seed | Global coordinates | element ID list |\n"
281  "| | i | x | y | z | |\n"
282  "|-------------------------------------------------------------------------------------|\n";
283  unsigned int counter = 0;
284  for (const auto thisTrack : *seedContainer)
285  {
286  auto spList = thisTrack->sp();
287  ++counter;
288  for(int i = 0; i < 3; i++)
289  {
290  auto sp = spList.at(i);
291  mainTable += std::format("| {:>6} | {:>6} | {:>12} | {:>12} | {:>12} | {:>9}, {:>9} |\n",
292  counter,
293  i,
294  sp->globalPosition().x(),
295  sp->globalPosition().y(),
296  sp->globalPosition().z(),
297  sp->elementIdList()[0],
298  sp->elementIdList().size() == 2 ? sp->elementIdList()[1] : 0);
299  }
300 
301  }
302  mainTable += "|=========================================================================================|";
303  ATH_MSG_INFO("Printout of ACTS seeds coming from " << seedContainer.key() << mainTable );
304 }
305 
306 
308 {
309  if (m_printoutForEveryEvent) printFPGASeedsParam(spContainer);
310 }
311 
313 {
314  std::string mainTable = "\n"
315  "|=============================================================================================|\n"
316  "| # | QopT | Theta | Phi | d0 | z0 |\n"
317  "|---------------------------------------------------------------------------------------------|\n";
318  unsigned int counter = 0;
319  for (const auto paramSet : *seedContainer)
320  {
321  ++counter;
322  auto parameters = paramSet->parameters();
323  mainTable += std::format("| {:>6} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} |\n",
324  counter,
325  parameters[Acts::eBoundQOverP],
326  parameters[Acts::eBoundTheta],
327  parameters[Acts::eBoundPhi],
328  parameters[Acts::eBoundLoc0],
329  parameters[Acts::eBoundLoc1]);
330  }
331  mainTable += "|=========================================================================================|";
332  ATH_MSG_INFO("Printout of ACTS seeds Param coming from " << seedContainer.key() << mainTable );
333 }
334 
335 
336 
337 
338 
340 {
341  if (m_printoutForEveryEvent) printFPGARoads(FPGARoads);
342 }
343 
345 {
346  std::string mainTable = "\n"
347  "|--------------------------------------------------------------------------------------------------|\n"
348  "| # | SubRegion | xBin | yBin | X | Y | RoadID | Sector |\n"
349  "|--------------------------------------------------------------------------------------------------|\n";
350 
351  unsigned int roadCounter = 0, hitCounter = 0;
352  for (const FPGATrackSimRoad& road : *FPGARoads)
353  {
354  ++roadCounter;
355  mainTable += std::format("| {:>6} | {:>11} | {:>8} | {:>8} | {:>12} | {:>12} | {:>10} | {:>8} |\n",
356  roadCounter,
357  road.getSubRegion(),
358  road.getXBin(),
359  road.getYBin(),
360  road.getX(),
361  road.getY(),
362  road.getRoadID(),
363  road.getSector());
364  mainTable +=
365  "| __________________________________________________________________________________________|\n"
366  "| | layer | ## | type | Global coordinates | isReal |\n"
367  "| | | | | x | y | z | |\n"
368  "| |.........................................................................................|\n";
369  for (unsigned int i = 0; i < road.getNLayers(); ++i)
370  {
371  hitCounter = 0;
372  const std::vector<std::shared_ptr<const FPGATrackSimHit>>& hits = road.getHits(i);
373  for (auto const& hit : hits)
374  {
375  if (!hit) {
376  ATH_MSG_WARNING("Null pointer for FPGATrackSimHit");
377  continue;
378  }
379  try {
380  ++hitCounter;
381  mainTable += std::format("| | {:>9} | {:>6} | {:>8} | {:>13} | {:>13} | {:>13} | {:>7} |\n",
382  (hit->isMapped() ? hit->getLayer() : 9999),
383  hitCounter,
384  (hit->isPixel() ? "Pixel" : hit->isStrip() ? "Strip" : "FAILED"),
385  hit->getX(),
386  hit->getY(),
387  hit->getZ(),
388  hit->isReal());
389  } catch (const std::exception& e) {
390  ATH_MSG_ERROR("Exception while processing FPGATrackSimHit: " << e.what());
391  }
392 
393  }
394  }
395  mainTable += "|--------------------------------------------------------------------------------------------------|\n";
396  }
397  ATH_MSG_INFO("List of FPGA roads for " << FPGARoads.key() << mainTable);
398 }
399 
400 
402 {
403  for (auto const& track : *FPGATracks)
404  {
405  const std::vector <FPGATrackSimHit>& hits = track.getFPGATrackSimHits();
406  uint32_t pixelHits = 0, stripHits = 0;
407  for (const FPGATrackSimHit& hit : hits)
408  {
409  if (hit.isPixel()) ++pixelHits;
410  if (hit.isStrip()) ++stripHits;
411  }
412  m_pixelClustersPerFPGATrack.push_back(pixelHits);
413  m_stripClustersPerFPGATrack.push_back(stripHits);
414  }
415  if (m_printoutForEveryEvent) printFPGATracks(FPGATracks);
416 }
417 
419 {
420  std::string maintable = "\n|--------------------------------------------------------------------------------------------------|\n";
421  unsigned int trackCounter = 0;
422  for (auto const& track : *FPGATracks)
423  {
424  ++trackCounter;
425  maintable += "| # | Eta | Phi | D0 | Z0 | QOverPt | chi2/ndf |\n"
426  "|--------------------------------------------------------------------------------------------------|\n";
427 
428  try
429  {
430  maintable += std::format("| {:>6} | {:>12.8f} | {:>12.8f} | {:>12.8f} | {:>12.5f} | {:>12.9f} | {:>12.8f} |\n",
431  trackCounter,
432  track.getEta(),
433  track.getPhi(),
434  track.getD0(),
435  track.getZ0(),
436  track.getQOverPt(),
437  track.getChi2ndof());
438  }
439  catch (const std::exception& e)
440  {
441  ATH_MSG_ERROR("Exception while processing FPGATrackSimTrack: " << e.what());
442  continue;
443  }
444 
445  maintable += "|__________________________________________________________________________________________________|\n"
446  "| | ## | type | layer | Global coordinates | isReal | HashID |\n"
447  "| | | | | x | y | z | | |\n"
448  "| |.........................................................................................|\n";
449  const std::vector <FPGATrackSimHit>& hits = track.getFPGATrackSimHits();
450  unsigned int hitCounter = 0;
451  for (auto const& hit : hits)
452  {
453  try {
454  ++hitCounter;
455  maintable += std::format("| | {:>6} | {:>8} | {:>5} | {:>9.3f} | {:>9.3f} | {:>9.3f} | {:>6} | {:>14} |\n",
456  hitCounter,
457  (hit.isPixel() ? "Pixel" : hit.isStrip() ? "Strip" : "FAILED"),
458  hit.getLayer(),
459  hit.getX(),
460  hit.getY(),
461  hit.getZ(),
462  hit.isReal(),
463  hit.getIdentifierHash());
464  } catch (const std::exception& e) {
465  ATH_MSG_ERROR("Exception while processing FPGATrackSimHits: " << e.what());
466  }
467  }
468  maintable += "|--------------------------------------------------------------------------------------------------|\n";
469  }
470  ATH_MSG_INFO("List of FPGA tracks for " << FPGATracks.key() << maintable);
471 }
472 
474 {
475  unsigned int nPixelMeasurements, nStripMeasurements;
476  for (auto const& prototrack : *FPGAPrototracks)
477  {
478  nPixelMeasurements = 0, nStripMeasurements = 0;
479  const std::vector<ActsTrk::ATLASUncalibSourceLink>* measurements = &prototrack.measurements;
480  for (const ActsTrk::ATLASUncalibSourceLink& measurementLink : *measurements)
481  {
482  const xAOD::UncalibratedMeasurement& measurement = ActsTrk::getUncalibratedMeasurement(measurementLink);
483  if (measurement.type() == xAOD::UncalibMeasType::PixelClusterType) ++nPixelMeasurements;
484  else if (measurement.type() == xAOD::UncalibMeasType::StripClusterType) ++nStripMeasurements;
485  }
486  m_pixelClustersPerPrototrack.push_back(nPixelMeasurements);
487  m_stripClustersPerPrototrack.push_back(nStripMeasurements);
488 
489  }
490  if (m_printoutForEveryEvent) printFPGAPrototracks(FPGAPrototracks);
491 }
492 
494 {
495  std::string mainTable = "\n";
496  if(not (*FPGAPrototracks).empty()) mainTable += "|---------------------------------------------------------------------------------------------|\n";
497 
498  unsigned int prototrackCounter = 0;
499  for (auto const& prototrack : *FPGAPrototracks)
500  {
501  ++prototrackCounter;
502  const Acts::BoundTrackParameters& initialParameters = *prototrack.parameters;
503  const Acts::BoundVector& parameters = initialParameters.parameters();
504  mainTable +=
505  "| # | QopT | Theta | Phi | d0 | z0 |\n"
506  "|---------------------------------------------------------------------------------------------|\n";
507  mainTable += std::format("| {:>6} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} |\n",
508  prototrackCounter,
509  parameters[Acts::eBoundQOverP],
510  parameters[Acts::eBoundTheta],
511  parameters[Acts::eBoundPhi],
512  parameters[Acts::eBoundLoc0],
513  parameters[Acts::eBoundLoc1]);
514 
515  const std::vector<ActsTrk::ATLASUncalibSourceLink>* measurements = &prototrack.measurements;
516  unsigned int measurementCounter = 0;
517  if (measurements->size())
518  {
519  mainTable +=
520  "| _____________________________________________________________________________________|\n"
521  "| | | type | Global coordinates | HashID | Identifier |\n"
522  "| | ## | | x | y | z | | |\n"
523  "| | |...........................................................................|\n";
524 
525  }
526  for (const ActsTrk::ATLASUncalibSourceLink& measurementLink : *measurements)
527  {
528  ++measurementCounter;
529  const xAOD::UncalibratedMeasurement& measurement = ActsTrk::getUncalibratedMeasurement(measurementLink);
530  if (measurement.type() == xAOD::UncalibMeasType::PixelClusterType) {
531  const xAOD::PixelCluster* pixelCluster = dynamic_cast<const xAOD::PixelCluster*>(&measurement);
532  mainTable += std::format("| | {:>6} | Pixel | {:>8.3f} | {:>8.3f} | {:>8.3f} | {:>7} | {:>19} |\n",
533  measurementCounter,
534  pixelCluster->globalPosition().cast<double>().x(),
535  pixelCluster->globalPosition().cast<double>().y(),
536  pixelCluster->globalPosition().cast<double>().z(),
537  pixelCluster->identifierHash(),
538  pixelCluster->identifier());
539  }
540  else if (measurement.type() == xAOD::UncalibMeasType::StripClusterType) {
541  const xAOD::StripCluster* stripCluster = dynamic_cast<const xAOD::StripCluster*>(&measurement);
542  mainTable += std::format("| | {:>6} | Strip | {:>8.3f} | {:>8.3f} | {:>8.3f} | {:>7} | {:>19} |\n",
543  measurementCounter,
544  stripCluster->globalPosition().cast<double>().x(),
545  stripCluster->globalPosition().cast<double>().y(),
546  stripCluster->globalPosition().cast<double>().z(),
547  stripCluster->identifierHash(),
548  stripCluster->identifier());
549  }
550  }
551  mainTable += "|---------------------------------------------------------------------------------------------|\n";
552  }
553  ATH_MSG_INFO("Printing out prototracks coming from " << FPGAPrototracks.key() << mainTable);
554 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
FPGATrackSim::FPGATrackSimReportingAlg::processxAODClusters
void processxAODClusters(SG::ReadHandle< DataVector< XAOD_CLUSTER >> &clusterContainer) const
Definition: FPGATrackSimReportingAlg.cxx:212
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSim::FPGATrackSimReportingAlg::printxAODSpacePoints
void printxAODSpacePoints(SG::ReadHandle< DataVector< xAOD::SpacePoint >> &spContainer) const
Definition: FPGATrackSimReportingAlg.cxx:247
vtune_athena.format
format
Definition: vtune_athena.py:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSim::FPGATrackSimReportingAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: FPGATrackSimReportingAlg.cxx:27
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
xAOD::UncalibMeasType::StripClusterType
@ StripClusterType
FPGATrackSim::FPGATrackSimReportingAlg::printFPGASeeds
void printFPGASeeds(SG::ReadHandle< ActsTrk::SeedContainer > &FPGASeeds) const
Definition: FPGATrackSimReportingAlg.cxx:276
Trk::stripCluster
@ stripCluster
Definition: MeasurementType.h:23
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
FPGATrackSim::FPGATrackSimReportingAlg::printFPGATracks
void printFPGATracks(SG::ReadHandle< FPGATrackSimTrackCollection > &FPGATracks) const
Definition: FPGATrackSimReportingAlg.cxx:418
FPGATrackSim::FPGATrackSimReportingAlg::printFPGAPrototracks
void printFPGAPrototracks(SG::ReadHandle< ActsTrk::ProtoTrackCollection > &FPGAPrototracks) const
Definition: FPGATrackSimReportingAlg.cxx:493
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FPGATrackSim::FPGATrackSimReportingAlg::initialize
virtual StatusCode initialize() override final
Definition: FPGATrackSimReportingAlg.cxx:11
calibdata.exception
exception
Definition: calibdata.py:495
xAOD::StripCluster_v1
Definition: StripCluster_v1.h:17
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
FPGATrackSim::FPGATrackSimReportingAlg::printFPGARoads
void printFPGARoads(SG::ReadHandle< FPGATrackSimRoadCollection > &FPGARoads) const
Definition: FPGATrackSimReportingAlg.cxx:344
FPGATrackSim::FPGATrackSimReportingAlg::processFPGASeedsParam
void processFPGASeedsParam(SG::ReadHandle< ActsTrk::BoundTrackParametersContainer > &FPGASeedsParam) const
Definition: FPGATrackSimReportingAlg.cxx:307
ActsTrk::getUncalibratedMeasurement
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:26
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
FPGATrackSim::FPGATrackSimReportingAlg::processFPGARoads
void processFPGARoads(SG::ReadHandle< FPGATrackSimRoadCollection > &FPGARoads) const
Definition: FPGATrackSimReportingAlg.cxx:339
FPGATrackSim::FPGATrackSimReportingAlg::processFPGATracks
void processFPGATracks(SG::ReadHandle< FPGATrackSimTrackCollection > &FPGATracks) const
Definition: FPGATrackSimReportingAlg.cxx:401
Trk::pixelCluster
@ pixelCluster
Definition: MeasurementType.h:22
FPGATrackSim::FPGATrackSimReportingAlg::processFPGASeeds
void processFPGASeeds(SG::ReadHandle< ActsTrk::SeedContainer > &FPGASeeds) const
Definition: FPGATrackSimReportingAlg.cxx:271
runIDAlign.accumulate
accumulate
Update flags based on parser line args.
Definition: runIDAlign.py:60
xAOD::PixelCluster_v1
Definition: PixelCluster_v1.h:17
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FPGATrackSim::FPGATrackSimReportingAlg::finalize
virtual StatusCode finalize() override final
Definition: FPGATrackSimReportingAlg.cxx:148
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
FPGATrackSimReportingAlg.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
FPGATrackSim::FPGATrackSimReportingAlg::processxAODSpacePoints
void processxAODSpacePoints(SG::ReadHandle< DataVector< xAOD::SpacePoint >> &spContainer) const
Definition: FPGATrackSimReportingAlg.cxx:242
FPGATrackSim::FPGATrackSimReportingAlg::processFPGAPrototracks
void processFPGAPrototracks(SG::ReadHandle< ActsTrk::ProtoTrackCollection > &FPGAPrototracks) const
Definition: FPGATrackSimReportingAlg.cxx:473
test_pyathena.counter
counter
Definition: test_pyathena.py:15
FPGATrackSim::FPGATrackSimReportingAlg::FPGATrackSimReportingAlg
FPGATrackSimReportingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FPGATrackSimReportingAlg.cxx:8
FPGATrackSim::FPGATrackSimReportingAlg::printFPGASeedsParam
void printFPGASeedsParam(SG::ReadHandle< ActsTrk::BoundTrackParametersContainer > &FPGASeedsParam) const
Definition: FPGATrackSimReportingAlg.cxx:312
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:31
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType
FPGATrackSim::FPGATrackSimReportingAlg::printxAODClusters
void printxAODClusters(SG::ReadHandle< DataVector< XAOD_CLUSTER >> &clusterContainer) const
Definition: FPGATrackSimReportingAlg.cxx:218