5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.Enums
import BeamType
12 if not flags.Detector.EnableTGC:
13 kwargs.setdefault(
"TgcPrdCollection",
"")
14 if not flags.Detector.EnableMDT:
15 kwargs.setdefault(
"MdtPrdCollection",
"")
16 if not flags.Detector.EnableRPC:
17 kwargs.setdefault(
"RpcPrdCollection",
"")
19 kwargs.setdefault(
'TgcPrdCollection',
'TGC_MeasurementsAllBCs' if not flags.Muon.useTGCPriorNextBC
else 'TGC_Measurements')
21 from TrkConfig.TrkResidualPullCalculatorConfig
import ResidualPullCalculatorCfg
24 the_tool = CompFactory.Muon.MuonEDMPrinterTool(name, **kwargs)
25 result.addPublicTool(the_tool, primary =
True)
27 from MuonConfig.MuonGeometryConfig
import MuonIdHelperSvcCfg
33 the_svc = CompFactory.Muon.MuonEDMHelperSvc(name, **kwargs)
34 result.addService(the_svc, primary =
True)
38 Muon__MuonTrackToSegmentTool=CompFactory.Muon.MuonTrackToSegmentTool
41 from MuonConfig.MuonCondAlgConfig
import MuonStationIntersectCondAlgCfg
44 from TrkConfig.TrkExRungeKuttaPropagatorConfig
import RungeKuttaPropagatorCfg
46 result.addPublicTool(atlasRungeKuttaPropagator)
47 kwargs.setdefault(
"Propagator",atlasRungeKuttaPropagator)
50 muon_track_to_segment_tool = Muon__MuonTrackToSegmentTool(name, **kwargs)
51 result.setPrivateTools(muon_track_to_segment_tool)
58 kwargs.setdefault(
'Printer', printer )
59 result.addPublicTool(printer)
60 the_tool = CompFactory.Muon.MuonHitSummaryTool(name, **kwargs)
61 result.setPrivateTools(the_tool)
66 from MuonConfig.MuonSegmentFindingConfig
import DCMathSegmentMakerCfg, MdtMathSegmentFinderCfg
67 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import MdtDriftCircleOnTrackCreatorCfg
68 from TrkConfig.TrkExRungeKuttaPropagatorConfig
import RungeKuttaPropagatorCfg
72 if "SegmentMaker" not in kwargs
or "SegmentMakerNoHoles" not in kwargs:
74 mdt_segment_finder = result.popToolsAndMerge(
MdtMathSegmentFinderCfg(flags, name=
"MCTBMdtMathSegmentFinder", UseChamberTheta =
False, AssociationRoadWidth = 1.5) )
75 if flags.Beam.Type
is BeamType.Collisions:
76 seg_maker = result.popToolsAndMerge (
DCMathSegmentMakerCfg( flags, name =
"MCTBDCMathSegmentMaker", MdtSegmentFinder = mdt_segment_finder, SinAngleCut = 0.04, DoGeometry =
True))
78 seg_maker = result.popToolsAndMerge (
DCMathSegmentMakerCfg( flags, name =
"MCTBDCMathSegmentMaker", MdtSegmentFinder = mdt_segment_finder, SinAngleCut = 0.1, DoGeometry =
False, AddUnassociatedPhiHits=
True ))
79 kwargs.setdefault(
"SegmentMaker", seg_maker)
80 kwargs.setdefault(
"SegmentMakerNoHoles", seg_maker)
86 if not flags.Detector.GeometryTGC:
87 kwargs.setdefault(
'TgcPrepDataContainer',
"")
88 if not flags.Detector.GeometryMDT:
89 kwargs.setdefault(
'MdtPrepDataContainer',
"")
90 if not flags.Detector.GeometryRPC:
91 kwargs.setdefault(
'RpcPrepDataContainer',
"")
92 if not flags.Detector.GeometryCSC:
93 kwargs.setdefault(
"CscPrepDataContainer",
"")
94 if not flags.Detector.GeometrysTGC:
95 kwargs.setdefault(
"sTgcPrepDataContainer",
"")
96 if not flags.Detector.GeometryMM:
97 kwargs.setdefault(
"MMPrepDataContainer",
"")
100 kwargs.setdefault(
'TgcPrepDataContainer',
'TGC_MeasurementsAllBCs' if not flags.Muon.useTGCPriorNextBC
else 'TGC_Measurements')
102 muon_seeded_segment_finder = CompFactory.Muon.MuonSeededSegmentFinder(name, **kwargs)
103 result.setPrivateTools(muon_seeded_segment_finder)
108 MuonSegmentMomentumFromField=CompFactory.MuonSegmentMomentumFromField
111 from TrkConfig.AtlasExtrapolatorToolsConfig
import AtlasNavigatorCfg
112 navigator = result.popToolsAndMerge (
AtlasNavigatorCfg(flags, name=
'InDetNavigator'))
113 kwargs.setdefault(
"NavigatorTool", navigator)
115 from TrkConfig.TrkExSTEP_PropagatorConfig
import AtlasSTEP_PropagatorCfg
117 kwargs.setdefault(
"PropagatorTool", muon_prop)
120 result.setPrivateTools(muon_seg_mom_from_field)
125 from TrkConfig.AtlasExtrapolatorConfig
import AtlasExtrapolatorCfg, MuonStraightLineExtrapolatorCfg
128 kwargs.setdefault(
"CalculateCloseHits",
True)
129 result.setPrivateTools(CompFactory.Muon.MuonTrackSummaryHelperTool(name=name,**kwargs))
133 Muon__MuonTrackScoringTool=CompFactory.Muon.MuonTrackScoringTool
136 from TrkConfig.TrkTrackSummaryToolConfig
import MuonTrackSummaryToolCfg
138 kwargs.setdefault(
'SumHelpTool', track_summary)
140 kwargs.setdefault(
"EDMPrinter", printer)
141 result.setPrivateTools(Muon__MuonTrackScoringTool(name=name,**kwargs))
146 kwargs.setdefault(
'DropDouble',
False)
148 kwargs.setdefault(
'ScoringTool', scoring_tool )
149 result.addPublicTool(scoring_tool)
153 muon_ami_selection_tool = CompFactory.Muon.MuonAmbiTrackSelectionTool(name=
"MuonAmbiSelectionTool", Printer=muon_edm_printer)
154 result.addPublicTool(muon_ami_selection_tool)
155 kwargs.setdefault(
'SelectionTool', muon_ami_selection_tool)
156 result.setPrivateTools(CompFactory.Trk.TrackSelectionProcessorTool(name=name,**kwargs))
160 Muon__MuonTrackCleaner=CompFactory.Muon.MuonTrackCleaner
161 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import MdtDriftCircleOnTrackCreatorCfg, TriggerChamberClusterOnTrackCreatorCfg
162 from TrkConfig.AtlasExtrapolatorConfig
import MuonStraightLineExtrapolatorCfg
167 kwargs.setdefault(
"MdtRotCreator", mdt_creator)
170 kwargs.setdefault(
"CompRotCreator", muon_cluster_creator)
175 kwargs.setdefault(
"Extrapolator", extrapolator)
177 from TrkConfig.TrkGlobalChi2FitterConfig
import MCTBSLFitterMaterialFromTrackCfg, MCTBFitterMaterialFromTrackCfg
179 kwargs.setdefault(
"SLFitter", slfitter)
181 if "PullCalculator" not in kwargs:
182 from TrkConfig.TrkResidualPullCalculatorConfig
import (
183 ResidualPullCalculatorCfg)
184 kwargs.setdefault(
"PullCalculator", result.popToolsAndMerge(
191 kwargs.setdefault(
"PullCut", 3)
192 kwargs.setdefault(
"PullCutPhi", 3)
193 kwargs.setdefault(
"UseSLFit",
True)
200 kwargs.setdefault(
"MaxAvePullSumPerChamber", 6)
201 kwargs.setdefault(
"Chi2Cut", flags.Muon.Chi2NDofCut)
202 if flags.Muon.MuonTrigger:
203 kwargs.setdefault(
"Iterate",
False)
204 kwargs.setdefault(
"RecoverOutliers",
False)
206 result.setPrivateTools(Muon__MuonTrackCleaner(name, **kwargs))
211 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import MuonClusterOnTrackCreatorCfg
213 kwargs.setdefault(
"MakeClusters",
True)
214 kwargs.setdefault(
"CompetingRios",
True)
215 kwargs.setdefault(
"DoCosmics", flags.Beam.Type
is BeamType.Cosmics)
218 kwargs.setdefault(
"MuonClusterOnTrackCreator", cluster_creator )
220 kwargs.setdefault(
"MuonCompetingClustersOnTrackCreator", CompFactory.Muon.MuonCompetingClustersOnTrackCreator(name=
'MuonCompetingClustersOnTrackCreator', ClusterCreator=cluster_creator) )
222 if flags.Detector.GeometryCSC:
223 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import CscClusterOnTrackCreatorCfg
226 kwargs.setdefault(
"CscRotCreator",
"")
227 result.setPrivateTools(CompFactory.MuonPhiHitSelector(name,**kwargs))
232 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import MdtDriftCircleOnTrackCreatorCfg
233 from TrkConfig.TrkExRungeKuttaPropagatorConfig
import RungeKuttaPropagatorCfg
236 kwargs.setdefault(
"AtlasRungeKuttaPropagator",result.popPrivateTools())
237 kwargs.setdefault(
"MdtRotCreator",
238 result.popToolsAndMerge(
MdtDriftCircleOnTrackCreatorCfg(flags, name =
"MdtDriftCircleOnTrackCreatorPreFit", DoFixedError =
True, CreateTubeHit =
True, DoSegmentErrors =
False)) )
240 if "ResidualPullCalculator" not in kwargs:
241 from TrkConfig.TrkResidualPullCalculatorConfig
import (
242 ResidualPullCalculatorCfg)
243 kwargs.setdefault(
"ResidualPullCalculator", result.popToolsAndMerge(
246 if flags.Detector.GeometryCSC:
247 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import CscClusterOnTrackCreatorCfg
250 kwargs.setdefault(
"CscRotCreator",
"")
252 kwargs.setdefault(
'Printer', printer)
253 result.addPublicTool( printer )
255 kwargs.setdefault(
"isCosmic", flags.Beam.Type
is BeamType.Cosmics)
257 result.setPrivateTools(CompFactory.Muon.MuPatHitTool(name,**kwargs))
264 from TrkConfig.AtlasExtrapolatorConfig
import AtlasExtrapolatorCfg, MuonExtrapolatorCfg
266 from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig
import TrackingGeometryCondAlgCfg
268 geom_cond_key = condAlg.TrackingGeometryWriteKey
269 kwargs.setdefault(
"TrackingGeometryReadKey", geom_cond_key)
270 kwargs.setdefault(
"Cosmics", flags.Beam.Type
is BeamType.Cosmics)
273 kwargs.setdefault(
"MuonExtrapolator", result.popToolsAndMerge(
MuonExtrapolatorCfg(flags) ) )
275 result.setPrivateTools(
276 CompFactory.Muon.MuonTrackExtrapolationTool(name, **kwargs))
280 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import MdtDriftCircleOnTrackCreatorCfg, TriggerChamberClusterOnTrackCreatorCfg
281 from TrkConfig.TrkGlobalChi2FitterConfig
import MCTBFitterMaterialFromTrackCfg
282 from TrkConfig.AtlasExtrapolatorConfig
import MuonExtrapolatorCfg
285 if flags.IOVDb.DatabaseInstance ==
'COMP200' or \
286 'HLT' in flags.IOVDb.GlobalTag
or flags.Common.isOnline
or flags.Muon.MuonTrigger:
287 kwargs[
"AlignmentErrorTool"] =
None
289 from MuonAlignErrorTool.AlignmentErrorToolConfig
import AlignmentErrorToolCfg
292 kwargs.setdefault(
'Printer', printer)
293 result.addPublicTool(printer)
295 kwargs.setdefault(
"MuonExtrapolator", result.popToolsAndMerge(
MuonExtrapolatorCfg(flags) ) )
301 result.setPrivateTools(CompFactory.Muon.MuonRefitTool(name, **kwargs))
306 from MuonConfig.MuonCalibrationConfig
import NswErrorCalibDbAlgCfg
308 the_tool = CompFactory.Muon.SimpleMMClusterBuilderTool(name,**kwargs)
309 result.setPrivateTools(the_tool)
314 from MuonConfig.MuonCalibrationConfig
import NswErrorCalibDbAlgCfg
316 the_tool = CompFactory.Muon.UTPCMMClusterBuilderTool(name,**kwargs)
317 result.setPrivateTools(the_tool)
322 from MuonConfig.MuonCalibrationConfig
import NswErrorCalibDbAlgCfg
324 the_tool = CompFactory.Muon.ClusterTimeProjectionMMClusterBuilderTool(name,**kwargs)
325 result.setPrivateTools(the_tool)
330 the_tool = CompFactory.Muon.SimpleSTgcClusterBuilderTool(name,**kwargs)
331 result.setPrivateTools(the_tool)
336 the_tool = CompFactory.Muon.CaruanaSTgcClusterBuilderTool(name,**kwargs)
337 result.setPrivateTools(the_tool)