ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonLearning
MuonInference
src
SegmentEdgeClassifierTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef MUONINFERENCE_SEGMENTEDGECLASSIFIERTOOL_H
5
#define MUONINFERENCE_SEGMENTEDGECLASSIFIERTOOL_H
6
7
#include "
BucketInferenceToolBase.h
"
8
#include "
MuonInferenceInterfaces/ISegmentEdgeClassifierTool.h
"
9
#include "
MuonMLEvent.h
"
10
#include "Gaudi/Property.h"
11
12
#include <atomic>
13
#include <cstdint>
14
#include <mutex>
15
#include <string>
16
#include <vector>
17
18
namespace
MuonML
{
19
27
struct
BucketSegmentFeatures
{
28
int
chamberIndex
{0};
29
int
layers
{0};
30
int
sector
{0};
31
int
nSegments
{0};
32
};
33
61
class
SegmentEdgeClassifierTool
final :
public
BucketInferenceToolBase
,
62
virtual
public
ISegmentEdgeClassifierTool
{
63
public
:
64
using
BucketInferenceToolBase::BucketInferenceToolBase;
65
67
StatusCode
initialize
()
override
;
68
71
StatusCode
runGraphInference
(
const
EventContext& ctx,
72
GraphRawData
& graphData)
const override
;
73
76
StatusCode
buildGraph
(
const
EventContext& ctx,
77
const
xAOD::MuonSegmentContainer
& segments,
78
SegmentEdgeGraph
& graph)
const override
;
79
82
StatusCode
classifyEdges
(
const
EventContext& ctx,
83
const
SegmentEdgeGraph
& graph,
84
std::vector<SegmentEdgeScore>& scores)
const override
;
85
86
private
:
87
StatusCode
dumpDebugEvent
(
const
EventContext& ctx,
88
const
SegmentEdgeGraph
& graph,
89
const
std::vector<SegmentEdgeScore>& scores)
const
;
90
91
Gaudi::Property<float>
m_maxDeltaThetaDeg
{
this
,
"MaxDeltaThetaDeg"
, 35.f};
92
Gaudi::Property<int>
m_maxDeltaSector
{
this
,
"MaxDeltaSector"
, 1};
93
Gaudi::Property<int>
m_sectorModulo
{
this
,
"SectorModulo"
, 16};
94
Gaudi::Property<std::string>
m_inputNodeName
{
this
,
"InputNodeName"
,
"x"
};
95
Gaudi::Property<std::string>
m_inputEdgeIndexName
{
this
,
"InputEdgeIndexName"
,
"edge_index"
};
96
Gaudi::Property<std::string>
m_inputEdgeAttrName
{
this
,
"InputEdgeAttrName"
,
"edge_attr"
};
97
Gaudi::Property<std::string>
m_outputName
{
this
,
"OutputName"
,
"logits"
};
98
Gaudi::Property<std::string>
m_debugDumpFile
{
this
,
"DebugDumpFile"
,
""
};
99
Gaudi::Property<unsigned int>
m_debugDumpMaxEvents
{
this
,
"DebugDumpMaxEvents"
, 0};
100
float
m_cosMin
{0.f};
101
103
std::vector<std::string>
m_nodeFeatureNames
{};
104
std::vector<SegmentNodeFeatureId>
m_nodeFeatureIds
{};
105
106
mutable
std::mutex
m_debugDumpMutex
;
107
mutable
std::atomic<unsigned int>
m_debugDumpEvents
{0};
108
};
109
}
110
#endif
BucketInferenceToolBase.h
ISegmentEdgeClassifierTool.h
MuonMLEvent.h
Generic feature definitions and utilities shared across ML inference tools.
MuonML::BucketInferenceToolBase
Definition
BucketInferenceToolBase.h:41
MuonML::ISegmentEdgeClassifierTool
Interface for segment-edge GNN classification.
Definition
ISegmentEdgeClassifierTool.h:34
MuonML::SegmentEdgeClassifierTool
Runs a segment-level GNN on reconstructed muon segments to classify segment-pair edges as "good" or "...
Definition
SegmentEdgeClassifierTool.h:62
MuonML::SegmentEdgeClassifierTool::m_debugDumpMutex
std::mutex m_debugDumpMutex
Definition
SegmentEdgeClassifierTool.h:106
MuonML::SegmentEdgeClassifierTool::m_debugDumpMaxEvents
Gaudi::Property< unsigned int > m_debugDumpMaxEvents
Definition
SegmentEdgeClassifierTool.h:99
MuonML::SegmentEdgeClassifierTool::m_outputName
Gaudi::Property< std::string > m_outputName
Definition
SegmentEdgeClassifierTool.h:97
MuonML::SegmentEdgeClassifierTool::m_debugDumpEvents
std::atomic< unsigned int > m_debugDumpEvents
Definition
SegmentEdgeClassifierTool.h:107
MuonML::SegmentEdgeClassifierTool::m_inputEdgeAttrName
Gaudi::Property< std::string > m_inputEdgeAttrName
Definition
SegmentEdgeClassifierTool.h:96
MuonML::SegmentEdgeClassifierTool::runGraphInference
StatusCode runGraphInference(const EventContext &ctx, GraphRawData &graphData) const override
Not supported by this tool; returns FAILURE.
Definition
SegmentEdgeClassifierTool.cxx:215
MuonML::SegmentEdgeClassifierTool::m_maxDeltaThetaDeg
Gaudi::Property< float > m_maxDeltaThetaDeg
Definition
SegmentEdgeClassifierTool.h:91
MuonML::SegmentEdgeClassifierTool::classifyEdges
StatusCode classifyEdges(const EventContext &ctx, const SegmentEdgeGraph &graph, std::vector< SegmentEdgeScore > &scores) const override
Run ONNX inference on graph and populate scores with logit and probability for each edge; called afte...
Definition
SegmentEdgeClassifierTool.cxx:330
MuonML::SegmentEdgeClassifierTool::m_debugDumpFile
Gaudi::Property< std::string > m_debugDumpFile
Definition
SegmentEdgeClassifierTool.h:98
MuonML::SegmentEdgeClassifierTool::m_sectorModulo
Gaudi::Property< int > m_sectorModulo
Definition
SegmentEdgeClassifierTool.h:93
MuonML::SegmentEdgeClassifierTool::m_maxDeltaSector
Gaudi::Property< int > m_maxDeltaSector
Definition
SegmentEdgeClassifierTool.h:92
MuonML::SegmentEdgeClassifierTool::buildGraph
StatusCode buildGraph(const EventContext &ctx, const xAOD::MuonSegmentContainer &segments, SegmentEdgeGraph &graph) const override
Build a GNN graph from segments, computing node and edge features and storing the graph structure in ...
Definition
SegmentEdgeClassifierTool.cxx:220
MuonML::SegmentEdgeClassifierTool::m_nodeFeatureNames
std::vector< std::string > m_nodeFeatureNames
Node feature order expected by the model metadata (resolved at initialize).
Definition
SegmentEdgeClassifierTool.h:103
MuonML::SegmentEdgeClassifierTool::m_cosMin
float m_cosMin
Definition
SegmentEdgeClassifierTool.h:100
MuonML::SegmentEdgeClassifierTool::m_inputEdgeIndexName
Gaudi::Property< std::string > m_inputEdgeIndexName
Definition
SegmentEdgeClassifierTool.h:95
MuonML::SegmentEdgeClassifierTool::m_inputNodeName
Gaudi::Property< std::string > m_inputNodeName
Definition
SegmentEdgeClassifierTool.h:94
MuonML::SegmentEdgeClassifierTool::m_nodeFeatureIds
std::vector< SegmentNodeFeatureId > m_nodeFeatureIds
Definition
SegmentEdgeClassifierTool.h:104
MuonML::SegmentEdgeClassifierTool::initialize
StatusCode initialize() override
Retrieve the ONNX model and resolve node feature ordering from metadata.
Definition
SegmentEdgeClassifierTool.cxx:97
MuonML::SegmentEdgeClassifierTool::dumpDebugEvent
StatusCode dumpDebugEvent(const EventContext &ctx, const SegmentEdgeGraph &graph, const std::vector< SegmentEdgeScore > &scores) const
Definition
SegmentEdgeClassifierTool.cxx:443
MuonML
Definition
BucketGraphUtils.h:19
xAOD::MuonSegmentContainer
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
Definition
MuonSegmentContainer.h:14
MuonML::BucketSegmentFeatures
Segment features derived from or stored in bucket metadata.
Definition
SegmentEdgeClassifierTool.h:27
MuonML::BucketSegmentFeatures::chamberIndex
int chamberIndex
Muon chamber index of the segment.
Definition
SegmentEdgeClassifierTool.h:28
MuonML::BucketSegmentFeatures::sector
int sector
Sector number (typically 0–15).
Definition
SegmentEdgeClassifierTool.h:30
MuonML::BucketSegmentFeatures::layers
int layers
Total number of active layers in the segment.
Definition
SegmentEdgeClassifierTool.h:29
MuonML::BucketSegmentFeatures::nSegments
int nSegments
Count of segments in the same chamber/sector/eta group.
Definition
SegmentEdgeClassifierTool.h:31
MuonML::GraphRawData
Helper struct to ship the Graph from the space point buckets to ONNX.
Definition
GraphData.h:25
MuonML::SegmentEdgeGraph
Definition
SegmentEdgeData.h:15
Generated on
for ATLAS Offline Software by
1.17.0