27#include "GaudiKernel/IEventProcessor.h"
30#ifdef BENCHMARK_LAYERSTUDYALG
51 while (std::getline(
ss, line,
'\n')) {
62 ATH_MSG_DEBUG(
"initialize() Instantiating output layer study tree");
82 return StatusCode::SUCCESS;
97 ATH_MSG_WARNING(
"Didn't receive " << FPGAHits.
key() <<
" on first event; assuming no input events.");
99 SmartIF<IEventProcessor> appMgr{service(
"ApplicationMgr")};
101 ATH_MSG_ERROR(
"Failed to retrieve ApplicationMgr as IEventProcessor");
102 return StatusCode::FAILURE;
104 return appMgr->stopRun();
108 if (!
m_evtSel->getSelectedEvent()) {
110 return StatusCode::SUCCESS;
121 std::vector<FPGATrackSimHit> hits;
122 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits;
124 phits.reserve(FPGAHits->size());
125 hits.reserve(FPGAHits->size());
131 pmap_2nd->
map(hitCopy);
132 hits.push_back(hitCopy);
136 phits.push_back(std::make_shared<FPGATrackSimHit>(hitCopy));
141 if (rmap_1st->
getRegions(*hit).size() > 0 && hit->isPixel()) phits.push_back(std::make_shared<FPGATrackSimHit>(hitCopy));
144 if (rmap_1st->
getRegions(*hit).size() == 0) phits.push_back(std::make_shared<FPGATrackSimHit>(hitCopy));
156 if (!FPGATruthTracks.
isValid()) {
157 ATH_MSG_ERROR(
"Could not find FPGA Truth Track Collection with key " << FPGATruthTracks.
key());
158 return StatusCode::FAILURE;
166 for (
auto &hit : phits) {
196 return StatusCode::SUCCESS;
205 ATH_MSG_INFO(
"========================================================================================");
208 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Binning Utilities for GenScanTool.
Structs that store the data flow information per event.
: FPGATrackSim-specific class to represent an hit in the detector.
Maps ITK module indices to FPGATrackSim regions.
Stores slice definitions for FPGATrackSim regions.
Defines a class for roads.
Structs that store the 5 track parameters.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::string m_description
virtual StatusCode initialize() override
virtual StatusCode finalize() override
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_evtSel
FPGATrackSimLayerStudyAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< int > m_stage
Gaudi::Property< bool > m_requireTruth
SG::ReadHandleKey< FPGATrackSimHitCollection > m_FPGAHitKey
ToolHandle< FPGATrackSimBinnedHits > m_hitBinningTool
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
ToolHandle< FPGATrackSimLayerStudyTool > m_binMonitoring
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
SG::ReadHandleKey< FPGATrackSimTruthTrackCollection > m_FPGATruthTrackKey
Gaudi::Property< unsigned > m_threshold
ServiceHandle< IChronoStatSvc > m_chrono
void map(FPGATrackSimHit &hit) const
std::vector< uint32_t > getRegions(const FPGATrackSimHit &hit) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
constexpr bool enableBenchmark