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

#include <FPGATrackSimGNNRoadMakerTool.h>

Inheritance diagram for FPGATrackSimGNNRoadMakerTool:
Collaboration diagram for FPGATrackSimGNNRoadMakerTool:

Public Member Functions

 FPGATrackSimGNNRoadMakerTool (const std::string &, const std::string &, const IInterface *)
virtual StatusCode initialize () override
virtual StatusCode makeRoads (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > &gnn_hits, const std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > &edges, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads)
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

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

void doScoreCut (const std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > &edges)
void doConnectedComponents ()
void doJunctionAwareCC ()
void addRoads (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > &gnn_hits, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads)
void addRoad (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< int > &road_hitIDs)
void addRoadForPixelSeed (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< int > &road_hitIDs)
void resetVectors ()
void reorderIndices ()
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"}
ToolHandle< ITrigL2LayerNumberToolm_layerNumberTool {this, "LayerNumberTool", "TrigL2LayerNumberToolITk"}
Gaudi::Property< float > m_edgeScoreCut { this, "edgeScoreCut", 0.0, "Cut value for edge scores to pass for road making algorithm" }
Gaudi::Property< std::string > m_roadMakerTool { this, "roadMakerTool", "", "Algorithm to perform graph segmentation into roads"}
Gaudi::Property< bool > m_doGNNPixelSeeding { this, "doGNNPixelSeeding", false, "Flag to configure for GNN Pixel Seeding" }
int m_num_nodes = 0
std::vector< int > m_pass_edge_index_1 {}
std::vector< int > m_pass_edge_index_2 {}
unsigned m_nLayers = 0
std::set< int > m_unique_nodes {}
std::map< int, int > m_node_index_map {}
std::vector< int > m_unique_indices {}
std::vector< int > m_control_var {}
std::vector< std::vector< int > > m_component {}
int m_num_components = 0
std::vector< std::vector< int > > m_labels {}
std::vector< std::vector< int > > m_road_hit_list {}
const std::vector< short > * m_pix_h2l {nullptr}
const std::vector< TrigInDetSiLayer > * m_layerGeometry {nullptr}
std::vector< FPGATrackSimRoadm_roads {}
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 37 of file FPGATrackSimGNNRoadMakerTool.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

◆ FPGATrackSimGNNRoadMakerTool()

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

Definition at line 10 of file FPGATrackSimGNNRoadMakerTool.cxx.

11 : AthAlgTool(algname, name, ifc) {}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ addRoad()

void FPGATrackSimGNNRoadMakerTool::addRoad ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
const std::vector< int > & road_hitIDs )
private

Definition at line 155 of file FPGATrackSimGNNRoadMakerTool.cxx.

156{
157 // Take the HitID values and find the correct hit from FPGATrackSimHit, then insert it into a vector of mapped FPGATrackSimHit which are needed for the FPGATrackSimRoad
158 std::vector<std::shared_ptr<const FPGATrackSimHit>> mapped_road_hits;
159 const FPGATrackSimPlaneMap *pmap = m_FPGATrackSimMapping->PlaneMap_1st(0);
160 layer_bitmask_t hitLayers = 0;
161
162 for (const auto& hitID : road_hitIDs) {
163 if(hitID+1 < static_cast<int>(hits.size()) && hits[hitID]->isStrip() && hits[hitID+1]->isStrip() &&
164 to_string(hits[hitID]->getHitType()) == "spacepoint" && to_string(hits[hitID+1]->getHitType()) == "spacepoint" &&
165 hits[hitID]->getX() == hits[hitID+1]->getX()) {
166 auto &hit1 = hits[hitID];
167 std::shared_ptr<FPGATrackSimHit> hitCopy1 = std::make_shared<FPGATrackSimHit>(*hit1);
168 pmap->map(*hitCopy1);
169 hitLayers |= 1 << hitCopy1->getLayer();
170 mapped_road_hits.push_back(std::move(hitCopy1));
171 //
172 auto &hit2 = hits[hitID+1];
173 std::shared_ptr<FPGATrackSimHit> hitCopy2 = std::make_shared<FPGATrackSimHit>(*hit2);
174 pmap->map(*hitCopy2);
175 hitLayers |= 1 << hitCopy2->getLayer();
176 mapped_road_hits.push_back(std::move(hitCopy2));
177 }
178 else {
179 auto &hit = hits[hitID];
180 std::shared_ptr<FPGATrackSimHit> hitCopy = std::make_shared<FPGATrackSimHit>(*hit);
181 pmap->map(*hitCopy);
182 hitLayers |= 1 << hitCopy->getLayer();
183 mapped_road_hits.push_back(std::move(hitCopy));
184 }
185 }
186 m_roads.emplace_back();
187 FPGATrackSimRoad & r = m_roads.back();
188 auto sorted_hits = ::sortByLayer(mapped_road_hits);
189 sorted_hits.resize(m_nLayers);
190 r.setRoadID(m_roads.size() - 1);
191 r.setHitLayers(hitLayers);
192 r.setHits(std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(std::move(sorted_hits)));
193 r.setSubRegion(0);
194}
static std::string to_string(const std::vector< T > &v)
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)
uint32_t layer_bitmask_t
std::vector< FPGATrackSimRoad > m_roads
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
void map(FPGATrackSimHit &hit) const
int r
Definition globals.cxx:22

◆ addRoadForPixelSeed()

void FPGATrackSimGNNRoadMakerTool::addRoadForPixelSeed ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
const std::vector< int > & road_hitIDs )
private

Definition at line 196 of file FPGATrackSimGNNRoadMakerTool.cxx.

197{
198 std::vector<std::shared_ptr<const FPGATrackSimHit>> all_hits;
199 std::vector<std::shared_ptr<const FPGATrackSimHit>> track_hit_list;
200
201 for (const auto& hitID : road_hitIDs) {
202 auto &hit = hits[hitID]; //Hit object inside the road candidate
203 all_hits.push_back(hit);
204 }
205
206 // Sort hits in CC list by rho
207 std::sort(all_hits.begin(), all_hits.end(),
208 [](const std::shared_ptr<const FPGATrackSimHit>& hit1,
209 const std::shared_ptr<const FPGATrackSimHit>& hit2) {
210 double rho1 = std::hypot(hit1->getX(), hit1->getY());
211 double rho2 = std::hypot(hit2->getX(), hit2->getY());
212 return rho1 < rho2;
213 });
214
215 // From all the hits in the CC list, only accept one per global layer ID, defined by the layer configuration from GBTS
216 std::unordered_set<int> seenLayers;
217 for (const auto &hit : all_hits) {
218 short layer = m_pix_h2l->at(static_cast<int>(hit->getIdentifierHash()));
219 TrigInDetSiLayer layerGeometry = m_layerGeometry->at(layer);
220 int combinedId = layerGeometry.m_subdet;
221
222 if (seenLayers.count(combinedId) == 0) { // unique layer
223 track_hit_list.push_back(hit);
224 seenLayers.insert(combinedId);
225 }
226 }
227
228 std::size_t nSp = track_hit_list.size();
229 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> seed_hit_list;
230
231 // Use a method to choose which spacepoints to keep for the road, which becomes a seed
232 // Need at least 3 spacepoints to form a seed, so only consider 3 spacepoint lists of hits-per-layer
233 // For >=4 spacepoints, consider a evenly-spaced method instead of first N spacepoints
234 // So the road candidate can have anywhere from 3-5 spacepoints
235 auto spacePointIndicesFun = [](std::size_t nSp, std::size_t nSeeds) -> std::vector<std::size_t> {
236 std::vector<std::size_t> idx;
237
238 for (std::size_t i = 0; i < nSeeds; ++i) {
239 std::size_t pos = (i * (nSp - 1)) / (nSeeds - 1); // evenly spaced
240 if (idx.empty() || idx.back() != pos) { // avoid duplicates
241 idx.push_back(pos);
242 }
243 }
244 return idx;
245 };
246
247 // Only keep road candidates with at >= 3 spacepoints in unique layers
248 if (nSp >= 3) {
249 std::size_t nSeeds = std::min<std::size_t>(5, nSp);
250 auto indices = spacePointIndicesFun(nSp, nSeeds);
251
252 for (auto idx : indices) {
253 seed_hit_list.push_back({track_hit_list[idx]});
254 }
255
256 m_roads.emplace_back();
257 FPGATrackSimRoad & r = m_roads.back();
258 r.setHits(std::move(seed_hit_list));
259 r.setRoadID(m_roads.size() - 1);
260 }
261}
const std::vector< short > * m_pix_h2l
const std::vector< TrigInDetSiLayer > * m_layerGeometry
@ layer
Definition HitInfo.h:79
std::pair< long int, long int > indices
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ addRoads()

void FPGATrackSimGNNRoadMakerTool::addRoads ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > & gnn_hits,
std::vector< std::shared_ptr< const FPGATrackSimRoad > > & roads )
private

Definition at line 131 of file FPGATrackSimGNNRoadMakerTool.cxx.

134{
135 roads.clear();
136 m_roads.clear();
137
139 for (size_t i = 0; i < m_labels.size(); i++) {
140 for (auto& current_label : m_labels[i]){
141 if(current_label != -1) {
142 m_road_hit_list[current_label].push_back(gnn_hits[i]->getHitID());
143 }
144 }
145 }
146 for (const auto& hit_list : m_road_hit_list) {
147 if(m_doGNNPixelSeeding) { addRoadForPixelSeed(hits, hit_list); }
148 else { addRoad(hits, hit_list); }
149 }
150
151 roads.reserve(m_roads.size());
152 for (const FPGATrackSimRoad & r : m_roads) roads.emplace_back(std::make_shared<const FPGATrackSimRoad>(r));
153}
void addRoadForPixelSeed(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< int > &road_hitIDs)
void addRoad(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< int > &road_hitIDs)
std::vector< std::vector< int > > m_labels
std::vector< std::vector< int > > m_road_hit_list

◆ 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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ 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.

◆ doConnectedComponents()

void FPGATrackSimGNNRoadMakerTool::doConnectedComponents ( )
private

Definition at line 55 of file FPGATrackSimGNNRoadMakerTool.cxx.

56{
58 boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> g(m_unique_nodes.size());
59
60 for (size_t i = 0; i < m_pass_edge_index_1.size(); i++) {
63 add_edge(u, v, g); // Add the edge between the mapped node indices
64 }
65
66 std::vector<int> components(num_vertices(g), -1);
67 m_component.resize(num_vertices(g), std::vector<int>(1,-1));
68 m_num_components = boost::connected_components(g, &components[0]);
69
70 for (size_t i = 0; i != components.size(); ++i){
71 m_component[i][0] = components[i];
72 }
73
74 m_labels.resize(m_num_nodes, std::vector<int>(1,-1));
75
76 for (size_t i = 0; i < m_unique_indices.size(); i++) {
78 }
79
80}
std::vector< std::vector< int > > m_component
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ doJunctionAwareCC()

void FPGATrackSimGNNRoadMakerTool::doJunctionAwareCC ( )
private

Definition at line 82 of file FPGATrackSimGNNRoadMakerTool.cxx.

83{
85 boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS> g(m_unique_nodes.size());
86
87 for (size_t i = 0; i < m_pass_edge_index_1.size(); i++) {
90 add_edge(u, v, g); // Add the edge between the mapped node indices
91 }
92 // Predecessor map, allowing to keep track of the previous hits in a component
93 std::unordered_map<Vertex, std::vector<Vertex>> pred_map;
94 // Visited vertices map
95 std::vector<bool> visited(num_vertices(g), false);
96
97 m_control_var.resize(num_vertices(g), -1);
98 m_component.resize(num_vertices(g), std::vector<int>(1, -1));
99 int comp_id = 0;
100
101 for (Vertex v = 0; v < num_vertices(g); ++v){
102 if(!visited[v] && boost::in_degree(v,g) == 0){
103
104 // Create a color map to store state of the nodes during the BFS
105 std::vector<boost::default_color_type> color_storage(num_vertices(g));
106 auto color_map = boost::make_iterator_property_map(color_storage.begin(), get(boost::vertex_index,g));
107
108 JunctionAwareVisitor JA_vis(comp_id, m_control_var, m_component, pred_map, color_map);
109 breadth_first_search(g, v, visitor(JA_vis).color_map(color_map));
110 // Mark visited vertices and reset control variables
111 for (unsigned long u = 0; u != num_vertices(g); ++u){
112 if (m_control_var[u] != -1){
113 visited[u] = true;
114 m_control_var[u] = -1;
115 }
116 }
117 // Clear predecessor map
118 pred_map.clear();
119 ++comp_id;
120 }
121 }
122 m_num_components = comp_id;
123
124 m_labels.resize(m_num_nodes, std::vector<int>(1,-1));
125
126 for (size_t i = 0; i < m_unique_indices.size(); i++) {
128 }
129}
boost::graph_traits< boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS > >::vertex_descriptor Vertex
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ doScoreCut()

void FPGATrackSimGNNRoadMakerTool::doScoreCut ( const std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > & edges)
private

Definition at line 45 of file FPGATrackSimGNNRoadMakerTool.cxx.

46{
47 for (const auto& edge : edges) {
48 if(edge->getEdgeScore() > m_edgeScoreCut) {
49 m_pass_edge_index_1.push_back(edge->getEdgeIndex1());
50 m_pass_edge_index_2.push_back(edge->getEdgeIndex2());
51 }
52 }
53}

◆ 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

◆ initialize()

StatusCode FPGATrackSimGNNRoadMakerTool::initialize ( )
overridevirtual

Definition at line 13 of file FPGATrackSimGNNRoadMakerTool.cxx.

14{
16 m_nLayers = m_FPGATrackSimMapping->PlaneMap_1st(0)->getNLogiLayers();
17 ATH_CHECK(m_layerNumberTool.retrieve());
18 m_pix_h2l = m_layerNumberTool->pixelLayers();
19 m_layerGeometry = m_layerNumberTool->layerGeometry();
20
21 return StatusCode::SUCCESS;
22}
#define ATH_CHECK
Evaluate an expression and check for errors.
ToolHandle< ITrigL2LayerNumberTool > m_layerNumberTool

◆ 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.

◆ makeRoads()

StatusCode FPGATrackSimGNNRoadMakerTool::makeRoads ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > & gnn_hits,
const std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > & edges,
std::vector< std::shared_ptr< const FPGATrackSimRoad > > & roads )
virtual

Definition at line 27 of file FPGATrackSimGNNRoadMakerTool.cxx.

28{
29 m_num_nodes = gnn_hits.size();
30 doScoreCut(edges);
31
32 if(m_roadMakerTool == "ConnectedComponents") {
34 addRoads(hits, gnn_hits, roads);
35 } else if (m_roadMakerTool == "JunctionAwareCC"){
37 addRoads(hits, gnn_hits, roads);
38 }
39
41
42 return StatusCode::SUCCESS;
43}
void doScoreCut(const std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > &edges)
void addRoads(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > &gnn_hits, std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads)
Gaudi::Property< std::string > m_roadMakerTool

◆ 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 }

◆ reorderIndices()

void FPGATrackSimGNNRoadMakerTool::reorderIndices ( )
private

Definition at line 275 of file FPGATrackSimGNNRoadMakerTool.cxx.

276{
277 // Remove isolated nodes from list of nodes using list of edges and indices
280
281 int index = 0;
282 for (int node : m_unique_nodes) {
283 m_node_index_map[node] = index++; // Mapping original node index to new graph index
284 }
285
286 for (const auto& entry : m_node_index_map) {
287 m_unique_indices.push_back(entry.first); // Push the original node index into unique_indices
288 }
289}
str index
Definition DeMoScan.py:362

◆ resetVectors()

void FPGATrackSimGNNRoadMakerTool::resetVectors ( )
private

Definition at line 263 of file FPGATrackSimGNNRoadMakerTool.cxx.

264{
265 m_pass_edge_index_1.clear();
266 m_pass_edge_index_2.clear();
267 m_unique_nodes.clear();
268 m_node_index_map.clear();
269 m_unique_indices.clear();
270 m_component.clear();
271 m_labels.clear();
272 m_road_hit_list.clear();
273}

◆ 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.

◆ 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_component

std::vector<std::vector<int> > FPGATrackSimGNNRoadMakerTool::m_component {}
private

Definition at line 82 of file FPGATrackSimGNNRoadMakerTool.h.

82{};

◆ m_control_var

std::vector<int> FPGATrackSimGNNRoadMakerTool::m_control_var {}
private

Definition at line 81 of file FPGATrackSimGNNRoadMakerTool.h.

81{};

◆ 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_doGNNPixelSeeding

Gaudi::Property<bool> FPGATrackSimGNNRoadMakerTool::m_doGNNPixelSeeding { this, "doGNNPixelSeeding", false, "Flag to configure for GNN Pixel Seeding" }
private

Definition at line 69 of file FPGATrackSimGNNRoadMakerTool.h.

69{ this, "doGNNPixelSeeding", false, "Flag to configure for GNN Pixel Seeding" };

◆ m_edgeScoreCut

Gaudi::Property<float> FPGATrackSimGNNRoadMakerTool::m_edgeScoreCut { this, "edgeScoreCut", 0.0, "Cut value for edge scores to pass for road making algorithm" }
private

Definition at line 67 of file FPGATrackSimGNNRoadMakerTool.h.

67{ this, "edgeScoreCut", 0.0, "Cut value for edge scores to pass for road making algorithm" };

◆ 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> FPGATrackSimGNNRoadMakerTool::m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"}
private

Definition at line 61 of file FPGATrackSimGNNRoadMakerTool.h.

61{this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"};

◆ m_labels

std::vector<std::vector<int> > FPGATrackSimGNNRoadMakerTool::m_labels {}
private

Definition at line 84 of file FPGATrackSimGNNRoadMakerTool.h.

84{};

◆ m_layerGeometry

const std::vector<TrigInDetSiLayer>* FPGATrackSimGNNRoadMakerTool::m_layerGeometry {nullptr}
private

Definition at line 87 of file FPGATrackSimGNNRoadMakerTool.h.

87{nullptr};

◆ m_layerNumberTool

ToolHandle<ITrigL2LayerNumberTool> FPGATrackSimGNNRoadMakerTool::m_layerNumberTool {this, "LayerNumberTool", "TrigL2LayerNumberToolITk"}
private

Definition at line 62 of file FPGATrackSimGNNRoadMakerTool.h.

62{this, "LayerNumberTool", "TrigL2LayerNumberToolITk"};

◆ m_nLayers

unsigned FPGATrackSimGNNRoadMakerTool::m_nLayers = 0
private

Definition at line 77 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_node_index_map

std::map<int, int> FPGATrackSimGNNRoadMakerTool::m_node_index_map {}
private

Definition at line 79 of file FPGATrackSimGNNRoadMakerTool.h.

79{};

◆ m_num_components

int FPGATrackSimGNNRoadMakerTool::m_num_components = 0
private

Definition at line 83 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_num_nodes

int FPGATrackSimGNNRoadMakerTool::m_num_nodes = 0
private

Definition at line 74 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_pass_edge_index_1

std::vector<int> FPGATrackSimGNNRoadMakerTool::m_pass_edge_index_1 {}
private

Definition at line 75 of file FPGATrackSimGNNRoadMakerTool.h.

75{};

◆ m_pass_edge_index_2

std::vector<int> FPGATrackSimGNNRoadMakerTool::m_pass_edge_index_2 {}
private

Definition at line 76 of file FPGATrackSimGNNRoadMakerTool.h.

76{};

◆ m_pix_h2l

const std::vector<short>* FPGATrackSimGNNRoadMakerTool::m_pix_h2l {nullptr}
private

Definition at line 86 of file FPGATrackSimGNNRoadMakerTool.h.

86{nullptr};

◆ m_road_hit_list

std::vector<std::vector<int> > FPGATrackSimGNNRoadMakerTool::m_road_hit_list {}
private

Definition at line 85 of file FPGATrackSimGNNRoadMakerTool.h.

85{};

◆ m_roadMakerTool

Gaudi::Property<std::string> FPGATrackSimGNNRoadMakerTool::m_roadMakerTool { this, "roadMakerTool", "", "Algorithm to perform graph segmentation into roads"}
private

Definition at line 68 of file FPGATrackSimGNNRoadMakerTool.h.

68{ this, "roadMakerTool", "", "Algorithm to perform graph segmentation into roads"};

◆ m_roads

std::vector<FPGATrackSimRoad> FPGATrackSimGNNRoadMakerTool::m_roads {}
private

Definition at line 106 of file FPGATrackSimGNNRoadMakerTool.h.

106{};

◆ m_unique_indices

std::vector<int> FPGATrackSimGNNRoadMakerTool::m_unique_indices {}
private

Definition at line 80 of file FPGATrackSimGNNRoadMakerTool.h.

80{};

◆ m_unique_nodes

std::set<int> FPGATrackSimGNNRoadMakerTool::m_unique_nodes {}
private

Definition at line 78 of file FPGATrackSimGNNRoadMakerTool.h.

78{};

◆ 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: