ATLAS Offline Software
ParticleLevelMissingETConfig.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 
6 class ParticleLevelMissingETBlock(ConfigBlock):
7  """ConfigBlock for particle-level truth missing transverse energy"""
8 
9  def __init__(self):
10  super(ParticleLevelMissingETBlock, self).__init__()
11  self.addOption('containerName', 'MET_Truth', type=str,
12  info='the name of the input truth MET container')
13  self.addOption('outputContainerName', 'TruthMET', type=str,
14  info='the name of the output MET container')
15  # Always skip on data
16  self.setOptionValue('skipOnData', True)
17 
18  def instanceName (self) :
19  """Return the instance name for this block"""
20  return self.containerName
21 
22  def makeAlgs(self, config):
23  # decorate the energy and phi so we can save them later
24  alg = config.createAlgorithm( 'CP::ParticleLevelMissingETAlg',
25  'ParticleLevelMissingET',
26  reentrant=True )
27  alg.met = self.containerName
28 
29  config.setSourceName (self.outputContainerName, self.containerName, isMet=True)
30  if config.wantCopy (self.outputContainerName):
31  alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'TruthMissingETShallowCopyAlg' )
32  alg.input = config.readName (self.outputContainerName)
33  alg.output = config.copyName (self.outputContainerName)
34 
35  config.addOutputVar (self.outputContainerName, 'met', 'met', noSys=True)
36  config.addOutputVar (self.outputContainerName, 'phi', 'phi', noSys=True)
ParticleLevelMissingETConfig.ParticleLevelMissingETBlock
Definition: ParticleLevelMissingETConfig.py:6
ParticleLevelMissingETConfig.ParticleLevelMissingETBlock.__init__
def __init__(self)
Definition: ParticleLevelMissingETConfig.py:9
ParticleLevelMissingETConfig.ParticleLevelMissingETBlock.instanceName
def instanceName(self)
Definition: ParticleLevelMissingETConfig.py:18
ParticleLevelMissingETConfig.ParticleLevelMissingETBlock.makeAlgs
def makeAlgs(self, config)
Definition: ParticleLevelMissingETConfig.py:22