ATLAS Offline Software
Loading...
Searching...
No Matches
MuonPatternRecognitionConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6
7def MuonPhiHoughTransformAlgCfg(flags, name = "MuonPhiHoughTransformAlg", **kwargs):
8 result = ComponentAccumulator()
9 kwargs.setdefault("downWeightPrdMultiplicity", True)
10 theAlg = CompFactory.MuonR4.PhiHoughTransformAlg(name, **kwargs)
11 result.addEventAlgo(theAlg, primary=True)
12 return result
13
14
15def MuonNSWSegmentFinderAlgCfg(flags, name = "MuonNswSegmentFinderAlg", **kwargs):
16 result = ComponentAccumulator()
17 from MuonSpacePointCalibrator.CalibrationConfig import MuonSpacePointCalibratorCfg
18 kwargs.setdefault("Calibrator", result.popToolsAndMerge(MuonSpacePointCalibratorCfg(flags)))
19 theAlg = CompFactory.MuonR4.NswSegmentFinderAlg(name, **kwargs)
20 result.addEventAlgo(theAlg, primary=True)
21 return result
22
23
24def MuonEtaHoughTransformAlgCfg(flags, name = "MuonEtaHoughTransformAlg", **kwargs):
25 result = ComponentAccumulator()
26 kwargs.setdefault("downWeightPrdMultiplicity", True)
27 theAlg = CompFactory.MuonR4.EtaHoughTransformAlg(name, **kwargs)
28 result.addEventAlgo(theAlg, primary=True)
29 return result
30
31def MuonSegmentFittingAlgCfg(flags, name = "MuonSegmentFittingAlg", **kwargs):
32 result = ComponentAccumulator()
33 from MuonSpacePointCalibrator.CalibrationConfig import MuonSpacePointCalibratorCfg
34 kwargs.setdefault("Calibrator", result.popToolsAndMerge(MuonSpacePointCalibratorCfg(flags)))
35 kwargs.setdefault("ResoSeedHitAssoc", 5. )
36 kwargs.setdefault("RecoveryPull", 3.)
37 kwargs.setdefault("fitSegmentT0", False)
38 kwargs.setdefault("recalibInFit", False)
39 kwargs.setdefault("useFastFitter", False)
40 kwargs.setdefault("doBeamspotConstraint", True)
41 theAlg = CompFactory.MuonR4.SegmentFittingAlg(name, **kwargs)
42 result.addEventAlgo(theAlg, primary=True)
43 return result
44
45def ActsMuonSegmentRefitAlgCfg(flags,name="ActsMuonSegmentRefitAlg", **kwargs):
46 result = ComponentAccumulator()
47 from MuonTrackFindingAlgs.TrackFindingConfig import SegmentSelectorCfg, MSTrackFitterCfg
48 kwargs.setdefault("SegmentSelectionTool", result.popToolsAndMerge(SegmentSelectorCfg(flags)))
49 from MuonSpacePointCalibrator.CalibrationConfig import MuonSpacePointCalibratorCfg
50 kwargs.setdefault("Calibrator", result.popToolsAndMerge(MuonSpacePointCalibratorCfg(flags)))
51 kwargs.setdefault("FittingTool", result.popToolsAndMerge(MSTrackFitterCfg(flags,
52 DoStraightLine=True)))
53 from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
54 kwargs.setdefault("ExtrapolationTool", result.popToolsAndMerge(ActsExtrapolationToolCfg(flags, MaxSteps=10000)))
55 from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
56 kwargs.setdefault("TrackingGeometryTool", result.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
57 kwargs.setdefault("SegmentContainer", "MuonSegmentsFromR4")
58 theAlg = CompFactory.MuonR4.SegmentActsRefitAlg(name, **kwargs)
59 result.addEventAlgo(theAlg, primary = True)
60 return result
61
63 result = ComponentAccumulator()
64 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
65 result.merge(ActsGeometryContextAlgCfg(flags))
66 segmentContainers = []
67 if flags.Detector.GeometrysTGC or flags.Detector.GeometryMM:
68 segmentContainers+=["MuonNswSegments"]
69 result.merge(MuonEtaHoughTransformAlgCfg(flags, name="MuonNswEtaHoughTransformAlg",
70 EtaHoughMaxContainer = "MuonHoughNswMaxima",
71 SpacePointContainer = "NswSpacePoints"))
72 result.merge(MuonNSWSegmentFinderAlgCfg(flags, name="MuonNswSegmentFinderAlg",
73 MuonNswSegmentWriteKey = segmentContainers[-1],
74 MuonNswSegmentSeedWriteKey = "MuonNswSegmentSeeds",
75 CombinatorialReadKey = "MuonHoughNswMaxima"))
76
77 if flags.Detector.GeometryMDT or flags.Detector.GeometryRPC or flags.Detector.GeometryTGC:
78 result.merge(MuonEtaHoughTransformAlgCfg(flags))
79 result.merge(MuonPhiHoughTransformAlgCfg(flags))
80 segmentContainers+=["R4MuonSegments"]
81
82 result.merge(MuonSegmentFittingAlgCfg(flags, OutSegmentContainer=segmentContainers[-1]))
83
84 from MuonSegmentCnv.MuonSegmentCnvConfig import xAODSegmentCnvAlgCfg
85 result.merge(xAODSegmentCnvAlgCfg(flags, InSegmentKeys = segmentContainers))
86 if flags.Input.isMC:
87 from MuonTruthAlgsR4.MuonTruthAlgsConfig import RecoSegmentTruthAssocCfg
88 result.merge(RecoSegmentTruthAssocCfg(flags,
89 name="MuonSegmentsFromR4TruthMatching",
90 SegmentKey="MuonSegmentsFromR4"))
91 if flags.Muon.scheduleActsReco:
92 from MuonSegmentCnv.MuonSegmentCnvConfig import MuonR4SegmentCnvAlgCfg
93 result.merge(MuonR4SegmentCnvAlgCfg(flags,
94 ReadSegments = segmentContainers,
95 WriteKey="TrackMuonSegments"))
96 return result
MuonEtaHoughTransformAlgCfg(flags, name="MuonEtaHoughTransformAlg", **kwargs)
ActsMuonSegmentRefitAlgCfg(flags, name="ActsMuonSegmentRefitAlg", **kwargs)
MuonPhiHoughTransformAlgCfg(flags, name="MuonPhiHoughTransformAlg", **kwargs)
MuonSegmentFittingAlgCfg(flags, name="MuonSegmentFittingAlg", **kwargs)
MuonNSWSegmentFinderAlgCfg(flags, name="MuonNswSegmentFinderAlg", **kwargs)