1 """Define methods to construct configured STGC 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 ProductionStep
8 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
9 from MuonConfig.MuonGeometryConfig
import MuonGeoModelCfg
10 from MuonConfig.MuonByteStreamCnvTestConfig
import STGC_DigitToRDOCfg
11 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
12 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
13 from DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
27 """Return a PileUpXingFolder tool configured for sTGC"""
30 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
31 if flags.Muon.usePhaseIIGeoSetup:
32 kwargs.setdefault(
"ItemList", [
"xAOD::MuonSimHitContainer#xStgcSimHits",
33 "xAOD::MuonSimHitAuxContainer#xStgcSimHitsAux."])
35 kwargs.setdefault(
"ItemList", [
"sTGCSimHitCollection#sTGC_Hits"])
41 from RngComps.RngCompsConfig
import AthRNGSvcCfg
42 kwargs.setdefault(
"RndmSvc", result.getPrimaryAndMerge(
AthRNGSvcCfg(flags)))
45 if flags.Digitization.PileUp:
47 if flags.Digitization.DoXingByXingPileUp:
52 kwargs.setdefault(
"PileUpMergeSvc", result.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)))
54 kwargs.setdefault(
"PileUpMergeSvc",
'')
55 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
57 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
58 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"sTGC_SDO")
60 kwargs.setdefault(
"OutputSDOName",
"sTGC_SDO")
61 kwargs.setdefault(
"OutputObjectName",
"sTGC_DIGITS")
64 if not flags.Muon.usePhaseIIGeoSetup:
65 from MuonConfig.MuonCalibrationConfig
import NSWCalibToolCfg, STgcCalibSmearingToolCfg
66 kwargs.setdefault(
"CalibrationTool", result.popToolsAndMerge(
NSWCalibToolCfg(flags)))
69 kwargs.setdefault(
"doToFCorrection",
True)
70 kwargs.setdefault(
"InputObjectName",
"sTGC_Hits")
71 the_tool = CompFactory.sTgcDigitizationTool(name, **kwargs)
73 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
75 kwargs.setdefault(
"StreamName",
"sTgcSimForklift")
76 kwargs.setdefault(
"SimHitKey",
"xStgcSimHits")
77 kwargs.setdefault(
"EffiDataKey",
"")
79 from MuonConfig.MuonCondAlgConfig import sTgcDigitEffiCondAlgCfg
80 result.merge(sTgcDigitEffiCondAlgCfg(flags,readFromJSON="EffMapsTGC.json"))
81 kwargs.setdefault("EffiDataKey", "sTgcDigitEff")
83 from MuonConfig.MuonCalibrationConfig
import NswErrorCalibDbAlgCfg
85 the_tool = CompFactory.MuonR4.sTgcFastDigiTool(name, **kwargs)
87 result.setPrivateTools(the_tool)
91 """Return ComponentAccumulator with TgcDigitizationTool configured for Overlay"""
93 kwargs.setdefault(
"PileUpMergeSvc",
'')
94 kwargs.setdefault(
"OnlyUseContainerName",
False)
95 kwargs.setdefault(
"OutputObjectName", flags.Overlay.SigPrefix +
"sTGC_DIGITS")
96 kwargs.setdefault(
"OutputSDOName", flags.Overlay.SigPrefix +
"sTGC_SDO")
98 acc.setPrivateTools(the_tool)
103 """Return ComponentAccumulator with Output for sTGC. Not standalone."""
105 if flags.Output.doWriteRDO:
106 ItemList = [
"Muon::STGC_RawDataContainer#*"]
107 if flags.Digitization.EnableTruth:
108 ItemList += [
"MuonSimDataCollection#*"]
109 ItemList += [
"xAOD::MuonSimHitContainer#*STGC_SDO",
110 "xAOD::MuonSimHitAuxContainer#*STGC_SDOAux."]
118 """Return ComponentAccumulator for sTGC digitization"""
120 if "PileUpTools" not in kwargs:
122 kwargs[
"PileUpTools"] = PileUpTools
128 """Return ComponentAccumulator with sTGC Overlay digitization"""
130 if flags.Common.ProductionStep != ProductionStep.FastChain:
131 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
132 if flags.Muon.usePhaseIIGeoSetup:
133 acc.merge(
SGInputLoaderCfg(flags, [
"xAOD::MuonSimHitContainer#xStgcSimHits",
134 "xAOD::MuonSimHitAuxContainer#xStgcSimHitsAux."]))
139 if flags.Concurrency.NumThreads > 0:
140 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
143 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
145 the_alg = CompFactory.MuonDigitizer(name=
"STGC_OverlayDigitizer", **kwargs)
146 acc.addEventAlgo(the_alg)
152 """Return ComponentAccumulator for sTGC digitization and Output"""
159 """Return ComponentAccumulator with sTGC digitization and Digit to TGCRDO"""