ATLAS Offline Software
Loading...
Searching...
No Matches
PhotonExtraVariablesConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
4
5class PhotonExtraVariablesBlock(ConfigBlock):
6 """a ConfigBlock for additional photon output variables
7
8 Decorates the output photons with the conversion type and calorimeter eta
9 and writes them to the output. Useful e.g. for photon-fake studies."""
10
11 def __init__(self):
12 super(PhotonExtraVariablesBlock, self).__init__()
13 self.addDependency('EventSelection', required=False)
14 self.addDependency('EventSelectionMerger', required=False)
15 self.addOption('containerName', None, type=str, info='the input photon container.',
16 meta={'role':'containerRef'})
17
18 def instanceName (self) :
19 """Return the instance name for this block"""
20 return self.containerName
21
22 def makeAlgs(self, config):
23
24 alg = config.createAlgorithm('CP::PhotonExtraVariablesAlg', 'PhotonExtraVariables')
25 alg.photons = config.readName(self.containerName)
26 alg.affectingSystematicsFilter = '.*'
27
28 config.addOutputVar(self.containerName, 'conversionType_%SYS%', 'conversionType', noSys=True, auxType='int')
29 config.addOutputVar(self.containerName, 'caloEta2_%SYS%', 'caloEta2', noSys=True, auxType='float')