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.SCT_ConditionsToolsConfig
import SCT_ReadCalibChipDataCfg, SCT_SiliconConditionsCfg
14 from SCT_GeoModel.SCT_GeoModelConfig
import SCT_ReadoutGeometryCfg
15 from SiLorentzAngleTool.SCT_LorentzAngleConfig
import SCT_LorentzAngleToolCfg
16 from SiPropertiesTool.SCT_SiPropertiesConfig
import SCT_SiPropertiesToolCfg
31 """Return ComponentAccumulator with common SCT digitization tool config"""
33 if not flags.Digitization.DoInnerDetectorNoise:
34 kwargs.setdefault(
"OnlyHitElements",
True)
35 kwargs.setdefault(
"InputObjectName",
"SCT_Hits")
36 kwargs.setdefault(
"EnableHits",
True)
37 kwargs.setdefault(
"BarrelOnly",
False)
39 if flags.Beam.Type
is BeamType.Cosmics:
40 kwargs.setdefault(
"CosmicsRun",
True)
41 kwargs.setdefault(
"FixedTime", 10)
42 if flags.Digitization.DoXingByXingPileUp:
45 from RngComps.RngCompsConfig
import AthRNGSvcCfg
46 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
48 SCT_DigitizationTool = CompFactory.SCT_DigitizationTool
54 acc.setPrivateTools(tool)
59 """Return ComponentAccumulator with configured SCT digitization tool"""
61 if flags.Digitization.PileUp:
63 if not flags.Digitization.DoXingByXingPileUp:
65 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
67 kwargs.setdefault(
"MergeSvc",
'')
68 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
69 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
70 kwargs.setdefault(
"OutputObjectName", flags.Overlay.BkgPrefix +
"SCT_RDOs")
71 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"SCT_SDO_Map")
73 kwargs.setdefault(
"OutputObjectName",
"SCT_RDOs")
74 kwargs.setdefault(
"OutputSDOName",
"SCT_SDO_Map")
75 kwargs.setdefault(
"HardScatterSplittingMode", 0)
77 acc.setPrivateTools(tool)
82 """Return ComponentAccumulator with hard scatter configured SCT digitization tool"""
85 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
86 kwargs.setdefault(
"OutputObjectName",
"SCT_RDOs")
87 kwargs.setdefault(
"OutputSDOName",
"SCT_SDO_Map")
88 kwargs.setdefault(
"HardScatterSplittingMode", 1)
90 acc.setPrivateTools(tool)
95 """Return ComponentAccumulator with pileup configured SCT digitization tool"""
98 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
99 kwargs.setdefault(
"OutputObjectName",
"SCT_PU_RDOs")
100 kwargs.setdefault(
"OutputSDOName",
"SCT_PU_SDO_Map")
101 kwargs.setdefault(
"HardScatterSplittingMode", 2)
103 acc.setPrivateTools(tool)
108 """Return ComponentAccumulator with overlay configured SCT digitization tool"""
110 kwargs.setdefault(
"OnlyUseContainerName",
False)
111 kwargs.setdefault(
"OutputObjectName", flags.Overlay.SigPrefix +
"SCT_RDOs")
112 kwargs.setdefault(
"OutputSDOName", flags.Overlay.SigPrefix +
"SCT_SDO_Map")
113 kwargs.setdefault(
"HardScatterSplittingMode", 0)
114 kwargs.setdefault(
"MergeSvc",
'')
116 acc.setPrivateTools(tool)
121 """Return ComponentAccumulator with merged pileup configured SCT digitization tool"""
124 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
125 kwargs.setdefault(
"InputObjectName",
"PileupSCT_Hits")
126 kwargs.setdefault(
"HardScatterSplittingMode", 0)
127 kwargs.setdefault(
"OutputObjectName",
"SCT_PU_RDOs")
128 kwargs.setdefault(
"OutputSDOName",
"SCT_PU_SDO_Map")
129 kwargs.setdefault(
"OnlyHitElements",
True)
130 kwargs.setdefault(
"FrontEnd",
"PileupSCT_FrontEnd")
132 acc.setPrivateTools(tool)
137 """Return Geantino truth configured digitization tool"""
138 kwargs.setdefault(
"VetoPileUpTruthLinks",
False)
143 """Return configured random cell disabling tool"""
145 kwargs.setdefault(
"TotalBadChannels", 0.01)
146 acc.setPrivateTools(CompFactory.SCT_RandomDisabledCellGenerator(name, **kwargs))
151 """Return configured amplifier and shaper tool"""
153 kwargs.setdefault(
"CrossFactor2sides", 0.1)
154 kwargs.setdefault(
"CrossFactorBack", 0.07)
155 kwargs.setdefault(
"PeakTime", 21)
156 kwargs.setdefault(
"deltaT", 1.0)
157 kwargs.setdefault(
"Tmin", -25.0)
158 kwargs.setdefault(
"Tmax", 150.0)
159 acc.setPrivateTools(CompFactory.SCT_Amp(name, **kwargs))
164 """Return ComponentAccumulator with configured surface charges tool"""
166 kwargs.setdefault(
"FixedTime", -999)
167 kwargs.setdefault(
"SubtractTime", -999)
168 kwargs.setdefault(
"SurfaceDriftTime", 10*Units.ns)
169 kwargs.setdefault(
"NumberOfCharges", 1)
170 kwargs.setdefault(
"SmallStepLength", 5*Units.micrometer)
171 kwargs.setdefault(
"DepletionVoltage", 70)
172 kwargs.setdefault(
"BiasVoltage", 150)
173 kwargs.setdefault(
"isOverlay", flags.Common.isOverlay)
176 SCT_SurfaceChargesGenerator, SCT_RadDamageSummaryTool = CompFactory.getComps(
"SCT_SurfaceChargesGenerator",
"SCT_RadDamageSummaryTool",)
180 tool.SiPropertiesTool = acc.popToolsAndMerge(
SCT_SiPropertiesToolCfg(flags, SiConditionsTool=tool.SiConditionsTool))
182 acc.setPrivateTools(tool)
187 """Return ComponentAccumulator with configured front-end electronics tool"""
191 kwargs.setdefault(
"NoiseBarrel", 1500.0)
192 kwargs.setdefault(
"NoiseBarrel3", 1541.0)
193 kwargs.setdefault(
"NoiseInners", 1090.0)
194 kwargs.setdefault(
"NoiseMiddles", 1557.0)
195 kwargs.setdefault(
"NoiseShortMiddles", 940.0)
196 kwargs.setdefault(
"NoiseOuters", 1618.0)
197 kwargs.setdefault(
"NOBarrel", 1.5e-5)
198 kwargs.setdefault(
"NOBarrel3", 2.1e-5)
199 kwargs.setdefault(
"NOInners", 5.0e-9)
200 kwargs.setdefault(
"NOMiddles", 2.7e-5)
201 kwargs.setdefault(
"NOShortMiddles", 2.0e-9)
202 kwargs.setdefault(
"NOOuters", 3.5e-5)
203 if not flags.Digitization.DoInnerDetectorNoise:
204 log = logging.getLogger(
"SCT_FrontEndCfg")
205 log.info(
"SCT_Digitization:::: Turned off Noise in SCT_FrontEnd")
206 kwargs.setdefault(
"NoiseOn",
False)
207 kwargs.setdefault(
"AnalogueNoiseOn",
False)
209 kwargs.setdefault(
"NoiseOn",
True)
210 kwargs.setdefault(
"AnalogueNoiseOn",
True)
212 if flags.Common.isOverlay:
213 kwargs[
"NoiseOn"] =
False
214 kwargs[
"AnalogueNoiseOn"] = flags.Input.isMC
216 kwargs.setdefault(
"UseCalibData",
True)
219 kwargs.setdefault(
"SCT_ReadCalibChipDataTool", acc.popPrivateTools())
221 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
222 kwargs.setdefault(
"DataCompressionMode", 3)
223 elif flags.Common.isOverlay
and flags.Input.isMC:
224 kwargs.setdefault(
"DataCompressionMode", 2)
225 elif flags.Beam.BunchSpacing <= 50:
226 kwargs.setdefault(
"DataCompressionMode", 1)
228 kwargs.setdefault(
"DataCompressionMode", 3)
230 if flags.Common.isOverlay
and flags.Input.isMC:
231 kwargs.setdefault(
"DataReadOutMode", 0)
233 kwargs.setdefault(
"DataReadOutMode", 1)
234 kwargs.setdefault(
"SCT_Amp", acc.popToolsAndMerge(
SCT_AmpCfg(flags)))
235 acc.setPrivateTools(CompFactory.SCT_FrontEnd(name, **kwargs))
240 """Return ComponentAccumulator with pileup-configured front-end electronics tool"""
241 kwargs.setdefault(
"NoiseBarrel", 0.0)
242 kwargs.setdefault(
"NoiseBarrel3", 0.0)
243 kwargs.setdefault(
"NoiseInners", 0.0)
244 kwargs.setdefault(
"NoiseMiddles", 0.0)
245 kwargs.setdefault(
"NoiseShortMiddles", 0.0)
246 kwargs.setdefault(
"NoiseOuters", 0.0)
247 kwargs.setdefault(
"NOBarrel", 0.0)
248 kwargs.setdefault(
"NOBarrel3", 0.0)
249 kwargs.setdefault(
"NOInners", 0.0)
250 kwargs.setdefault(
"NOMiddles", 0.0)
251 kwargs.setdefault(
"NOShortMiddles", 0.0)
252 kwargs.setdefault(
"NOOuters", 0.0)
253 kwargs.setdefault(
"NoiseOn",
False)
258 """Return an SCT configured PileUpXingFolder tool"""
261 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
262 kwargs.setdefault(
"ItemList", [
"SiHitCollection#SCT_Hits"] )
267 """Return ComponentAccumulator with Output for SCT. Not standalone."""
269 if flags.Output.doWriteRDO:
270 ItemList = [
"SCT_RDO_Container#*"]
271 if flags.Digitization.EnableTruth:
272 ItemList += [
"InDetSimDataCollection#*"]
274 if flags.InDet.saveSCTSiHits:
275 ItemList += [
"SiHitCollection#SCT_Hits"]
281 """Return ComponentAccumulator for SCT digitization"""
283 if "PileUpTools" not in kwargs:
285 kwargs[
"PileUpTools"] = PileUpTools
291 """Return ComponentAccumulator with SCT Overlay digitization"""
293 if flags.Common.ProductionStep != ProductionStep.FastChain:
294 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
297 if "DigitizationTool" not in kwargs:
299 kwargs[
"DigitizationTool"] = tool
301 if flags.Concurrency.NumThreads > 0:
302 kwargs.setdefault(
'Cardinality', flags.Concurrency.NumThreads)
305 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
307 SCT_Digitization = CompFactory.SCT_Digitization
308 acc.addEventAlgo(
SCT_Digitization(name=
"SCT_OverlayDigitization", **kwargs))
314 """Return ComponentAccumulator for SCT digitization and Output"""
321 """Return ComponentAccumulator with SCT Overlay digitization and Output"""
329 """Return ComponentAccumulator for Hard-Scatter-only SCT digitization and Output"""
331 kwargs[
"PileUpTools"] = acc.popPrivateTools()
338 """Return ComponentAccumulator with Pile-up-only SCT digitization and Output"""
340 kwargs[
"PileUpTools"] = acc.popPrivateTools()