ATLAS Offline Software
Loading...
Searching...
No Matches
muonEdgeSegmentInference Namespace Reference

Functions

 main (args)

Variables

 parser = SetupArgParser()
 nEvents
 inputFile
 required
 True
 dest
 help
 type
 float
 default
 int
 action
 score_mode = parser.add_mutually_exclusive_group()
 choices
 DEFAULT_BUCKET_SINGLE_OUTPUT_MODE
 const
 False
 args = parser.parse_args()

Detailed Description

Run segment-edge ONNX inference with an optional JSONL parity dump.

Function Documentation

◆ main()

muonEdgeSegmentInference.main ( args)

Definition at line 6 of file muonEdgeSegmentInference.py.

6def main(args):
7 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg
8 from MuonConfig.MuonConfigUtils import executeTest
9 from AthenaConfiguration.AllConfigFlags import initConfigFlags
10 flags = initConfigFlags()
11
12 if args.athenaDebug:
13 flags.Exec.DebugMessageComponents = [
14 "SegmentEdgeInferenceAlg",
15 "SegmentEdgeInferenceAlg.SegmentEdgeClassifierTool",
16 "SegmentEdgeInferenceAlg.SegmentTrackCandidateBuilderTool",
17 "SegmentEdgeInferenceAlg.SegmentEdgeClassifierTool.OnnxRuntimeSessionToolCPU",
18 "SegmentEdgeInferenceAlg.SegmentEdgeClassifierTool.OnnxRuntimeSessionToolCUDA",
19 "GraphInferenceAlg",
20 "GraphBucketFilterTool",
21 ]
22 print("INFO: Exec.DebugMessageComponents configured:", flags.Exec.DebugMessageComponents)
23
24 from AthOnnxComps.OnnxRuntimeFlags import OnnxRuntimeType
25 if args.use_cpu:
26 flags.AthOnnx.ExecutionProvider = OnnxRuntimeType.CPU
27 else:
28 flags.AthOnnx.ExecutionProvider = OnnxRuntimeType.CUDA
29
30 flags, cfg = setupGeoR4TestCfg(args, flags)
31
32 from MuonConfig.MuonDataPrepConfig import xAODUncalibMeasPrepCfg
33 cfg.merge(xAODUncalibMeasPrepCfg(flags))
34
35 from MuonSpacePointFormation.SpacePointFormationConfig import MuonSpacePointFormationCfg
36 cfg.merge(MuonSpacePointFormationCfg(flags))
37
38 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig import MuonPatternRecognitionCfg
39 if args.doMLBucketFilter:
40 from MuonInference.InferenceConfig import GraphBucketFilterToolCfg, GraphInferenceAlgCfg
41 bucket_tool = cfg.popToolsAndMerge(
42 GraphBucketFilterToolCfg(
43 flags,
44 ModelPath=args.bucket_model_path,
45 ScoreThreshold=args.score_threshold,
46 OutputName=args.output_name,
47 SingleOutputMode=args.single_output_mode,
48 )
49 )
50 cfg.merge(GraphInferenceAlgCfg(flags, InferenceTools=[bucket_tool]))
51 cfg.merge(MuonPatternRecognitionCfg(flags))
52 cfg.getEventAlgo("MuonEtaHoughTransformAlg").SpacePointContainer = "FilteredMlBuckets"
53 else:
54 cfg.merge(MuonPatternRecognitionCfg(flags))
55
56 output_level = 1 if args.athenaDebug else 3
57 edge_space_point_key = "FilteredMlBuckets" if args.doMLBucketFilter else "MuonSpacePoints"
58
59 edge_classifier_kwargs = {
60 "ModelPath": args.edgeModel,
61 "ReadSpacePoints": edge_space_point_key,
62 "DebugDumpFile": args.segment_edge_debug_dump_file,
63 "DebugDumpMaxEvents": args.segment_edge_debug_dump_max_events,
64 "MaxDeltaThetaDeg": args.max_delta_theta_deg,
65 "MaxDeltaSector": args.max_delta_sector,
66 "SectorModulo": args.sector_modulo,
67 "OutputLevel": output_level,
68 }
69 from MuonInference.InferenceConfig import SegmentEdgeInferenceAlgCfg
70 cfg.merge(
71 SegmentEdgeInferenceAlgCfg(
72 flags,
73 EdgeClassifierTool=edge_classifier_kwargs,
74 EdgeThreshold=args.edge_threshold,
75 OutputLevel=output_level,
76 )
77 )
78
79 executeTest(cfg)
80
void print(char *figname, TCanvas *c1)
int main()
Definition hello.cxx:18

Variable Documentation

◆ action

muonEdgeSegmentInference.action

Definition at line 102 of file muonEdgeSegmentInference.py.

◆ args

muonEdgeSegmentInference.args = parser.parse_args()

Definition at line 124 of file muonEdgeSegmentInference.py.

◆ choices

muonEdgeSegmentInference.choices

Definition at line 109 of file muonEdgeSegmentInference.py.

◆ const

muonEdgeSegmentInference.const

Definition at line 111 of file muonEdgeSegmentInference.py.

◆ default

muonEdgeSegmentInference.default

Definition at line 88 of file muonEdgeSegmentInference.py.

◆ DEFAULT_BUCKET_SINGLE_OUTPUT_MODE

muonEdgeSegmentInference.DEFAULT_BUCKET_SINGLE_OUTPUT_MODE

Definition at line 109 of file muonEdgeSegmentInference.py.

◆ dest

muonEdgeSegmentInference.dest

Definition at line 86 of file muonEdgeSegmentInference.py.

◆ False

muonEdgeSegmentInference.False

Definition at line 122 of file muonEdgeSegmentInference.py.

◆ float

muonEdgeSegmentInference.float

Definition at line 88 of file muonEdgeSegmentInference.py.

◆ help

muonEdgeSegmentInference.help

Definition at line 87 of file muonEdgeSegmentInference.py.

◆ inputFile

muonEdgeSegmentInference.inputFile

Definition at line 85 of file muonEdgeSegmentInference.py.

◆ int

muonEdgeSegmentInference.int

Definition at line 92 of file muonEdgeSegmentInference.py.

◆ nEvents

muonEdgeSegmentInference.nEvents

Definition at line 84 of file muonEdgeSegmentInference.py.

◆ parser

muonEdgeSegmentInference.parser = SetupArgParser()

Definition at line 83 of file muonEdgeSegmentInference.py.

◆ required

muonEdgeSegmentInference.required

Definition at line 86 of file muonEdgeSegmentInference.py.

◆ score_mode

muonEdgeSegmentInference.score_mode = parser.add_mutually_exclusive_group()

Definition at line 108 of file muonEdgeSegmentInference.py.

◆ True

muonEdgeSegmentInference.True

Definition at line 86 of file muonEdgeSegmentInference.py.

◆ type

muonEdgeSegmentInference.type

Definition at line 88 of file muonEdgeSegmentInference.py.