1 """Define methods to construct configured RPC Digitization tools and algorithms
3 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.Enums
import LHCPeriod, ProductionStep
8 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
9 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
10 from MuonConfig.MuonByteStreamCnvTestConfig
import RpcDigitToRpcRDOCfg
11 from MuonConfig.MuonByteStreamCnvTestConfig
import NrpcDigitToNrpcRDOCfg
12 from MuonConfig.MuonCablingConfig
import RPCCablingConfigCfg
13 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
14 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
15 from DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
29 """Return a PileUpXingFolder tool configured for RPC"""
32 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
33 if flags.Muon.usePhaseIIGeoSetup:
34 kwargs.setdefault(
"ItemList", [
"xAOD::MuonSimHitContainer#xRpcSimHits",
35 "xAOD::MuonSimHitAuxContainer#xRpcSimHitsAux."])
37 kwargs.setdefault(
"ItemList", [
"RPCSimHitCollection#RPC_Hits"])
44 """Return ComponentAccumulator with configured RpcDigitizationTool"""
47 if flags.GeoModel.Run < LHCPeriod.Run3:
48 from MuonConfig.MuonCondAlgConfig
import RpcCondDbAlgCfg
51 if flags.Digitization.DoXingByXingPileUp:
54 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
55 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"RPC_SDO")
57 kwargs.setdefault(
"OutputSDOName",
"RPC_SDO")
59 from RngComps.RngCompsConfig
import AthRNGSvcCfg
60 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)))
61 kwargs.setdefault(
"OutputObjectName",
"RPC_DIGITS")
64 if flags.Muon.usePhaseIIGeoSetup:
65 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
67 kwargs.setdefault(
"StreamName",
"RpcSimForklift")
68 kwargs.setdefault(
"SimHitKey",
"xRpcSimHits")
69 kwargs.setdefault(
"EffiDataKey",
"")
70 the_tool = CompFactory.MuonR4.RpcFastDigiTool(name=
"RpcDigitizationTool", **kwargs)
71 acc.setPrivateTools(the_tool)
75 kwargs.setdefault(
"DeadTime", 100)
76 kwargs.setdefault(
"PatchForRpcTime",
True)
78 kwargs.setdefault(
"PatchForRpcTimeShift", 12.5)
79 kwargs.setdefault(
"turnON_efficiency",
True)
80 kwargs.setdefault(
"turnON_clustersize",
True)
81 kwargs.setdefault(
"ClusterSize1_2uncorr",
False)
82 kwargs.setdefault(
"CutProjectedTracks", 100)
83 kwargs.setdefault(
"RPCInfoFromDb",
True)
84 kwargs.setdefault(
"Efficiency_fromCOOL",
True)
85 kwargs.setdefault(
"EfficiencyPatchForBMShighEta",
False)
86 kwargs.setdefault(
"ClusterSize_fromCOOL",
True)
87 kwargs.setdefault(
"IgnoreRunDependentConfig",
False)
88 kwargs.setdefault(
"PhiAndEtaEff_A",[0.938, 0.938, 0.938, 0.938, 0.938, 0.938, 0.938, 0.938, 0.938])
89 kwargs.setdefault(
"OnlyPhiEff_A" ,[0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022])
90 kwargs.setdefault(
"OnlyEtaEff_A" ,[0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022])
91 kwargs.setdefault(
"PhiAndEtaEff_C",[0.938, 0.938, 0.938, 0.938, 0.938, 0.938, 0.938, 0.938, 0.938])
92 kwargs.setdefault(
"OnlyPhiEff_C" ,[0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022])
93 kwargs.setdefault(
"OnlyEtaEff_C" ,[0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022, 0.022])
94 kwargs.setdefault(
"FracClusterSize1_A", [0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664])
95 kwargs.setdefault(
"FracClusterSize2_A", [0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986])
96 kwargs.setdefault(
"FracClusterSizeTail_A",[0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035 ])
97 kwargs.setdefault(
"MeanClusterSizeTail_A",[0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598])
98 kwargs.setdefault(
"FracClusterSize1_C", [0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664, 0.609664])
99 kwargs.setdefault(
"FracClusterSize2_C", [0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986, 0.259986])
100 kwargs.setdefault(
"FracClusterSizeTail_C",[0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035, 0.13035 ])
101 kwargs.setdefault(
"MeanClusterSizeTail_C",[0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598, 0.548598])
102 RpcDigitizationTool = CompFactory.RpcDigitizationTool(name, **kwargs)
103 acc.setPrivateTools(RpcDigitizationTool)
108 """Return ComponentAccumulator with configured RpcDigitizationTool"""
110 if flags.Digitization.PileUp:
112 if not flags.Digitization.DoXingByXingPileUp:
113 intervals += [acc.popToolsAndMerge(
RPC_RangeCfg(flags))]
114 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
116 kwargs.setdefault(
"PileUpMergeSvc",
'')
117 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
118 kwargs.setdefault(
"OutputObjectName",
"RPC_DIGITS")
119 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
120 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"RPC_SDO")
122 kwargs.setdefault(
"OutputSDOName",
"RPC_SDO")
124 acc.setPrivateTools(tool)
129 """Return ComponentAccumulator with RpcDigitizationTool configured for Overlay"""
130 kwargs.setdefault(
"OnlyUseContainerName",
False)
131 kwargs.setdefault(
"OutputObjectName", flags.Overlay.SigPrefix +
"RPC_DIGITS")
132 kwargs.setdefault(
"OutputSDOName", flags.Overlay.SigPrefix +
"RPC_SDO")
133 kwargs.setdefault(
"PileUpMergeSvc",
'')
138 """Return ComponentAccumulator with Output for RPC. Not standalone."""
140 if flags.Output.doWriteRDO:
141 ItemList = [
"RpcPadContainer#*"]
142 if flags.Muon.enableNRPC:
143 ItemList += [
'xAOD::NRPCRDOContainer#*' ,
'xAOD::NRPCRDOAuxContainer#*' ]
144 if flags.Digitization.EnableTruth:
145 ItemList += [
"MuonSimDataCollection#*"]
146 ItemList += [
"xAOD::MuonSimHitContainer#*RPC_SDO",
147 "xAOD::MuonSimHitAuxContainer#*RPC_SDOAux."]
154 """Return ComponentAccumulator for RPC digitization"""
156 if "PileUpTools" not in kwargs:
158 kwargs[
"PileUpTools"] = PileUpTools
164 """Return ComponentAccumulator with RPC Overlay digitization"""
167 if flags.Common.ProductionStep != ProductionStep.FastChain:
168 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
169 if flags.Muon.usePhaseIIGeoSetup:
171 "xAOD::MuonSimHitAuxContainer#xRpcSimHitsAux."]))
177 if flags.Concurrency.NumThreads > 0:
178 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
181 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
183 the_alg = CompFactory.MuonDigitizer(name=
"RPC_OverlayDigitizer", **kwargs)
184 acc.addEventAlgo(the_alg)
190 """Return ComponentAccumulator for RPC digitization and Output"""
197 """Return ComponentAccumulator with RPC digitization and Digit to RPCPAD RDO"""
200 if not flags.Muon.usePhaseIIGeoSetup:
202 if flags.Muon.enableNRPC: