401 def makeAlgs (self, config) :
403 if config.dataType()
is not DataType.Data:
410 if config.campaign()
is Campaign.MC20a:
412 elif config.campaign()
is Campaign.MC20d:
414 elif config.campaign()
is Campaign.MC20e:
416 elif config.campaign()
in [Campaign.MC21a, Campaign.MC23a]:
418 elif config.campaign()
in [Campaign.MC23c, Campaign.MC23d]:
422 triggerConfigYears = {}
424 triggerChains = self.triggerChainsPerYear.
get(
int(year), self.triggerChainsPerYear.
get(
str(year), []))
425 for chain
in triggerChains:
426 chain = chain.replace(
" || ",
"_OR_")
427 chain_noHLT = chain.replace(
"HLT_",
"")
428 legs = triggerDict[chain_noHLT]
430 if chain_noHLT.startswith(
'mu')
and chain_noHLT[2].isdigit:
432 triggerConfigs[chain_noHLT] = chain
433 if chain_noHLT
in triggerConfigYears.keys():
434 triggerConfigYears[chain_noHLT].
append(year)
436 triggerConfigYears[chain_noHLT] = [year]
439 if leg.startswith(
'mu')
and leg[2].isdigit:
441 triggerConfigs[leg] =
'HLT_' + leg
442 if chain_noHLT
in triggerConfigYears.keys():
443 triggerConfigYears[leg].
append(year)
445 triggerConfigYears[leg] = [year]
447 for trig_short, trig
in triggerConfigs.items():
448 alg = config.createAlgorithm(
'CP::MuonTriggerEfficiencyScaleFactorAlg',
449 'MuonTrigEfficiencyCorrectionsAlg_' + trig_short)
450 config.addPrivateTool(
'efficiencyScaleFactorTool',
451 'CP::MuonTriggerScaleFactors' )
454 alg.efficiencyScaleFactorTool.MuonQuality = self.muonID
455 alg.efficiencyScaleFactorTool.AllowZeroSF =
True
458 if config.campaign()
is Campaign.MC20a:
459 if triggerConfigYears[trig_short] == [2015]:
460 alg.maxRunNumber = 290000
461 elif triggerConfigYears[trig_short] == [2016]:
462 alg.minRunNumber = 290000
465 alg.scaleFactorDecoration =
'muon_trigEffSF_' + trig_short +
'_%SYS%'
467 alg.mcEfficiencyDecoration =
'muon_trigEff_' + trig_short +
'_%SYS%'
468 alg.outOfValidity = 2
469 alg.outOfValidityDeco =
'bad_eff_muontrig_' + trig_short
470 alg.muons = config.readName (self.containerName)
471 alg.preselection = config.getPreselection (self.containerName,
'')
472 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
'trigEffSF_' + trig_short)
474 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
'trigEff_' + trig_short)