1 """Define methods to construct configured ITk Pixel Digitization tools and algorithms
3 Copyright (C) 2002-2021 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
12 from PixelConditionsAlgorithms.ITkPixelConditionsConfig
import (
13 ITkPixelModuleConfigCondAlgCfg, ITkPixelChargeCalibCondAlgCfg,
14 ITkPixelDistortionAlgCfg
16 from PixelConditionsTools.ITkPixelConditionsSummaryConfig
import ITkPixelConditionsSummaryCfg
17 from PixelGeoModelXml.ITkPixelGeoModelConfig
import ITkPixelReadoutGeometryCfg
18 from PixelReadoutGeometry.PixelReadoutGeometryConfig
import ITkPixelReadoutManagerCfg
19 from SiLorentzAngleTool.ITkPixelLorentzAngleConfig
import ITkPixelLorentzAngleToolCfg
20 from SiPropertiesTool.ITkPixelSiPropertiesConfig
import ITkPixelSiPropertiesToolCfg
21 from SimulationConfig.SimEnums
import PixelRadiationDamageSimulationType
31 if flags.Beam.BunchSpacing > 50:
38 """Return a configured EnergyDepositionTool"""
40 kwargs.setdefault(
"DeltaRayCut", 80.7687)
41 kwargs.setdefault(
"nCols", 5)
42 kwargs.setdefault(
"LoopLimit", 100000)
43 kwargs.setdefault(
"doBichsel",
True)
44 kwargs.setdefault(
"doBichselBetaGammaCut", 0.7)
45 kwargs.setdefault(
"doDeltaRay",
False)
46 kwargs.setdefault(
"doPU",
False)
47 kwargs.setdefault(
"PixelDistortionData",
"ITkPixelDistortionData")
48 EnergyDepositionTool = CompFactory.EnergyDepositionTool
54 """Return a RD53SimTool configured for Barrel"""
58 kwargs.setdefault(
"BarrelEC", 0)
59 kwargs.setdefault(
"DoNoise", flags.Digitization.DoInnerDetectorNoise)
60 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
61 kwargs.setdefault(
"PixelModuleData",
"ITkPixelModuleData")
62 kwargs.setdefault(
"PixelChargeCalibCondData",
"ITkPixelChargeCalibCondData")
64 kwargs.setdefault(
"DoTimeWalk",
False)
65 acc.setPrivateTools(CompFactory.RD53SimTool(name, **kwargs))
70 """Return a RD53SimTool configured for Endcap"""
74 kwargs.setdefault(
"BarrelEC", 2)
75 kwargs.setdefault(
"DoNoise", flags.Digitization.DoInnerDetectorNoise)
76 kwargs.setdefault(
"PixelReadoutManager", acc.getPrimary())
77 kwargs.setdefault(
"PixelModuleData",
"ITkPixelModuleData")
78 kwargs.setdefault(
"PixelChargeCalibCondData",
"ITkPixelChargeCalibCondData")
80 kwargs.setdefault(
"DoTimeWalk",
False)
81 RD53SimTool = CompFactory.RD53SimTool
87 """Return ComponentAccumulator with configured SensorSimPlanarTool for ITk"""
91 kwargs.setdefault(
"PixelModuleData",
"ITkPixelModuleData")
92 kwargs.setdefault(
"DigitizeITk3Das3D", flags.Digitization.DigitizeITk3Das3D)
93 kwargs.setdefault(
"RadiationDamageSimulationType", flags.Digitization.PixelPlanarRadiationDamageSimulationType.value)
96 kwargs.setdefault(
"TemplateCorrectionROOTfile",
"maps_ITk_Planar_100V_fl10e15.root")
97 kwargs.setdefault(
"LorentzAngleCorrectionHistos", [
"layer_1_100_um_la",
"layer_2_150_um_la",
"layer_3_150_um_la",
"layer_4_150_um_la"])
98 kwargs.setdefault(
"ChargeCorrectionHistos", [
"layer_1_100_um_cce",
"layer_2_150_um_cce",
"layer_3_150_um_cce",
"layer_4_150_um_cce"])
99 kwargs.setdefault(
"DistanceCorrectionHistos", [
"layer_1_100_um_dz",
"layer_2_150_um_dz",
"layer_3_150_um_dz",
"layer_4_150_um_dz"])
100 if flags.Digitization.PixelPlanarRadiationDamageSimulationType
is not PixelRadiationDamageSimulationType.NoRadiationDamage:
103 acc.setPrivateTools(CompFactory.SensorSimPlanarTool(name, **kwargs))
108 """Return ComponentAccumulator with configured SensorSim3DTool for ITk"""
111 kwargs.setdefault(
"PixelModuleData",
"ITkPixelModuleData")
112 kwargs.setdefault(
"RadiationDamageSimulationType", flags.Digitization.Pixel3DRadiationDamageSimulationType.value)
113 kwargs.setdefault(
"DigitizeITk3Das3D", flags.Digitization.DigitizeITk3Das3D)
116 kwargs.setdefault(
"TemplateCorrectionROOTfile",
"maps_ITk_3D_100V_fl10e15.root")
117 kwargs.setdefault(
"ChargeCorrectionHistos", [
"barrel_25_um_cee",
"ring_25_um_cee"])
118 if flags.Digitization.Pixel3DRadiationDamageSimulationType
is not PixelRadiationDamageSimulationType.NoRadiationDamage:
121 acc.setPrivateTools(CompFactory.SensorSim3DTool(name, **kwargs))
126 """Return ComponentAccumulator with configured PixelDigitizationTool for ITk"""
135 kwargs.setdefault(
"ChargeTools", chargeTools)
137 kwargs.setdefault(
"FrontEndSimTools", feSimTools)
138 kwargs.setdefault(
"InputObjectName",
"ITkPixelHits")
139 kwargs.setdefault(
"PixelDetEleCollKey",
"ITkPixelDetectorElementCollection")
140 if flags.Digitization.DoXingByXingPileUp:
143 from RngComps.RngCompsConfig
import AthRNGSvcCfg
144 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
146 acc.setPrivateTools(CompFactory.PixelDigitizationTool(name, **kwargs))
151 """Return ComponentAccumulator with configured ITkPixelDigitizationBasicTool"""
153 if flags.Digitization.PileUp:
155 if not flags.Digitization.DoXingByXingPileUp:
157 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
159 kwargs.setdefault(
"PileUpMergeSvc",
'')
160 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
161 kwargs.setdefault(
"HardScatterSplittingMode", 0)
162 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
163 kwargs.setdefault(
"RDOCollName", flags.Overlay.BkgPrefix +
"ITkPixelRDOs")
164 kwargs.setdefault(
"SDOCollName", flags.Overlay.BkgPrefix +
"ITkPixelSDO_Map")
166 kwargs.setdefault(
"RDOCollName",
"ITkPixelRDOs")
167 kwargs.setdefault(
"SDOCollName",
"ITkPixelSDO_Map")
169 acc.setPrivateTools(tool)
174 """Return ComponentAccumulator with PixelDigitizationTool configured for Hard Scatter ITk"""
177 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
178 kwargs.setdefault(
"HardScatterSplittingMode", 1)
180 acc.setPrivateTools(tool)
185 """Return ComponentAccumulator with PixelDigitizationTool configured for PileUp ITk"""
188 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
189 kwargs.setdefault(
"HardScatterSplittingMode", 2)
190 kwargs.setdefault(
"RDOCollName",
"ITkPixel_PU_RDOs")
191 kwargs.setdefault(
"SDOCollName",
"ITkPixel_PU_SDO_Map")
193 acc.setPrivateTools(tool)
198 """Return ComponentAccumulator with PixelDigitizationTool configured for PileUpITkPixelHits"""
201 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
202 kwargs.setdefault(
"HardScatterSplittingMode", 0)
203 kwargs.setdefault(
"InputObjectName",
"PileupITkPixelHits")
204 kwargs.setdefault(
"RDOCollName",
"ITkPixel_PU_RDOs")
205 kwargs.setdefault(
"SDOCollName",
"ITkPixel_PU_SDO_Map")
207 acc.setPrivateTools(tool)
212 """Return ComponentAccumulator with PixelDigitizationTool configured for overlay"""
213 kwargs.setdefault(
"OnlyUseContainerName",
False)
214 kwargs.setdefault(
"RDOCollName", flags.Overlay.SigPrefix +
"ITkPixelRDOs")
215 kwargs.setdefault(
"SDOCollName", flags.Overlay.SigPrefix +
"ITkPixelSDO_Map")
216 kwargs.setdefault(
"HardScatterSplittingMode", 0)
221 """Return a configured PileUpXingFolder tool"""
224 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
225 kwargs.setdefault(
"ItemList", [
"SiHitCollection#ITkPixelHits"])
230 """Return ComponentAccumulator with Output for ITk Pixel. Not standalone."""
232 if flags.Output.doWriteRDO:
233 ItemList = [
"PixelRDO_Container#*"]
234 if flags.Digitization.EnableTruth:
235 ItemList += [
"InDetSimDataCollection#*"]
237 if flags.ITk.savePixelSiHits:
238 ItemList += [
"SiHitCollection#ITkPixelHits"]
244 """Return ComponentAccumulator for ITk Pixel digitization"""
246 if "PileUpTools" not in kwargs:
248 kwargs[
"PileUpTools"] = PileUpTools
254 """Return ComponentAccumulator with ITk Pixel Overlay digitization"""
256 if flags.Common.ProductionStep != ProductionStep.FastChain:
257 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
260 if "DigitizationTool" not in kwargs:
262 kwargs[
"DigitizationTool"] = tool
264 if flags.Concurrency.NumThreads > 0:
265 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
268 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
269 acc.addEventAlgo(CompFactory.PixelDigitization(name=
"ITkPixelOverlayDigitization", **kwargs))
275 """Return ComponentAccumulator for ITk Pixel digitization and Output"""
283 """Return ComponentAccumulator for Hard-Scatter-only ITk Pixel digitization and Output"""
286 kwargs[
"PileUpTools"] = tool
293 """Return ComponentAccumulator with Pile-up-only ITk Pixel digitization and Output"""
296 kwargs[
"PileUpTools"] = tool