1"""ComponentAccumulator service configuration for ISF
3Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory
import CompFactory
7from SimulationConfig.SimEnums
import TruthStrategy
8from ISF_HepMC_Tools.ISF_HepMC_ToolsConfig
import (
9 KeepLLPDecayChildrenStrategyCfg,
10 KeepLLPHadronicInteractionChildrenStrategyCfg,
11 TruthStrategyGroupID_MC15Cfg,
12 TruthStrategyGroupIDHadInt_MC15Cfg,
14 TruthStrategyGroupCaloDecay_MC15Cfg,
16 TruthStrategyGroupIDCfg,
17 TruthStrategyGroupIDHadIntCfg,
18 TruthStrategyGroupCaloMuBremCfg,
19 ValidationTruthStrategyCfg,
20 FCSParamTruthStrategyCfg
22from BarcodeServices.BarcodeServicesConfig
import BarcodeSvcCfg
23from ISF_Geant4CommonTools.ISF_Geant4CommonToolsConfig
import (
24 EntryLayerToolCfg, ATLFAST_EntryLayerToolCfg
26from ISF_Tools.ISF_ToolsConfig
import ParticleOrderingToolCfg
30cppyy.include(
"AtlasDetDescr/AtlasRegion.h")
34 result = ComponentAccumulator()
35 kwargs.setdefault(
"QuasiStableParticlesIncluded", flags.Sim.ISF.Simulator.isQuasiStable())
36 kwargs.setdefault(
"UseShadowEvent", flags.Sim.UseShadowEvent)
37 kwargs.setdefault(
"UseGeneratedParticleMass",
False)
38 if "GenParticleFilters" not in kwargs:
39 from ISF_HepMC_Tools.ISF_HepMC_ToolsConfig
import GenParticleFilterToolsCfg
40 kwargs.setdefault(
"GenParticleFilters", result.popToolsAndMerge(GenParticleFilterToolsCfg(flags)) )
41 result.addService(CompFactory.ISF.InputConverter(name, **kwargs), primary =
True)
46 result = ComponentAccumulator()
47 if "EntryLayerTool" not in kwargs:
48 kwargs.setdefault(
"EntryLayerTool", result.addPublicTool(result.popToolsAndMerge(EntryLayerToolCfg(flags))))
49 kwargs.setdefault(
"GeoIDSvc", result.getService(
"ISF_GeoIDSvc"))
51 kwargs.setdefault(
"AlwaysUseGeoIDSvc",
False)
52 kwargs.setdefault(
"ValidateGeoIDs", flags.Sim.ISF.ValidationMode)
53 kwargs.setdefault(
"ValidationOutput", flags.Sim.ISF.ValidationMode)
54 kwargs.setdefault(
"ValidationStreamName",
"ParticleBroker")
56 result.addService(CompFactory.ISF.ParticleBrokerDynamicOnReadIn(name, **kwargs), primary =
True)
63 result = ComponentAccumulator()
64 kwargs.setdefault(
"ParticleOrderingTool", result.popToolsAndMerge(ParticleOrderingToolCfg(flags)))
66 result.addService(pbsvc, primary =
True)
71 result = ComponentAccumulator()
72 kwargs.setdefault(
"EntryLayerTool", result.addPublicTool(result.popToolsAndMerge(ATLFAST_EntryLayerToolCfg(flags))))
73 kwargs.setdefault(
"GeoIDSvc", result.getService(
"ISF_ATLFAST_GeoIDSvc"))
75 result.addService(pbsvc, primary =
True)
81 """Return the TruthService config flagged by Sim.TruthStrategy"""
83 TruthStrategy.MC12: MC12TruthServiceCfg,
84 TruthStrategy.MC12LLP: MC12LLPTruthServiceCfg,
85 TruthStrategy.MC12Plus: MC12PlusTruthServiceCfg,
86 TruthStrategy.MC15: MC15TruthServiceCfg,
87 TruthStrategy.MC15a: MC15aTruthServiceCfg,
88 TruthStrategy.MC15aPlus: MC15aPlusTruthServiceCfg,
89 TruthStrategy.MC15aPlusLLP: MC15aPlusLLPTruthServiceCfg,
90 TruthStrategy.MC16: MC16TruthServiceCfg,
91 TruthStrategy.MC16LLP: MC16LLPTruthServiceCfg,
92 TruthStrategy.MC18: MC18TruthServiceCfg,
93 TruthStrategy.MC18LLP: MC18LLPTruthServiceCfg,
96 TruthStrategy.Validation: ValidationTruthServiceCfg,
99 xCfg = stratmap[flags.Sim.TruthStrategy]
100 return xCfg(flags, **kwargs)
104 result = ComponentAccumulator()
105 kwargs.setdefault(
"BarcodeSvc", result.getPrimaryAndMerge(BarcodeSvcCfg(flags)))
107 kwargs.setdefault(
"SkipIfNoChildren",
True)
108 kwargs.setdefault(
"SkipIfNoParentId",
True)
109 kwargs.setdefault(
"ForceEndVtxInRegions", [])
111 if flags.Sim.ISF.Simulator.isQuasiStable():
112 kwargs.setdefault(
"QuasiStableParticlesIncluded",
True)
113 kwargs.setdefault(
"QuasiStableParticleOverwrite",
not flags.Sim.UseShadowEvent)
114 svc = CompFactory.ISF.TruthSvc(name, **kwargs)
115 result.addService(svc, primary=
True)
120 result = ComponentAccumulator()
121 kwargs.setdefault(
"TruthStrategies", [result.popToolsAndMerge(ValidationTruthStrategyCfg(flags))] )
122 kwargs.setdefault(
"IgnoreUndefinedBarcodes",
True)
123 kwargs.setdefault(
"PassWholeVertices",
True)
125 result.addService(truthService, primary=
True)
131 return [
"ISF_MCTruthStrategyGroupID"]
135 return [
"ISF_MCTruthStrategyGroupID",
"ISF_MCTruthStrategyGroupIDHadInt"]
139 return [
"ISF_MCTruthStrategyGroupCaloMuBrem"]
147 result = ComponentAccumulator()
148 if "TruthStrategies" not in kwargs:
150 TruthStrategyGroupIDCfg,
151 TruthStrategyGroupIDHadIntCfg,
152 TruthStrategyGroupCaloMuBremCfg,
154 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
155 kwargs.setdefault(
"TruthStrategies", truthStrats)
156 kwargs.setdefault(
"IgnoreUndefinedBarcodes",
False)
157 kwargs.setdefault(
"PassWholeVertices",
True)
159 result.addService(truthService, primary=
True)
164 result = ComponentAccumulator()
166 TruthStrategyGroupIDCfg,
167 TruthStrategyGroupIDHadIntCfg,
168 TruthStrategyGroupCaloMuBremCfg,
171 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
172 kwargs.setdefault(
"TruthStrategies", truthStrats)
174 result.addService(truthService, primary =
True)
179 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
180 kwargs.setdefault(
"ForceEndVtxInRegions", [AtlasRegion.fAtlasID] )
186 return [
"ISF_MCTruthStrategyGroupID_MC15"]
190 return [
"ISF_MCTruthStrategyGroupID_MC15",
"ISF_MCTruthStrategyGroupIDHadInt_MC15"]
194 return [
"ISF_MCTruthStrategyGroupCaloMuBrem",
"ISF_MCTruthStrategyGroupCaloMuBrem_MC15"]
201 result = ComponentAccumulator()
202 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
204 if "TruthStrategies" not in kwargs:
206 TruthStrategyGroupID_MC15Cfg,
207 TruthStrategyGroupIDHadInt_MC15Cfg,
208 TruthStrategyGroupCaloMuBremCfg,
209 TruthStrategyGroupCaloDecay_MC15Cfg ]
210 if flags.Sim.RecordStepInfo:
212 truthCfgs = [ FCSParamTruthStrategyCfg ]
213 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
214 kwargs.setdefault(
"TruthStrategies", truthStrats)
216 kwargs.setdefault(
"IgnoreUndefinedBarcodes",
False)
217 kwargs.setdefault(
"PassWholeVertices",
False)
218 kwargs.setdefault(
"ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
220 result.addService(truthService, primary=
True)
225 kwargs.setdefault(
"ForceEndVtxInRegions", [])
230 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
232 kwargs.setdefault(
"ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
237 result = ComponentAccumulator()
239 KeepLLPDecayChildrenStrategyCfg,
240 KeepLLPHadronicInteractionChildrenStrategyCfg,
241 TruthStrategyGroupID_MC15Cfg,
242 TruthStrategyGroupIDHadInt_MC15Cfg,
243 TruthStrategyGroupCaloMuBremCfg,
244 TruthStrategyGroupCaloDecay_MC15Cfg,
247 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
248 kwargs.setdefault(
"TruthStrategies", truthStrats)
250 result.addService(truthService, primary =
True)
ParticleBrokerSvcNoOrderingCfg(flags, name="ISF_ParticleBrokerSvcNoOrdering", **kwargs)
MC12BeamPipeTruthStrategies()
MC12CaloTruthStrategies()
GenericTruthServiceCfg(flags, name="ISF_TruthService", **kwargs)
MC15aTruthServiceCfg(flags, name="ISF_MC15aTruthService", **kwargs)
MC15TruthServiceCfg(flags, name="ISF_MC15TruthService", **kwargs)
MC15BeamPipeTruthStrategies()
MC15aPlusLLPTruthServiceCfg(flags, name="ISF_MC15aPlusLLPTruthService", **kwargs)
MC15aPlusTruthServiceCfg(flags, name="ISF_MC15aPlusTruthService", **kwargs)
MC12LLPTruthServiceCfg(flags, name="ISF_MC12TruthLLPService", **kwargs)
MC12PlusTruthServiceCfg(flags, name="ISF_MC12PlusTruthService", **kwargs)
ParticleBrokerSvcCfg(flags, name="ISF_ParticleBrokerSvc", **kwargs)
MC18LLPTruthServiceCfg(flags, name="ISF_MC18LLPTruthService", **kwargs)
InputConverterCfg(flags, name="ISF_InputConverter", **kwargs)
MC15CaloTruthStrategies()
MC18TruthServiceCfg(flags, name="ISF_MC18TruthService", **kwargs)
MC16TruthServiceCfg(flags, name="ISF_MC16TruthService", **kwargs)
MC16LLPTruthServiceCfg(flags, name="ISF_MC16LLPTruthService", **kwargs)
ValidationTruthServiceCfg(flags, name="ISF_ValidationTruthService", **kwargs)
MC12TruthServiceCfg(flags, name="ISF_MC12TruthService", **kwargs)
ATLFAST_ParticleBrokerSvcCfg(flags, name="ISF_ATLFAST_ParticleBrokerSvc", **kwargs)
TruthServiceCfg(flags, **kwargs)