368 def makeAlgs (self, config) :
370 if config.dataType()
is not DataType.Data:
371 if config.campaign()
is Campaign.MC20a:
372 triggers = self.get_year_data(self.triggerChainsPerYear, 2015)
373 triggers += self.get_year_data(self.triggerChainsPerYear, 2016)
376 elif config.campaign()
is Campaign.MC20d:
377 triggers = self.get_year_data(self.triggerChainsPerYear, 2017)
378 elif config.campaign()
is Campaign.MC20e:
379 triggers = self.get_year_data(self.triggerChainsPerYear, 2018)
380 elif config.campaign()
in [Campaign.MC21a, Campaign.MC23a]:
381 triggers = self.get_year_data(self.triggerChainsPerYear, 2022)
382 elif config.campaign()
in [Campaign.MC23c, Campaign.MC23d]:
383 triggers = self.get_year_data(self.triggerChainsPerYear, 2023)
385 logging.warning(
"unknown campaign, skipping triggers: " +
str(config.campaign()))
388 for trig
in triggers:
389 trig = trig.replace(
"HLT_",
"")
390 alg = config.createAlgorithm(
'CP::TauEfficiencyCorrectionsAlg',
391 'TauTrigEfficiencyCorrectionsAlg' + trig )
392 config.addPrivateTool(
'efficiencyCorrectionsTool',
393 'TauAnalysisTools::TauEfficiencyCorrectionsTool' )
396 alg.efficiencyCorrectionsTool.EfficiencyCorrectionTypes = [12]
397 alg.efficiencyCorrectionsTool.TriggerName =
'HLT_' + trig
401 if self.tauID==
"Loose":
403 elif self.tauID==
"Medium":
405 elif self.tauID==
"Tight":
408 raise ValueError (
"invalid tauID: \"" + self.tauID +
"\". Allowed values are loose, medium, tight")
409 alg.efficiencyCorrectionsTool.JetIDLevel = JetIDLevel
410 alg.efficiencyCorrectionsTool.TriggerSFMeasurement =
"combined"
411 alg.efficiencyCorrectionsTool.useFastSim = config.dataType()
is DataType.FastSim
413 alg.scaleFactorDecoration =
'tau_trigEffSF_' + trig +
'_%SYS%'
414 alg.outOfValidity = 2
415 alg.outOfValidityDeco =
'bad_eff_tautrig_' + trig
416 alg.taus = config.readName (self.containerName)
417 alg.preselection = config.getPreselection (self.containerName, self.tauID)
418 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
'trigEffSF_' + trig)