1 """Define methods to construct configured PLR Digitization tools and algorithms
3 Copyright (C) 2002-2022 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 ProductionStep
8 from DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
9 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
10 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
11 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
13 from PixelConditionsAlgorithms.PLR_ConditionsConfig
import (
14 PLR_ConfigCondAlgCfg, PLR_ChargeCalibCondAlgCfg,
17 from PixelConditionsTools.PLR_ConditionsSummaryConfig
import PLR_ConditionsSummaryCfg
18 from PLRGeoModelXml.PLR_GeoModelConfig
import PLR_ReadoutGeometryCfg
19 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import PLR_ReadoutManagerCfg
20 from SiLorentzAngleTool.PLR_LorentzAngleConfig
import PLR_LorentzAngleToolCfg
21 from SiPropertiesTool.PLR_SiPropertiesConfig
import PLR_SiPropertiesToolCfg
22 from SimulationConfig.SimEnums
import PixelRadiationDamageSimulationType
32 if flags.Beam.BunchSpacing > 50:
39 """Return a configured EnergyDepositionTool"""
41 kwargs.setdefault(
"DeltaRayCut", 117.)
42 kwargs.setdefault(
"nCols", 5)
43 kwargs.setdefault(
"LoopLimit", 100000)
44 kwargs.setdefault(
"doBichsel",
True)
45 kwargs.setdefault(
"doBichselBetaGammaCut", 0.7)
46 kwargs.setdefault(
"doDeltaRay",
False)
47 kwargs.setdefault(
"doPU",
True)
48 kwargs.setdefault(
"PixelDistortionData",
"PLR_DistortionData")
49 acc.setPrivateTools(CompFactory.EnergyDepositionTool(name, **kwargs))
54 """Return a RD53SimTool configured for PLR"""
58 kwargs.setdefault(
"BarrelEC", 4)
59 kwargs.setdefault(
"DoNoise", flags.Digitization.DoInnerDetectorNoise)
60 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
61 kwargs.setdefault(
"PixelModuleData",
"PLR_ModuleData")
62 kwargs.setdefault(
"PixelChargeCalibCondData",
"PLR_ChargeCalibCondData")
64 kwargs.setdefault(
"DoTimeWalk",
False)
65 acc.setPrivateTools(CompFactory.RD53SimTool(name, **kwargs))
70 """Return ComponentAccumulator with configured SensorSimPlanarTool for PLR"""
74 kwargs.setdefault(
"PixelModuleData",
"PLR_ModuleData")
75 kwargs.setdefault(
"RadiationDamageSimulationType", flags.Digitization.PixelPlanarRadiationDamageSimulationType.value)
76 kwargs.setdefault(
"DigitizeITk3Das3D",
False)
77 if flags.Digitization.PixelPlanarRadiationDamageSimulationType
is not PixelRadiationDamageSimulationType.NoRadiationDamage:
80 acc.setPrivateTools(CompFactory.SensorSimPlanarTool(name, **kwargs))
85 """Return ComponentAccumulator with configured SensorSim3DTool for PLR"""
88 kwargs.setdefault(
"PixelModuleData",
"PLR_ModuleData")
89 kwargs.setdefault(
"RadiationDamageSimulationType", flags.Digitization.Pixel3DRadiationDamageSimulationType.value)
90 kwargs.setdefault(
"DigitizeITk3Das3D",
False)
91 if flags.Digitization.Pixel3DRadiationDamageSimulationType
is not PixelRadiationDamageSimulationType.NoRadiationDamage:
94 acc.setPrivateTools(CompFactory.SensorSim3DTool(name, **kwargs))
99 """Return ComponentAccumulator with configured PixelDigitizationTool for PLR"""
107 kwargs.setdefault(
"PixelIDName",
"PLR_ID")
108 kwargs.setdefault(
"ChargeTools", chargeTools)
110 kwargs.setdefault(
"FrontEndSimTools", feSimTools)
111 kwargs.setdefault(
"InputObjectName",
"PLR_Hits")
112 kwargs.setdefault(
"PixelDetEleCollKey",
"PLR_DetectorElementCollection")
113 if flags.Digitization.DoXingByXingPileUp:
116 from RngComps.RngCompsConfig
import AthRNGSvcCfg
117 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
119 acc.setPrivateTools(CompFactory.PixelDigitizationTool(name, **kwargs, ))
124 """Return ComponentAccumulator with configured PLR_DigitizationBasicTool"""
126 if flags.Digitization.PileUp:
128 if not flags.Digitization.DoXingByXingPileUp:
129 intervals += [acc.popToolsAndMerge(
PLR_RangeCfg(flags))]
130 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
132 kwargs.setdefault(
"PileUpMergeSvc",
"")
133 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
134 kwargs.setdefault(
"HardScatterSplittingMode", 0)
135 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
136 kwargs.setdefault(
"RDOCollName", flags.Overlay.BkgPrefix +
"PLR_RDOs")
137 kwargs.setdefault(
"SDOCollName", flags.Overlay.BkgPrefix +
"PLR_SDO_Map")
139 kwargs.setdefault(
"RDOCollName",
"PLR_RDOs")
140 kwargs.setdefault(
"SDOCollName",
"PLR_SDO_Map")
142 acc.setPrivateTools(tool)
147 """Return ComponentAccumulator with PixelDigitizationTool configured for Hard Scatter"""
151 kwargs.setdefault(
"HardScatterSplittingMode", 1)
153 acc.setPrivateTools(tool)
158 """Return ComponentAccumulator with PixelDigitizationTool configured for PileUp"""
162 kwargs.setdefault(
"HardScatterSplittingMode", 2)
163 kwargs.setdefault(
"RDOCollName",
"PLR_PU_RDOs")
164 kwargs.setdefault(
"SDOCollName",
"PLR_PU_SDO_Map")
166 acc.setPrivateTools(tool)
171 """Return ComponentAccumulator with PixelDigitizationTool configured for PileUpPLR_Hits"""
175 kwargs.setdefault(
"HardScatterSplittingMode", 0)
176 kwargs.setdefault(
"InputObjectName",
"PileupPLR_Hits")
177 kwargs.setdefault(
"RDOCollName",
"PLR_PU_RDOs")
178 kwargs.setdefault(
"SDOCollName",
"PLR_PU_SDO_Map")
180 acc.setPrivateTools(tool)
185 """Return ComponentAccumulator with PixelDigitizationTool configured for overlay"""
186 kwargs.setdefault(
"OnlyUseContainerName",
False)
187 kwargs.setdefault(
"RDOCollName", flags.Overlay.SigPrefix +
"PLR_RDOs")
188 kwargs.setdefault(
"SDOCollName", flags.Overlay.SigPrefix +
"PLR_SDO_Map")
189 kwargs.setdefault(
"HardScatterSplittingMode", 0)
194 """Return a configured PileUpXingFolder tool"""
197 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
198 kwargs.setdefault(
"ItemList", [
"SiHitCollection#PLR_Hits"])
203 """Return ComponentAccumulator with Output for PLR. Not standalone."""
205 if flags.Output.doWriteRDO:
206 ItemList = [
"PixelRDO_Container#*"]
207 if flags.Digitization.EnableTruth:
208 ItemList += [
"InDetSimDataCollection#*"]
215 """Return ComponentAccumulator for PLR digitization"""
217 if "PileUpTools" not in kwargs:
219 kwargs[
"PileUpTools"] = PileUpTools
225 """Return ComponentAccumulator with PLR Overlay digitization"""
227 if flags.Common.ProductionStep != ProductionStep.FastChain:
228 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
231 if "DigitizationTool" not in kwargs:
233 kwargs[
"DigitizationTool"] = tool
235 if flags.Concurrency.NumThreads > 0:
236 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
239 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
240 acc.addEventAlgo(CompFactory.PixelDigitization(name=
"PLR_OverlayDigitization", **kwargs))
246 """Return ComponentAccumulator for PLR digitization and Output"""
254 """Return ComponentAccumulator for Hard-Scatter-only PLR digitization and Output"""
257 kwargs[
"PileUpTools"] = tool
264 """Return ComponentAccumulator with Pile-up-only PLR digitization and Output"""
267 kwargs[
"PileUpTools"] = tool