ATLAS Offline Software
Loading...
Searching...
No Matches
SegmentRefitTester.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5def SegmentRefitTestCfg(flags,name="SegmentRefitter", drawEvent=False, **kwargs):
6 result = ComponentAccumulator()
7 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig import ActsMuonSegmentRefitAlgCfg
8
9 result.merge(ActsMuonSegmentRefitAlgCfg(flags, drawEvent=drawEvent))
10 the_alg = CompFactory.MuonValR4.SegmentRefitTest(name, **kwargs)
11 result.addEventAlgo(the_alg, primary = True)
12 return result
13
14def SegmentExtpTestCfg(falgs, name="SegmentExtrapolationTest", **kwargs):
15 result = ComponentAccumulator()
16 from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
17 kwargs.setdefault("ExtrapolationTool",
18 result.popToolsAndMerge(ActsExtrapolationToolCfg(flags,
19 FieldMode="StraightLine")))
20 the_alg = CompFactory.MuonValR4.SegmentExtpTest(name, **kwargs)
21 result.addEventAlgo(the_alg, primary = True)
22 return result
23
24if __name__=="__main__":
25 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg, SetupArgParser, MuonPhaseIITestDefaults
26 from MuonConfig.MuonConfigUtils import executeTest, setupHistSvcCfg
27 parser = SetupArgParser()
28 parser.add_argument("--noMonitorPlots", help="If set to true, there're no monitoring plots", default = False,
29 action='store_true')
30 parser.add_argument("--dumpObjFiles", help="If set to true, the spacepoints in the bucket are saved to disk",
31 default=False, action='store_true')
32 parser.add_argument("--noPerfMon", help="If set to true, disable performance monitoring.",
33 default=False, action='store_true')
34 parser.set_defaults(nEvents = -1)
35
36 parser.set_defaults(outRootFile="MsTrkTester.root")
37 parser.set_defaults(inputFile=MuonPhaseIITestDefaults.HITS_PG_R3)
38
39 args = parser.parse_args()
40 from AthenaConfiguration.AllConfigFlags import initConfigFlags
41 flags = initConfigFlags()
42 flags.PerfMon.doFullMonMT = not args.noPerfMon
43 flags.Muon.doFastMMDigitization = False
44 flags.Acts.TrackingGeometry.UseBlueprint = False
45
46
47 flags, cfg = setupGeoR4TestCfg(args,flags)
48 cfg.getService("MessageSvc").setVerbose = ["ActsMuonSegmentRefitAlg"]
49
50
51 cfg.merge(setupHistSvcCfg(flags,outFile=args.outRootFile,
52 outStream="SegmentRefitTest"))
53
54
55 from MuonConfig.MuonDataPrepConfig import xAODUncalibMeasPrepCfg
56 cfg.merge(xAODUncalibMeasPrepCfg(flags))
57
58 from MuonSpacePointFormation.SpacePointFormationConfig import MuonSpacePointFormationCfg
59 cfg.merge(MuonSpacePointFormationCfg(flags))
60
61 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig import MuonPatternRecognitionCfg
62 cfg.merge(MuonPatternRecognitionCfg(flags))
63 cfg.merge(SegmentRefitTestCfg(flags, drawEvent = args.dumpObjFiles))
64 cfg.merge(SegmentExtpTestCfg(flags, drawEvent = args.dumpObjFiles ))
65
66 from MuonPatternRecognitionTest.PatternTestConfig import PatternVisualizationToolCfg
67
68 cfg.getEventAlgo("MuonSegmentFittingAlg").VisualizationTool = cfg.popToolsAndMerge(PatternVisualizationToolCfg(flags,
69 CanvasPreFix="SegmentPlotValid", outSubDir="SegmentValidPlots",
70 displayTruthOnly = True, saveSinglePDFs = True, saveSummaryPDF= True))
71
72 executeTest(cfg)
SegmentExtpTestCfg(falgs, name="SegmentExtrapolationTest", **kwargs)
SegmentRefitTestCfg(flags, name="SegmentRefitter", drawEvent=False, **kwargs)