Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ParticleLevelOverlapRemovalConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
4 
5 
7  """ConfigBlock for particle-level truth taus"""
8 
9  def __init__(self):
10  super(ParticleLevelOverlapRemovalBlock, self).__init__()
11  self.addOption('jets', '', type=str,
12  info ='the name of the input truth jets container, in the format "container" or "container.selection".')
13  self.addOption('electrons', '', type=str,
14  info='the name of the input truth electrons container, in the format "container" or "container.selection".')
15  self.addOption('muons', '', type=str,
16  info='the name of the input truth muons container, in the format "container" or "container.selection".')
17  self.addOption('photons', '', type=str,
18  info='the name of the input truth photons container, in the format "container" or "container.selection".')
19  self.addOption('label', 'passesOR', type=str,
20  info='the name of the decoration to apply to all particles passing OR')
21  self.addOption('useDressedProperties', True, type=bool,
22  info='whether to use dressed electron and muon kinematics rather than simple P4 kinematics')
23  self.addOption('useRapidityForDeltaR', True, type=bool,
24  info='whether to use rapidity instead of pseudo-rapidity for the calculation of DeltaR')
25  # Always skip on data
26  self.setOptionValue('skipOnData', True)
27 
28  def makeAlgs(self, config):
29  alg = config.createAlgorithm('CP::ParticleLevelOverlapRemovalAlg',
30  'ParticleLevelOverlapRemoval',
31  reentrant=True)
32  alg.useDressedProperties = self.useDressedProperties
33  alg.useRapidityForDeltaR = self.useRapidityForDeltaR
34  alg.labelOR = self.label
35  if self.electrons:
36  alg.electrons, alg.electronSelection = config.readNameAndSelection (self.electrons)
37  alg.doJetElectronOR = True
38  config.addSelection (self.electrons, '', alg.labelOR + ',as_char')
39  if self.muons:
40  alg.muons, alg.muonSelection = config.readNameAndSelection (self.muons)
41  alg.doJetMuonOR = True
42  config.addSelection (self.muons, '', alg.labelOR + ',as_char')
43  if self.photons:
44  alg.photons, alg.photonSelection = config.readNameAndSelection (self.photons)
45  alg.doJetPhotonOR = True
46  config.addSelection (self.photons, '', alg.labelOR + ',as_char')
47  if self.jets:
48  alg.jets, alg.jetSelection = config.readNameAndSelection (self.jets)
49  config.addSelection (self.jets, '', alg.labelOR + ',as_char')
50  else:
51  raise ValueError('Particle-level overlap removal needs the jet container to be run!')
ParticleLevelOverlapRemovalConfig.ParticleLevelOverlapRemovalBlock
Definition: ParticleLevelOverlapRemovalConfig.py:6
ParticleLevelOverlapRemovalConfig.ParticleLevelOverlapRemovalBlock.makeAlgs
def makeAlgs(self, config)
Definition: ParticleLevelOverlapRemovalConfig.py:28
ParticleLevelOverlapRemovalConfig.ParticleLevelOverlapRemovalBlock.__init__
def __init__(self)
Definition: ParticleLevelOverlapRemovalConfig.py:9