ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimRoadUnionTool Class Reference

#include <FPGATrackSimRoadUnionTool.h>

Inheritance diagram for FPGATrackSimRoadUnionTool:
Collaboration diagram for FPGATrackSimRoadUnionTool:

Public Member Functions

 FPGATrackSimRoadUnionTool (const std::string &, const std::string &, const IInterface *)
virtual StatusCode initialize () override
StatusCode getRoads (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads, std::vector< FPGATrackSimTruthTrack > const &truthtracks)
StatusCode getRoads (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads)
std::vector< FPGATrackSimTruthTrack > const * getTruthTracks ()
ToolHandleArray< IFPGATrackSimRoadFinderTool > const & tools () const
void setupSlices (FPGATrackSimLogicalEventInputHeader *slicedHitHeader)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Public Attributes

Gaudi::Property< bool > m_noHitFilter {this, "noHitFilter", {false}, "Disable filtering of hits"}

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< IFPGATrackSimMappingSvcm_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
ToolHandleArray< IFPGATrackSimRoadFinderToolm_tools
FPGATrackSimLogicalEventInputHeaderm_slicedHitHeader = nullptr
std::vector< FPGATrackSimTruthTrackm_truthtracks
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 27 of file FPGATrackSimRoadUnionTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimRoadUnionTool()

FPGATrackSimRoadUnionTool::FPGATrackSimRoadUnionTool ( const std::string & algname,
const std::string & name,
const IInterface * ifc )

Definition at line 30 of file FPGATrackSimRoadUnionTool.cxx.

30 :
31 AthAlgTool(algname,name,ifc),
32 m_tools(this)
33{
34 declareProperty("tools", m_tools, "Array of FPGATrackSimRoadFinderTools");
35}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandleArray< IFPGATrackSimRoadFinderTool > m_tools

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getRoads() [1/2]

StatusCode FPGATrackSimRoadUnionTool::getRoads ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
std::vector< std::shared_ptr< const FPGATrackSimRoad > > & roads )

Definition at line 51 of file FPGATrackSimRoadUnionTool.cxx.

52{
54
55 // Create one "tower" per slice for this event.
57 for (unsigned ireg = 0; ireg < m_tools.size(); ireg++) {
58 FPGATrackSimTowerInputHeader tower = FPGATrackSimTowerInputHeader(ireg);
59 m_slicedHitHeader->addTower(tower);
60 }
61 }
62
63 // We separately need to pass a vector of *pointers* to hit objects to the road finder tools.
64 // Makes a vector of slices that have a vector of hits assiociated with that slice
65 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> sliceHits(m_tools.size());
66 const FPGATrackSimPlaneMap *pmap = nullptr;
67 int toolNum = 0;//same as sliceNum
68 for (auto &tool : m_tools) {
69 pmap = m_FPGATrackSimMapping->PlaneMap_1st(toolNum);
70 auto *subrmap = m_FPGATrackSimMapping->SubRegionMap();
71 for (auto & iHit:hits)
72 {
73 std::shared_ptr<FPGATrackSimHit> hitCopy = std::make_shared<FPGATrackSimHit>(*iHit);
74 pmap->map(*hitCopy);
75 if ((subrmap->isInRegion(tool->getSubRegion(), *hitCopy)) || m_noHitFilter) {
76 // Do we really need to do both of these? can we make the tower class produce a vector of shared pointers?
77 if (m_slicedHitHeader) m_slicedHitHeader->getTower(toolNum)->addHit(*hitCopy);
78 sliceHits[toolNum].push_back(hitCopy);
79 }
80 }
81 toolNum++;
82 }
83 roads.clear();
84 for (auto & tool : m_tools)
85 {
86 std::vector<std::shared_ptr<const FPGATrackSimRoad>> r;
87 ATH_CHECK(tool->getRoads(sliceHits[tool->getSubRegion()], r, *getTruthTracks()));
88 roads.insert(roads.end(), std::make_move_iterator(r.begin()), std::make_move_iterator(r.end()));
89 }
90
91
92 return StatusCode::SUCCESS;
93}
#define ATH_CHECK
Evaluate an expression and check for errors.
void map(FPGATrackSimHit &hit) const
FPGATrackSimLogicalEventInputHeader * m_slicedHitHeader
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
std::vector< FPGATrackSimTruthTrack > const * getTruthTracks()
Gaudi::Property< bool > m_noHitFilter
int r
Definition globals.cxx:22

◆ getRoads() [2/2]

StatusCode FPGATrackSimRoadUnionTool::getRoads ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
std::vector< std::shared_ptr< const FPGATrackSimRoad > > & roads,
std::vector< FPGATrackSimTruthTrack > const & truthtracks )
inline

Definition at line 41 of file FPGATrackSimRoadUnionTool.h.

44 {
45 m_truthtracks = truthtracks;
46 return getRoads(hits, roads);
47 }
std::vector< FPGATrackSimTruthTrack > m_truthtracks
StatusCode getRoads(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads, std::vector< FPGATrackSimTruthTrack > const &truthtracks)

◆ getTruthTracks()

std::vector< FPGATrackSimTruthTrack > const * FPGATrackSimRoadUnionTool::getTruthTracks ( )
inline

Definition at line 51 of file FPGATrackSimRoadUnionTool.h.

51{ return &m_truthtracks; }

◆ initialize()

StatusCode FPGATrackSimRoadUnionTool::initialize ( )
overridevirtual

Definition at line 38 of file FPGATrackSimRoadUnionTool.cxx.

39{
40 // Retrieve
41 ATH_MSG_INFO("Using " << m_tools.size() << " tools");
42 ATH_CHECK(m_tools.retrieve());
43
44 if (m_tools.empty()) {
45 ATH_MSG_FATAL("initialize() Tool list empty");
46 return StatusCode::FAILURE;
47 }
48 return StatusCode::SUCCESS;
49}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setupSlices()

void FPGATrackSimRoadUnionTool::setupSlices ( FPGATrackSimLogicalEventInputHeader * slicedHitHeader)
inline

Definition at line 57 of file FPGATrackSimRoadUnionTool.h.

57 {
58 m_slicedHitHeader = slicedHitHeader;
59 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tools()

ToolHandleArray< IFPGATrackSimRoadFinderTool > const & FPGATrackSimRoadUnionTool::tools ( ) const
inline

Definition at line 56 of file FPGATrackSimRoadUnionTool.h.

56{ return m_tools; }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_FPGATrackSimMapping

ServiceHandle<IFPGATrackSimMappingSvc> FPGATrackSimRoadUnionTool::m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
private

Definition at line 71 of file FPGATrackSimRoadUnionTool.h.

71{this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"};

◆ m_noHitFilter

Gaudi::Property<bool> FPGATrackSimRoadUnionTool::m_noHitFilter {this, "noHitFilter", {false}, "Disable filtering of hits"}

Definition at line 63 of file FPGATrackSimRoadUnionTool.h.

63{this, "noHitFilter", {false}, "Disable filtering of hits"};

◆ m_slicedHitHeader

FPGATrackSimLogicalEventInputHeader* FPGATrackSimRoadUnionTool::m_slicedHitHeader = nullptr
private

Definition at line 77 of file FPGATrackSimRoadUnionTool.h.

◆ m_tools

ToolHandleArray<IFPGATrackSimRoadFinderTool> FPGATrackSimRoadUnionTool::m_tools
private

Definition at line 73 of file FPGATrackSimRoadUnionTool.h.

◆ m_truthtracks

std::vector<FPGATrackSimTruthTrack> FPGATrackSimRoadUnionTool::m_truthtracks
private

Definition at line 78 of file FPGATrackSimRoadUnionTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: