ATLAS Offline Software
MuonRIO_OnTrackCreatorToolConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from AthenaConfiguration.Enums import BeamType
6 from MuonConfig.MuonCalibrationConfig import MdtCalibrationToolCfg
7 
8 
11 
12 __mdtCalibWindows = ['User',
13  'Default',
14  'Collision_G4',
15  'Collision_data',
16  'Collision_t0fit',
17  ]
18 
20  """Returns index number corresponding to the calibration window name.
21  This will throw a ValueError if name is not in the list.
22  """
23  return __mdtCalibWindows.index(name)
24 
25 def TriggerChamberClusterOnTrackCreatorCfg(flags, name="TriggerChamberClusterOnTrackCreator", **kwargs):
26  result=ComponentAccumulator()
27  acc = MuonClusterOnTrackCreatorCfg(flags)
28  muon_cluster_creator=acc.getPrimary()
29  result.merge(acc)
30  kwargs.setdefault("ClusterCreator", muon_cluster_creator)
31  result.setPrivateTools(CompFactory.Muon.TriggerChamberClusterOnTrackCreator(name, **kwargs))
32  return result
33 
34 def CscClusterOnTrackCreatorCfg(flags,name="CscClusterOnTrackCreator", **kwargs):
35  from MuonConfig.MuonSegmentFindingConfig import QratCscClusterFitterCfg, CscClusterUtilToolCfg, CalibCscStripFitterCfg
36 
37  result=ComponentAccumulator()
38  acc = QratCscClusterFitterCfg(flags)
39  qrat = acc.popPrivateTools()
40  result.merge(acc)
41  kwargs.setdefault("CscClusterFitter", qrat )
42 
43  acc = CalibCscStripFitterCfg(flags)
44  strip_fitter = acc.popPrivateTools()
45  result.merge(acc)
46  kwargs.setdefault("CscStripFitter", strip_fitter)
47 
48  acc = CscClusterUtilToolCfg(flags)
49  cluster_util_tool = acc.popPrivateTools()
50  kwargs.setdefault("CscClusterUtilTool", cluster_util_tool )
51  result.merge(acc)
52 
53  if not flags.Input.isMC: # collisions real data or simulated first data
54  # scale CSC and hit errors
55  kwargs.setdefault("ErrorScalerBeta", 0.070 )
56 
57  result.setPrivateTools(CompFactory.Muon.CscClusterOnTrackCreator(name,**kwargs))
58 
59  return result
60 
61 
62 def MdtCalibToolForRotsCfg(flags, name ="MdtCalibrationTool", **kwargs):
63  kwargs.setdefault("DoMagneticFieldCorrection", flags.Muon.Calib.correctMdtRtForBField)
64 
65  kwargs.setdefault("DoSlewingCorrection", flags.Muon.Calib.correctMdtRtForTimeSlewing)
66  if flags.Beam.Type in [BeamType.Cosmics, BeamType.SingleBeam]:
67  kwargs.setdefault("DoTofCorrection", False)
68  else:
69  kwargs.setdefault("DoTofCorrection", True)
70  kwargs.setdefault("TimeWindowSetting", MdtCalibWindowNumber('Collision_data'))
71  return MdtCalibrationToolCfg(flags, name = name, **kwargs)
72 
73 def MdtDriftCircleOnTrackCreatorCfg(flags,name="MdtDriftCircleOnTrackCreator", **kwargs):
74  result = ComponentAccumulator()
75  if flags.Beam.Type in [BeamType.Cosmics, BeamType.SingleBeam]:
76  kwargs.setdefault("DoFixedError", True)
77  kwargs.setdefault("TimingMode", 1)
78  kwargs.setdefault("UseParametrisedError", True)
79  kwargs.setdefault("ApplyToF", False)
80 
81  else: # collisions simulation/data settings
82  kwargs.setdefault("UseParametrisedError", False)
83  kwargs.setdefault("DoFixedError", False)
84  kwargs.setdefault("DoErrorScaling", False)
85 
86  if not flags.Input.isMC :
87  kwargs.setdefault("CreateTubeHit", True) # BroadErrors
88  kwargs.setdefault("UseLooseErrors", flags.Muon.useLooseErrorTuning) # LooseErrors on data
89 
90  kwargs.setdefault("CalibrationTool", result.popToolsAndMerge( MdtCalibToolForRotsCfg(flags)) )
91  kwargs.setdefault("IsMC", flags.Input.isMC)
92 
93  result.setPrivateTools(CompFactory.Muon.MdtDriftCircleOnTrackCreator(name, WasConfigured=True, **kwargs))
94  return result
95 
96 def MuonClusterOnTrackCreatorCfg(flags, name="MuonClusterOnTrackCreator", **kwargs):
97  result=ComponentAccumulator()
98  if not flags.Input.isMC: # collisions real data or simulated first data
99  # scale TGC eta hit errors as long as TGC eta are not well aligned
100  kwargs.setdefault("DoFixedErrorTgcEta", True)
101  kwargs.setdefault("FixedErrorTgcEta", 15.)
102  else:
103  kwargs.setdefault("DoFixedErrorTgcEta", False) # This is ONLY to make the tool configured. Real solution is to use default name.
104 
105  if flags.Detector.EnablesTGC or flags.Detector.EnableMM:
106  from MuonConfig.MuonCalibrationConfig import NSWCalibToolCfg
107  kwargs.setdefault("NSWCalibTool", result.popToolsAndMerge(NSWCalibToolCfg(flags)))
108 
109  from MuonConfig.MuonConfigFlags import MMClusterBuilderEnum
110  if flags.Muon.MMClusterCalibRecoTool == MMClusterBuilderEnum.Centroid:
111  from MuonConfig.MuonRecToolsConfig import SimpleMMClusterBuilderToolCfg
112  kwargs.setdefault("MMClusterBuilder", result.popToolsAndMerge(SimpleMMClusterBuilderToolCfg(flags)))
113  elif flags.Muon.MMClusterCalibRecoTool == MMClusterBuilderEnum.ClusterTimeProjection:
114  from MuonConfig.MuonRecToolsConfig import ClusterTimeProjectionMMClusterBuilderToolCfg
115  kwargs.setdefault("MMClusterBuilder", result.popToolsAndMerge(ClusterTimeProjectionMMClusterBuilderToolCfg(flags)))
116 
117  muon_cluster_rot_creator = CompFactory.Muon.MuonClusterOnTrackCreator(name, **kwargs)
118  result.setPrivateTools(muon_cluster_rot_creator)
119  return result
120 
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MuonRecToolsConfig.SimpleMMClusterBuilderToolCfg
def SimpleMMClusterBuilderToolCfg(flags, name="SimpleMMClusterBuilderTool", **kwargs)
Definition: MuonRecToolsConfig.py:304
python.MuonRIO_OnTrackCreatorToolConfig.MdtCalibWindowNumber
def MdtCalibWindowNumber(name)
Definition: MuonRIO_OnTrackCreatorToolConfig.py:19
python.MuonRIO_OnTrackCreatorToolConfig.TriggerChamberClusterOnTrackCreatorCfg
def TriggerChamberClusterOnTrackCreatorCfg(flags, name="TriggerChamberClusterOnTrackCreator", **kwargs)
Definition: MuonRIO_OnTrackCreatorToolConfig.py:25
python.MuonSegmentFindingConfig.QratCscClusterFitterCfg
def QratCscClusterFitterCfg(flags, **kwargs)
Definition: MuonSegmentFindingConfig.py:276
python.MuonSegmentFindingConfig.CalibCscStripFitterCfg
def CalibCscStripFitterCfg(flags, name="CalibCscStripFitter", **kwargs)
Definition: MuonSegmentFindingConfig.py:306
python.MuonSegmentFindingConfig.CscClusterUtilToolCfg
def CscClusterUtilToolCfg(flags, name='CscClusterUtilTool', **kwargs)
Definition: MuonSegmentFindingConfig.py:314
python.MuonCalibrationConfig.NSWCalibToolCfg
def NSWCalibToolCfg(flags, name="NSWCalibTool", **kwargs)
Definition: MuonCalibrationConfig.py:143
python.MuonRecToolsConfig.ClusterTimeProjectionMMClusterBuilderToolCfg
def ClusterTimeProjectionMMClusterBuilderToolCfg(flags, name="ClusterTimeProjectionMMClusterBuilderTool", **kwargs)
Definition: MuonRecToolsConfig.py:320
python.MuonRIO_OnTrackCreatorToolConfig.CscClusterOnTrackCreatorCfg
def CscClusterOnTrackCreatorCfg(flags, name="CscClusterOnTrackCreator", **kwargs)
Definition: MuonRIO_OnTrackCreatorToolConfig.py:34
python.MuonCalibrationConfig.MdtCalibrationToolCfg
def MdtCalibrationToolCfg(flags, name="MdtCalibrationTool", **kwargs)
Definition: MuonCalibrationConfig.py:82
python.MuonRIO_OnTrackCreatorToolConfig.MuonClusterOnTrackCreatorCfg
def MuonClusterOnTrackCreatorCfg(flags, name="MuonClusterOnTrackCreator", **kwargs)
Definition: MuonRIO_OnTrackCreatorToolConfig.py:96
python.MuonRIO_OnTrackCreatorToolConfig.MdtDriftCircleOnTrackCreatorCfg
def MdtDriftCircleOnTrackCreatorCfg(flags, name="MdtDriftCircleOnTrackCreator", **kwargs)
Definition: MuonRIO_OnTrackCreatorToolConfig.py:73
python.MuonRIO_OnTrackCreatorToolConfig.MdtCalibToolForRotsCfg
def MdtCalibToolForRotsCfg(flags, name="MdtCalibrationTool", **kwargs)
Definition: MuonRIO_OnTrackCreatorToolConfig.py:62