ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
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. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS > m_Graph
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void doScoreCut (const std::vector< std::shared_ptr< FPGATrackSimGNNEdge >> &edges)
 
void doConnectedComponents ()
 
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 ()
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

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_component {}
 
int m_num_components = 0
 
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) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 33 of file FPGATrackSimGNNRoadMakerTool.h.

Member Typedef Documentation

◆ m_Graph

typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS> FPGATrackSimGNNRoadMakerTool::m_Graph
private

Definition at line 77 of file FPGATrackSimGNNRoadMakerTool.h.

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

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 108 of file FPGATrackSimGNNRoadMakerTool.cxx.

109 {
110  // 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
111  std::vector<std::shared_ptr<const FPGATrackSimHit>> mapped_road_hits;
112  const FPGATrackSimPlaneMap *pmap = m_FPGATrackSimMapping->PlaneMap_1st(0);
113  layer_bitmask_t hitLayers = 0;
114 
115  for (const auto& hitID : road_hitIDs) {
116  if(hitID+1 < static_cast<int>(hits.size()) && hits[hitID]->isStrip() && hits[hitID+1]->isStrip() &&
117  to_string(hits[hitID]->getHitType()) == "spacepoint" && to_string(hits[hitID+1]->getHitType()) == "spacepoint" &&
118  hits[hitID]->getX() == hits[hitID+1]->getX()) {
119  auto &hit1 = hits[hitID];
120  std::shared_ptr<FPGATrackSimHit> hitCopy1 = std::make_shared<FPGATrackSimHit>(*hit1);
121  pmap->map(*hitCopy1);
122  hitLayers |= 1 << hitCopy1->getLayer();
123  mapped_road_hits.push_back(std::move(hitCopy1));
124  //
125  auto &hit2 = hits[hitID+1];
126  std::shared_ptr<FPGATrackSimHit> hitCopy2 = std::make_shared<FPGATrackSimHit>(*hit2);
127  pmap->map(*hitCopy2);
128  hitLayers |= 1 << hitCopy2->getLayer();
129  mapped_road_hits.push_back(std::move(hitCopy2));
130  }
131  else {
132  auto &hit = hits[hitID];
133  std::shared_ptr<FPGATrackSimHit> hitCopy = std::make_shared<FPGATrackSimHit>(*hit);
134  pmap->map(*hitCopy);
135  hitLayers |= 1 << hitCopy->getLayer();
136  mapped_road_hits.push_back(std::move(hitCopy));
137  }
138  }
139 
140  m_roads.emplace_back();
141  FPGATrackSimRoad & r = m_roads.back();
142  auto sorted_hits = ::sortByLayer(mapped_road_hits);
143  sorted_hits.resize(m_nLayers);
144  r.setRoadID(m_roads.size() - 1);
145  r.setHitLayers(hitLayers);
146  r.setHits(std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(std::move(sorted_hits)));
147  r.setSubRegion(0);
148 }

◆ addRoadForPixelSeed()

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

Definition at line 150 of file FPGATrackSimGNNRoadMakerTool.cxx.

151 {
152  std::vector<std::shared_ptr<const FPGATrackSimHit>> all_hits;
153  std::vector<std::shared_ptr<const FPGATrackSimHit>> track_hit_list;
154 
155  for (const auto& hitID : road_hitIDs) {
156  auto &hit = hits[hitID]; //Hit object inside the road candidate
157  all_hits.push_back(hit);
158  }
159 
160  // Sort hits in CC list by rho
161  std::sort(all_hits.begin(), all_hits.end(),
162  [](const std::shared_ptr<const FPGATrackSimHit>& hit1,
163  const std::shared_ptr<const FPGATrackSimHit>& hit2) {
164  double rho1 = std::hypot(hit1->getX(), hit1->getY());
165  double rho2 = std::hypot(hit2->getX(), hit2->getY());
166  return rho1 < rho2;
167  });
168 
169  // From all the hits in the CC list, only accept one per global layer ID, defined by the layer configuration from GBTS
170  std::unordered_set<int> seenLayers;
171  for (const auto &hit : all_hits) {
172  short layer = m_pix_h2l->at(static_cast<int>(hit->getIdentifierHash()));
173  TrigInDetSiLayer layerGeometry = m_layerGeometry->at(layer);
174  int combinedId = layerGeometry.m_subdet;
175 
176  if (seenLayers.count(combinedId) == 0) { // unique layer
177  track_hit_list.push_back(hit);
178  seenLayers.insert(combinedId);
179  }
180  }
181 
182  std::size_t nSp = track_hit_list.size();
183  std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> seed_hit_list;
184 
185  // Use a method to choose which spacepoints to keep for the road, which becomes a seed
186  // Need at least 3 spacepoints to form a seed, so only consider 3 spacepoint lists of hits-per-layer
187  // For >=4 spacepoints, consider a evenly-spaced method instead of first N spacepoints
188  // So the road candidate can have anywhere from 3-5 spacepoints
189  auto spacePointIndicesFun = [](std::size_t nSp, std::size_t nSeeds) -> std::vector<std::size_t> {
190  std::vector<std::size_t> idx;
191 
192  for (std::size_t i = 0; i < nSeeds; ++i) {
193  std::size_t pos = (i * (nSp - 1)) / (nSeeds - 1); // evenly spaced
194  if (idx.empty() || idx.back() != pos) { // avoid duplicates
195  idx.push_back(pos);
196  }
197  }
198  return idx;
199  };
200 
201  // Only keep road candidates with at >= 3 spacepoints in unique layers
202  if (nSp >= 3) {
203  std::size_t nSeeds = std::min<std::size_t>(5, nSp);
204  auto indices = spacePointIndicesFun(nSp, nSeeds);
205 
206  for (auto idx : indices) {
207  seed_hit_list.push_back({track_hit_list[idx]});
208  }
209 
210  m_roads.emplace_back();
211  FPGATrackSimRoad & r = m_roads.back();
212  r.setHits(std::move(seed_hit_list));
213  r.setRoadID(m_roads.size() - 1);
214  }
215 }

◆ 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 85 of file FPGATrackSimGNNRoadMakerTool.cxx.

88 {
89  roads.clear();
90  m_roads.clear();
91 
93  for (size_t i = 0; i < m_labels.size(); i++) {
94  if(m_labels[i] != -1) {
95  m_road_hit_list[m_labels[i]].push_back(gnn_hits[i]->getHitID());
96  }
97  }
98 
99  for (const auto& hit_list : m_road_hit_list) {
100  if(m_doGNNPixelSeeding) { addRoadForPixelSeed(hits, hit_list); }
101  else { addRoad(hits, hit_list); }
102  }
103 
104  roads.reserve(m_roads.size());
105  for (const FPGATrackSimRoad & r : m_roads) roads.emplace_back(std::make_shared<const FPGATrackSimRoad>(r));
106 }

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

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

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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  }

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

95 { return m_detStore; }

◆ doConnectedComponents()

void FPGATrackSimGNNRoadMakerTool::doConnectedComponents ( )
private

Definition at line 52 of file FPGATrackSimGNNRoadMakerTool.cxx.

53 {
54  // Remove isolated nodes from list of nodes using list of edges and indices
57 
58  int index = 0;
59  for (int node : m_unique_nodes) {
60  m_node_index_map[node] = index++; // Mapping original node index to new graph index
61  }
62 
63  for (const auto& entry : m_node_index_map) {
64  m_unique_indices.push_back(entry.first); // Push the original node index into unique_indices
65  }
66 
67  m_Graph g(m_unique_nodes.size());
68 
69  for (size_t i = 0; i < m_pass_edge_index_1.size(); i++) {
72  add_edge(u, v, g); // Add the edge between the mapped node indices
73  }
74 
75  m_component.resize(num_vertices(g), -1);
76  m_num_components = boost::connected_components(g, &m_component[0]);
77 
78  m_labels.resize(m_num_nodes,-1);
79 
80  for (size_t i = 0; i < m_unique_indices.size(); i++) {
82  }
83 }

◆ doScoreCut()

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

Definition at line 42 of file FPGATrackSimGNNRoadMakerTool.cxx.

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

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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 {
15  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
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 }

◆ 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  }
36 
37  resetVectors();
38 
39  return StatusCode::SUCCESS;
40 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ resetVectors()

void FPGATrackSimGNNRoadMakerTool::resetVectors ( )
private

Definition at line 217 of file FPGATrackSimGNNRoadMakerTool.cxx.

218 {
219  m_pass_edge_index_1.clear();
220  m_pass_edge_index_2.clear();
221  m_unique_nodes.clear();
222  m_node_index_map.clear();
223  m_unique_indices.clear();
224  m_component.clear();
225  m_labels.clear();
226  m_road_hit_list.clear();
227 }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_component

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

Definition at line 78 of file FPGATrackSimGNNRoadMakerTool.h.

◆ 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 65 of file FPGATrackSimGNNRoadMakerTool.h.

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

Definition at line 57 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_labels

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

Definition at line 80 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_layerGeometry

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

Definition at line 83 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_layerNumberTool

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

Definition at line 58 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_nLayers

unsigned FPGATrackSimGNNRoadMakerTool::m_nLayers = 0
private

Definition at line 73 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_node_index_map

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

Definition at line 75 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_num_components

int FPGATrackSimGNNRoadMakerTool::m_num_components = 0
private

Definition at line 79 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_num_nodes

int FPGATrackSimGNNRoadMakerTool::m_num_nodes = 0
private

Definition at line 70 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_pass_edge_index_1

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

Definition at line 71 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_pass_edge_index_2

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

Definition at line 72 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_pix_h2l

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

Definition at line 82 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_road_hit_list

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

Definition at line 81 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_roadMakerTool

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

Definition at line 64 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_roads

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

Definition at line 100 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_unique_indices

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

Definition at line 76 of file FPGATrackSimGNNRoadMakerTool.h.

◆ m_unique_nodes

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

Definition at line 74 of file FPGATrackSimGNNRoadMakerTool.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:
FPGATrackSimGNNRoadMakerTool::m_layerNumberTool
ToolHandle< ITrigL2LayerNumberTool > m_layerNumberTool
Definition: FPGATrackSimGNNRoadMakerTool.h:58
beamspotman.r
def r
Definition: beamspotman.py:672
FPGATrackSimGNNRoadMakerTool::m_edgeScoreCut
Gaudi::Property< float > m_edgeScoreCut
Definition: FPGATrackSimGNNRoadMakerTool.h:63
getMenu.algname
algname
Definition: getMenu.py:54
FPGATrackSimGNNRoadMakerTool::m_component
std::vector< int > m_component
Definition: FPGATrackSimGNNRoadMakerTool.h:78
FPGATrackSimGNNRoadMakerTool::addRoads
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)
Definition: FPGATrackSimGNNRoadMakerTool.cxx:85
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimGNNRoadMakerTool::m_roadMakerTool
Gaudi::Property< std::string > m_roadMakerTool
Definition: FPGATrackSimGNNRoadMakerTool.h:64
FPGATrackSimGNNRoadMakerTool::m_num_nodes
int m_num_nodes
Definition: FPGATrackSimGNNRoadMakerTool.h:70
index
Definition: index.py:1
FPGATrackSimGNNRoadMakerTool::addRoadForPixelSeed
void addRoadForPixelSeed(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, const std::vector< int > &road_hitIDs)
Definition: FPGATrackSimGNNRoadMakerTool.cxx:150
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
FPGATrackSimGNNRoadMakerTool::doConnectedComponents
void doConnectedComponents()
Definition: FPGATrackSimGNNRoadMakerTool.cxx:52
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
FPGATrackSimGNNRoadMakerTool::m_pass_edge_index_2
std::vector< int > m_pass_edge_index_2
Definition: FPGATrackSimGNNRoadMakerTool.h:72
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
FPGATrackSimGNNRoadMakerTool::m_doGNNPixelSeeding
Gaudi::Property< bool > m_doGNNPixelSeeding
Definition: FPGATrackSimGNNRoadMakerTool.h:65
FPGATrackSimHit::getLayer
int getLayer() const
Definition: FPGATrackSimHit.cxx:87
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
FPGATrackSimGNNRoadMakerTool::m_unique_nodes
std::set< int > m_unique_nodes
Definition: FPGATrackSimGNNRoadMakerTool.h:74
FPGATrackSimGNNRoadMakerTool::addRoad
void addRoad(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, const std::vector< int > &road_hitIDs)
Definition: FPGATrackSimGNNRoadMakerTool.cxx:108
FPGATrackSimGNNRoadMakerTool::m_node_index_map
std::map< int, int > m_node_index_map
Definition: FPGATrackSimGNNRoadMakerTool.h:75
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
FPGATrackSimGNNRoadMakerTool::resetVectors
void resetVectors()
Definition: FPGATrackSimGNNRoadMakerTool.cxx:217
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
FPGATrackSimGNNRoadMakerTool::m_nLayers
unsigned m_nLayers
Definition: FPGATrackSimGNNRoadMakerTool.h:73
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FPGATrackSimGNNRoadMakerTool::m_labels
std::vector< int > m_labels
Definition: FPGATrackSimGNNRoadMakerTool.h:80
FPGATrackSimPlaneMap::map
void map(FPGATrackSimHit &hit) const
Definition: FPGATrackSimPlaneMap.cxx:234
lumiFormat.i
int i
Definition: lumiFormat.py:85
FPGATrackSimGNNRoadMakerTool::m_pix_h2l
const std::vector< short > * m_pix_h2l
Definition: FPGATrackSimGNNRoadMakerTool.h:82
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
FPGATrackSimGNNRoadMakerTool::m_pass_edge_index_1
std::vector< int > m_pass_edge_index_1
Definition: FPGATrackSimGNNRoadMakerTool.h:71
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
PyPoolBrowser.node
node
Definition: PyPoolBrowser.py:131
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
FPGATrackSimPlaneMap
Definition: FPGATrackSimPlaneMap.h:62
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
FPGATrackSimGNNRoadMakerTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimGNNRoadMakerTool.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
FPGATrackSimGNNRoadMakerTool::m_layerGeometry
const std::vector< TrigInDetSiLayer > * m_layerGeometry
Definition: FPGATrackSimGNNRoadMakerTool.h:83
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
python.PyAthena.v
v
Definition: PyAthena.py:154
a
TList * a
Definition: liststreamerinfos.cxx:10
h
FPGATrackSimGNNRoadMakerTool::m_road_hit_list
std::vector< std::vector< int > > m_road_hit_list
Definition: FPGATrackSimGNNRoadMakerTool.h:81
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
layer_bitmask_t
uint32_t layer_bitmask_t
Definition: FPGATrackSimTypes.h:22
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
FPGATrackSimGNNRoadMakerTool::m_num_components
int m_num_components
Definition: FPGATrackSimGNNRoadMakerTool.h:79
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
FPGATrackSimGNNRoadMakerTool::doScoreCut
void doScoreCut(const std::vector< std::shared_ptr< FPGATrackSimGNNEdge >> &edges)
Definition: FPGATrackSimGNNRoadMakerTool.cxx:42
TrigInDetSiLayer
Definition: TrigInDetSiLayer.h:8
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:801
FPGATrackSimGNNRoadMakerTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimGNNRoadMakerTool.h:100
FPGATrackSimGNNRoadMakerTool::m_unique_indices
std::vector< int > m_unique_indices
Definition: FPGATrackSimGNNRoadMakerTool.h:76
FPGATrackSimGNNRoadMakerTool::m_Graph
boost::adjacency_list< boost::vecS, boost::vecS, boost::undirectedS > m_Graph
Definition: FPGATrackSimGNNRoadMakerTool.h:77
node
Definition: node.h:21
TrigInDetSiLayer::m_subdet
int m_subdet
Definition: TrigInDetSiLayer.h:10
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:31
fitman.k
k
Definition: fitman.py:528
sortByLayer
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)
Definition: FPGATrackSimHit.h:315