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 SpacePointContainers = ["MuonSpacePoints"]
9 if flags.Detector.GeometrysTGC or flags.Detector.GeometryMM:
10 SpacePointContainers += ["NswSpacePoints"]
11 kwargs.setdefault("InSpacePoints", SpacePointContainers)
12 theAlg = CompFactory.MuonR4.FastReconstructionAlg(name, **kwargs)
13 result.addEventAlgo(theAlg, primary=True)
14 return result
15
16def PatternRecognitionFromFastRecoCfg(flags, suffix = ""):
17 result = ComponentAccumulator()
18 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
19 result.merge(ActsGeometryContextAlgCfg(flags))
20
21 from MuonPatternRecognitionAlgs.MuonPatternRecognitionConfig import MuonEtaHoughTransformAlgCfg, MuonNSWSegmentFinderAlgCfg, MuonPhiHoughTransformAlgCfg, MuonSegmentFittingAlgCfg
22 segmentContainers = []
23 if flags.Detector.GeometrysTGC or flags.Detector.GeometryMM:
24 segmentContainers+=["MuonNswSegments"]
25 result.merge(MuonEtaHoughTransformAlgCfg(flags, name=f"MuonNswEtaHoughTransformAlg{suffix}",
26 EtaHoughMaxContainer = "MuonHoughNswMaxima",
27 SpacePointContainer = "NswSpacePointsFastReco"))
28 result.merge(MuonNSWSegmentFinderAlgCfg(flags, name=f"MuonNswSegmentFinderAlg{suffix}",
29 MuonNswSegmentWriteKey = segmentContainers[-1],
30 MuonNswSegmentSeedWriteKey = "MuonNswSegmentSeeds",
31 CombinatorialReadKey = "MuonHoughNswMaxima"))
32
33 if flags.Detector.GeometryMDT or flags.Detector.GeometryRPC or flags.Detector.GeometryTGC:
34 result.merge(MuonEtaHoughTransformAlgCfg(flags, name = f"MuonEtaHoughTransformAlg{suffix}",
35 SpacePointContainer = "MuonSpacePointsFastReco"))
36 result.merge(MuonPhiHoughTransformAlgCfg(flags, name = f"MuonPhiHoughTransformAlg{suffix}"))
37 segmentContainers+=["R4MuonSegments"]
38
39 result.merge(MuonSegmentFittingAlgCfg(flags,
40 name = f"MuonSegmentFittingAlg{suffix}",
41 OutSegmentContainer=segmentContainers[-1]))
42
43 from MuonSegmentCnv.MuonSegmentCnvConfig import xAODSegmentCnvAlgCfg
44 result.merge(xAODSegmentCnvAlgCfg(flags, name = f"MuonR4xAODSegmentCnvAlg{suffix}", InSegmentKeys = segmentContainers))
45 if flags.Input.isMC:
46 from MuonTruthAlgsR4.MuonTruthAlgsConfig import RecoSegmentTruthAssocCfg
47 result.merge(RecoSegmentTruthAssocCfg(flags,
48 name=f"MuonSegmentsFromR4TruthMatching{suffix}",
49 SegmentKey="MuonSegmentsFromR4"))
50 if flags.Muon.scheduleActsReco:
51 from MuonSegmentCnv.MuonSegmentCnvConfig import MuonR4SegmentCnvAlgCfg
52 result.merge(MuonR4SegmentCnvAlgCfg(flags,
53 name=f"MuonR4SegmentCnvAlg{suffix}",
54 ReadSegments = segmentContainers,
55 WriteKey="TrackMuonSegments"))
56 return result
MuonFastReconstructionAlgCfg(flags, name="MuonFastReconstructionAlg", **kwargs)