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.
◆ __init__()
def python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock.__init__ |
( |
|
self | ) |
|
Definition at line 11 of file LeptonSFCalculatorConfig.py.
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`.')
◆ 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
31 alg = config.createAlgorithm(
'CP::LeptonSFCalculatorAlg',
32 f
'leptonSFCalculator_{self.lepton_postfix}')
35 electrons, electronSelection = config.readNameAndSelection(self.electrons)
36 alg.electrons = electrons
37 alg.electronSelection = electronSelection
39 alg.electronSFs = self.electronSFs
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%' ]
47 muons, muonSelection = config.readNameAndSelection(self.muons)
49 alg.muonSelection = muonSelection
51 alg.muonSFs = self.muonSFs
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%' ]
59 photons, photonSelection = config.readNameAndSelection(self.photons)
61 alg.photonSelection = photonSelection
63 alg.photonSFs = self.photonSFs
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%' ]
69 alg.event_leptonSF = f
'leptonSF_{self.lepton_postfix}_%SYS%'
71 config.addOutputVar(
'EventInfo', alg.event_leptonSF, f
'weight_leptonSF_{self.lepton_postfix}')
The documentation for this class was generated from the following file: