 |
ATLAS Offline Software
|
#include <FPGATrackSimGNNRoadMakerTool.h>
|
| | 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 |
| |
|
| 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> 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...
|
| |
|
| ServiceHandle< IFPGATrackSimMappingSvc > | m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc", "FPGATrackSimMappingSvc"} |
| |
| ToolHandle< ITrigL2LayerNumberTool > | m_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< FPGATrackSimRoad > | m_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 |
| |
◆ StoreGateSvc_t
◆ FPGATrackSimGNNRoadMakerTool()
| FPGATrackSimGNNRoadMakerTool::FPGATrackSimGNNRoadMakerTool |
( |
const std::string & |
algname, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
ifc |
|
) |
| |
◆ addRoad()
| void FPGATrackSimGNNRoadMakerTool::addRoad |
( |
const std::vector< std::shared_ptr< const FPGATrackSimHit >> & |
hits, |
|
|
const std::vector< int > & |
road_hitIDs |
|
) |
| |
|
private |
Definition at line 148 of file FPGATrackSimGNNRoadMakerTool.cxx.
151 std::vector<std::shared_ptr<const FPGATrackSimHit>> mapped_road_hits;
155 for (
const auto& hitID : road_hitIDs) {
156 if(hitID+1 <
static_cast<int>(
hits.size()) &&
hits[hitID]->isStrip() &&
hits[hitID+1]->isStrip() &&
158 hits[hitID]->getX() ==
hits[hitID+1]->getX()) {
159 auto &hit1 =
hits[hitID];
160 std::shared_ptr<FPGATrackSimHit> hitCopy1 = std::make_shared<FPGATrackSimHit>(*hit1);
161 pmap->
map(*hitCopy1);
162 hitLayers |= 1 << hitCopy1->
getLayer();
163 mapped_road_hits.push_back(std::move(hitCopy1));
165 auto &hit2 =
hits[hitID+1];
166 std::shared_ptr<FPGATrackSimHit> hitCopy2 = std::make_shared<FPGATrackSimHit>(*hit2);
167 pmap->
map(*hitCopy2);
168 hitLayers |= 1 << hitCopy2->
getLayer();
169 mapped_road_hits.push_back(std::move(hitCopy2));
172 auto &hit =
hits[hitID];
173 std::shared_ptr<FPGATrackSimHit> hitCopy = std::make_shared<FPGATrackSimHit>(*hit);
175 hitLayers |= 1 << hitCopy->
getLayer();
176 mapped_road_hits.push_back(std::move(hitCopy));
184 r.setHitLayers(hitLayers);
185 r.setHits(std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>(std::move(sorted_hits)));
◆ addRoadForPixelSeed()
| void FPGATrackSimGNNRoadMakerTool::addRoadForPixelSeed |
( |
const std::vector< std::shared_ptr< const FPGATrackSimHit >> & |
hits, |
|
|
const std::vector< int > & |
road_hitIDs |
|
) |
| |
|
private |
Definition at line 189 of file FPGATrackSimGNNRoadMakerTool.cxx.
191 std::vector<std::shared_ptr<const FPGATrackSimHit>> all_hits;
192 std::vector<std::shared_ptr<const FPGATrackSimHit>> track_hit_list;
194 for (
const auto& hitID : road_hitIDs) {
195 auto &hit =
hits[hitID];
196 all_hits.push_back(hit);
200 std::sort(all_hits.begin(), all_hits.end(),
201 [](
const std::shared_ptr<const FPGATrackSimHit>& hit1,
202 const std::shared_ptr<const FPGATrackSimHit>& hit2) {
203 double rho1 = std::hypot(hit1->getX(), hit1->getY());
204 double rho2 = std::hypot(hit2->getX(), hit2->getY());
209 std::unordered_set<int> seenLayers;
210 for (
const auto &hit : all_hits) {
211 short layer =
m_pix_h2l->at(
static_cast<int>(hit->getIdentifierHash()));
213 int combinedId = layerGeometry.
m_subdet;
215 if (seenLayers.count(combinedId) == 0) {
216 track_hit_list.push_back(hit);
217 seenLayers.insert(combinedId);
221 std::size_t nSp = track_hit_list.size();
222 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> seed_hit_list;
228 auto spacePointIndicesFun = [](std::size_t nSp, std::size_t nSeeds) -> std::vector<std::size_t> {
229 std::vector<std::size_t>
idx;
231 for (std::size_t
i = 0;
i < nSeeds; ++
i) {
232 std::size_t
pos = (
i * (nSp - 1)) / (nSeeds - 1);
242 std::size_t nSeeds = std::min<std::size_t>(5, nSp);
243 auto indices = spacePointIndicesFun(nSp, nSeeds);
246 seed_hit_list.push_back({track_hit_list[
idx]});
251 r.setHits(std::move(seed_hit_list));
◆ addRoads()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ doConnectedComponents()
| void FPGATrackSimGNNRoadMakerTool::doConnectedComponents |
( |
| ) |
|
|
private |
Definition at line 55 of file FPGATrackSimGNNRoadMakerTool.cxx.
58 boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS>
g(
m_unique_nodes.size());
66 std::vector<int> components(num_vertices(
g), -1);
67 m_component.resize(num_vertices(
g), std::vector<int>(1,-1));
70 for (
size_t i = 0;
i != components.size(); ++
i){
◆ doJunctionAwareCC()
| void FPGATrackSimGNNRoadMakerTool::doJunctionAwareCC |
( |
| ) |
|
|
private |
Definition at line 81 of file FPGATrackSimGNNRoadMakerTool.cxx.
84 boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS>
g(
m_unique_nodes.size());
92 std::unordered_map<Vertex, std::vector<Vertex>> pred_map;
94 std::vector<bool> visited(num_vertices(
g),
false);
101 if(!visited[
v] && boost::in_degree(
v,
g) == 0){
103 std::vector<boost::default_color_type> color_map(num_vertices(
g));
104 breadth_first_search(
g,
v, visitor(JA_vis).color_map(boost::make_iterator_property_map(color_map.begin(),
get(boost::vertex_index,
g))));
106 for (
unsigned long u = 0;
u != num_vertices(
g); ++
u){
◆ doScoreCut()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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 |
◆ inputHandles()
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()
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ reorderIndices()
| void FPGATrackSimGNNRoadMakerTool::reorderIndices |
( |
| ) |
|
|
private |
◆ resetVectors()
| void FPGATrackSimGNNRoadMakerTool::resetVectors |
( |
| ) |
|
|
private |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_component
| std::vector<std::vector<int> > FPGATrackSimGNNRoadMakerTool::m_component {} |
|
private |
◆ m_control_var
| std::vector<int> FPGATrackSimGNNRoadMakerTool::m_control_var {} |
|
private |
◆ m_detStore
◆ m_doGNNPixelSeeding
| Gaudi::Property<bool> FPGATrackSimGNNRoadMakerTool::m_doGNNPixelSeeding { this, "doGNNPixelSeeding", false, "Flag to configure for GNN Pixel Seeding" } |
|
private |
◆ m_edgeScoreCut
| Gaudi::Property<float> FPGATrackSimGNNRoadMakerTool::m_edgeScoreCut { this, "edgeScoreCut", 0.0, "Cut value for edge scores to pass for road making algorithm" } |
|
private |
◆ m_evtStore
◆ m_FPGATrackSimMapping
◆ m_labels
| std::vector<std::vector<int> > FPGATrackSimGNNRoadMakerTool::m_labels {} |
|
private |
◆ m_layerGeometry
◆ m_layerNumberTool
◆ m_nLayers
| unsigned FPGATrackSimGNNRoadMakerTool::m_nLayers = 0 |
|
private |
◆ m_node_index_map
| std::map<int, int> FPGATrackSimGNNRoadMakerTool::m_node_index_map {} |
|
private |
◆ m_num_components
| int FPGATrackSimGNNRoadMakerTool::m_num_components = 0 |
|
private |
◆ m_num_nodes
| int FPGATrackSimGNNRoadMakerTool::m_num_nodes = 0 |
|
private |
◆ m_pass_edge_index_1
| std::vector<int> FPGATrackSimGNNRoadMakerTool::m_pass_edge_index_1 {} |
|
private |
◆ m_pass_edge_index_2
| std::vector<int> FPGATrackSimGNNRoadMakerTool::m_pass_edge_index_2 {} |
|
private |
◆ m_pix_h2l
| const std::vector<short>* FPGATrackSimGNNRoadMakerTool::m_pix_h2l {nullptr} |
|
private |
◆ m_road_hit_list
| std::vector<std::vector<int> > FPGATrackSimGNNRoadMakerTool::m_road_hit_list {} |
|
private |
◆ m_roadMakerTool
| Gaudi::Property<std::string> FPGATrackSimGNNRoadMakerTool::m_roadMakerTool { this, "roadMakerTool", "", "Algorithm to perform graph segmentation into roads"} |
|
private |
◆ m_roads
◆ m_unique_indices
| std::vector<int> FPGATrackSimGNNRoadMakerTool::m_unique_indices {} |
|
private |
◆ m_unique_nodes
| std::set<int> FPGATrackSimGNNRoadMakerTool::m_unique_nodes {} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::pair< long int, long int > indices
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
@ u
Enums for curvilinear frames.
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void map(FPGATrackSimHit &hit) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string to_string(const DetectorType &type)
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.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)