ConfigBlock for the common electron-muon-photon-tau 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, also ECIDS (charge ID) if available.')
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(
'taus',
None, type=str,
26 info=
'the input tau container, with a possible selection, in the format `container` or `container.selection`.')
27 self.addOption(
'tauSFs',
None, type=list,
28 info=
'list of decorated tau SFs to use in the computation. If not set, will use reconstruction x ID x eVeto.')
29 self.addOption(
'lepton_postfix',
None, type=str,
30 info=
'the name of the common lepton SF, e.g. `tight`.')
31 self.addOption(
'includeElectronChargeMisID',
False, type=str,
32 info=
'whether to include the electron charge mis-ID SFs in the computation. The user is responsible for determining whether these are available.')
33 self.addOption(
'includeMuonBadVeto',
False, type=str,
34 info=
'whether to include the muon bad veto SFs in the computation. The user is responsible for determining whether these are available.')
◆ instanceName()
| def python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock.instanceName |
( |
|
self | ) |
|
Return the instance name for this block
Definition at line 36 of file LeptonSFCalculatorConfig.py.
36 def instanceName (self) :
37 """Return the instance name for this block"""
38 return self.lepton_postfix
◆ makeAlgs()
| def python.LeptonSFCalculatorConfig.LeptonSFCalculatorBlock.makeAlgs |
( |
|
self, |
|
|
|
config |
|
) |
| |
Definition at line 40 of file LeptonSFCalculatorConfig.py.
40 def makeAlgs(self, config):
41 if config.dataType()
is DataType.Data:
return
43 alg = config.createAlgorithm(
'CP::LeptonSFCalculatorAlg',
47 electrons, electronSelection = config.readNameAndSelection(self.electrons)
48 alg.electrons = electrons
49 alg.electronSelection = electronSelection
51 alg.electronSFs = self.electronSFs
53 alg.electronSFs = [ f
'el_reco_effSF_{self.electrons.split(".")[1]}_%SYS%',
54 f
'el_id_effSF_{self.electrons.split(".")[1]}_%SYS%' ]
55 if 'isolated' in alg.electronSelection:
56 alg.electronSFs += [ f
'el_isol_effSF_{self.electrons.split(".")[1]}_%SYS%' ]
57 if 'chargeID' in alg.electronSelection:
58 alg.electronSFs += [ f
'el_ecids_effSF_{self.electrons.split(".")[1]}_%SYS%' ]
59 if self.includeElectronChargeMisID:
60 alg.electronSFs += [ f
'el_charge_misid_effSF_{self.electrons.split(".")[1]}_%SYS%' ]
63 muons, muonSelection = config.readNameAndSelection(self.muons)
65 alg.muonSelection = muonSelection
67 alg.muonSFs = self.muonSFs
69 alg.muonSFs = [ f
'muon_reco_effSF_{self.muons.split(".")[1]}_%SYS%']
70 if 'trackSelection' in alg.muonSelection:
71 alg.muonSFs += [ f
'muon_TTVA_effSF_{self.muons.split(".")[1]}_%SYS%' ]
72 if 'isolated' in alg.muonSelection:
73 alg.muonSFs += [ f
'muon_isol_effSF_{self.muons.split(".")[1]}_%SYS%' ]
74 if self.includeMuonBadVeto:
75 alg.muonSFs += [ f
'muon_BadMuonVeto_effSF_{self.muons.split(".")[1]}_%SYS%' ]
78 photons, photonSelection = config.readNameAndSelection(self.photons)
80 alg.photonSelection = photonSelection
82 alg.photonSFs = self.photonSFs
84 alg.photonSFs = [ f
'ph_id_effSF_{self.photons.split(".")[1]}_%SYS%' ]
85 if 'isolated' in alg.photonSelection:
86 alg.photonSFs += [ f
'ph_isol_effSF_{self.photons.split(".")[1]}_%SYS%' ]
89 taus, tauSelection = config.readNameAndSelection(self.taus)
91 alg.tauSelection = tauSelection
93 alg.tauSFs = self.tauSFs
95 alg.tauSFs = [ f
'tau_Reco_effSF_{self.taus.split(".")[1]}_%SYS%',
96 f
'tau_ID_effSF_{self.taus.split(".")[1]}_%SYS%']
97 if 'eVeto' in alg.tauSelection:
98 alg.tauSFs += [ f
'tau_EvetoFakeTau_effSF_{self.taus.split(".")[1]}_%SYS%',
99 f
'tau_EvetoTrueTau_effSF_{self.taus.split(".")[1]}_%SYS%']
101 alg.event_leptonSF = f
'leptonSF_{self.lepton_postfix}_%SYS%'
103 config.addOutputVar(
'EventInfo', alg.event_leptonSF, f
'weight_leptonSF_{self.lepton_postfix}')
The documentation for this class was generated from the following file: