1 """Define methods to construct configured TGC Digitization tools and algorithms
3 Copyright (C) 2002-2022 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 TgcDigitToTgcRDOCfg
11 from MuonConfig.MuonCablingConfig
import TGCCablingConfigCfg
12 from DigitizationConfig.TruthDigitizationOutputConfig
import TruthDigitizationOutputCfg
13 from DigitizationConfig.PileUpToolsConfig
import PileUpToolsCfg
14 from DigitizationConfig.PileUpMergeSvcConfig
import PileUpMergeSvcCfg, PileUpXingFolderCfg
28 """Return a PileUpXingFolder tool configured for TGC"""
31 kwargs.setdefault(
"CacheRefreshFrequency", 1.0)
32 if flags.Muon.usePhaseIIGeoSetup:
33 kwargs.setdefault(
"ItemList", [
"xAOD::MuonSimHitContainer#xTgcSimHits",
34 "xAOD::MuonSimHitAuxContainer#xTgcSimHitsAux."])
36 kwargs.setdefault(
"ItemList", [
"TGCSimHitCollection#TGC_Hits"])
41 """Return ComponentAccumulator with configured TgcDigitizationTool"""
43 if flags.Digitization.PileUp:
45 if not flags.Digitization.DoXingByXingPileUp:
47 kwargs.setdefault(
"PileUpMergeSvc", acc.getPrimaryAndMerge(
PileUpMergeSvcCfg(flags, Intervals=intervals)))
49 kwargs.setdefault(
"PileUpMergeSvc",
'')
50 kwargs.setdefault(
"OnlyUseContainerName", flags.Digitization.PileUp)
52 if flags.Digitization.DoXingByXingPileUp:
56 if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
57 kwargs.setdefault(
"OutputSDOName", flags.Overlay.BkgPrefix +
"TGC_SDO")
59 kwargs.setdefault(
"OutputSDOName",
"TGC_SDO")
60 kwargs.setdefault(
"OutputObjectName",
"TGC_DIGITS")
62 from RngComps.RngCompsConfig
import AthRNGSvcCfg
63 kwargs.setdefault(
"RndmSvc", acc.getPrimaryAndMerge(
AthRNGSvcCfg(flags)))
66 if not flags.Muon.usePhaseIIGeoSetup:
67 from MuonConfig.MuonCondAlgConfig
import TgcDigitCondAlgCfg
69 kwargs.setdefault(
"TGCDigitASDposKey",
"TGCDigitASDposData")
70 kwargs.setdefault(
"TGCDigitTimeOffsetKey",
"TGCDigitTimeOffsetData")
71 kwargs.setdefault(
"TGCDigitCrosstalkKey",
"TGCDigitCrosstalkData")
73 from AthenaConfiguration.Enums
import LHCPeriod
74 kwargs.setdefault(
"FourBunchDigitization", flags.GeoModel.Run >= LHCPeriod.Run3)
75 the_tool = CompFactory.TgcDigitizationTool(name, **kwargs)
77 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
79 kwargs.setdefault(
"StreamName",
"TgcSimForklift")
80 kwargs.setdefault(
"SimHitKey",
"xTgcSimHits")
81 kwargs.setdefault(
"EffiDataKey",
"")
82 the_tool = CompFactory.MuonR4.TgcFastDigiTool(name, **kwargs)
84 acc.setPrivateTools(the_tool)
89 """Return ComponentAccumulator with TgcDigitizationTool configured for Overlay"""
91 kwargs.setdefault(
"OnlyUseContainerName",
False)
92 kwargs.setdefault(
"OutputObjectName", flags.Overlay.SigPrefix +
"TGC_DIGITS")
93 kwargs.setdefault(
"OutputSDOName", flags.Overlay.SigPrefix +
"TGC_SDO")
95 acc.setPrivateTools(the_tool)
100 """Return ComponentAccumulator with Output for TGC. Not standalone."""
102 if flags.Output.doWriteRDO:
103 ItemList = [
"TgcRdoContainer#*"]
104 if flags.Digitization.EnableTruth:
105 ItemList += [
"MuonSimDataCollection#*"]
106 ItemList += [
"xAOD::MuonSimHitContainer#*TGC_SDO",
107 "xAOD::MuonSimHitAuxContainer#*TGC_SDOAux."]
115 """Return ComponentAccumulator for TGC digitization"""
117 if "PileUpTools" not in kwargs:
119 kwargs[
"PileUpTools"] = PileUpTools
125 """Return ComponentAccumulator with TGC Overlay digitization"""
127 if flags.Common.ProductionStep != ProductionStep.FastChain:
128 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
129 if flags.Muon.usePhaseIIGeoSetup:
131 "xAOD::MuonSimHitAuxContainer#xTgcSimHitsAux."]))
137 if flags.Concurrency.NumThreads > 0:
138 kwargs.setdefault(
"Cardinality", flags.Concurrency.NumThreads)
141 kwargs.setdefault(
"ExtraInputs", flags.Overlay.ExtraInputs)
143 the_alg = CompFactory.MuonDigitizer(name=
"TGC_OverlayDigitizer", **kwargs)
144 acc.addEventAlgo(the_alg)
150 """Return ComponentAccumulator for TGC digitization and Output"""
157 """Return ComponentAccumulator with TGC digitization and Digit to TGCRDO"""