1 """ComponentAccumulator HepMC tools configurations for ISF
3 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from ISF_Services.ISF_ServicesCoreConfig
import GeoIDSvcCfg
15 G4NotInUse =
not flags.Sim.UsingGeant4
16 G4NotInUse = G4NotInUse
and flags.Sim.ISFRun
18 kwargs.setdefault(
"CheckGenSimStable", G4NotInUse)
19 kwargs.setdefault(
"CheckGenInteracting", G4NotInUse)
20 result.setPrivateTools(CompFactory.ISF.GenParticleFinalStateFilter(name, **kwargs))
26 kwargs.setdefault(
"UseShadowEvent", flags.Sim.UseShadowEvent)
27 result.setPrivateTools(CompFactory.ISF.GenParticleSimAcceptList(name, **kwargs))
33 result.setPrivateTools(CompFactory.ISF.GenParticleSimQuasiStableFilter(name, **kwargs))
40 acceptLists = [
"G4particle_acceptlist.txt"]
42 from ExtraParticles
import PDGHelpers
46 acceptLists += [
"G4particle_acceptlist_ExtraParticles.txt"]
48 print (
'ERROR Failed to find PDGTABLE.MeV file')
49 kwargs.setdefault(
"AcceptLists" , acceptLists )
50 kwargs.setdefault(
"UseShadowEvent", flags.Sim.UseShadowEvent)
51 result.setPrivateTools(CompFactory.ISF.GenParticleSimAcceptList(name, **kwargs))
58 kwargs.setdefault(
"GeoIDService", result.getPrimaryAndMerge(
GeoIDSvcCfg(flags)).name)
59 result.setPrivateTools(CompFactory.ISF.GenParticlePositionFilter(name, **kwargs))
66 cppyy.load_library(
"libAtlasDetDescrDict")
67 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
69 kwargs.setdefault(
"CheckRegion" , [ AtlasRegion.fAtlasID ] )
76 cppyy.load_library(
"libAtlasDetDescrDict")
77 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
79 kwargs.setdefault(
"CheckRegion" , [ AtlasRegion.fAtlasID,
80 AtlasRegion.fAtlasForward,
81 AtlasRegion.fAtlasCalo ] )
88 cppyy.load_library(
"libAtlasDetDescrDict")
89 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
91 kwargs.setdefault(
"CheckRegion" , [ AtlasRegion.fAtlasID,
92 AtlasRegion.fAtlasForward,
93 AtlasRegion.fAtlasCalo,
94 AtlasRegion.fAtlasMS ] )
101 cppyy.load_library(
"libAtlasDetDescrDict")
102 AtlasRegion = ROOT.AtlasDetDescr.AtlasRegion
103 kwargs.setdefault(
"CheckRegion" , [ AtlasRegion.fAtlasID,
104 AtlasRegion.fAtlasForward,
105 AtlasRegion.fAtlasCalo,
106 AtlasRegion.fAtlasMS,
107 AtlasRegion.fAtlasCavern ] )
114 if flags.Detector.EnableMuon:
116 elif flags.Detector.EnableCalo:
118 elif flags.Detector.EnableID:
126 kwargs.setdefault(
"AdditionalInteractingParticleTypes", eval(flags.Input.SpecialConfiguration.get(
"InteractingPDGCodes",
"[]")))
127 kwargs.setdefault(
"AdditionalNonInteractingParticleTypes", eval(flags.Input.SpecialConfiguration.get(
"NonInteractingPDGCodes",
"[]")))
128 result.setPrivateTools(CompFactory.ISF.GenParticleInteractingFilter(name, **kwargs))
135 EtaRange = 7.0
if flags.Detector.EnableLucid
else 6.0
136 kwargs.setdefault(
"MinEta" , -EtaRange)
137 kwargs.setdefault(
"MaxEta" , EtaRange)
138 kwargs.setdefault(
"MaxApplicableRadius", 30*mm)
140 result.setPrivateTools(CompFactory.ISF.GenParticleGenericFilter(name, **kwargs))
146 genParticleFilterList = []
147 if flags.Sim.ISF.Simulator.isQuasiStable():
151 if "ATLAS" in flags.GeoModel.Layout
or "atlas" in flags.GeoModel.Layout:
152 from AthenaConfiguration.Enums
import BeamType
153 if flags.Beam.Type
not in [BeamType.Cosmics, BeamType.TestBeam]:
155 from SimulationConfig.SimEnums
import CavernBackground
156 if not (flags.Detector.GeometryAFP
or flags.Detector.GeometryALFA
or flags.Detector.GeometryFwdRegion) \
157 and not flags.Detector.GeometryCavern \
158 and flags.Sim.CavernBackground
in [CavernBackground.Off, CavernBackground.Signal]:
159 genParticleFilterList += [result.popToolsAndMerge(
EtaPhiFilterCfg(flags))]
161 result.setPrivateTools(genParticleFilterList)
169 result.setPrivateTools(CompFactory.ISF.TruthPreselectionTool(name, **kwargs))
189 kwargs.setdefault(
"ParentMinPt", 100.*MeV)
190 kwargs.setdefault(
"ChildMinPt" , 300.*MeV)
191 kwargs.setdefault(
"VertexTypes", [3, 14, 15, 4, 5, 6, 7, 2, 12, 13])
192 kwargs.setdefault(
"VertexTypeRangeLow", 201)
193 kwargs.setdefault(
"VertexTypeRangeHigh", 298)
194 kwargs.setdefault(
"Regions", [1,2])
195 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
201 kwargs.setdefault(
"ParentMinPt", 100.*MeV)
202 kwargs.setdefault(
"ChildMinPt" , 300.*MeV)
203 kwargs.setdefault(
"VertexTypes", [111, 121, 131, 141, 151, 161, 210])
204 kwargs.setdefault(
"AllowChildrenOrParentPassKineticCuts",
True)
205 kwargs.setdefault(
"Regions", [1])
206 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
212 kwargs.setdefault(
"ParentMinEkin", 500.*MeV)
213 kwargs.setdefault(
"ChildMinEkin" , 100.*MeV)
214 kwargs.setdefault(
"VertexTypes" , [3])
215 kwargs.setdefault(
"ParentPDGCodes", [13, -13])
216 kwargs.setdefault(
"Regions", [3])
217 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
223 kwargs.setdefault(
"ParentMinEkin", 1000.*MeV)
224 kwargs.setdefault(
"ChildMinEkin" , 500.*MeV)
225 kwargs.setdefault(
"VertexTypes" , [5, 6, 7])
226 kwargs.setdefault(
"VertexTypeRangeLow" , 201)
227 kwargs.setdefault(
"VertexTypeRangeHigh", 298)
228 kwargs.setdefault(
"Regions", [3])
229 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
235 kwargs.setdefault(
"ParentMinPt", 100.*MeV)
236 kwargs.setdefault(
"ChildMinPt" , 100.*MeV)
237 kwargs.setdefault(
"VertexTypes", [3, 14, 15, 4, 5, 6, 7, 2, 12, 13])
238 kwargs.setdefault(
"VertexTypeRangeLow" , 201)
239 kwargs.setdefault(
"VertexTypeRangeHigh" , 298)
240 kwargs.setdefault(
"Regions", [1,2])
241 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
247 kwargs.setdefault(
"ParentMinPt", 100.*MeV)
248 kwargs.setdefault(
"ChildMinPt" , 100.*MeV)
249 kwargs.setdefault(
"VertexTypes", [111, 121, 131, 141, 151, 161, 210])
250 kwargs.setdefault(
"AllowChildrenOrParentPassKineticCuts",
True)
251 kwargs.setdefault(
"Regions", [1])
252 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
258 kwargs.setdefault(
"ParentMinEkin", 500.*MeV)
259 kwargs.setdefault(
"ChildMinEkin" , 300.*MeV)
260 kwargs.setdefault(
"VertexTypes" , [3])
261 kwargs.setdefault(
"ParentPDGCodes", [13, -13])
262 kwargs.setdefault(
"Regions", [3])
263 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
269 kwargs.setdefault(
"ParentMinPt", 1000.*MeV)
270 kwargs.setdefault(
"ChildMinPt" , 500.*MeV)
271 kwargs.setdefault(
"VertexTypes", [5, 6, 7])
272 kwargs.setdefault(
"VertexTypeRangeLow" , 201)
273 kwargs.setdefault(
"VertexTypeRangeHigh", 298)
274 kwargs.setdefault(
"Regions", [3])
275 result.setPrivateTools(CompFactory.ISF.GenericTruthStrategy(name, **kwargs))
280 kwargs.setdefault(
"ParentMinP", 50.*MeV)
281 kwargs.setdefault(
"Regions", [1,2,3,4])
282 result.setPrivateTools(CompFactory.ISF.ValidationTruthStrategy(name, **kwargs))
288 kwargs.setdefault(
"ParentMinP", 150.*MeV)
289 kwargs.setdefault(
"Regions", [3])
290 result.setPrivateTools(CompFactory.ISF.ValidationTruthStrategy(name, **kwargs))
296 kwargs.setdefault(
"PassProcessCodeRangeLow", 200)
297 kwargs.setdefault(
"PassProcessCodeRangeHigh", 299)
300 kwargs.setdefault(
"PassProcessCategory", 9)
301 kwargs.setdefault(
"Regions", [1,2,3,4])
302 result.setPrivateTools(CompFactory.ISF.LLPTruthStrategy(name, **kwargs))
310 kwargs.setdefault(
"PassProcessCategory", 9)
311 kwargs.setdefault(
"VertexTypeRangeLow" , 200)
312 kwargs.setdefault(
"VertexTypeRangeHigh", 299)
313 kwargs.setdefault(
"BSMParent" ,
True)
314 result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
320 kwargs.setdefault(
"VertexTypes", [111, 121, 131, 141, 151, 161, 210])
321 kwargs.setdefault(
"BSMParent" ,
True)
322 result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
330 kwargs.setdefault(
"PassProcessCategory", 9)
331 kwargs.setdefault(
"VertexTypeRangeLow" , 200)
332 kwargs.setdefault(
"VertexTypeRangeHigh", 299)
333 result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))
339 kwargs.setdefault(
"VertexTypes", [111, 121, 131, 141, 151, 161, 210])
340 result.setPrivateTools(CompFactory.ISF.KeepChildrenTruthStrategy(name, **kwargs))