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 from MuonConfig.MuonCondAlgConfig
import MdtCondDbAlgCfg
110 if flags.GeoModel.Run
is LHCPeriod.Run4
and flags.Muon.usePhaseIIGeoSetup:
111 alg = CompFactory.MuonCalibR4.MdtCalibDbAlg(name, **kwargs)
112 result.addCondAlgo (alg, primary =
True)
116 if flags.Common.isOnline
and not flags.Input.isMC:
117 kwargs.setdefault(
"ReadKeyTube",
"/MDT/T0")
118 kwargs.setdefault(
"ReadKeyRt",
"/MDT/RT")
120 kwargs.setdefault(
"ReadKeyTube",
"/MDT/T0"+ mdt_folder_name_appendix)
121 kwargs.setdefault(
"ReadKeyRt",
"/MDT/RT"+ mdt_folder_name_appendix)
122 if flags.Input.isMC
is False:
123 kwargs.setdefault(
"defaultT0", 40)
125 kwargs.setdefault(
"defaultT0", 799)
126 if not flags.Muon.useMdtDcsData:
127 kwargs.setdefault(
"ReadKeyDCS",
"" )
128 kwargs.setdefault(
"UseMLRt", flags.Muon.Calib.useMLRt )
129 kwargs.setdefault(
"TimeSlewingCorrection", flags.Muon.Calib.correctMdtRtForTimeSlewing)
130 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 ])
131 kwargs.setdefault(
"PropagationSpeedBeta", flags.Muon.Calib.mdtPropagationSpeedBeta)
133 kwargs.setdefault(
"CreateBFieldFunctions", flags.Muon.Calib.correctMdtRtForBField)
134 kwargs.setdefault(
"CreateSlewingFunctions", flags.Muon.Calib.correctMdtRtForTimeSlewing)
135 from RngComps.RngCompsConfig
import AthRNGSvcCfg
136 kwargs.setdefault(
"AthRNGSvc", result.getPrimaryAndMerge(
AthRNGSvcCfg(flags)))
138 kwargs.setdefault(
"UseR4DetMgr", flags.Muon.usePhaseIIGeoSetup)
139 alg = CompFactory.MdtCalibDbAlg (name, **kwargs)
140 result.addCondAlgo (alg, primary =
True)
144 """Return ComponentAccumulator configured for NSW calibration with NSWCalibTool as PrivateTools"""
147 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
149 kwargs.setdefault(
"isData",
not flags.Input.isMC)
150 kwargs.setdefault(
"mmPeakTime",200)
151 kwargs.setdefault(
"sTgcPeakTime",0)
152 kwargs.setdefault(
"applyMmT0Calib", flags.Muon.Calib.applyMmT0Correction)
153 kwargs.setdefault(
"applysTgcT0Calib", flags.Muon.Calib.applysTgcT0Correction)
154 kwargs.setdefault(
"applyMmBFieldCalib",flags.Muon.Calib.applyMmBFieldCalib)
155 the_tool = CompFactory.Muon.NSWCalibTool(name,**kwargs)
156 result.setPrivateTools(the_tool)
160 """Return ComponentAccumulator configured for MM smearing with NSWCalibSmearing as PrivateTools"""
162 kwargs.setdefault(
"EtaSectors", [
True,
True,
True,
True])
163 the_tool = CompFactory.Muon.NSWCalibSmearingTool(name,**kwargs)
164 result.setPrivateTools(the_tool)
168 """Return ComponentAccumulator configured for sTGC smearing with NSWCalibSmearing as PrivateTools"""
170 kwargs.setdefault(
"EtaSectors", [
True,
True,
True,
True,
True,
True])
171 the_tool = CompFactory.Muon.NSWCalibSmearingTool(name,**kwargs)
172 result.setPrivateTools(the_tool)
178 if "readFromJSON" in kwargs:
181 elif flags.Common.isOnline:
182 from IOVDbSvc.IOVDbSvcConfig
import addFolders
183 folderNames+=[
"/MDT/Onl/MM/ClusterUncertainties/SIDEA",
184 "/MDT/Onl/MM/ClusterUncertainties/SIDEC",
185 "/TGC/Onl/NSW/ClusterUncertainties/SIDEA",
186 "/TGC/Onl/NSW/ClusterUncertainties/SIDEC",
188 result.merge(
addFolders(flags,folderNames[:2], className=
'CondAttrListCollection', detDb=
"MDT_ONL"))
189 result.merge(
addFolders(flags,folderNames[2:], className=
'CondAttrListCollection', detDb=
"TGC_ONL"))
192 from IOVDbSvc.IOVDbSvcConfig
import addFolders
193 folderNames+=[
"/MDT/MM/ClusterUncertainties/SIDEA",
194 "/MDT/MM/ClusterUncertainties/SIDEC",
195 "/TGC/NSW/ClusterUncertainties/SIDEA",
196 "/TGC/NSW/ClusterUncertainties/SIDEC"]
197 result.merge(
addFolders(flags,folderNames[:2], className=
'CondAttrListCollection', detDb=
"MDT_OFL"))
198 result.merge(
addFolders(flags,folderNames[2:], className=
'CondAttrListCollection', detDb=
"TGC_OFL"))
200 kwargs.setdefault(
"ReadKeys", folderNames)
201 the_alg = CompFactory.NswUncertDbAlg(name = name, **kwargs)
202 result.addCondAlgo(the_alg, primary =
True)