1 """Define methods to construct configured TRT 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 BeamType, ProductionStep
8 from TRT_GeoModel.TRT_GeoModelConfig
import TRT_ReadoutGeometryCfg
9 from MagFieldServices.MagFieldServicesConfig
import AtlasFieldCacheCondAlgCfg
10 from TRT_PAI_Process.TRT_PAI_ProcessConfig
import TRT_PAI_Process_XeToolCfg, TRT_PAI_Process_ArToolCfg, TRT_PAI_Process_KrToolCfg
11 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
12 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
13 from DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
14 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
28 """Return an TRT configured PileUpXingFolder tool"""
31 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
32 kwargs.setdefault(
"ItemList", [
"TRTUncompressedHitCollection#TRTUncompressedHits"])
37 """Return ComponentAccumulator with common TRT digitization tool config"""
40 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
41 kwargs.setdefault(
'PartPropSvc', acc.getPrimaryAndMerge(
PartPropSvcCfg(flags)).name)
42 kwargs.setdefault(
"DigVersContainerKey",
"")
44 from TRT_ConditionsServices.TRT_ConditionsServicesConfig
import TRT_StrawStatusSummaryToolCfg
46 acc.addPublicTool(StrawStatusTool)
47 kwargs.setdefault(
"InDetTRTStrawStatusSummaryTool", StrawStatusTool)
51 kwargs.setdefault(
"Override_TrtRangeCutProperty", flags.Sim.TRTRangeCut)
52 kwargs.setdefault(
"RandomSeedOffset", flags.Digitization.RandomSeedOffset)
53 if not flags.Digitization.DoInnerDetectorNoise:
54 kwargs.setdefault(
"Override_noiseInSimhits", 0)
55 kwargs.setdefault(
"Override_noiseInUnhitStraws", 0)
56 if flags.Beam.Type
is BeamType.Cosmics:
57 kwargs.setdefault(
"PrintDigSettings",
True)
58 kwargs.setdefault(
"Override_cosmicFlag", 0)
59 kwargs.setdefault(
"Override_doCosmicTimingPit", 1)
60 kwargs.setdefault(
"Override_jitterTimeOffset", 0.)
61 kwargs.setdefault(
"Override_timeCorrection", 0)
62 if flags.Digitization.DoXingByXingPileUp:
65 if flags.BField.configuredSolenoidFieldScale>0
and flags.BField.configuredSolenoidFieldScale<1:
67 kwargs.setdefault(
"Override_solenoidFieldStrength", flags.BField.configuredSolenoidFieldScale * 2.0 * tesla)
68 from RngComps.RngCompsConfig
import AthRNGSvcCfg
69 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)).name)
70 TRTDigitizationTool = CompFactory.TRTDigitizationTool
72 acc.setPrivateTools(tool)
77 """Return ComponentAccumulator with configured TRT digitization tool"""
79 if flags.Digitization.PileUp:
81 if not flags.Digitization.DoXingByXingPileUp:
83 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
85 kwargs.setdefault(
"MergeSvc",
'')
86 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
87 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
88 kwargs.setdefault(
"OutputObjectName", flags.Overlay.BkgPrefix +
"TRT_RDOs")
89 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"TRT_SDO_Map")
91 kwargs.setdefault(
"OutputObjectName",
"TRT_RDOs")
92 kwargs.setdefault(
"OutputSDOName",
"TRT_SDO_Map")
93 kwargs.setdefault(
"HardScatterSplittingMode", 0)
94 if flags.Digitization.TRT.HeavyIonHT:
95 kwargs.setdefault(
"Override_highThresholdBarShort", 0.00129875)
96 kwargs.setdefault(
"Override_highThresholdBarLong", 0.00118775)
97 kwargs.setdefault(
"Override_highThresholdECAwheels", 0.001185591)
98 kwargs.setdefault(
"Override_highThresholdECBwheels", 0.001145376)
99 kwargs.setdefault(
"Override_highThresholdBarShortArgon", 0.000468802)
100 kwargs.setdefault(
"Override_highThresholdBarLongArgon", 0.000456754)
101 kwargs.setdefault(
"Override_highThresholdECAwheelsArgon", 0.0006035)
102 kwargs.setdefault(
"Override_highThresholdECBwheelsArgon", 0.00057375)
104 acc.setPrivateTools(tool)
109 """Return ComponentAccumulator with Geantino configured TRT digitization tool"""
111 if flags.Digitization.PileUp:
113 if not flags.Digitization.DoXingByXingPileUp:
114 intervals += [acc.popToolsAndMerge(
TRT_RangeCfg(flags))]
115 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
117 kwargs.setdefault(
"MergeSvc",
'')
118 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
119 kwargs.setdefault(
"VetoPileUpTruthLinks",
False)
121 acc.setPrivateTools(tool)
126 """Return ComponentAccumulator with Hard Scatter configured TRT digitization tool"""
129 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
130 kwargs.setdefault(
"OutputObjectName",
"TRT_RDOs")
131 kwargs.setdefault(
"OutputSDOName",
"TRT_SDO_Map")
132 kwargs.setdefault(
"HardScatterSplittingMode", 1)
134 acc.setPrivateTools(tool)
139 """Return ComponentAccumulator with Pile Up configured TRT digitization tool"""
142 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
143 kwargs.setdefault(
"OutputObjectName",
"TRT_PU_RDOs")
144 kwargs.setdefault(
"OutputSDOName",
"TRT_PU_SDO_Map")
145 kwargs.setdefault(
"HardScatterSplittingMode", 2)
151 """Return ComponentAccumulator with PileUpTRT_Hits configured TRT digitization tool"""
154 kwargs.setdefault(
"MergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=rangetool)).name)
155 kwargs.setdefault(
"HardScatterSplittingMode", 0)
156 kwargs.setdefault(
"DataObjectName",
"PileupTRTUncompressedHits")
157 kwargs.setdefault(
"OutputObjectName",
"TRT_PU_RDOs")
158 kwargs.setdefault(
"OutputSDOName",
"TRT_PU_SDO_Map")
159 kwargs.setdefault(
"Override_noiseInSimhits", 0)
160 kwargs.setdefault(
"Override_noiseInUnhitStraws", 0)
162 acc.setPrivateTools(tool)
167 """Return ComponentAccumulator with configured Overlay TRT digitization tool"""
169 if flags.Overlay.DataOverlay:
170 from IOVDbSvc.IOVDbSvcConfig
import addFolders
172 acc.merge(
addFolders(flags,
"/TRT/Cond/DigVers",
"TRT_OFL", tag=
"TRTCondDigVers-Collisions-01", db=
"OFLP200", className=
"AthenaAttributeList"))
173 kwargs.setdefault(
"DigVersContainerKey",
"/TRT/Cond/DigVers")
175 kwargs.setdefault(
"OnlyUseContainerName",
False)
176 kwargs.setdefault(
"OutputObjectName", flags.Overlay.SigPrefix +
"TRT_RDOs")
177 kwargs.setdefault(
"OutputSDOName", flags.Overlay.SigPrefix +
"TRT_SDO_Map")
178 kwargs.setdefault(
"Override_isOverlay", 1)
179 kwargs.setdefault(
"HardScatterSplittingMode", 0)
180 kwargs.setdefault(
"Override_getT0FromData", 0)
181 kwargs.setdefault(
"Override_noiseInSimhits", 0)
182 kwargs.setdefault(
"Override_noiseInUnhitStraws", 0)
183 kwargs.setdefault(
"MergeSvc",
'')
185 acc.setPrivateTools(tool)
190 """Return ComponentAccumulator with Output for TRT. Not standalone."""
192 if flags.Output.doWriteRDO:
193 ItemList = [
"TRT_RDO_Container#*"]
194 if flags.Digitization.EnableTruth:
195 ItemList += [
"InDetSimDataCollection#*"]
202 """Return ComponentAccumulator for TRT digitization"""
204 if "PileUpTools" not in kwargs:
206 kwargs[
"PileUpTools"] = PileUpTools
212 """Return ComponentAccumulator with TRT Overlay digitization"""
214 if flags.Common.ProductionStep != ProductionStep.FastChain:
215 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
216 acc.merge(
SGInputLoaderCfg(flags, [
"TRTUncompressedHitCollection#TRTUncompressedHits"]))
218 if "DigitizationTool" not in kwargs:
220 kwargs[
"DigitizationTool"] = tool
222 if flags.Concurrency.NumThreads > 0:
223 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
226 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
228 TRTDigitization = CompFactory.TRTDigitization
229 acc.addEventAlgo(
TRTDigitization(name=
"TRT_OverlayDigitization", **kwargs))
235 """Return ComponentAccumulator for TRT digitization and Output"""
242 """Return ComponentAccumulator with TRT Overlay digitization and Output"""
250 """Return ComponentAccumulator for Hard-Scatter-only TRT digitization and Output"""
252 kwargs[
"PileUpTools"] = acc.popPrivateTools()
259 """Return ComponentAccumulator with Pile-up-only TRT digitization and Output"""
261 kwargs[
"PileUpTools"] = acc.popPrivateTools()