5 from MuonConfig.MuonCondAlgConfig
import CscCondDbAlgCfg, NswCalibDbAlgCfg
6 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
7 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
10 from AthenaConfiguration.Enums
import BeamType, LHCPeriod
11 from IOVDbSvc.IOVDbSvcConfig
import addFoldersSplitOnline
12 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
14 from AthenaCommon.Logging
import logging
15 log = logging.getLogger(
'MuonCalibConfig')
22 """Return ComponentAccumulator configured for CSC calibration with CscCalibTool as PrivateTools"""
26 kwargs.setdefault(
"Slope", 0.19)
27 kwargs.setdefault(
"Noise", 3.5)
28 kwargs.setdefault(
"Pedestal", 2048.0)
29 kwargs.setdefault(
"ReadFromDatabase",
True)
30 kwargs.setdefault(
"SlopeFromDatabase",
False)
31 kwargs.setdefault(
"integrationNumber", 12.0)
32 kwargs.setdefault(
"integrationNumber2", 11.66)
33 kwargs.setdefault(
"samplingTime", 50.0)
34 kwargs.setdefault(
"signalWidth", 14.40922)
35 kwargs.setdefault(
"timeOffset", 71.825)
36 kwargs.setdefault(
"IsOnline", flags.Common.isOnline)
37 kwargs.setdefault(
"Latency", 119)
39 acc.setPrivateTools(CompFactory.CscCalibTool(name, **kwargs))
52 if flags.Muon.Calib.readMDTCalibFromBlob:
53 mdt_folder_name_appendix =
"BLOB"
55 mdt_folder_name_appendix=
""
57 online_folders = [
'/MDT/Onl/RT'+ mdt_folder_name_appendix,
'/MDT/Onl/T0' + mdt_folder_name_appendix]
58 offline_folders = [
'/MDT/RT' + mdt_folder_name_appendix,
'/MDT/T0' + mdt_folder_name_appendix]
60 if flags.Muon.Calib.mdtCalibrationSource==
"MDT":
61 if flags.GeoModel.Run
is LHCPeriod.Run4:
63 from IOVDbSvc.IOVDbSvcConfig
import addFolders
65 if flags.GeoModel.AtlasVersion.startswith(
'ATLAS-P2-RUN4-01-00'):
66 result.merge(
addFolders(flags,
'/MDT/RT' + mdt_folder_name_appendix,
'MDT_OFL', className=
'CondAttrListCollection', tag=
'MDTRT_Sim-Run4-01', db=
"OFLP200"))
67 result.merge(
addFolders(flags,
'/MDT/T0' + mdt_folder_name_appendix,
'MDT_OFL', className=
'CondAttrListCollection', tag=
'MDTT0_Sim-Run4-01', db=
"OFLP200"))
69 result.merge(
addFolders(flags,
'/MDT/RT' + mdt_folder_name_appendix,
'MDT_OFL', className=
'CondAttrListCollection', tag=
'MDTRT_Sim-R3SYM-04', db=
"OFLP200"))
70 result.merge(
addFolders(flags,
'/MDT/T0' + mdt_folder_name_appendix,
'MDT_OFL', className=
'CondAttrListCollection', tag=
'MDTT0_Sim-R3SYM-03', db=
"OFLP200"))
73 className =
'CondAttrListCollection' ) )
75 result.merge(
addFoldersSplitOnline(flags, flags.Muon.Calib.mdtCalibrationSource, online_folders, offline_folders,
76 className =
'CondAttrListCollection' ) )
78 return result, mdt_folder_name_appendix
86 kwargs.setdefault(
"DoSlewingCorrection", flags.Muon.Calib.correctMdtRtForTimeSlewing)
87 kwargs.setdefault(
"DoTemperatureCorrection", flags.Muon.Calib.applyRtScaling)
88 kwargs.setdefault(
"DoTofCorrection", flags.Beam.Type
is BeamType.Collisions)
90 if flags.Beam.Type
is BeamType.Collisions:
91 from MuonConfig.MuonRIO_OnTrackCreatorToolConfig
import MdtCalibWindowNumber
96 mdt_calibration_tool = CompFactory.MdtCalibrationTool(name= name, **kwargs)
97 result.setPrivateTools(mdt_calibration_tool)
103 if flags.GeoModel.Run
is LHCPeriod.Run4
and flags.Muon.usePhaseIIGeoSetup:
104 alg = CompFactory.MuonCalibR4.MdtCalibDbAlg(name)
105 result.addCondAlgo (alg, primary =
True)
107 from MuonConfig.MuonCondAlgConfig
import MdtCondDbAlgCfg
115 if flags.Common.isOnline
and not flags.Input.isMC:
116 kwargs.setdefault(
"ReadKeyTube",
"/MDT/T0")
117 kwargs.setdefault(
"ReadKeyRt",
"/MDT/RT")
119 kwargs.setdefault(
"ReadKeyTube",
"/MDT/T0"+ mdt_folder_name_appendix)
120 kwargs.setdefault(
"ReadKeyRt",
"/MDT/RT"+ mdt_folder_name_appendix)
121 if flags.Input.isMC
is False:
122 kwargs.setdefault(
"defaultT0", 40)
124 kwargs.setdefault(
"defaultT0", 799)
125 if flags.Common.isOnline:
126 kwargs.setdefault(
"ReadKeyDCS",
"" )
127 kwargs.setdefault(
"UseMLRt", flags.Muon.Calib.useMLRt )
128 kwargs.setdefault(
"TimeSlewingCorrection", flags.Muon.Calib.correctMdtRtForTimeSlewing)
129 kwargs.setdefault(
"MeanCorrectionVsR", [ -5.45973, -4.57559, -3.71995, -3.45051, -3.4505, -3.4834, -3.59509, -3.74869, -3.92066, -4.10799, -4.35237, -4.61329, -4.84111, -5.14524 ])
130 kwargs.setdefault(
"PropagationSpeedBeta", flags.Muon.Calib.mdtPropagationSpeedBeta)
132 kwargs.setdefault(
"CreateBFieldFunctions", flags.Muon.Calib.correctMdtRtForBField)
133 kwargs.setdefault(
"CreateSlewingFunctions", flags.Muon.Calib.correctMdtRtForTimeSlewing)
134 from RngComps.RngCompsConfig
import AthRNGSvcCfg
135 kwargs.setdefault(
"AthRNGSvc", result.getPrimaryAndMerge(
AthRNGSvcCfg(flags)))
137 kwargs.setdefault(
"UseR4DetMgr", flags.Muon.usePhaseIIGeoSetup)
138 alg = CompFactory.MdtCalibDbAlg (name, **kwargs)
139 result.addCondAlgo (alg, primary =
True)
143 """Return ComponentAccumulator configured for NSW calibration with NSWCalibTool as PrivateTools"""
146 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
148 kwargs.setdefault(
"isData",
not flags.Input.isMC)
149 kwargs.setdefault(
"mmPeakTime",200)
150 kwargs.setdefault(
"sTgcPeakTime",0)
151 kwargs.setdefault(
"applyMmT0Calib", flags.Muon.Calib.applyMmT0Correction)
152 kwargs.setdefault(
"applysTgcT0Calib", flags.Muon.Calib.applysTgcT0Correction)
153 kwargs.setdefault(
"applyMmBFieldCalib",flags.Muon.Calib.applyMmBFieldCalib)
154 the_tool = CompFactory.Muon.NSWCalibTool(name,**kwargs)
155 result.setPrivateTools(the_tool)
159 """Return ComponentAccumulator configured for MM smearing with NSWCalibSmearing as PrivateTools"""
161 kwargs.setdefault(
"EtaSectors", [
True,
True,
True,
True])
162 the_tool = CompFactory.Muon.NSWCalibSmearingTool(name,**kwargs)
163 result.setPrivateTools(the_tool)
167 """Return ComponentAccumulator configured for sTGC smearing with NSWCalibSmearing as PrivateTools"""
169 kwargs.setdefault(
"EtaSectors", [
True,
True,
True,
True,
True,
True])
170 the_tool = CompFactory.Muon.NSWCalibSmearingTool(name,**kwargs)
171 result.setPrivateTools(the_tool)
177 if "readFromJSON" in kwargs:
180 elif flags.Common.isOnline:
181 from IOVDbSvc.IOVDbSvcConfig
import addFolders
182 folderNames+=[
"/MDT/Onl/MM/ClusterUncertainties/SIDEA",
183 "/MDT/Onl/MM/ClusterUncertainties/SIDEC",
184 "/TGC/Onl/NSW/ClusterUncertainties/SIDEA",
185 "/TGC/Onl/NSW/ClusterUncertainties/SIDEC",
187 result.merge(
addFolders(flags,folderNames[:2], className=
'CondAttrListCollection', detDb=
"MDT_ONL"))
188 result.merge(
addFolders(flags,folderNames[2:], className=
'CondAttrListCollection', detDb=
"TGC_ONL"))
191 from IOVDbSvc.IOVDbSvcConfig
import addFolders
192 folderNames+=[
"/MDT/MM/ClusterUncertainties/SIDEA",
193 "/MDT/MM/ClusterUncertainties/SIDEC",
194 "/TGC/NSW/ClusterUncertainties/SIDEA",
195 "/TGC/NSW/ClusterUncertainties/SIDEC"]
196 result.merge(
addFolders(flags,folderNames[:2], className=
'CondAttrListCollection', detDb=
"MDT_OFL"))
197 result.merge(
addFolders(flags,folderNames[2:], className=
'CondAttrListCollection', detDb=
"TGC_OFL"))
199 kwargs.setdefault(
"ReadKeys", folderNames)
200 the_alg = CompFactory.NswUncertDbAlg(name = name, **kwargs)
201 result.addCondAlgo(the_alg, primary =
True)