ATLAS Offline Software
FPGATrackSimReportingAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 
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(!m_isDataPrep));
20  ATH_CHECK(m_ActsSeedCollections.initialize(!m_isDataPrep));
21  ATH_CHECK(m_ActsSeedParamCollections.initialize(!m_isDataPrep));
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 
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(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  } // if it's not the data preparation chain
146  return StatusCode::SUCCESS;
147 }
148 
150 {
151  ATH_MSG_INFO("Printing statistics for FPGA objects");
152 
153  if (!m_isDataPrep.value()) {
154  // Printing summary for clusters/FPGATracks
155  std::string summaryTableFPGATracks = "\n"
156  "Number of measurements for FPGA Tracks\n"
157  "|-----------------------------------|\n"
158  "| | min | max | Avg |\n"
159  "|-----------------------------------|\n";
160 
161  if (not m_pixelClustersPerFPGATrack.empty()) {
162  summaryTableFPGATracks += std::format("| Pixels | {:>4} | {:>4} | {:>10.2f} |\n",
163  *std::min_element(m_pixelClustersPerFPGATrack.begin(), m_pixelClustersPerFPGATrack.end()),
164  *std::max_element(m_pixelClustersPerFPGATrack.begin(), m_pixelClustersPerFPGATrack.end()),
165  std::accumulate(m_pixelClustersPerFPGATrack.begin(), m_pixelClustersPerFPGATrack.end(), 0.0) / m_pixelClustersPerFPGATrack.size());
166  }
167  else summaryTableFPGATracks += std::format("| Pixels | ---- | ---- | inf |\n");
168 
169  if (not m_stripClustersPerFPGATrack.empty()) {
170  summaryTableFPGATracks += std::format("| Strips | {:>4} | {:>4} | {:>10.2f} |\n",
171  *std::min_element(m_stripClustersPerFPGATrack.begin(), m_stripClustersPerFPGATrack.end()),
172  *std::max_element(m_stripClustersPerFPGATrack.begin(), m_stripClustersPerFPGATrack.end()),
173  std::accumulate(m_stripClustersPerFPGATrack.begin(), m_stripClustersPerFPGATrack.end(), 0.0) / m_stripClustersPerFPGATrack.size());
174  }
175  else summaryTableFPGATracks += std::format("| Strips | ---- | ---- | inf |\n");
176 
177  summaryTableFPGATracks += "|-----------------------------------|";
178  ATH_MSG_INFO( summaryTableFPGATracks );
179 
180 
181  // Printing summary for clusters/prototracks
182  std::string summaryTableFPGAPrototracks = std::format("\n"
183  "Number of measurements for FPGA Prototracks\n"
184  "|-----------------------------------|\n"
185  "| | min | max | Avg |\n"
186  "|-----------------------------------|\n");
187 
188  if (not m_pixelClustersPerPrototrack.empty()) {
189  summaryTableFPGAPrototracks += std::format("| Pixels | {:>4} | {:>4} | {:>10.2f} |\n",
190  *std::min_element(m_pixelClustersPerPrototrack.begin(), m_pixelClustersPerPrototrack.end()),
191  *std::max_element(m_pixelClustersPerPrototrack.begin(), m_pixelClustersPerPrototrack.end()),
192  std::accumulate(m_pixelClustersPerPrototrack.begin(), m_pixelClustersPerPrototrack.end(), 0.0) / m_pixelClustersPerPrototrack.size());
193  }
194  else summaryTableFPGAPrototracks += std::format("| Pixels | ---- | ---- | inf |\n");
195 
196  if (not m_stripClustersPerPrototrack.empty()) {
197  summaryTableFPGAPrototracks += std::format("| Strips | {:>4} | {:>4} | {:>10.2f} |\n",
198  *std::min_element(m_stripClustersPerPrototrack.begin(), m_stripClustersPerPrototrack.end()),
199  *std::max_element(m_stripClustersPerPrototrack.begin(), m_stripClustersPerPrototrack.end()),
200  std::accumulate(m_stripClustersPerPrototrack.begin(), m_stripClustersPerPrototrack.end(), 0.0) / m_stripClustersPerPrototrack.size());
201  }
202  else summaryTableFPGAPrototracks += std::format("| Strips | ---- | ---- | inf |\n");
203 
204  summaryTableFPGAPrototracks += "|-----------------------------------|";
205  ATH_MSG_INFO( summaryTableFPGAPrototracks );
206  }
207 
208  ATH_MSG_INFO(m_ActsInspectionTool->getPrintoutStatistics(m_actsTrackStats));
209  return StatusCode::SUCCESS;
210 }
211 
212 template <class XAOD_CLUSTER>
214 {
215  if (m_printoutForEveryEvent) printxAODClusters(clusterContainer);
216 }
217 
218 template <class XAOD_CLUSTER>
220 {
221  std::string mainTable = "\n"
222  "|=========================================================================================|\n"
223  "| # | Global coordinates | Hash ID | Identifier |\n"
224  "| | x | y | z | | |\n"
225  "|-----------------------------------------------------------------------------------------|\n";
226  unsigned int counter = 0;
227  for (const auto& cluster : *clusterContainer)
228  {
229  ++counter;
230  mainTable += std::format("| {:>6} | {:>12} | {:>12} | {:>12} | {:>12} | {:>18} |\n",
231  counter,
232  cluster->globalPosition().x(),
233  cluster->globalPosition().y(),
234  cluster->globalPosition().z(),
235  cluster->identifierHash(),
236  cluster->identifier());
237  }
238  mainTable += "|=========================================================================================|";
239  ATH_MSG_INFO("Printout of xAOD clusters coming from " << clusterContainer.key() << mainTable );
240 }
241 
242 
244 {
245  if (m_printoutForEveryEvent) printxAODSpacePoints(spContainer);
246 }
247 
249 {
250  std::string mainTable = "\n"
251  "|============================================================================|\n"
252  "| # | Global coordinates | element ID list |\n"
253  "| | x | y | z | |\n"
254  "|----------------------------------------------------------------------------|\n";
255  unsigned int counter = 0;
256  for (const auto sp : *spContainer)
257  {
258  ++counter;
259  mainTable += std::format("| {:>6} | {:>12} | {:>12} | {:>12} | {:>9}, {:>9} |\n",
260  counter,
261  sp->globalPosition().x(),
262  sp->globalPosition().y(),
263  sp->globalPosition().z(),
264  sp->elementIdList()[0],
265  sp->elementIdList().size() == 2 ? sp->elementIdList()[1] : 0);
266  }
267  mainTable += "|=========================================================================================|";
268  ATH_MSG_INFO("Printout of xAOD space points coming from " << spContainer.key() << mainTable );
269 }
270 
271 
273 {
274  if (m_printoutForEveryEvent) printFPGASeeds(spContainer);
275 }
276 
278 {
279  std::string mainTable = "\n"
280  "|=====================================================================================|\n"
281  "| # | seed | Global coordinates | element ID list |\n"
282  "| | i | x | y | z | |\n"
283  "|-------------------------------------------------------------------------------------|\n";
284  unsigned int counter = 0;
285  for (const auto thisTrack : *seedContainer)
286  {
287  auto spList = thisTrack->sp();
288  ++counter;
289  for(int i = 0; i < 3; i++)
290  {
291  auto sp = spList.at(i);
292  mainTable += std::format("| {:>6} | {:>6} | {:>12} | {:>12} | {:>12} | {:>9}, {:>9} |\n",
293  counter,
294  i,
295  sp->globalPosition().x(),
296  sp->globalPosition().y(),
297  sp->globalPosition().z(),
298  sp->elementIdList()[0],
299  sp->elementIdList().size() == 2 ? sp->elementIdList()[1] : 0);
300  }
301 
302  }
303  mainTable += "|=========================================================================================|";
304  ATH_MSG_INFO("Printout of ACTS seeds coming from " << seedContainer.key() << mainTable );
305 }
306 
307 
309 {
310  if (m_printoutForEveryEvent) printFPGASeedsParam(spContainer);
311 }
312 
314 {
315  std::string mainTable = "\n"
316  "|=============================================================================================|\n"
317  "| # | QopT | Theta | Phi | d0 | z0 |\n"
318  "|---------------------------------------------------------------------------------------------|\n";
319  unsigned int counter = 0;
320  for (const auto paramSet : *seedContainer)
321  {
322  ++counter;
323  auto parameters = paramSet->parameters();
324  mainTable += std::format("| {:>6} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} |\n",
325  counter,
326  parameters[Acts::eBoundQOverP],
327  parameters[Acts::eBoundTheta],
328  parameters[Acts::eBoundPhi],
329  parameters[Acts::eBoundLoc0],
330  parameters[Acts::eBoundLoc1]);
331  }
332  mainTable += "|=========================================================================================|";
333  ATH_MSG_INFO("Printout of ACTS seeds Param coming from " << seedContainer.key() << mainTable );
334 }
335 
336 
337 
338 
339 
341 {
342  if (m_printoutForEveryEvent) printFPGARoads(FPGARoads);
343 }
344 
346 {
347  std::string mainTable = "\n"
348  "|--------------------------------------------------------------------------------------------------|\n"
349  "| # | SubRegion | xBin | yBin | X | Y | RoadID | Sector |\n"
350  "|--------------------------------------------------------------------------------------------------|\n";
351 
352  unsigned int roadCounter = 0, hitCounter = 0;
353  for (const FPGATrackSimRoad& road : *FPGARoads)
354  {
355  ++roadCounter;
356  mainTable += std::format("| {:>6} | {:>11} | {:>8} | {:>8} | {:>12} | {:>12} | {:>10} | {:>8} |\n",
357  roadCounter,
358  road.getSubRegion(),
359  road.getXBin(),
360  road.getYBin(),
361  road.getX(),
362  road.getY(),
363  road.getRoadID(),
364  road.getSector());
365  mainTable +=
366  "| __________________________________________________________________________________________|\n"
367  "| | layer | ## | type | Global coordinates | isReal |\n"
368  "| | | | | x | y | z | |\n"
369  "| |.........................................................................................|\n";
370  for (unsigned int i = 0; i < road.getNLayers(); ++i)
371  {
372  hitCounter = 0;
373  const std::vector<std::shared_ptr<const FPGATrackSimHit>>& hits = road.getHits(i);
374  for (auto const& hit : hits)
375  {
376  if (!hit) {
377  ATH_MSG_WARNING("Null pointer for FPGATrackSimHit");
378  continue;
379  }
380  try {
381  ++hitCounter;
382  mainTable += std::format("| | {:>9} | {:>6} | {:>8} | {:>13} | {:>13} | {:>13} | {:>7} |\n",
383  (hit->isMapped() ? hit->getLayer() : 9999),
384  hitCounter,
385  (hit->isPixel() ? "Pixel" : hit->isStrip() ? "Strip" : "FAILED"),
386  hit->getX(),
387  hit->getY(),
388  hit->getZ(),
389  hit->isReal());
390  } catch (const std::exception& e) {
391  ATH_MSG_ERROR("Exception while processing FPGATrackSimHit: " << e.what());
392  }
393 
394  }
395  }
396  mainTable += "|--------------------------------------------------------------------------------------------------|\n";
397  }
398  ATH_MSG_INFO("List of FPGA roads for " << FPGARoads.key() << mainTable);
399 }
400 
401 
403 {
404  for (auto const& track : *FPGATracks)
405  {
406  const std::vector <FPGATrackSimHit>& hits = track.getFPGATrackSimHits();
407  uint32_t pixelHits = 0, stripHits = 0;
408  for (const FPGATrackSimHit& hit : hits)
409  {
410  if (hit.isPixel()) ++pixelHits;
411  if (hit.isStrip()) ++stripHits;
412  }
413  m_pixelClustersPerFPGATrack.push_back(pixelHits);
414  m_stripClustersPerFPGATrack.push_back(stripHits);
415  }
416  if (m_printoutForEveryEvent) printFPGATracks(FPGATracks);
417 }
418 
420 {
421  std::string maintable = "\n|--------------------------------------------------------------------------------------------------|\n";
422  unsigned int trackCounter = 0;
423  for (auto const& track : *FPGATracks)
424  {
425  ++trackCounter;
426  maintable += "| # | Eta | Phi | D0 | Z0 | QOverPt | chi2/ndf |\n"
427  "|--------------------------------------------------------------------------------------------------|\n";
428 
429  try
430  {
431  maintable += std::format("| {:>6} | {:>12.8f} | {:>12.8f} | {:>12.8f} | {:>12.5f} | {:>12.9f} | {:>12.8f} |\n",
432  trackCounter,
433  track.getEta(),
434  track.getPhi(),
435  track.getD0(),
436  track.getZ0(),
437  track.getQOverPt(),
438  track.getChi2ndof());
439  }
440  catch (const std::exception& e)
441  {
442  ATH_MSG_ERROR("Exception while processing FPGATrackSimTrack: " << e.what());
443  continue;
444  }
445 
446  maintable += "|__________________________________________________________________________________________________|\n"
447  "| | ## | type | layer | Global coordinates | isReal | HashID |\n"
448  "| | | | | x | y | z | | |\n"
449  "| |.........................................................................................|\n";
450  const std::vector <FPGATrackSimHit>& hits = track.getFPGATrackSimHits();
451  unsigned int hitCounter = 0;
452  for (auto const& hit : hits)
453  {
454  try {
455  ++hitCounter;
456  maintable += std::format("| | {:>6} | {:>8} | {:>5} | {:>9.3f} | {:>9.3f} | {:>9.3f} | {:>6} | {:>14} |\n",
457  hitCounter,
458  (hit.isPixel() ? "Pixel" : hit.isStrip() ? "Strip" : "FAILED"),
459  hit.getLayer(),
460  hit.getX(),
461  hit.getY(),
462  hit.getZ(),
463  hit.isReal(),
464  hit.getIdentifierHash());
465  } catch (const std::exception& e) {
466  ATH_MSG_ERROR("Exception while processing FPGATrackSimHits: " << e.what());
467  }
468  }
469  maintable += "|--------------------------------------------------------------------------------------------------|\n";
470  }
471  ATH_MSG_INFO("List of FPGA tracks for " << FPGATracks.key() << maintable);
472 }
473 
475 {
476  unsigned int nPixelMeasurements, nStripMeasurements;
477  for (auto const& prototrack : *FPGAPrototracks)
478  {
479  nPixelMeasurements = 0, nStripMeasurements = 0;
480  const std::vector<ActsTrk::ATLASUncalibSourceLink>* measurements = &prototrack.measurements;
481  for (const ActsTrk::ATLASUncalibSourceLink& measurementLink : *measurements)
482  {
483  const xAOD::UncalibratedMeasurement& measurement = ActsTrk::getUncalibratedMeasurement(measurementLink);
484  if (measurement.type() == xAOD::UncalibMeasType::PixelClusterType) ++nPixelMeasurements;
485  else if (measurement.type() == xAOD::UncalibMeasType::StripClusterType) ++nStripMeasurements;
486  }
487  m_pixelClustersPerPrototrack.push_back(nPixelMeasurements);
488  m_stripClustersPerPrototrack.push_back(nStripMeasurements);
489 
490  }
491  if (m_printoutForEveryEvent) printFPGAPrototracks(FPGAPrototracks);
492 }
493 
495 {
496  std::string mainTable = "\n";
497  if(not (*FPGAPrototracks).empty()) mainTable += "|---------------------------------------------------------------------------------------------|\n";
498 
499  unsigned int prototrackCounter = 0;
500  for (auto const& prototrack : *FPGAPrototracks)
501  {
502  ++prototrackCounter;
503  const Acts::BoundTrackParameters& initialParameters = *prototrack.parameters;
504  const Acts::BoundVector& parameters = initialParameters.parameters();
505  mainTable +=
506  "| # | QopT | Theta | Phi | d0 | z0 |\n"
507  "|---------------------------------------------------------------------------------------------|\n";
508  mainTable += std::format("| {:>6} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} | {:>14.10f} |\n",
509  prototrackCounter,
510  parameters[Acts::eBoundQOverP],
511  parameters[Acts::eBoundTheta],
512  parameters[Acts::eBoundPhi],
513  parameters[Acts::eBoundLoc0],
514  parameters[Acts::eBoundLoc1]);
515 
516  const std::vector<ActsTrk::ATLASUncalibSourceLink>* measurements = &prototrack.measurements;
517  unsigned int measurementCounter = 0;
518  if (measurements->size())
519  {
520  mainTable +=
521  "| _____________________________________________________________________________________|\n"
522  "| | | type | Global coordinates | HashID | Identifier |\n"
523  "| | ## | | x | y | z | | |\n"
524  "| | |...........................................................................|\n";
525 
526  }
527  for (const ActsTrk::ATLASUncalibSourceLink& measurementLink : *measurements)
528  {
529  ++measurementCounter;
530  const xAOD::UncalibratedMeasurement& measurement = ActsTrk::getUncalibratedMeasurement(measurementLink);
531  if (measurement.type() == xAOD::UncalibMeasType::PixelClusterType) {
532  const xAOD::PixelCluster* pixelCluster = dynamic_cast<const xAOD::PixelCluster*>(&measurement);
533  mainTable += std::format("| | {:>6} | Pixel | {:>8.3f} | {:>8.3f} | {:>8.3f} | {:>7} | {:>19} |\n",
534  measurementCounter,
535  pixelCluster->globalPosition().cast<double>().x(),
536  pixelCluster->globalPosition().cast<double>().y(),
537  pixelCluster->globalPosition().cast<double>().z(),
538  pixelCluster->identifierHash(),
539  pixelCluster->identifier());
540  }
541  else if (measurement.type() == xAOD::UncalibMeasType::StripClusterType) {
542  const xAOD::StripCluster* stripCluster = dynamic_cast<const xAOD::StripCluster*>(&measurement);
543  mainTable += std::format("| | {:>6} | Strip | {:>8.3f} | {:>8.3f} | {:>8.3f} | {:>7} | {:>19} |\n",
544  measurementCounter,
545  stripCluster->globalPosition().cast<double>().x(),
546  stripCluster->globalPosition().cast<double>().y(),
547  stripCluster->globalPosition().cast<double>().z(),
548  stripCluster->identifierHash(),
549  stripCluster->identifier());
550  }
551  }
552  mainTable += "|---------------------------------------------------------------------------------------------|\n";
553  }
554  ATH_MSG_INFO("Printing out prototracks coming from " << FPGAPrototracks.key() << mainTable);
555 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
FPGATrackSim::FPGATrackSimReportingAlg::processxAODClusters
void processxAODClusters(SG::ReadHandle< DataVector< XAOD_CLUSTER >> &clusterContainer) const
Definition: FPGATrackSimReportingAlg.cxx:213
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSim::FPGATrackSimReportingAlg::printxAODSpacePoints
void printxAODSpacePoints(SG::ReadHandle< DataVector< xAOD::SpacePoint >> &spContainer) const
Definition: FPGATrackSimReportingAlg.cxx:248
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:70
xAOD::UncalibMeasType::StripClusterType
@ StripClusterType
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
FPGATrackSim::FPGATrackSimReportingAlg::printFPGASeeds
void printFPGASeeds(SG::ReadHandle< ActsTrk::SeedContainer > &FPGASeeds) const
Definition: FPGATrackSimReportingAlg.cxx:277
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:83
FPGATrackSim::FPGATrackSimReportingAlg::printFPGATracks
void printFPGATracks(SG::ReadHandle< FPGATrackSimTrackCollection > &FPGATracks) const
Definition: FPGATrackSimReportingAlg.cxx:419
FPGATrackSim::FPGATrackSimReportingAlg::printFPGAPrototracks
void printFPGAPrototracks(SG::ReadHandle< ActsTrk::ProtoTrackCollection > &FPGAPrototracks) const
Definition: FPGATrackSimReportingAlg.cxx:494
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:496
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:228
FPGATrackSim::FPGATrackSimReportingAlg::printFPGARoads
void printFPGARoads(SG::ReadHandle< FPGATrackSimRoadCollection > &FPGARoads) const
Definition: FPGATrackSimReportingAlg.cxx:345
FPGATrackSim::FPGATrackSimReportingAlg::processFPGASeedsParam
void processFPGASeedsParam(SG::ReadHandle< ActsTrk::BoundTrackParametersContainer > &FPGASeedsParam) const
Definition: FPGATrackSimReportingAlg.cxx:308
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:340
FPGATrackSim::FPGATrackSimReportingAlg::processFPGATracks
void processFPGATracks(SG::ReadHandle< FPGATrackSimTrackCollection > &FPGATracks) const
Definition: FPGATrackSimReportingAlg.cxx:402
Trk::pixelCluster
@ pixelCluster
Definition: MeasurementType.h:22
FPGATrackSim::FPGATrackSimReportingAlg::processFPGASeeds
void processFPGASeeds(SG::ReadHandle< ActsTrk::SeedContainer > &FPGASeeds) const
Definition: FPGATrackSimReportingAlg.cxx:272
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:149
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
FPGATrackSimReportingAlg.h
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
FPGATrackSim::FPGATrackSimReportingAlg::processxAODSpacePoints
void processxAODSpacePoints(SG::ReadHandle< DataVector< xAOD::SpacePoint >> &spContainer) const
Definition: FPGATrackSimReportingAlg.cxx:243
FPGATrackSim::FPGATrackSimReportingAlg::processFPGAPrototracks
void processFPGAPrototracks(SG::ReadHandle< ActsTrk::ProtoTrackCollection > &FPGAPrototracks) const
Definition: FPGATrackSimReportingAlg.cxx:474
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:313
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:30
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType
FPGATrackSim::FPGATrackSimReportingAlg::printxAODClusters
void printxAODClusters(SG::ReadHandle< DataVector< XAOD_CLUSTER >> &clusterContainer) const
Definition: FPGATrackSimReportingAlg.cxx:219