ATLAS Offline Software
ISF_ToolsConfig.py
Go to the documentation of this file.
1 """ComponentAccumulator tool configuration for ISF
2 
3 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from AthenaCommon.SystemOfUnits import MeV
8 
9 
10 def ParticleHelperCfg(flags, name="ISF_ParticleHelper", **kwargs):
12  acc.setPrivateTools(CompFactory.ISF.ParticleHelper(name, **kwargs))
13  return acc
14 
15 
16 def MemoryMonitorToolCfg(flags, name="ISF_MemoryMonitor", **kwargs):
17  acc = ComponentAccumulator()
18  acc.setPrivateTools(CompFactory.ISF.MemoryMonitoringTool(name, **kwargs))
19  return acc
20 
21 
22 def EntryLayerFilterCfg(flags, **kwargs):
23  """Return the MCxEntryLayerFilterCfg config flagged by Sim.TruthStrategy"""
24  from SimulationConfig.SimEnums import TruthStrategy
25  stratmap = {
26  TruthStrategy.MC12: MC12EntryLayerFilterCfg,
27  TruthStrategy.MC12LLP: MC12LLPEntryLayerFilterCfg,
28  TruthStrategy.MC12Plus: MC12PlusEntryLayerFilterCfg,
29  TruthStrategy.MC15: MC15EntryLayerFilterCfg,
30  TruthStrategy.MC15a: MC15aEntryLayerFilterCfg,
31  TruthStrategy.MC15aPlus: MC15aPlusEntryLayerFilterCfg,
32  TruthStrategy.MC15aPlusLLP: MC15aPlusLLPEntryLayerFilterCfg,
33  TruthStrategy.MC16: MC16EntryLayerFilterCfg,
34  TruthStrategy.MC16LLP: MC16LLPEntryLayerFilterCfg,
35  TruthStrategy.MC18: MC18EntryLayerFilterCfg,
36  TruthStrategy.MC18LLP: MC18LLPEntryLayerFilterCfg,
37  TruthStrategy.Validation: ValidationEntryLayerFilterCfg,
38  # TruthStrategy.PhysicsProcess: PhysicsProcessTruthServiceCfg,
39  # TruthStrategy.Global: GlobalTruthServiceCfg,
40  TruthStrategy.Cosmic: CosmicEventFilterToolCfg,
41  }
42  MCxCfg = stratmap[flags.Sim.TruthStrategy]
43  return MCxCfg(flags, **kwargs)
44 
45 
46 def MC12EntryLayerFilterCfg(flags, name="ISF_MC12EntryLayerFilter", **kwargs):
47  acc = ComponentAccumulator()
48  acc.setPrivateTools(CompFactory.ISF.EntryLayerFilter(name, **kwargs))
49  return acc
50 
51 
52 def MC12LLPEntryLayerFilterCfg(flags, name="ISF_MC12LLPEntryLayerFilter", **kwargs):
53  return MC12EntryLayerFilterCfg(flags, name, **kwargs)
54 
55 
56 def MC12PlusEntryLayerFilterCfg(flags, name="ISF_MC12PlusEntryLayerFilter", **kwargs):
57  return MC12EntryLayerFilterCfg(flags, name, **kwargs)
58 
59 
60 def MC15EntryLayerFilterCfg(flags, name="ISF_MC15EntryLayerFilter", **kwargs):
61  acc = ComponentAccumulator()
62  kwargs.setdefault("MinEkinCharged", 100.*MeV)
63  kwargs.setdefault("MinEkinNeutral", -1.)
64  acc.setPrivateTools(CompFactory.ISF.EntryLayerFilter(name, **kwargs))
65  return acc
66 
67 
68 def MC15aEntryLayerFilterCfg(flags, name="ISF_MC15aEntryLayerFilter", **kwargs):
69  return MC15EntryLayerFilterCfg(flags, name, **kwargs)
70 
71 
72 def MC15aPlusEntryLayerFilterCfg(flags, name="ISF_MC15aPlusEntryLayerFilter", **kwargs):
73  return MC15EntryLayerFilterCfg(flags, name, **kwargs)
74 
75 
76 def MC15aPlusLLPEntryLayerFilterCfg(flags, name="ISF_MC15aPlusLLPEntryLayerFilter", **kwargs):
77  return MC15aPlusEntryLayerFilterCfg(flags, name, **kwargs)
78 
79 
80 def MC16EntryLayerFilterCfg(flags, name="ISF_MC16EntryLayerFilter", **kwargs):
81  return MC15aPlusEntryLayerFilterCfg(flags, name, **kwargs)
82 
83 
84 def MC16LLPEntryLayerFilterCfg(flags, name="ISF_MC16LLPEntryLayerFilter", **kwargs):
85  return MC15aPlusLLPEntryLayerFilterCfg(flags, name, **kwargs)
86 
87 
88 def MC18EntryLayerFilterCfg(flags, name="ISF_MC18EntryLayerFilter", **kwargs):
89  return MC15aPlusEntryLayerFilterCfg(flags, name, **kwargs)
90 
91 
92 def MC18LLPEntryLayerFilterCfg(flags, name="ISF_MC18LLPEntryLayerFilter", **kwargs):
93  return MC15aPlusLLPEntryLayerFilterCfg(flags, name, **kwargs)
94 
95 
96 def ValidationEntryLayerFilterCfg(flags, name="ISF_ValidationEntryLayerFilter", **kwargs):
97  return MC12EntryLayerFilterCfg(flags, name, **kwargs)
98 
99 
100 def CosmicEventFilterToolCfg(flags, name="ISF_CosmicEventFilter", **kwargs):
101  from G4CosmicFilter.G4CosmicFilterConfig import configCosmicFilterVolumeNames
102  acc = ComponentAccumulator()
103  volumeNames = configCosmicFilterVolumeNames(flags)
104  kwargs.setdefault("UseAndFilter", len(volumeNames)<3 )
105  kwargs.setdefault("VolumeNames", volumeNames)
106  if flags.Sim.CosmicFilterID:
107  kwargs.setdefault("PDG_ID", flags.Sim.CosmicFilterID)
108  if flags.Sim.CosmicFilterPTmin:
109  kwargs.setdefault("ptMin", flags.Sim.CosmicFilterPTmin)
110  if flags.Sim.CosmicFilterPTmax:
111  kwargs.setdefault("ptMax", flags.Sim.CosmicFilterPTmax)
112  acc.setPrivateTools(CompFactory.ISF.CosmicEventFilterTool(name, **kwargs))
113  return acc
114 
115 
116 def StoppedParticleFilterToolCfg(flags, name="ISF_StoppedParticleFilter", **kwargs):
117  kwargs.setdefault("VolumeNames", ["StoppingPositions"])
118  acc = ComponentAccumulator()
119  acc.setPrivateTools(CompFactory.ISF.CosmicEventFilterTool(name, **kwargs))
120  return acc
121 
122 
123 def InToOutSubDetOrderingToolCfg(flags, name="ISF_InToOutSubDetOrderingTool", **kwargs):
124  # higher ordered particles will be simulated first
125  kwargs.setdefault("OrderID" , 100000000)
126  kwargs.setdefault("OrderBeamPipe", 1000000 )
127  kwargs.setdefault("OrderCalo" , 10000 )
128  kwargs.setdefault("OrderMS" , 100 )
129  kwargs.setdefault("OrderCavern" , 1 )
130  acc = ComponentAccumulator()
131  acc.setPrivateTools(CompFactory.ISF.GenericParticleOrderingTool(name, **kwargs))
132  return acc
133 
134 
135 def ParticleOrderingToolCfg(flags, name="ISF_ParticleOrderingTool", **kwargs):
136  kwargs.setdefault("OrderID" , 1)
137  kwargs.setdefault("OrderBeamPipe", 1)
138  kwargs.setdefault("OrderCalo" , 1)
139  kwargs.setdefault("OrderMS" , 1)
140  kwargs.setdefault("OrderCavern" , 1)
141  acc = ComponentAccumulator()
142  acc.setPrivateTools(CompFactory.ISF.GenericParticleOrderingTool(name, **kwargs))
143  return acc
144 
145 
146 def EnergyParticleOrderingToolCfg(flags, name="ISF_EnergyParticleOrderingTool", **kwargs):
147  acc = ComponentAccumulator()
148  acc.setPrivateTools(CompFactory.ISF.EnergyParticleOrderingTool(name, **kwargs))
149  return acc
150 
151 
152 def ParticleKillerToolCfg(flags, name="ISF_ParticleKillerTool", **kwargs):
153  acc = ComponentAccumulator()
154  acc.setPrivateTools(CompFactory.ISF.ParticleKillerSimTool(name, **kwargs))
155  return acc
ISF_ToolsConfig.MC15aEntryLayerFilterCfg
def MC15aEntryLayerFilterCfg(flags, name="ISF_MC15aEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:68
SystemOfUnits
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ISF_ToolsConfig.MC18EntryLayerFilterCfg
def MC18EntryLayerFilterCfg(flags, name="ISF_MC18EntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:88
ISF_ToolsConfig.MC12PlusEntryLayerFilterCfg
def MC12PlusEntryLayerFilterCfg(flags, name="ISF_MC12PlusEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:56
ISF_ToolsConfig.MC16LLPEntryLayerFilterCfg
def MC16LLPEntryLayerFilterCfg(flags, name="ISF_MC16LLPEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:84
ISF_ToolsConfig.StoppedParticleFilterToolCfg
def StoppedParticleFilterToolCfg(flags, name="ISF_StoppedParticleFilter", **kwargs)
Definition: ISF_ToolsConfig.py:116
ISF_ToolsConfig.MC18LLPEntryLayerFilterCfg
def MC18LLPEntryLayerFilterCfg(flags, name="ISF_MC18LLPEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:92
ISF_ToolsConfig.MC16EntryLayerFilterCfg
def MC16EntryLayerFilterCfg(flags, name="ISF_MC16EntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:80
ISF_ToolsConfig.EnergyParticleOrderingToolCfg
def EnergyParticleOrderingToolCfg(flags, name="ISF_EnergyParticleOrderingTool", **kwargs)
Definition: ISF_ToolsConfig.py:146
ISF_ToolsConfig.MC15EntryLayerFilterCfg
def MC15EntryLayerFilterCfg(flags, name="ISF_MC15EntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:60
ISF_ToolsConfig.ParticleKillerToolCfg
def ParticleKillerToolCfg(flags, name="ISF_ParticleKillerTool", **kwargs)
Definition: ISF_ToolsConfig.py:152
ISF_ToolsConfig.MC15aPlusLLPEntryLayerFilterCfg
def MC15aPlusLLPEntryLayerFilterCfg(flags, name="ISF_MC15aPlusLLPEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:76
ISF_ToolsConfig.MC12LLPEntryLayerFilterCfg
def MC12LLPEntryLayerFilterCfg(flags, name="ISF_MC12LLPEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:52
ISF_ToolsConfig.InToOutSubDetOrderingToolCfg
def InToOutSubDetOrderingToolCfg(flags, name="ISF_InToOutSubDetOrderingTool", **kwargs)
Definition: ISF_ToolsConfig.py:123
ISF_ToolsConfig.ParticleOrderingToolCfg
def ParticleOrderingToolCfg(flags, name="ISF_ParticleOrderingTool", **kwargs)
Definition: ISF_ToolsConfig.py:135
ISF_ToolsConfig.CosmicEventFilterToolCfg
def CosmicEventFilterToolCfg(flags, name="ISF_CosmicEventFilter", **kwargs)
Definition: ISF_ToolsConfig.py:100
ISF_ToolsConfig.MemoryMonitorToolCfg
def MemoryMonitorToolCfg(flags, name="ISF_MemoryMonitor", **kwargs)
Definition: ISF_ToolsConfig.py:16
ISF_ToolsConfig.ValidationEntryLayerFilterCfg
def ValidationEntryLayerFilterCfg(flags, name="ISF_ValidationEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:96
G4CosmicFilterConfig.configCosmicFilterVolumeNames
def configCosmicFilterVolumeNames(flags)
Definition: G4CosmicFilterConfig.py:6
ISF_ToolsConfig.MC12EntryLayerFilterCfg
def MC12EntryLayerFilterCfg(flags, name="ISF_MC12EntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:46
ISF_ToolsConfig.MC15aPlusEntryLayerFilterCfg
def MC15aPlusEntryLayerFilterCfg(flags, name="ISF_MC15aPlusEntryLayerFilter", **kwargs)
Definition: ISF_ToolsConfig.py:72
ISF_ToolsConfig.EntryLayerFilterCfg
def EntryLayerFilterCfg(flags, **kwargs)
Definition: ISF_ToolsConfig.py:22