ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleLevelMissingETConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
4
5
6class 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 meta={'role':'container'})
16 # Always skip on data
17 self.setOptionValue('skipOnData', True)
18
19 def instanceName (self) :
20 """Return the instance name for this block"""
21 return self.containerName
22
23 def makeAlgs(self, config):
24 # decorate the energy and phi so we can save them later
25 alg = config.createAlgorithm( 'CP::ParticleLevelMissingETAlg',
26 'ParticleLevelMissingET',
27 reentrant=True )
28 alg.met = self.containerName
29
30 config.setSourceName (self.outputContainerName, self.containerName, isMet=True)
31 if config.wantCopy (self.outputContainerName):
32 alg = config.createAlgorithm( 'CP::AsgShallowCopyAlg', 'TruthMissingETShallowCopyAlg' )
33 alg.input = config.readName (self.outputContainerName)
34 alg.output = config.copyName (self.outputContainerName)
35
36 config.addOutputVar (self.outputContainerName, 'met', 'met', noSys=True, auxType='float')
37 config.addOutputVar (self.outputContainerName, 'phi', 'phi', noSys=True, auxType='float')