397 def makeAlgs (self, config) :
399 if config.dataType()
is not DataType.Data:
406 if config.campaign()
is Campaign.MC20a:
407 years = [
'2015',
'2016']
408 elif config.campaign()
is Campaign.MC20d:
410 elif config.campaign()
is Campaign.MC20e:
412 elif config.campaign()
in [Campaign.MC21a, Campaign.MC23a]:
414 elif config.campaign()
in [Campaign.MC23c, Campaign.MC23d]:
418 triggerConfigYears = {}
420 triggerChains = self.triggerChainsPerYear.
get(year,[])
421 for chain
in triggerChains:
422 chain = chain.replace(
" || ",
"_OR_")
423 chain_noHLT = chain.replace(
"HLT_",
"")
424 legs = triggerDict[chain_noHLT]
426 if chain_noHLT.startswith(
'mu')
and chain_noHLT[2].isdigit:
428 triggerConfigs[chain_noHLT] = chain
429 if chain_noHLT
in triggerConfigYears.keys():
430 triggerConfigYears[chain_noHLT].
append(year)
432 triggerConfigYears[chain_noHLT] = [year]
435 if leg.startswith(
'mu')
and leg[2].isdigit:
437 triggerConfigs[leg] =
'HLT_' + leg
438 if chain_noHLT
in triggerConfigYears.keys():
439 triggerConfigYears[leg].
append(year)
441 triggerConfigYears[leg] = [year]
443 for trig_short, trig
in triggerConfigs.items():
444 alg = config.createAlgorithm(
'CP::MuonTriggerEfficiencyScaleFactorAlg',
445 'MuonTrigEfficiencyCorrectionsAlg_' + trig_short)
446 config.addPrivateTool(
'efficiencyScaleFactorTool',
447 'CP::MuonTriggerScaleFactors' )
450 alg.efficiencyScaleFactorTool.MuonQuality = self.muonID
451 alg.efficiencyScaleFactorTool.AllowZeroSF =
True
454 if config.campaign()
is Campaign.MC20a:
455 if triggerConfigYears[trig_short] == [
'2015']:
456 alg.maxRunNumber = 290000
457 elif triggerConfigYears[trig_short] == [
'2016']:
458 alg.minRunNumber = 290000
461 alg.scaleFactorDecoration =
'muon_trigEffSF_' + trig_short +
'_%SYS%'
463 alg.mcEfficiencyDecoration =
'muon_trigEff_' + trig_short +
'_%SYS%'
464 alg.outOfValidity = 2
465 alg.outOfValidityDeco =
'bad_eff_muontrig_' + trig_short
466 alg.muons = config.readName (self.containerName)
467 alg.preselection = config.getPreselection (self.containerName,
'')
468 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
'trigEffSF_' + trig_short)
470 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
'trigEff_' + trig_short)