ATLAS Offline Software
Public Member Functions | List of all members
python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock Class Reference
Inheritance diagram for python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock:
Collaboration diagram for python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock:

Public Member Functions

def __init__ (self)
 
def makeAlgs (self, config)
 

Detailed Description

ConfigBlock for the common electron-muon-photon SF calculator
--> combine all the per-object SFs into a single per-event SF

Definition at line 7 of file LeptonSFCalculatorConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock.__init__ (   self)

Definition at line 11 of file LeptonSFCalculatorConfig.py.

11  def __init__(self):
12  super(LeptonSFCalculatorBlock, self).__init__()
13  self.addOption('electrons', None, type=str,
14  info='the input electron container, with a possible selection, in the format `container` or `container.selection`.')
15  self.addOption('electronSFs', None, type=list,
16  info='list of decorated electron SFs to use in the computation. If not set, will use reconstruction x ID x isolation.')
17  self.addOption('muons', None, type=str,
18  info='the input muon container, with a possible selection, in the format `container` or `container.selection`.')
19  self.addOption('muonSFs', None, type=list,
20  info='list of decorated muon SFs to use in the computation. If not set, will use reconstruction x isolation x TTVA.')
21  self.addOption('photons', None, type=str,
22  info='the input photon container, with a possible selection, in the format `container` or `container.selection`.')
23  self.addOption('photonSFs', None, type=list,
24  info='list of decorated photon SFs to use in the computation. If not set, will use ID x isolation.')
25  self.addOption('lepton_postfix', None, type=str,
26  info='the name of the common lepton SF, e.g. `tight`.')
27 

Member Function Documentation

◆ makeAlgs()

def python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock.makeAlgs (   self,
  config 
)

Definition at line 28 of file LeptonSFCalculatorConfig.py.

28  def makeAlgs(self, config):
29  if config.dataType() is DataType.Data: return
30 
31  alg = config.createAlgorithm('CP::LeptonSFCalculatorAlg',
32  f'leptonSFCalculator_{self.lepton_postfix}')
33 
34  if self.electrons:
35  electrons, electronSelection = config.readNameAndSelection(self.electrons)
36  alg.electrons = electrons
37  alg.electronSelection = electronSelection
38  if self.electronSFs:
39  alg.electronSFs = self.electronSFs
40  else:
41  alg.electronSFs = [ f'el_reco_effSF_{self.electrons.split(".")[1]}_%SYS%',
42  f'el_id_effSF_{self.electrons.split(".")[1]}_%SYS%' ]
43  if 'isolated' in alg.electronSelection:
44  alg.electronSFs += [ f'el_isol_effSF_{self.electrons.split(".")[1]}_%SYS%' ]
45 
46  if self.muons:
47  muons, muonSelection = config.readNameAndSelection(self.muons)
48  alg.muons = muons
49  alg.muonSelection = muonSelection
50  if self.muonSFs:
51  alg.muonSFs = self.muonSFs
52  else:
53  alg.muonSFs = [ f'muon_reco_effSF_{self.muons.split(".")[1]}_%SYS%',
54  f'muon_TTVA_effSF_{self.muons.split(".")[1]}_%SYS%' ]
55  if 'isolated' in alg.muonSelection:
56  alg.muonSFs += [ f'muon_isol_effSF_{self.muons.split(".")[1]}_%SYS%' ]
57 
58  if self.photons:
59  photons, photonSelection = config.readNameAndSelection(self.photons)
60  alg.photons = photons
61  alg.photonSelection = photonSelection
62  if self.photonSFs:
63  alg.photonSFs = self.photonSFs
64  else:
65  alg.photonSFs = [ f'ph_id_effSF_{self.photons.split(".")[1]}_%SYS%' ]
66  if 'isolated' in alg.photonSelection:
67  alg.photonSFs += [ f'ph_isol_effSF_{self.photons.split(".")[1]}_%SYS%' ]
68 
69  alg.event_leptonSF = f'leptonSF_{self.lepton_postfix}_%SYS%'
70 
71  config.addOutputVar('EventInfo', alg.event_leptonSF, f'weight_leptonSF_{self.lepton_postfix}')

The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18