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;
92 const EventContext& ctx = getContext();
98 ATH_MSG_WARNING(
"Didn't receive " << FPGAHits.
key() <<
" on first event; assuming no input events.");
100 SmartIF<IEventProcessor> appMgr{service(
"ApplicationMgr")};
102 ATH_MSG_ERROR(
"Failed to retrieve ApplicationMgr as IEventProcessor");
103 return StatusCode::FAILURE;
105 return appMgr->stopRun();
109 if (!
m_evtSel->getSelectedEvent()) {
111 return StatusCode::SUCCESS;
122 std::vector<FPGATrackSimHit> hits;
123 std::vector<std::shared_ptr<const FPGATrackSimHit>> phits;
125 phits.reserve(FPGAHits->size());
126 hits.reserve(FPGAHits->size());
132 pmap_2nd->
map(hitCopy);
133 hits.push_back(hitCopy);
137 phits.push_back(std::make_shared<FPGATrackSimHit>(hitCopy));
142 if (rmap_1st->
getRegions(*hit).size() > 0 && hit->isPixel()) phits.push_back(std::make_shared<FPGATrackSimHit>(hitCopy));
145 if (rmap_1st->
getRegions(*hit).size() == 0) phits.push_back(std::make_shared<FPGATrackSimHit>(hitCopy));
157 if (!FPGATruthTracks.
isValid()) {
158 ATH_MSG_ERROR(
"Could not find FPGA Truth Track Collection with key " << FPGATruthTracks.
key());
159 return StatusCode::FAILURE;
167 for (
auto &hit : phits) {
197 return StatusCode::SUCCESS;
206 ATH_MSG_INFO(
"========================================================================================");
209 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
virtual StatusCode execute() override
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
ToolHandle< FPGATrackSimLayerStudyTool > m_binMonitoring
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