401 if config.geometry()
is LHCPeriod.Run1:
402 raise ValueError (
"Can't set up the MuonWorkingPointEfficiencyConfig with %s, there must be something wrong!" % config.geometry().value)
404 postfix = self.postfix
406 postfix = self.selectionName
407 if postfix !=
'' and postfix[0] !=
'_' :
408 postfix =
'_' + postfix
412 if config.dataType()
is not DataType.Data
and not self.
noEffSF:
413 alg = config.createAlgorithm(
'CP::MuonEfficiencyScaleFactorAlg',
414 'MuonEfficiencyScaleFactorAlgReco' )
415 config.addPrivateTool(
'efficiencyScaleFactorTool',
416 'CP::MuonEfficiencyScaleFactors' )
417 config.setExtraInputs ({(
'xAOD::EventInfo',
'EventInfo.RandomRunNumber')})
418 alg.scaleFactorDecoration =
'muon_reco_effSF' + postfix +
"_%SYS%"
419 alg.outOfValidity = 2
420 alg.outOfValidityDeco =
'muon_reco_bad_eff' + postfix
421 alg.efficiencyScaleFactorTool.WorkingPoint = self.
quality
423 if self.useLRT
and self.
quality !=
'Medium':
424 raise ValueError (
"useLRT is only supported with the Medium quality working point, not '%s'" % self.
quality)
425 if config.geometry() >= LHCPeriod.Run3:
426 alg.efficiencyScaleFactorTool.CalibrationRelease =
'250418_Preliminary_r24run3' if self.useLRT
else '251211_Preliminary_r24run3'
428 alg.efficiencyScaleFactorTool.CalibrationRelease =
'240620_LRT_r22run2' if self.useLRT
else '230213_Preliminary_r22run2_loosefix'
429 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
431 alg.preselection = config.getPreselection (self.
containerName, self.selectionName)
434 'reco_effSF' + postfix)
435 sfList += [alg.scaleFactorDecoration]
438 if config.dataType()
is not DataType.Data
and self.
quality ==
'HighPt' and not self.
noEffSF:
439 alg = config.createAlgorithm(
'CP::MuonEfficiencyScaleFactorAlg',
440 'MuonEfficiencyScaleFactorAlgBMVHighPt' )
441 config.addPrivateTool(
'efficiencyScaleFactorTool',
442 'CP::MuonEfficiencyScaleFactors' )
443 alg.scaleFactorDecoration =
'muon_BadMuonVeto_effSF' + postfix +
"_%SYS%"
444 alg.outOfValidity = 2
445 alg.outOfValidityDeco =
'muon_BadMuonVeto_bad_eff' + postfix
446 alg.efficiencyScaleFactorTool.WorkingPoint =
'BadMuonVeto_HighPt'
447 if config.geometry() >= LHCPeriod.Run3:
448 alg.efficiencyScaleFactorTool.CalibrationRelease =
'220817_Preliminary_r22run3'
450 alg.efficiencyScaleFactorTool.CalibrationRelease =
'230213_Preliminary_r22run2_loosefix'
451 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
453 alg.preselection = config.getPreselection (self.
containerName, self.selectionName)
455 config.addOutputVar (self.
containerName, alg.scaleFactorDecoration,
456 'BadMuonVeto_effSF' + postfix)
457 sfList += [alg.scaleFactorDecoration]
460 if config.dataType()
is not DataType.Data
and self.isolation !=
'NonIso' and not self.
noEffSF:
461 alg = config.createAlgorithm(
'CP::MuonEfficiencyScaleFactorAlg',
462 'MuonEfficiencyScaleFactorAlgIsol' )
463 config.addPrivateTool(
'efficiencyScaleFactorTool',
464 'CP::MuonEfficiencyScaleFactors' )
465 alg.scaleFactorDecoration =
'muon_isol_effSF' + postfix +
"_%SYS%"
466 alg.outOfValidity = 2
467 alg.outOfValidityDeco =
'muon_isol_bad_eff' + postfix
468 alg.efficiencyScaleFactorTool.WorkingPoint = self.isolation +
'Iso'
469 if config.geometry() >= LHCPeriod.Run3:
470 alg.efficiencyScaleFactorTool.CalibrationRelease =
'251211_Preliminary_r24run3'
472 alg.efficiencyScaleFactorTool.CalibrationRelease =
'230213_Preliminary_r22run2_loosefix'
473 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
475 alg.preselection = config.getPreselection (self.
containerName, self.selectionName)
477 config.addOutputVar (self.
containerName, alg.scaleFactorDecoration,
478 'isol_effSF' + postfix)
479 sfList += [alg.scaleFactorDecoration]
482 if config.dataType()
is not DataType.Data
and self.trackSelection
and not self.
noEffSF:
483 alg = config.createAlgorithm(
'CP::MuonEfficiencyScaleFactorAlg',
484 'MuonEfficiencyScaleFactorAlgTTVA' )
485 config.addPrivateTool(
'efficiencyScaleFactorTool',
486 'CP::MuonEfficiencyScaleFactors' )
487 alg.scaleFactorDecoration =
'muon_TTVA_effSF' + postfix +
"_%SYS%"
488 alg.outOfValidity = 2
489 alg.outOfValidityDeco =
'muon_TTVA_bad_eff' + postfix
490 alg.efficiencyScaleFactorTool.WorkingPoint =
'TTVA'
491 if config.geometry() >= LHCPeriod.Run3:
492 alg.efficiencyScaleFactorTool.CalibrationRelease =
'251211_Preliminary_r24run3'
494 alg.efficiencyScaleFactorTool.CalibrationRelease =
'230213_Preliminary_r22run2_loosefix'
495 alg.efficiencyScaleFactorTool.BreakDownSystematics = self.systematicBreakdown
497 alg.preselection = config.getPreselection (self.
containerName, self.selectionName)
499 config.addOutputVar (self.
containerName, alg.scaleFactorDecoration,
500 'TTVA_effSF' + postfix)
501 sfList += [alg.scaleFactorDecoration]
504 alg = config.createAlgorithm(
'CP::AsgObjectScaleFactorAlg',
505 'MuonCombinedEfficiencyScaleFactorAlg' )
507 alg.inScaleFactors = sfList
508 alg.outScaleFactor =
'effSF' + postfix +
'_%SYS%'
509 config.addOutputVar (self.
containerName, alg.outScaleFactor,
'effSF' + postfix)