ATLAS Offline Software
Loading...
Searching...
No Matches
MuonFastReconstructionConfig.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
6def MuonFastReconstructionAlgCfg(flags, name = "MuonFastReconstructionAlg", **kwargs):
7 result = ComponentAccumulator()
8 # Set defaults input space point containers
9 SpacePointContainers = ["MuonSpacePoints"]
10 if flags.Detector.GeometrysTGC or flags.Detector.GeometryMM:
11 SpacePointContainers += ["NswSpacePoints"]
12 kwargs.setdefault("InSpacePoints", SpacePointContainers)
13 # Set SP calibrator tool
14 from MuonSpacePointCalibrator.CalibrationConfig import MuonSpacePointCalibratorCfg
15 kwargs.setdefault("Calibrator", result.popToolsAndMerge(MuonSpacePointCalibratorCfg(flags)))
16
17 kwargs.setdefault("MinBendingTriggerLayers", 1)
18 kwargs.setdefault("MinBendingPrecisionLayers", 8)
19 kwargs.setdefault("MinPhiLayers", 1)
20
21 theAlg = CompFactory.MuonR4.FastReconstructionAlg(name, **kwargs)
22 result.addEventAlgo(theAlg, primary=True)
23 return result
24
25def PatternRecognitionFromFastRecoCfg(flags, suffix = ""):
26 result = ComponentAccumulator()
27 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
28 result.merge(ActsGeometryContextAlgCfg(flags))
29
30 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig import MuonEtaHoughTransformAlgCfg, MuonNSWSegmentFinderAlgCfg, MuonPhiHoughTransformAlgCfg, MuonSegmentFittingAlgCfg
31 segmentContainers = []
32 if flags.Detector.GeometrysTGC or flags.Detector.GeometryMM:
33 segmentContainers+=["MuonNswSegments"]
34 result.merge(MuonEtaHoughTransformAlgCfg(flags, name=f"MuonNswEtaHoughTransformAlg{suffix}",
35 EtaHoughMaxContainer = "MuonHoughNswMaxima",
36 SpacePointContainer = "NswSpacePointsFastReco"))
37 result.merge(MuonNSWSegmentFinderAlgCfg(flags, name=f"MuonNswSegmentFinderAlg{suffix}",
38 MuonNswSegmentWriteKey = segmentContainers[-1],
39 MuonNswSegmentSeedWriteKey = "MuonNswSegmentSeeds",
40 CombinatorialReadKey = "MuonHoughNswMaxima"))
41
42 if flags.Detector.GeometryMDT or flags.Detector.GeometryRPC or flags.Detector.GeometryTGC:
43 result.merge(MuonEtaHoughTransformAlgCfg(flags, name = f"MuonEtaHoughTransformAlg{suffix}",
44 SpacePointContainer = "MuonSpacePointsFastReco"))
45 result.merge(MuonPhiHoughTransformAlgCfg(flags, name = f"MuonPhiHoughTransformAlg{suffix}"))
46 segmentContainers+=["R4MuonSegments"]
47
48 result.merge(MuonSegmentFittingAlgCfg(flags,
49 name = f"MuonSegmentFittingAlg{suffix}",
50 OutSegmentContainer=segmentContainers[-1]))
51
52 from MuonSegmentCnv.MuonSegmentCnvConfig import xAODSegmentCnvAlgCfg
53 result.merge(xAODSegmentCnvAlgCfg(flags, name = f"MuonR4xAODSegmentCnvAlg{suffix}", InSegmentKeys = segmentContainers))
54 if flags.Muon.setupTruthAlgorithms:
55 from MuonTruthAlgsR4.MuonTruthAlgsConfig import RecoSegmentTruthAssocCfg
56 result.merge(RecoSegmentTruthAssocCfg(flags,
57 name=f"MuonSegmentsFromR4TruthMatching{suffix}",
58 SegmentKey="MuonSegmentsFromR4"))
59 if flags.Muon.scheduleActsReco:
60 from MuonSegmentCnv.MuonSegmentCnvConfig import MuonR4SegmentCnvAlgCfg
61 result.merge(MuonR4SegmentCnvAlgCfg(flags,
62 name=f"MuonR4SegmentCnvAlg{suffix}",
63 ReadSegments = segmentContainers,
64 WriteKey="TrackMuonSegments"))
65 return result
MuonFastReconstructionAlgCfg(flags, name="MuonFastReconstructionAlg", **kwargs)