3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
10 kwargs.setdefault(
"JSONFile",
"")
11 if len(kwargs[
"JSONFile"]) == 0:
12 from IOVDbSvc.IOVDbSvcConfig
import addFolders
13 dbName =
'RPC_OFL' if flags.Input.isMC
else 'RPC'
14 cablingFolder =
"/RPC/NCABLING/JSON" if flags.Input.isMC
else "/RPC/Onl/NCABLING/JSON"
15 cablingTag =
"RpcNcablingJson-RUN3-07"
16 from AthenaConfiguration.Enums
import LHCPeriod
17 if flags.Muon.usePhaseIIGeoSetup
and flags.Input.isMC:
18 if flags.GeoModel.Run <= LHCPeriod.Run3:
19 cablingTag =
"RpcNcablingJson-RUN3-FantasyCabling-4"
21 cablingTag =
"RpcNcablingJson-RUN4-FantasyCabling-4"
23 result.merge(
addFolders(flags, [cablingFolder], detDb=dbName, className=
'CondAttrListCollection', tag=cablingTag))
24 kwargs.setdefault(
"MapFolders", cablingFolder)
27 NRPCCablingAlg = CompFactory.Muon.NRpcCablingAlg(name, **kwargs)
29 result.addCondAlgo( NRPCCablingAlg, primary=
True)
35 if not flags.Detector.GeometryRPC:
return acc
36 if flags.Muon.enableNRPC:
43 dbName =
'RPC_OFL' if flags.Input.isMC
else 'RPC'
44 dbRepo=
"MuonRPC_Cabling/ATLAS.data"
45 rpcCabMap=
"/RPC/CABLING/MAP_SCHEMA"
46 rpcCabMapCorr=
"/RPC/CABLING/MAP_SCHEMA_CORR"
47 rpcTrigEta=
"/RPC/TRIGGER/CM_THR_ETA"
48 rpcTrigPhi=
"/RPC/TRIGGER/CM_THR_PHI"
50 from IOVDbSvc.IOVDbSvcConfig
import addFolders
51 acc.merge(
addFolders(flags, [rpcCabMap,rpcCabMapCorr], dbName, className=
'CondAttrListCollection' ))
53 acc.merge(
addFolders(flags, [rpcTrigEta,rpcTrigPhi], dbName, className=
'CondAttrListCollection'))
55 RpcCablingCondAlg=CompFactory.RpcCablingCondAlg
57 acc.addCondAlgo( RpcCablingAlg )
65 filename =
'ASD2PP_diff_12_OFL.db' if flags.Input.isMC
else 'ASD2PP_diff_12_ONL.db'
66 acc.setPrivateTools(CompFactory.TGCCablingDbTool(name =
"TGCCablingDbTool",
67 filename_ASD2PP_DIFF_12 = filename))
75 svc = CompFactory.MuonTGC_CablingSvc()
79 acc.addPublicTool(tool)
80 svc.TGCCablingDbTool = tool
81 acc.addService(svc, primary =
True)
88 if not flags.Detector.GeometryTGC:
return acc
92 from IOVDbSvc.IOVDbSvcConfig
import addFolders
93 dbName =
'TGC_OFL' if flags.Input.isMC
else 'TGC'
94 acc.merge(
addFolders(flags,
'/TGC/CABLING/MAP_SCHEMA', dbName))
102 if not flags.Detector.GeometryMDT:
return acc
103 from AthenaConfiguration.Enums
import LHCPeriod
105 kwargs.setdefault(
"UseJSONFormat", flags.Muon.usePhaseIIGeoSetup
and \
106 flags.GeoModel.Run >= LHCPeriod.Run4)
108 kwargs.setdefault(
"MezzanineJSON",
"")
109 kwargs.setdefault(
"CablingJSON",
"")
111 kwargs.setdefault(
"isRun3", flags.GeoModel.Run >= LHCPeriod.Run3 )
112 from IOVDbSvc.IOVDbSvcConfig
import addFolders
113 if len(kwargs[
"MezzanineJSON"]) == 0
and len(kwargs[
"CablingJSON"]) == 0:
114 if flags.Input.isMC
is True:
117 if flags.Muon.usePhaseIIGeoSetup
and \
118 flags.GeoModel.Run >= LHCPeriod.Run4:
119 dbTagMezz =
"MDTMezMapSchemaJSON_RUN4_FantasyCabling_1"
120 dbTagSchema =
"MDTCablingMapSchemaJSON_RUN4_FantasyCabling_1"
121 elif flags.GeoModel.Run >= LHCPeriod.Run4:
122 dbTagSchema =
"MDTOflCablingMapSchema_RUN124_MC15_02"
123 dbTagMezz =
"MDTOflCablingMezzanineSchema_RUN124_MC15_02"
124 if kwargs[
"UseJSONFormat"]:
125 kwargs.setdefault(
"MapFolders",
"/MDT/CABLING/MAP_SCHEMA_JSON")
126 kwargs.setdefault(
"MezzanineFolders",
"/MDT/CABLING/MEZZANINE_SCHEMA_JSON")
128 kwargs.setdefault(
"MapFolders",
"/MDT/Ofl/CABLING/MAP_SCHEMA")
129 kwargs.setdefault(
"MezzanineFolders",
"/MDT/Ofl/CABLING/MEZZANINE_SCHEMA")
130 acc.merge(
addFolders( flags, [kwargs[
"MapFolders"]],
'MDT_OFL',
131 className=
"CondAttrListCollection", tag = dbTagSchema))
132 acc.merge(
addFolders( flags, [kwargs[
"MezzanineFolders"]],
'MDT_OFL',
133 className=
"CondAttrListCollection", tag = dbTagMezz) )
135 if kwargs[
"UseJSONFormat"]:
136 kwargs.setdefault(
"MapFolders",
"/MDT/CABLING/MAP_SCHEMA_JSON")
137 kwargs.setdefault(
"MezzanineFolders",
"/MDT/CABLING/MEZZANINE_SCHEMA_JSON")
139 kwargs.setdefault(
"MapFolders",
"/MDT/CABLING/MAP_SCHEMA")
140 kwargs.setdefault(
"MezzanineFolders",
"/MDT/CABLING/MEZZANINE_SCHEMA")
141 acc.merge(
addFolders( flags, [kwargs[
"MapFolders"], kwargs[
"MezzanineFolders"]],
'MDT',
142 className=
"CondAttrListCollection") )
145 MDTCablingAlg = CompFactory.MuonMDT_CablingAlg(name, **kwargs)
146 acc.addCondAlgo( MDTCablingAlg, primary =
True )
152 if not flags.Detector.GeometryMDT:
return result
153 kwargs.setdefault(
"JSONFile",
"")
154 if(
not kwargs[
"JSONFile"]):
155 kwargs.setdefault(
"FolderName",
"/MDT/TWINMAPPING")
156 from IOVDbSvc.IOVDbSvcConfig
import addFolders
157 result.merge(
addFolders(flags,[kwargs[
"FolderName"]], (
"MDT_OFL" if flags.Input.isMC
else "MDT"),className=
"CondAttrListCollection", tag=
"MDTTwinMapping_compactFormat_Run123"))
159 kwargs[
"FolderName"] =
""
161 the_alg = CompFactory.Muon.TwinTubeMappingCondAlg(name, **kwargs)
162 result.addCondAlgo(the_alg, primary =
True)
168 if not flags.Detector.GeometryCSC:
return acc
169 CSCcablingSvc=CompFactory.CSCcablingSvc
172 acc.addService( cscCablingSvc, primary=
True )
179 if flags.Input.isMC
or (
not flags.Detector.GeometryMM
and not flags.Detector.GeometrysTGC):
182 from IOVDbSvc.IOVDbSvcConfig
import addFolders
183 cablingFolder = [
"/MDT/MM/CABLING" if not flags.Common.isOnline
else "/MDT/Onl/MM/CABLING"]
184 kwargs.setdefault(
"CablingFolder",cablingFolder)
185 result.merge(
addFolders(flags, kwargs[
"CablingFolder"], detDb=(
"MDT_OFL" if not flags.Common.isOnline
else "MDT_ONL"), className=
"CondAttrListCollection"))
187 the_alg = CompFactory.MuonNSW_CablingAlg(name, **kwargs)
188 result.addCondAlgo(the_alg, primary =
True)
204 if __name__ ==
'__main__':
205 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
206 from AthenaConfiguration.TestDefaults
import defaultTestFiles, defaultGeometryTags
208 flags.Input.Files = defaultTestFiles.RAW_RUN2
209 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2