ATLAS Offline Software
BJetCalibAnalysisConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 # AnaAlgorithm import(s):
4 from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
5 import AthenaCommon.SystemOfUnits as Units
6 
7 
8 class BJetCalibAnalysisConfig (ConfigBlock) :
9  """the ConfigBlock for the b-jet calibration sequence"""
10 
11  def __init__ (self, containerName='', muonContainerName='') :
12  super (BJetCalibAnalysisConfig, self).__init__ ()
13  self.setBlockName('BJetCalib')
14  self.addDependency('FTag', required=False)
15  self.addDependency('Muons', required=True)
16  self.addDependency('MuonsWorkingPoint', required=False)
17  self.addOption ('containerName', containerName, type=str,
18  noneAction='error',
19  info="the name of the input jet container.")
20  self.addOption ('muonContainerName', muonContainerName, type=str,
21  noneAction='error',
22  info="the name of the input muon container.")
23  self.addOption ('jetPreselection', "", type=str,
24  info="the jet preselection")
25  self.addOption ('muonPreselection', "", type=str,
26  info="the muon preselection")
27  self.addOption ('doPtCorr', True, type=bool,
28  info="whether to run the b-jet pT correction on top of the muon-in-jet one")
29 
30  def makeAlgs(self, config):
31 
32  # Set up kinematic selection for which ftag selection should be used downstream
33  jetPreselection = config.getFullSelection(self.containerName, self.jetPreselection)
34  if jetPreselection:
35  alg = config.createAlgorithm('CP::AsgSelectionAlg',
36  'FtagPTEtaCutAlg' + self.containerName)
37  alg.selectionDecoration = 'selectPtEtaFtag'
38  config.addPrivateTool('selectionTool', 'CP::AsgPtEtaSelectionTool')
39  alg.selectionTool.maxEta = 2.5
40  alg.selectionTool.minPt = 20. * Units.GeV
41  alg.particles = config.readName(self.containerName)
42  alg.preselection = config.getPreselection(self.containerName, '')
43  jetPreselection = "selectPtEtaFtag&&"+jetPreselection
44 
45  alg = config.createAlgorithm('CP::BJetCalibrationAlg',
46  'BJetCalibAlg_' + self.containerName)
47  alg.muons = config.readName(self.muonContainerName)
48  alg.muonPreselection = config.getPreselection(self.muonContainerName,
49  self.muonPreselection)
50  alg.jets = config.readName(self.containerName)
51  alg.jetPreselection = jetPreselection
52  alg.jetsOut = config.copyName(self.containerName)
53 
54  config.addPrivateTool('muonInJetTool', 'MuonInJetCorrectionTool')
55  # Adjust dR matching for large-R jets
56  if "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets" in alg.jets:
57  alg.muonInJetTool.doLargeR = True
58 
59  if self.doPtCorr:
60  config.addPrivateTool('bJetTool', 'BJetCorrectionTool')
61 
62  # (re-)decorate jets with the updated energy
63  alg = config.createAlgorithm( 'CP::AsgEnergyDecoratorAlg', 'EnergyDecoratorBJetCalib' + self.containerName )
64  alg.particles = config.readName (self.containerName)
SystemOfUnits
python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.makeAlgs
def makeAlgs(self, config)
Definition: BJetCalibAnalysisConfig.py:30
python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig.__init__
def __init__(self, containerName='', muonContainerName='')
Definition: BJetCalibAnalysisConfig.py:11
python.BJetCalibAnalysisConfig.BJetCalibAnalysisConfig
Definition: BJetCalibAnalysisConfig.py:8