1 """Define methods to construct configured Pixel 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 DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
9 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
10 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
11 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
12 from PixelConditionsAlgorithms.PixelConditionsConfig
import (
13 PixelConfigCondAlgCfg, PixelChargeCalibCondCfg,
14 PixelDistortionAlgCfg, PixelRadSimFluenceMapAlgCfg
16 from PixelConditionsTools.PixelConditionsSummaryConfig
import PixelConditionsSummaryCfg
17 from PixelGeoModel.PixelGeoModelConfig
import PixelReadoutGeometryCfg
18 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import PixelReadoutManagerCfg
19 from SiLorentzAngleTool.PixelLorentzAngleConfig
import PixelLorentzAngleToolCfg
20 from SiPropertiesTool.PixelSiPropertiesConfig
import PixelSiPropertiesToolCfg
21 from SimulationConfig.SimEnums
import PixelRadiationDamageSimulationType
22 from AthenaConfiguration.Enums
import BeamType
26 if flags.Beam.estimatedLuminosity > 0.5e33:
33 if flags.Beam.estimatedLuminosity > 0.5e33:
34 if flags.Beam.BunchSpacing > 50:
43 """Return a configured RadDamageUtil"""
44 kwargs.setdefault(
"defaultRamo", 1)
45 kwargs.setdefault(
"betaElectrons", 4.5e-16)
46 kwargs.setdefault(
"betaHoles", 6.0e-16)
47 kwargs.setdefault(
"saveDebugMaps",
False)
48 kwargs.setdefault(
"fieldScale", flags.BField.configuredSolenoidFieldScale)
49 RadDamageUtil = CompFactory.RadDamageUtil
54 """Return a configured EfieldInterpolator"""
55 kwargs.setdefault(
"initialized",
False)
56 kwargs.setdefault(
"useSpline",
True)
57 kwargs.setdefault(
"sensorDepth", 200)
58 EfieldInterpolator = CompFactory.EfieldInterpolator
63 """Return a configured EnergyDepositionTool"""
65 kwargs.setdefault(
"DeltaRayCut", 80.7687)
66 kwargs.setdefault(
"nCols", 5)
67 kwargs.setdefault(
"LoopLimit", 100000)
68 kwargs.setdefault(
"doBichsel",
True)
69 kwargs.setdefault(
"doBichselBetaGammaCut", 0.7)
70 kwargs.setdefault(
"doDeltaRay",
False)
71 kwargs.setdefault(
"doPU",
False)
72 EnergyDepositionTool = CompFactory.EnergyDepositionTool
78 """Return ComponentAccumulator with configured SensorSimPlanarTool"""
82 SensorSimPlanarTool = CompFactory.SensorSimPlanarTool
83 kwargs.setdefault(
"RadiationDamageSimulationType", flags.Digitization.PixelPlanarRadiationDamageSimulationType.value)
84 if flags.Digitization.PixelPlanarRadiationDamageSimulationType
is not PixelRadiationDamageSimulationType.NoRadiationDamage:
91 """Return ComponentAccumulator with configured SensorSim3DTool"""
94 SensorSim3DTool = CompFactory.SensorSim3DTool
95 kwargs.setdefault(
"RadiationDamageSimulationType", flags.Digitization.Pixel3DRadiationDamageSimulationType.value)
96 if flags.Digitization.Pixel3DRadiationDamageSimulationType
is not PixelRadiationDamageSimulationType.NoRadiationDamage:
103 """Return a FEI4SimTool configured for Barrel"""
107 kwargs.setdefault(
"BarrelEC", 0)
108 kwargs.setdefault(
"DoNoise", flags.Digitization.DoInnerDetectorNoise)
109 kwargs.setdefault(
"Cosmics", flags.Beam.Type
is BeamType.Cosmics)
110 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
112 FEI4SimTool = CompFactory.FEI4SimTool
118 """Return a FEI4SimTool configured for Endcap"""
122 kwargs.setdefault(
"BarrelEC", 4)
123 kwargs.setdefault(
"DoNoise", flags.Digitization.DoInnerDetectorNoise)
124 kwargs.setdefault(
"Cosmics", flags.Beam.Type
is BeamType.Cosmics)
125 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
127 FEI4SimTool = CompFactory.FEI4SimTool
133 """Return a FEI3SimTool configured for Barrel"""
137 kwargs.setdefault(
"BarrelEC", 0)
138 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
139 kwargs.setdefault(
"Cosmics", flags.Beam.Type
is BeamType.Cosmics)
141 kwargs.setdefault(
"HitDuplication", (flags.GeoModel.Run
is LHCPeriod.Run1))
142 FEI3SimTool = CompFactory.FEI3SimTool
148 """Return a FEI3SimTool configured for Endcap"""
152 kwargs.setdefault(
"BarrelEC", 2)
153 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
154 kwargs.setdefault(
"Cosmics", flags.Beam.Type
is BeamType.Cosmics)
156 kwargs.setdefault(
"HitDuplication", (flags.GeoModel.Run
is LHCPeriod.Run1))
157 FEI3SimTool = CompFactory.FEI3SimTool
163 """Return ComponentAccumulator with configured PixelDigitizationTool"""
174 kwargs.setdefault(
"InputObjectName",
"PixelHits")
175 kwargs.setdefault(
"ChargeTools", chargeTools)
176 kwargs.setdefault(
"FrontEndSimTools", feSimTools)
178 if flags.Digitization.DoXingByXingPileUp:
181 from RngComps.RngCompsConfig
import AthRNGSvcCfg
182 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
184 PixelDigitizationTool = CompFactory.PixelDigitizationTool
190 """Return ComponentAccumulator with configured BasicPixelDigitizationTool"""
192 if flags.Digitization.PileUp:
194 if not flags.Digitization.DoXingByXingPileUp:
196 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
198 kwargs.setdefault(
"PileUpMergeSvc",
'')
199 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
200 kwargs.setdefault(
"HardScatterSplittingMode", 0)
201 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
202 kwargs.setdefault(
"RDOCollName", flags.Overlay.BkgPrefix +
"PixelRDOs")
203 kwargs.setdefault(
"SDOCollName", flags.Overlay.BkgPrefix +
"PixelSDO_Map")
205 kwargs.setdefault(
"RDOCollName",
"PixelRDOs")
206 kwargs.setdefault(
"SDOCollName",
"PixelSDO_Map")
208 acc.setPrivateTools(tool)
213 """Return configured PixelDigitizationTool"""
215 if flags.Digitization.PileUp:
217 if not flags.Digitization.DoXingByXingPileUp:
219 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
221 kwargs.setdefault(
"PileUpMergeSvc",
'')
222 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
223 kwargs.setdefault(
"VetoPileUpTruthLinks",
False)
224 from RngComps.RngCompsConfig
import AthRNGSvcCfg
225 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
226 PixelDigitizationTool = CompFactory.PixelDigitizationTool
232 """Return ComponentAccumulator with PixelDigitizationTool configured for Hard Scatter"""
235 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
236 kwargs.setdefault(
"HardScatterSplittingMode", 1)
238 acc.setPrivateTools(tool)
243 """Return ComponentAccumulator with PixelDigitizationTool configured for PileUp"""
246 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
247 kwargs.setdefault(
"HardScatterSplittingMode", 2)
248 kwargs.setdefault(
"RDOCollName",
"Pixel_PU_RDOs")
249 kwargs.setdefault(
"SDOCollName",
"Pixel_PU_SDO_Map")
251 acc.setPrivateTools(tool)
256 """Return ComponentAccumulator with PixelDigitizationTool configured for PileUpPixelHits"""
259 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
260 kwargs.setdefault(
"HardScatterSplittingMode", 0)
261 kwargs.setdefault(
"InputObjectName",
"PileupPixelHits")
262 kwargs.setdefault(
"RDOCollName",
"Pixel_PU_RDOs")
263 kwargs.setdefault(
"SDOCollName",
"Pixel_PU_SDO_Map")
265 acc.setPrivateTools(tool)
270 """Return ComponentAccumulator with PixelDigitizationTool configured for overlay"""
271 kwargs.setdefault(
"OnlyUseContainerName",
False)
272 kwargs.setdefault(
"RDOCollName", flags.Overlay.SigPrefix +
"PixelRDOs")
273 kwargs.setdefault(
"SDOCollName", flags.Overlay.SigPrefix +
"PixelSDO_Map")
274 kwargs.setdefault(
"HardScatterSplittingMode", 0)
275 kwargs.setdefault(
"PileUpMergeSvc",
'')
280 """Return a configured PileUpXingFolder tool"""
283 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
284 kwargs.setdefault(
"ItemList", [
"SiHitCollection#PixelHits"])
289 """Return ComponentAccumulator with Output for Pixel. Not standalone."""
291 if flags.Output.doWriteRDO:
292 ItemList = [
"PixelRDO_Container#*"]
293 if flags.Digitization.EnableTruth:
294 ItemList += [
"InDetSimDataCollection#*"]
296 if flags.InDet.savePixelSiHits:
297 ItemList += [
"SiHitCollection#PixelHits"]
303 """Return ComponentAccumulator for Pixel digitization"""
305 if "PileUpTools" not in kwargs:
307 kwargs[
"PileUpTools"] = PileUpTools
313 """Return ComponentAccumulator with Pixel Overlay digitization"""
315 if flags.Common.ProductionStep != ProductionStep.FastChain:
316 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
319 if "DigitizationTool" not in kwargs:
321 kwargs[
"DigitizationTool"] = tool
323 if flags.Concurrency.NumThreads > 0:
324 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
327 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
328 PixelDigitization = CompFactory.PixelDigitization
335 """Return ComponentAccumulator for Pixel digitization and Output"""
343 """Return ComponentAccumulator for Hard-Scatter-only Pixel digitization and Output"""
346 kwargs[
"PileUpTools"] = tool
353 """Return ComponentAccumulator with Pile-up-only Pixel digitization and Output"""
356 kwargs[
"PileUpTools"] = tool