ATLAS Offline Software
MuonHoughTransformAlgConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 
7 def 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 
15 def MuonNSWPhiSeedFinderAlgCfg(flags, name = "MuonNswPhiSeedFinderAlg", **kwargs):
16  result = ComponentAccumulator()
17  theAlg = CompFactory.MuonR4.CombinatorialNSWSeedFinderAlg(name, **kwargs)
18  result.addEventAlgo(theAlg, primary=True)
19  return result
20 
21 
22 def MuonEtaHoughTransformAlgCfg(flags, name = "MuonEtaHoughTransformAlg", **kwargs):
23  result = ComponentAccumulator()
24  kwargs.setdefault("downWeightPrdMultiplicity", True)
25  theAlg = CompFactory.MuonR4.EtaHoughTransformAlg(name, **kwargs)
26  result.addEventAlgo(theAlg, primary=True)
27  return result
28 
29 def MuonSegmentFittingAlgCfg(flags, name = "MuonSegmentFittingAlg", **kwargs):
30  result = ComponentAccumulator()
31  from MuonSpacePointCalibrator.CalibrationConfig import MuonSpacePointCalibratorCfg
32  kwargs.setdefault("Calibrator", result.popToolsAndMerge(MuonSpacePointCalibratorCfg(flags)))
33  kwargs.setdefault("ResoSeedHitAssoc", 5. )
34  kwargs.setdefault("RecoveryPull", 3.)
35  kwargs.setdefault("fitSegmentT0", False)
36  kwargs.setdefault("recalibInFit", True)
37  kwargs.setdefault("useFastFitter", False)
38  kwargs.setdefault("doBeamspotConstraint", True)
39 
40  theAlg = CompFactory.MuonR4.SegmentFittingAlg(name, **kwargs)
41  result.addEventAlgo(theAlg, primary=True)
42  return result
43 
44 def ActsMuonSegmentRefitAlgCfg(flags,name="ActsMuonSegmentRefitAlg", **kwargs):
45  result = ComponentAccumulator()
46  from MuonTrackFindingAlgs.TrackFindingConfig import SegmentSelectorCfg, MSTrackFitterCfg
47  kwargs.setdefault("SegmentSelectionTool", result.popToolsAndMerge(SegmentSelectorCfg(flags)))
48  kwargs.setdefault("FittingTool", result.popToolsAndMerge(MSTrackFitterCfg(flags)))
49  from ActsConfig.ActsGeometryConfig import ActsExtrapolationToolCfg
50  kwargs.setdefault("ExtrapolationTool", result.popToolsAndMerge(ActsExtrapolationToolCfg(flags, MaxSteps=10000)))
51  from ActsConfig.ActsGeometryConfig import ActsTrackingGeometryToolCfg
52  kwargs.setdefault("TrackingGeometryTool", result.getPrimaryAndMerge(ActsTrackingGeometryToolCfg(flags)))
53  kwargs.setdefault("SegmentContainer", "MuonSegmentsFromR4")
54  theAlg = CompFactory.MuonR4.SegmentActsRefitAlg(name, **kwargs)
55  result.addEventAlgo(theAlg, primary = True)
56  return result
57 
59  result = ComponentAccumulator()
60  from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
61  result.merge(ActsGeometryContextAlgCfg(flags))
62  sgementContainers = []
63  if flags.Detector.GeometrysTGC or flags.Detector.GeometryMM:
64  sgementContainers+=["R4MuonSegmentsNsw"]
65  result.merge(MuonEtaHoughTransformAlgCfg(flags, name="NswEtaHoughTransformAlg",
66  EtaHoughMaxContainer = "MuonHoughNswMaxima",
67  SpacePointContainer = "NswSpacePoints"))
68  result.merge(MuonNSWPhiSeedFinderAlgCfg(flags, name="NswPhiSeedFinderAlg",
69  CombinatorialPhiWriteKey = "MuonHoughNswSegmentSeeds",
70  CombinatorialReadKey = "MuonHoughNswMaxima"))
71  result.merge(MuonSegmentFittingAlgCfg(flags, name="NswSegmentFitter",
72  OutSegmentContainer=sgementContainers[-1],
73  ReadKey="MuonHoughNswSegmentSeeds",
74  fitSegmentT0 = False,
75  recalibInFit = False,
76  doBeamspotConstraint=False,
77  useHessianResidual=True,
78  tryPatternPars = True ))
79  if flags.Detector.GeometryMDT or flags.Detector.GeometryRPC or flags.Detector.GeometryTGC:
80  result.merge(MuonEtaHoughTransformAlgCfg(flags))
81  result.merge(MuonPhiHoughTransformAlgCfg(flags))
82  sgementContainers+=["R4MuonSegments"]
83 
84  result.merge(MuonSegmentFittingAlgCfg(flags, OutSegmentContainer=sgementContainers[-1]))
85 
86  from MuonSegmentCnv.MuonSegmentCnvConfig import xAODSegmentCnvAlgCfg
87  result.merge(xAODSegmentCnvAlgCfg(flags, InSegmentKeys = sgementContainers))
88  if flags.Input.isMC:
89  from MuonTruthAlgsR4.MuonTruthAlgsConfig import RecoSegmentTruthAssocCfg
90  result.merge(RecoSegmentTruthAssocCfg(flags,
91  name="MuonSegmentsFromR4TruthMatching",
92  SegmentKey="MuonSegmentsFromR4"))
93 
94  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MuonHoughTransformAlgConfig.MuonSegmentFittingAlgCfg
def MuonSegmentFittingAlgCfg(flags, name="MuonSegmentFittingAlg", **kwargs)
Definition: MuonHoughTransformAlgConfig.py:29
TrackFindingConfig.SegmentSelectorCfg
def SegmentSelectorCfg(flags, name="SegmentSelectionTool", **kwargs)
Definition: TrackFindingConfig.py:6
MuonHoughTransformAlgConfig.ActsMuonSegmentRefitAlgCfg
def ActsMuonSegmentRefitAlgCfg(flags, name="ActsMuonSegmentRefitAlg", **kwargs)
Definition: MuonHoughTransformAlgConfig.py:44
TrackFindingConfig.MSTrackFitterCfg
def MSTrackFitterCfg(flags, name="MSTrackFitTool", **kwargs)
Definition: TrackFindingConfig.py:12
MuonSegmentCnvConfig.xAODSegmentCnvAlgCfg
def xAODSegmentCnvAlgCfg(flags, name="MuonR4xAODSegmentCnvAlg", **kwargs)
Definition: MuonSegmentCnvConfig.py:28
ActsGeometryConfig.ActsExtrapolationToolCfg
ComponentAccumulator ActsExtrapolationToolCfg(flags, str name="ActsExtrapolationTool", **kwargs)
Definition: ActsGeometryConfig.py:152
AlignmentAlgsConfig.ActsGeometryContextAlgCfg
def ActsGeometryContextAlgCfg(flags, name="GeometryContextAlg", **kwargs)
Setup the Geometry context algorithm.
Definition: AlignmentAlgsConfig.py:125
ActsGeometryConfig.ActsTrackingGeometryToolCfg
ComponentAccumulator ActsTrackingGeometryToolCfg(flags, str name="ActsTrackingGeometryTool")
Definition: ActsGeometryConfig.py:143
MuonHoughTransformAlgConfig.MuonPhiHoughTransformAlgCfg
def MuonPhiHoughTransformAlgCfg(flags, name="MuonPhiHoughTransformAlg", **kwargs)
Definition: MuonHoughTransformAlgConfig.py:7
MuonHoughTransformAlgConfig.MuonPatternRecognitionCfg
def MuonPatternRecognitionCfg(flags)
Definition: MuonHoughTransformAlgConfig.py:58
MuonTruthAlgsConfig.RecoSegmentTruthAssocCfg
def RecoSegmentTruthAssocCfg(flags, **kwargs)
Definition: MuonPhaseII/MuonPatternRecognition/MuonTruthAlgsR4/python/MuonTruthAlgsConfig.py:133
CalibrationConfig.MuonSpacePointCalibratorCfg
def MuonSpacePointCalibratorCfg(flags, name="MuonSpacePointCalibrator", **kwargs)
Definition: CalibrationConfig.py:6
MuonHoughTransformAlgConfig.MuonNSWPhiSeedFinderAlgCfg
def MuonNSWPhiSeedFinderAlgCfg(flags, name="MuonNswPhiSeedFinderAlg", **kwargs)
Definition: MuonHoughTransformAlgConfig.py:15
MuonHoughTransformAlgConfig.MuonEtaHoughTransformAlgCfg
def MuonEtaHoughTransformAlgCfg(flags, name="MuonEtaHoughTransformAlg", **kwargs)
Definition: MuonHoughTransformAlgConfig.py:22