3from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory
import CompFactory
6 drawEvent=False, smearSegPars=False, **kwargs):
7 result = ComponentAccumulator()
8 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig
import ActsMuonSegmentRefitAlgCfg
10 result.merge(ActsMuonSegmentRefitAlgCfg(flags, drawEvent=drawEvent, smearSegPars = smearSegPars))
11 the_alg = CompFactory.MuonValR4.SegmentRefitTest(name, **kwargs)
12 result.addEventAlgo(the_alg, primary =
True)
16 result = ComponentAccumulator()
17 from ActsConfig.ActsGeometryConfig
import ActsExtrapolationToolCfg
18 kwargs.setdefault(
"ExtrapolationTool",
19 result.popToolsAndMerge(ActsExtrapolationToolCfg(flags,
20 FieldMode=
"StraightLine")))
21 the_alg = CompFactory.MuonValR4.SegmentExtpTest(name, **kwargs)
22 result.addEventAlgo(the_alg, primary =
True)
25if __name__==
"__main__":
26 from MuonGeoModelTestR4.testGeoModel
import setupGeoR4TestCfg, SetupArgParser, MuonPhaseIITestDefaults
27 from MuonConfig.MuonConfigUtils
import executeTest, setupHistSvcCfg
28 parser = SetupArgParser()
29 parser.add_argument(
"--noMonitorPlots", help=
"If set to true, there're no monitoring plots",
30 default =
False, action=
'store_true')
31 parser.add_argument(
"--dumpObjFiles", help=
"If set to true, the spacepoints in the bucket are saved to disk",
32 default=
False, action=
'store_true')
33 parser.add_argument(
"--noPerfMon", help=
"If set to true, disable performance monitoring.",
34 default=
False, action=
'store_true')
35 parser.add_argument(
"--smearSegPars", help=
"If set to true the segment parameters are smeared",
36 default=
False, action=
'store_true')
37 parser.set_defaults(nEvents = -1)
39 parser.set_defaults(outRootFile=
"MsTrkTester.root")
40 parser.set_defaults(inputFile=MuonPhaseIITestDefaults.HITS_PG_R3)
42 args = parser.parse_args()
43 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
44 flags = initConfigFlags()
45 flags.PerfMon.doFullMonMT =
not args.noPerfMon
47 flags, cfg = setupGeoR4TestCfg(args,flags)
48 cfg.getService(
"MessageSvc").setVerbose = [
"ActsMuonSegmentRefitAlg",
"SegmentExtrapolationTest"]
49 cfg.getService(
"MessageSvc").setDebug = [
"SegmentExtrapolationTest"]
51 cfg.getService(
"MessageSvc").setVerbose = []
52 cfg.getService(
"MessageSvc").setDebug = []
54 cfg.merge(setupHistSvcCfg(flags,outFile=args.outRootFile,
55 outStream=
"SegmentRefitTest"))
58 from MuonConfig.MuonDataPrepConfig
import xAODUncalibMeasPrepCfg
59 cfg.merge(xAODUncalibMeasPrepCfg(flags))
61 from MuonSpacePointFormation.SpacePointFormationConfig
import MuonSpacePointFormationCfg
62 cfg.merge(MuonSpacePointFormationCfg(flags))
64 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig
import MuonPatternRecognitionCfg
65 cfg.merge(MuonPatternRecognitionCfg(flags))
67 smearSegPars = args.smearSegPars))
70 from MuonPatternRecognitionTest.PatternTestConfig
import PatternVisualizationToolCfg
72 cfg.getEventAlgo(
"MuonSegmentFittingAlg").VisualizationTool = cfg.popToolsAndMerge(PatternVisualizationToolCfg(flags,
73 CanvasPreFix=
"SegmentPlotValid", outSubDir=
"SegmentValidPlots",
74 displayTruthOnly =
False, saveSinglePDFs =
True, saveSummaryPDF=
True))
76 cfg.getEventAlgo(
"MuonR4xAODSegmentCnvAlg").convertBeamSpot =
True
SegmentExtpTestCfg(falgs, name="SegmentExtrapolationTest", **kwargs)
SegmentRefitTestCfg(flags, name="SegmentRefitter", drawEvent=False, smearSegPars=False, **kwargs)