Bug fix in TrigGlobalEfficiencyAlg for running with multiple different object ID/Iso working points
It was reported by @rjoshi that when computing trigger scale factors for multiple different object selections using a combination of Trigger
and TriggerMatching
blocks in the config, a discrepancy is observed when comparing the global trigger SFs of the same object selection (e.g. medium electron) with and without an additional object selection (e.g. tight electron).
An example of the configuration blocks looks like the following:
Trigger:
triggerChainsPerYear:
'2018':
- 'HLT_e26_lhtight_nod0_ivarloose || HLT_e60_lhmedium_nod0 || HLT_e140_lhloose_nod0'
- 'HLT_mu26_ivarmedium || HLT_mu50'
noFilter: True
electrons: 'AnaElectrons.medium'
electronID: 'Tight'
electronIsol: 'Loose_VarRad'
muons: 'AnaMuons.medium'
muonID: 'Medium'
noGlobalTriggerEff: False
postfix: 'medium'
TriggerMatching:
triggerChainsPerYear:
'2018':
- 'HLT_e26_lhtight_nod0_ivarloose || HLT_e60_lhmedium_nod0 || HLT_e140_lhloose_nod0'
- 'HLT_mu26_ivarmedium || HLT_mu50'
noFilter: True
electrons: 'AnaElectrons.tight'
electronID: 'Tight'
electronIsol: 'Tight_VarRad'
muons: 'AnaMuons.tight'
muonID: 'Medium'
noGlobalTriggerEff: False
postfix: 'tight'
The problem was the global trigger scale factors for medium leptons are mostly exactly the same as the ones for tight leptons, and are different than the ones if we run with only one Trigger
block with medium leptons.
The above configuration schedules one TriggerAnalysisBlock
for trigger decisions and two TriggerAnalysisSFBlock
, one for tight leptons and the other for medium leptons. The issue is caused by trigger tool handles (for electron, photon, muon, and global) in TrigGlobalEfficiencyAlg
having the same names in the algorithm for tight leptons and in the one for medium leptons. The trigger tools are initialized with tight lepton WPs at first. But later in the algorithm for medium leptons, because the tool with the same name already exists, AnaToolHandle just reuses the one configured with tight lepton WPs for the medium lepton selection.
Appending lepton ID/iso WP strings to the tool names fixes the bug.