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 TruthStrategyGroupCaloMSBroadCfg,
20 TruthStrategyGroupCaloMSHadIntCfg,
21 ValidationTruthStrategyCfg,
22 FCSParamTruthStrategyCfg
24from BarcodeServices.BarcodeServicesConfig
import BarcodeSvcCfg
25from ISF_Geant4CommonTools.ISF_Geant4CommonToolsConfig
import (
26 EntryLayerToolCfg, ATLFAST_EntryLayerToolCfg
28from ISF_Tools.ISF_ToolsConfig
import ParticleOrderingToolCfg
32cppyy.include(
"AtlasDetDescr/AtlasRegion.h")
36 result = ComponentAccumulator()
37 kwargs.setdefault(
"QuasiStableParticlesIncluded", flags.Sim.ISF.Simulator.isQuasiStable())
38 kwargs.setdefault(
"UseShadowEvent", flags.Sim.UseShadowEvent)
39 kwargs.setdefault(
"UseGeneratedParticleMass",
False)
40 if "GenParticleFilters" not in kwargs:
41 from ISF_HepMC_Tools.ISF_HepMC_ToolsConfig
import GenParticleFilterToolsCfg
42 kwargs.setdefault(
"GenParticleFilters", result.popToolsAndMerge(GenParticleFilterToolsCfg(flags)) )
43 result.addService(CompFactory.ISF.InputConverter(name, **kwargs), primary =
True)
48 result = ComponentAccumulator()
49 if "EntryLayerTool" not in kwargs:
50 kwargs.setdefault(
"EntryLayerTool", result.addPublicTool(result.popToolsAndMerge(EntryLayerToolCfg(flags))))
51 kwargs.setdefault(
"GeoIDSvc", result.getService(
"ISF_GeoIDSvc"))
53 kwargs.setdefault(
"AlwaysUseGeoIDSvc",
False)
54 kwargs.setdefault(
"ValidateGeoIDs", flags.Sim.ISF.ValidationMode)
55 kwargs.setdefault(
"ValidationOutput", flags.Sim.ISF.ValidationMode)
56 kwargs.setdefault(
"ValidationStreamName",
"ParticleBroker")
58 result.addService(CompFactory.ISF.ParticleBrokerDynamicOnReadIn(name, **kwargs), primary =
True)
65 result = ComponentAccumulator()
66 kwargs.setdefault(
"ParticleOrderingTool", result.popToolsAndMerge(ParticleOrderingToolCfg(flags)))
68 result.addService(pbsvc, primary =
True)
73 result = ComponentAccumulator()
74 kwargs.setdefault(
"EntryLayerTool", result.addPublicTool(result.popToolsAndMerge(ATLFAST_EntryLayerToolCfg(flags))))
75 kwargs.setdefault(
"GeoIDSvc", result.getService(
"ISF_ATLFAST_GeoIDSvc"))
77 result.addService(pbsvc, primary =
True)
83 """Return the TruthService config flagged by Sim.TruthStrategy"""
85 TruthStrategy.MC12: MC12TruthServiceCfg,
86 TruthStrategy.MC12LLP: MC12LLPTruthServiceCfg,
87 TruthStrategy.MC12Plus: MC12PlusTruthServiceCfg,
88 TruthStrategy.MC15: MC15TruthServiceCfg,
89 TruthStrategy.MC15a: MC15aTruthServiceCfg,
90 TruthStrategy.MC15aPlus: MC15aPlusTruthServiceCfg,
91 TruthStrategy.MC15aPlusLLP: MC15aPlusLLPTruthServiceCfg,
92 TruthStrategy.MC16: MC16TruthServiceCfg,
93 TruthStrategy.MC16LLP: MC16LLPTruthServiceCfg,
94 TruthStrategy.MC18: MC18TruthServiceCfg,
95 TruthStrategy.MC18LLP: MC18LLPTruthServiceCfg,
98 TruthStrategy.Validation: ValidationTruthServiceCfg,
99 TruthStrategy.MSLLPValidation: MSLLPValidationTruthServiceCfg,
102 xCfg = stratmap[flags.Sim.TruthStrategy]
103 return xCfg(flags, **kwargs)
107 result = ComponentAccumulator()
108 kwargs.setdefault(
"BarcodeSvc", result.getPrimaryAndMerge(BarcodeSvcCfg(flags)))
110 kwargs.setdefault(
"SkipIfNoChildren",
True)
111 kwargs.setdefault(
"SkipIfNoParentId",
True)
112 kwargs.setdefault(
"ForceEndVtxInRegions", [])
114 if flags.Sim.ISF.Simulator.isQuasiStable():
115 kwargs.setdefault(
"QuasiStableParticlesIncluded",
True)
116 kwargs.setdefault(
"QuasiStableParticleOverwrite",
not flags.Sim.UseShadowEvent)
117 svc = CompFactory.ISF.TruthSvc(name, **kwargs)
118 result.addService(svc, primary=
True)
123 result = ComponentAccumulator()
124 kwargs.setdefault(
"TruthStrategies", [result.popToolsAndMerge(ValidationTruthStrategyCfg(flags))] )
125 kwargs.setdefault(
"IgnoreUndefinedBarcodes",
True)
126 kwargs.setdefault(
"PassWholeVertices",
True)
128 result.addService(truthService, primary=
True)
134 return [
"ISF_MCTruthStrategyGroupID"]
138 return [
"ISF_MCTruthStrategyGroupID",
"ISF_MCTruthStrategyGroupIDHadInt"]
142 return [
"ISF_MCTruthStrategyGroupCaloMuBrem"]
150 result = ComponentAccumulator()
151 if "TruthStrategies" not in kwargs:
153 TruthStrategyGroupIDCfg,
154 TruthStrategyGroupIDHadIntCfg,
155 TruthStrategyGroupCaloMuBremCfg,
157 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
158 kwargs.setdefault(
"TruthStrategies", truthStrats)
159 kwargs.setdefault(
"IgnoreUndefinedBarcodes",
False)
160 kwargs.setdefault(
"PassWholeVertices",
True)
162 result.addService(truthService, primary=
True)
167 result = ComponentAccumulator()
169 TruthStrategyGroupIDCfg,
170 TruthStrategyGroupIDHadIntCfg,
171 TruthStrategyGroupCaloMuBremCfg,
174 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
175 kwargs.setdefault(
"TruthStrategies", truthStrats)
177 result.addService(truthService, primary =
True)
182 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
183 kwargs.setdefault(
"ForceEndVtxInRegions", [AtlasRegion.fAtlasID] )
189 return [
"ISF_MCTruthStrategyGroupID_MC15"]
193 return [
"ISF_MCTruthStrategyGroupID_MC15",
"ISF_MCTruthStrategyGroupIDHadInt_MC15"]
197 return [
"ISF_MCTruthStrategyGroupCaloMuBrem",
"ISF_MCTruthStrategyGroupCaloMuBrem_MC15"]
204 result = ComponentAccumulator()
205 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
207 if "TruthStrategies" not in kwargs:
209 TruthStrategyGroupID_MC15Cfg,
210 TruthStrategyGroupIDHadInt_MC15Cfg,
211 TruthStrategyGroupCaloMuBremCfg,
212 TruthStrategyGroupCaloDecay_MC15Cfg ]
213 if flags.Sim.RecordStepInfo:
215 truthCfgs = [ FCSParamTruthStrategyCfg ]
216 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
217 kwargs.setdefault(
"TruthStrategies", truthStrats)
219 kwargs.setdefault(
"IgnoreUndefinedBarcodes",
False)
220 kwargs.setdefault(
"PassWholeVertices",
False)
221 kwargs.setdefault(
"ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
223 result.addService(truthService, primary=
True)
228 kwargs.setdefault(
"ForceEndVtxInRegions", [])
233 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
235 kwargs.setdefault(
"ForceEndVtxInRegions", [AtlasRegion.fAtlasID])
240 result = ComponentAccumulator()
242 KeepLLPDecayChildrenStrategyCfg,
243 KeepLLPHadronicInteractionChildrenStrategyCfg,
244 TruthStrategyGroupID_MC15Cfg,
245 TruthStrategyGroupIDHadInt_MC15Cfg,
246 TruthStrategyGroupCaloMuBremCfg,
247 TruthStrategyGroupCaloDecay_MC15Cfg,
250 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
251 kwargs.setdefault(
"TruthStrategies", truthStrats)
253 result.addService(truthService, primary =
True)
277 result = ComponentAccumulator()
278 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
280 if "TruthStrategies" not in kwargs:
283 KeepLLPDecayChildrenStrategyCfg,
284 KeepLLPHadronicInteractionChildrenStrategyCfg,
285 TruthStrategyGroupID_MC15Cfg,
286 TruthStrategyGroupIDHadInt_MC15Cfg,
287 TruthStrategyGroupCaloMuBremCfg,
288 TruthStrategyGroupCaloDecay_MC15Cfg,
291 TruthStrategyGroupCaloMSBroadCfg,
292 TruthStrategyGroupCaloMSHadIntCfg,
294 truthStrats = [result.popToolsAndMerge(cfg(flags))
for cfg
in truthCfgs]
295 kwargs.setdefault(
"TruthStrategies", truthStrats)
297 kwargs.setdefault(
"ForceEndVtxInRegions",
298 [AtlasRegion.fAtlasID, AtlasRegion.fAtlasCalo, AtlasRegion.fAtlasMS])
299 truthService = result.getPrimaryAndMerge(
301 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)
MSLLPValidationTruthServiceCfg(flags, name="ISF_MSLLPValidationTruthService", **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)