|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
   26 #include "GaudiKernel/IEventProcessor.h" 
   30 #ifdef BENCHMARK_FPGATRACKSIM 
   51         while (std::getline(
ss, 
line, 
'\n')) {
 
   91     return StatusCode::SUCCESS;
 
  101     const EventContext& ctx = getContext();
 
  108       SmartIF<IEventProcessor> appMgr{service(
"ApplicationMgr")};
 
  110           ATH_MSG_ERROR(
"Failed to retrieve ApplicationMgr as IEventProcessor");
 
  111           return StatusCode::FAILURE;
 
  113       return appMgr->stopRun();
 
  117     ATH_CHECK( FPGAHits.
record (std::make_unique<FPGATrackSimHitCollection>()));
 
  120     ATH_CHECK( FPGAHitUnmapped.
record (std::make_unique<FPGATrackSimHitCollection>()));
 
  123     ATH_CHECK( FPGAClusters.
record (std::make_unique<FPGATrackSimClusterCollection>()));
 
  126     ATH_CHECK(truthLinkVec.
record(std::make_unique<xAODTruthParticleLinkVector>()));
 
  129     ATH_CHECK(FPGATruthTracks.
record(std::make_unique<FPGATrackSimTruthTrackCollection>()));
 
  132     ATH_CHECK(FPGAOfflineTracks.
record(std::make_unique<FPGATrackSimOfflineTrackCollection>()));
 
  135         bool acceptEvent = 
false;
 
  148             if (!truthParticleContainer.
isValid()) {
 
  149                 ATH_MSG_ERROR(
"No valid truth particle container with key " << truthParticleContainer.
key());
 
  150                 return StatusCode::FAILURE;
 
  153             std::unordered_map<HepMcParticleLink::barcode_type, std::pair<const xAOD::TruthParticle*, size_t>> truthParticlesMap;
 
  154             size_t truthParticleIndex = 0;
 
  156                 truthParticlesMap.insert(std::make_pair(
HepMC::uniqueID(truthParticle), std::make_pair(truthParticle,truthParticleIndex)));
 
  157                 truthParticleIndex++;
 
  160             truthLinkVec->
reserve(fpgaTruthTracks.size());
 
  161             ATH_MSG_DEBUG(
"begin truth matching for " << fpgaTruthTracks.size() << 
" FPGA truth tracks");
 
  163                 auto it = truthParticlesMap.find(fpgaTruthTrack.getUniqueID()); 
 
  164                 if (
it != truthParticlesMap.end()) {
 
  172             if (truthLinkVec->
empty()) {
 
  173                 ATH_MSG_DEBUG(
"No truth particles selected. Skipping event...");
 
  174                 return StatusCode::SUCCESS;
 
  196         FPGATruthTracks->push_back(truthtrack);
 
  201         FPGAOfflineTracks->push_back(offlineTrack);
 
  222         FPGAHits->reserve(
hits.size());
 
  223         for (
const auto& hit : 
hits) {
 
  224             if (hit.isReal()) FPGAHits->push_back(hit);
 
  246     return StatusCode::SUCCESS;
 
  261         return StatusCode::SUCCESS;
 
  270             ATH_MSG_DEBUG(
"Cannot read more events from file, returning");
 
  271             return StatusCode::SUCCESS; 
 
  283             ATH_MSG_INFO(
"Cannot read more events from file, returning");
 
  284             return StatusCode::SUCCESS;
 
  290     return StatusCode::SUCCESS;
 
  327         unsigned npix(0), nstrip(0);
 
  329             if (cluster.getClusterEquiv().isPixel()) npix++;
 
  338     FPGAClusters->insert(
 
  345     return StatusCode::SUCCESS;
 
  353     ATH_MSG_INFO(
"PRINTING FPGATRACKSIM SIMPLE DATAPREP STATS");
 
  354     ATH_MSG_INFO(
"========================================================================================");
 
  361     return StatusCode::SUCCESS;
 
  
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
StatusCode readInputs(bool &done)
ServiceHandle< IChronoStatSvc > m_chrono
Gaudi::Property< bool > m_recordHits
ToolHandle< GenericMonitoringTool > m_monTool
Group
Properties of a chain group.
ToolHandle< IFPGATrackSimInputTool > m_hitSGInputTool
const std::vector< FPGATrackSimOfflineTrack > & getOfflineTracks() const
Stores slice definitions for FPGATrackSim regions.
ToolHandle< FPGATrackSimReadRawRandomHitsTool > m_hitInputTool2
unsigned m_nMaxStripClusters
virtual StatusCode initialize() override
FPGATrackSimEventInputHeader m_eventHeader
virtual StatusCode execute() override
FPGATrackSimLogicalEventInputHeader * m_logicEventHeader_precluster
Gaudi::Property< bool > m_useInternalTruthTracks
Gaudi::Property< bool > m_writePreClusterBranch
FPGATrackSimLogicalEventInputHeader * m_logicEventHeader
ToolHandleArray< FPGATrackSimRawToLogicalHitsTool > m_hitMapTools
SG::WriteHandleKey< FPGATrackSimEventInfo > m_FPGAEventInfoKey
std::string m_description
SG::WriteHandleKey< FPGATrackSimOfflineTrackCollection > m_FPGAOfflineTrackKey
const std::vector< FPGATrackSimTruthTrack > & getTruthTracks() const
Maps ITK module indices to FPGATrackSim regions.
unsigned long m_nStripClusters
Gaudi::Property< bool > m_writeOutputData
ToolHandle< IFPGATrackSimHitFilteringTool > m_hitFilteringTool
Gaudi::Property< bool > m_doEvtSel
a link optimized in size for a GenParticle in a McEventCollection
SG::WriteHandleKey< FPGATrackSimHitCollection > m_FPGAHitKey
unsigned m_nMaxPixClusters
Gaudi::Property< bool > m_doHitFiltering
SG::WriteHandleKey< FPGATrackSimHitCollection > m_FPGAHitUnmappedKey
Gaudi::Property< int > m_clustering
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_inputTruthParticleContainerKey
Class describing a truth particle in the MC record.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
Gaudi::Property< int > m_secondInputToolN
SG::WriteHandleKeyArray< FPGATrackSimClusterCollection > m_FPGAClusterKey
: FPGATrackSim-specific class to represent an hit in the detector.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ToolHandle< FPGATrackSimOutputHeaderTool > m_writeOutputTool
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
ToolHandle< FPGATrackSimClusteringToolI > m_clusteringTool
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Gaudi::Property< std::string > m_preClusterBranch
StatusCode processInputs(SG::WriteHandle< FPGATrackSimHitCollection > &FPGAHitUnmapped, SG::WriteHandle< FPGATrackSimClusterCollection > &FPGAClusters)
Gaudi::Property< std::string > m_postClusterBranch
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
std::unique_ptr< FPGATrackSimClusterCollection > m_clusters
SG::WriteHandleKey< xAODTruthParticleLinkVector > m_truthLinkContainerKey
Gaudi::Property< int > m_firstInputToolN
std::pair< HepMcParticleLink, ElementLink< xAOD::TruthParticleContainer > > xAODTruthParticleLink
std::vector< FPGATrackSimHit > m_hits_miss
FPGATrackSimDataPrepAlg(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandleArray< FPGATrackSim::FPGATrackSimEventSelectionTool > m_eventSelectionTools
constexpr bool enableBenchmark
ToolHandle< IFPGATrackSimEventInputHeaderTool > m_hitInputTool
Defines a class for roads.
Declare a monitored scalar variable.
FPGATrackSimEventInputHeader m_firstInputHeader
virtual StatusCode finalize() override
SG::WriteHandleKey< FPGATrackSimTruthTrackCollection > m_FPGATruthTrackKey
std::vector< FPGATrackSimTruthTrack > FPGATrackSimTruthTrackCollection
bool empty() const noexcept
Returns true if the collection is empty.
Structs that store the 5 track parameters.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
unsigned long m_nPixClusters