1 """Define methods to construct configured SCT Digitization tools and algorithms
3 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 from AthenaCommon.Logging
import logging
6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory
import CompFactory
8 from AthenaConfiguration.Enums
import BeamType, ProductionStep
9 from DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
10 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
11 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
12 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
13 from SCT_ConditionsTools.ITkStripConditionsToolsConfig
import ITkStripSiliconConditionsCfg
15 from SiLorentzAngleTool.ITkStripLorentzAngleConfig
import ITkStripLorentzAngleToolCfg
16 from SiPropertiesTool.ITkStripSiPropertiesConfig
import ITkStripSiPropertiesToolCfg
17 from StripGeoModelXml.ITkStripGeoModelConfig
import ITkStripReadoutGeometryCfg
32 """Return ComponentAccumulator with common ITkStrip digitization tool config"""
34 if not flags.Digitization.DoInnerDetectorNoise:
35 kwargs.setdefault(
"OnlyHitElements",
True)
36 kwargs.setdefault(
"InputObjectName",
"ITkStripHits")
37 kwargs.setdefault(
"EnableHits",
True)
38 kwargs.setdefault(
"BarrelOnly",
False)
40 if flags.Beam.Type
is BeamType.Cosmics:
41 kwargs.setdefault(
"CosmicsRun",
True)
42 kwargs.setdefault(
"FixedTime", 10)
43 if flags.Digitization.DoXingByXingPileUp:
47 ITkStripDigitizationTool = CompFactory.ITk.StripDigitizationTool
48 tool = ITkStripDigitizationTool(name, **kwargs)
53 acc.setPrivateTools(tool)
58 """Return ComponentAccumulator with configured ITkStrip digitization tool"""
60 if flags.Digitization.PileUp:
62 if not flags.Digitization.DoXingByXingPileUp:
64 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
66 kwargs.setdefault(
"MergeSvc",
'')
67 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
68 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
69 kwargs.setdefault(
"OutputObjectName", flags.Overlay.BkgPrefix +
"ITkStripRDOs")
70 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"ITkStripSDO_Map")
72 kwargs.setdefault(
"OutputObjectName",
"ITkStripRDOs")
73 kwargs.setdefault(
"OutputSDOName",
"ITkStripSDO_Map")
74 kwargs.setdefault(
"HardScatterSplittingMode", 0)
76 acc.setPrivateTools(tool)
81 """Return ComponentAccumulator with hard scatter configured SCT digitization tool"""
84 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
85 kwargs.setdefault(
"OutputObjectName",
"ITkStripRDOs")
86 kwargs.setdefault(
"OutputSDOName",
"ITkStripSDO_Map")
87 kwargs.setdefault(
"HardScatterSplittingMode", 1)
89 acc.setPrivateTools(tool)
94 """Return ComponentAccumulator with pileup configured SCT digitization tool"""
97 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
98 kwargs.setdefault(
"OutputObjectName",
"ITkStrip_PU_RDOs")
99 kwargs.setdefault(
"OutputSDOName",
"ITkStrip_PU_SDO_Map")
100 kwargs.setdefault(
"HardScatterSplittingMode", 2)
102 acc.setPrivateTools(tool)
107 """Return ComponentAccumulator with overlay configured SCT digitization tool"""
109 kwargs.setdefault(
"OnlyUseContainerName",
False)
110 kwargs.setdefault(
"OutputObjectName", flags.Overlay.SigPrefix +
"ITkStripRDOs")
111 kwargs.setdefault(
"OutputSDOName", flags.Overlay.SigPrefix +
"ITkStripSDO_Map")
112 kwargs.setdefault(
"HardScatterSplittingMode", 0)
114 acc.setPrivateTools(tool)
119 """Return ComponentAccumulator with merged pileup configured SCT digitization tool"""
122 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
123 kwargs.setdefault(
"InputObjectName",
"PileupITkStripHits")
124 kwargs.setdefault(
"HardScatterSplittingMode", 0)
125 kwargs.setdefault(
"OutputObjectName",
"ITkStrip_PU_RDOs")
126 kwargs.setdefault(
"OutputSDOName",
"ITkStrip_PU_SDO_Map")
127 kwargs.setdefault(
"OnlyHitElements",
True)
128 kwargs.setdefault(
"FrontEnd",
"PileupITkStripFrontEnd")
130 acc.setPrivateTools(tool)
135 """Return Geantino truth configured digitization tool"""
136 kwargs.setdefault(
"VetoPileUpTruthLinks",
False)
141 """Return configured random cell disabling tool"""
142 kwargs.setdefault(
"TotalBadChannels", 0.01)
143 ITkStripRandomDisabledCellGenerator = CompFactory.SCT_RandomDisabledCellGenerator
144 return ITkStripRandomDisabledCellGenerator(name, **kwargs)
148 """Return configured amplifier and shaper tool"""
150 kwargs.setdefault(
"CrossFactor2sides", 0.1)
151 kwargs.setdefault(
"CrossFactorBack", 0.07)
152 kwargs.setdefault(
"PeakTime", 21)
153 kwargs.setdefault(
"deltaT", 1.0)
154 kwargs.setdefault(
"Tmin", -25.0)
155 kwargs.setdefault(
"Tmax", 150.0)
156 acc.setPrivateTools(CompFactory.SCT_Amp(name, **kwargs))
161 """Return ComponentAccumulator with configured surface charges tool"""
163 kwargs.setdefault(
"FixedTime", -999)
164 kwargs.setdefault(
"SubtractTime", -999)
165 kwargs.setdefault(
"SurfaceDriftTime", 10*Units.ns)
166 kwargs.setdefault(
"NumberOfCharges", 1)
167 kwargs.setdefault(
"SmallStepLength", 5*Units.micrometer)
168 kwargs.setdefault(
"DepletionVoltage", 70)
169 kwargs.setdefault(
"BiasVoltage", 150)
170 kwargs.setdefault(
"isOverlay", flags.Common.isOverlay)
173 tool = CompFactory.ITk.StripSurfaceChargesGenerator(name, **kwargs)
174 tool.RadDamageSummaryTool = CompFactory.SCT_RadDamageSummaryTool(name=
"ITkStripRadDamageSummaryTool")
178 acc.setPrivateTools(tool)
183 """Return ComponentAccumulator with configured front-end electronics tool"""
199 kwargs.setdefault(
"DetectorManager",
"ITkStrip")
203 log = logging.getLogger(
"ITkStripFrontEndCfg")
204 log.info(
"ITkStripDigitization:::: Turned off Noise in ITkStripFrontEnd")
205 log.info(
"ITkStripDigitization:::: Overriding Digitization.DoInnerDetectorNoise flag")
206 kwargs.setdefault(
"NoiseOn",
False)
207 kwargs.setdefault(
"AnalogueNoiseOn",
False)
213 if flags.Common.isOverlay:
214 kwargs[
"NoiseOn"] =
False
216 kwargs[
"AnalogueNoiseOn"] =
False
219 kwargs.setdefault(
"UseCalibData",
False)
226 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
227 kwargs.setdefault(
"DataCompressionMode", 3)
229 kwargs.setdefault(
"DataCompressionMode", 2)
231 if flags.Common.isOverlay:
232 kwargs.setdefault(
"DataReadOutMode", 0)
234 kwargs.setdefault(
"DataReadOutMode", 1)
236 kwargs.setdefault(
"SCT_Amp", acc.popToolsAndMerge(
ITkStripAmpCfg(flags)))
238 acc.setPrivateTools(CompFactory.SCT_FrontEnd(name, **kwargs))
243 """Return ComponentAccumulator with pileup-configured front-end electronics tool"""
244 kwargs.setdefault(
"NoiseBarrel", 0.0)
245 kwargs.setdefault(
"NoiseBarrel3", 0.0)
246 kwargs.setdefault(
"NoiseInners", 0.0)
247 kwargs.setdefault(
"NoiseMiddles", 0.0)
248 kwargs.setdefault(
"NoiseShortMiddles", 0.0)
249 kwargs.setdefault(
"NoiseOuters", 0.0)
250 kwargs.setdefault(
"NOBarrel", 0.0)
251 kwargs.setdefault(
"NOBarrel3", 0.0)
252 kwargs.setdefault(
"NOInners", 0.0)
253 kwargs.setdefault(
"NOMiddles", 0.0)
254 kwargs.setdefault(
"NOShortMiddles", 0.0)
255 kwargs.setdefault(
"NOOuters", 0.0)
256 kwargs.setdefault(
"NoiseOn",
False)
261 """Return an SCT configured PileUpXingFolder tool"""
264 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
265 kwargs.setdefault(
"ItemList", [
"SiHitCollection#ITkStripHits"] )
270 """Return ComponentAccumulator with Output for SCT. Not standalone."""
272 if flags.Output.doWriteRDO:
273 ItemList = [
"SCT_RDO_Container#*"]
274 if flags.Digitization.EnableTruth:
275 ItemList += [
"InDetSimDataCollection#*"]
277 if flags.ITk.saveStripSiHits:
278 ItemList += [
"SiHitCollection#ITkStripHits"]
284 """Return ComponentAccumulator for SCT digitization"""
286 if "PileUpTools" not in kwargs:
288 kwargs[
"PileUpTools"] = PileUpTools
294 """Return ComponentAccumulator with SCT Overlay digitization"""
296 if flags.Common.ProductionStep != ProductionStep.FastChain:
297 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
300 if "DigitizationTool" not in kwargs:
302 kwargs[
"DigitizationTool"] = tool
304 if flags.Concurrency.NumThreads > 0:
305 kwargs.setdefault(
'Cardinality', flags.Concurrency.NumThreads)
308 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
310 acc.addEventAlgo(CompFactory.SCT_Digitization(name=
"ITkStripOverlayDigitization", **kwargs))
316 """Return ComponentAccumulator for SCT digitization and Output"""
323 """Return ComponentAccumulator with SCT Overlay digitization and Output"""
331 """Return ComponentAccumulator for Hard-Scatter-only SCT digitization and Output"""
333 kwargs[
"PileUpTools"] = acc.popPrivateTools()
340 """Return ComponentAccumulator with Pile-up-only SCT digitization and Output"""
342 kwargs[
"PileUpTools"] = acc.popPrivateTools()