ATLAS Offline Software
JetJvtAnalysisConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 
4 # AnaAlgorithm import(s):
5 from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
6 from AnalysisAlgorithmsConfig.ConfigAccumulator import DataType
7 
8 
9 class JetJvtAnalysisConfig (ConfigBlock) :
10  """the ConfigBlock for the JVT sequence"""
11 
12  def __init__ (self, containerName='') :
13  super (JetJvtAnalysisConfig, self).__init__ ()
14  self.setBlockName('JVT')
15  self.addDependency('OverlapRemoval', required=False)
16  self.addOption ('containerName', containerName, type=str,
17  noneAction='error',
18  info="the name of the input container.")
19  self.addOption ('postfix', '', type=str,
20  info="a postfix to apply to decorations and algorithm names. Typically "
21  "not needed here.")
22  self.addOption ('enableFJvt', False, type=bool,
23  info="whether to enable forward JVT calculations. The default is False.")
24 
25 
26  def makeAlgs (self, config) :
27 
28  if config.dataType() is DataType.Data: return
29 
30  postfix = self.postfix
31  if postfix != '' and postfix[0] != '_' :
32  postfix = '_' + postfix
33 
34  # Set up the per-event jet efficiency scale factor calculation algorithm
35  alg = config.createAlgorithm( 'CP::AsgEventScaleFactorAlg', 'JvtEventScaleFactorAlg' + postfix )
36  preselection = config.getFullSelection (self.containerName, '')
37  alg.preselection = preselection + '&&no_jvt' if preselection else 'no_jvt'
38  alg.scaleFactorInputDecoration = 'jvt_effSF_%SYS%'
39  alg.scaleFactorOutputDecoration = 'jvt_effSF_%SYS%'
40  alg.particles = config.readName (self.containerName)
41 
42  config.addOutputVar('EventInfo', alg.scaleFactorOutputDecoration, 'weight_jvt_effSF')
43 
44  if self.enableFJvt:
45  alg = config.createAlgorithm( 'CP::AsgEventScaleFactorAlg', 'ForwardJvtEventScaleFactorAlg' )
46  preselection = config.getFullSelection (self.containerName, '')
47  alg.preselection = preselection + '&&no_fjvt' if preselection else 'no_fjvt'
48  alg.scaleFactorInputDecoration = 'fjvt_effSF_%SYS%'
49  alg.scaleFactorOutputDecoration = 'fjvt_effSF_%SYS%'
50  alg.particles = config.readName (self.containerName)
51 
52  config.addOutputVar('EventInfo', alg.scaleFactorOutputDecoration, 'weight_fjvt_effSF')
53 
54 
55 def makeJetJvtAnalysisConfig( seq, containerName,
56  postfix = None,
57  enableFJvt = None ):
58  """Create a jet JVT analysis algorithm config
59 
60  Keyword arguments:
61  enableFJvt -- Whether to enable forward JVT calculations
62  """
63 
64  config = JetJvtAnalysisConfig (containerName)
65  config.setOptionValue ('postfix', postfix)
66  config.setOptionValue ('enableFJvt', enableFJvt)
67 
68  seq.append (config)
python.JetJvtAnalysisConfig.JetJvtAnalysisConfig
Definition: JetJvtAnalysisConfig.py:9
python.JetJvtAnalysisConfig.JetJvtAnalysisConfig.__init__
def __init__(self, containerName='')
Definition: JetJvtAnalysisConfig.py:12
python.JetJvtAnalysisConfig.makeJetJvtAnalysisConfig
def makeJetJvtAnalysisConfig(seq, containerName, postfix=None, enableFJvt=None)
Definition: JetJvtAnalysisConfig.py:55
python.JetJvtAnalysisConfig.JetJvtAnalysisConfig.makeAlgs
def makeAlgs(self, config)
Definition: JetJvtAnalysisConfig.py:26