ATLAS Offline Software
FakeBkgConfig.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 class FakeBkgBlock(ConfigBlock):
6  """ConfigBlock for the FakeBkgTools Calculator algorithm
7 
8  The source code and documentation for FakeBkgTools are available
9  from https://gitlab.cern.ch/atlas/athena/-/tree/main/PhysicsAnalysis/AnalysisCommon/FakeBkgTools
10  """
11 
12  def __init__(self):
13  super(FakeBkgBlock, self).__init__()
14  self.addOption('setupName', '', type=str,
15  info='custom name for this instance of the algorithm and tool')
16  self.addOption('electrons', None, type=str,
17  info='the input electron container, with a possible selection, in the format `container` or `container.selection`.')
18  self.addOption('electronsTarget', None, type=str,
19  info='the input electron tight selection in the format `selection`.')
20  self.addOption('muons', None, type=str,
21  info='the input muon container, with a possible selection, in the format `container` or `container.selection`.')
22  self.addOption('muonsTarget', None, type=str,
23  info='the input muon tight selection in the format `selection`.')
24  self.addOption('eventPreselection', '', type=str,
25  info='the event selection flag to estimate the fake background.')
26  self.addOption('fakeTool', '', type=str,
27  info='the tool for fake lepton estimate among the different [FakeBkgTools](https://gitlab.cern.ch/atlas/athena/-/tree/main/PhysicsAnalysis/AnalysisCommon/FakeBkgTools). The currently available one is `CP::AsymptMatrixTool`.')
28  self.addOption('config', '', type=str,
29  info='the input to the tool (ROOT or XML file). Some test files (deprecated and computed in Release 21) can be found in `dev/AnalysisTop/FakeBkgToolsData/`.')
30  self.addOption('process', '', type=str,
31  info='this argument allows one to set what kind of processes, in terms of number of real and fake/non-prompt leptons in the final state, are estimated by the fake lepton background yields or weights computed by the tools. More details [here](https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/AnalysisCommon/FakeBkgTools/doc/arg_process.md).')
32  self.addOption('definition', '', type=str,
33  info='this argument allows the user to specify the definition of the region of interest, in terms of how many (tight) leptons are selected, and how extra leptons are treated (vetoed or not). This must describe the way events are selected in the main analysis. More details [here](https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/AnalysisCommon/FakeBkgTools/doc/arg_selection.md).')
34 
35  def makeAlgs(self, config):
36 
37  alg = config.createAlgorithm('CP::FakeBkgCalculatorAlg', 'FakeBkgCalculatorAlg_' + self.setupName)
38 
39  alg.electrons, alg.electronSelection = config.readNameAndSelection(self.electrons)
40  alg.electronSelectionTarget = config.getFullSelection(self.electrons.split(".")[0], self.electronsTarget)
41  alg.muons, alg.muonSelection = config.readNameAndSelection(self.muons)
42  alg.muonSelectionTarget = config.getFullSelection(self.muons.split(".")[0], self.muonsTarget)
43 
44  alg.eventPreselection = self.eventPreselection
45  alg.Process = self.process
46  alg.Definition = self.definition
47 
48  config.addPrivateTool('FakeTool', self.fakeTool)
49  alg.FakeTool.InputFiles = [self.config]
50  alg.FakeTool.Process = self.process
51  alg.FakeTool.Selection = self.definition
52  alg.FakeTool.EnergyUnit = 'GeV'
53  alg.FakeTool.ConvertWhenMissing = True
54  alg.FakeTool.TightDecoration = 'TightForFakeBkgCalculation,as_char'
55 
56  alg.FakeToolOutput = 'FakeToolOutput_' + self.setupName + '_%SYS%'
57  config.addOutputVar('EventInfo', alg.FakeToolOutput, 'weight_fake_' + self.setupName, noSys=True)
python.FakeBkgConfig.FakeBkgBlock.makeAlgs
def makeAlgs(self, config)
Definition: FakeBkgConfig.py:35
python.FakeBkgConfig.FakeBkgBlock
Definition: FakeBkgConfig.py:5
python.FakeBkgConfig.FakeBkgBlock.__init__
def __init__(self)
Definition: FakeBkgConfig.py:12
Trk::split
@ split
Definition: LayerMaterialProperties.h:38