ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.TauAnalysisConfig.TauTriggerAnalysisSFBlock Class Reference
Inheritance diagram for python.TauAnalysisConfig.TauTriggerAnalysisSFBlock:
Collaboration diagram for python.TauAnalysisConfig.TauTriggerAnalysisSFBlock:

Public Member Functions

def __init__ (self)
 
def instanceName (self)
 
def makeAlgs (self, config)
 

Public Attributes

 tauID
 

Detailed Description

Definition at line 484 of file TauAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.__init__ (   self)

Definition at line 486 of file TauAnalysisConfig.py.

486  def __init__ (self) :
487  super (TauTriggerAnalysisSFBlock, self).__init__ ()
488 
489  self.addOption ('triggerChainsPerYear', {}, type=None,
490  info="a dictionary with key (string) the year and value (list of "
491  "strings) the trigger chains. The default is {} (empty dictionary).")
492  self.addOption ('tauID', '', type=str,
493  info="the tau quality WP (string) to use.")
494  self.addOption ('prefixSF', 'trigEffSF', type=str,
495  info="the decoration prefix for trigger scale factors, "
496  "the default is 'trigEffSF'")
497  self.addOption ('includeAllYearsPerRun', False, type=bool,
498  info="if True, all configured years in the LHC run will "
499  "be included in all jobs. The default is False.")
500  self.addOption ('removeHLTPrefix', True, type=bool,
501  info="remove the HLT prefix from trigger chain names, "
502  "The default is True.")
503  self.addOption ('containerName', '', type=str,
504  info="the input tau container, with a possible selection, in "
505  "the format container or container.selection.")
506 

Member Function Documentation

◆ instanceName()

def python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.instanceName (   self)
Return the instance name for this block

Definition at line 507 of file TauAnalysisConfig.py.

507  def instanceName (self) :
508  """Return the instance name for this block"""
509  return self.containerName + '_' + self.prefixSF + '_' + self.tauID
510 

◆ makeAlgs()

def python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.makeAlgs (   self,
  config 
)

Definition at line 511 of file TauAnalysisConfig.py.

511  def makeAlgs (self, config) :
512 
513  if config.dataType() is not DataType.Data:
514  triggers = trigger_set(config, self.triggerChainsPerYear,
515  self.includeAllYearsPerRun)
516  for chain in triggers:
517  chain_noHLT = chain.replace("HLT_", "")
518  chain_out = chain_noHLT if self.removeHLTPrefix else chain
519  alg = config.createAlgorithm( 'CP::TauEfficiencyCorrectionsAlg',
520  'TauTrigEfficiencyCorrectionsAlg_' + chain )
521  config.addPrivateTool( 'efficiencyCorrectionsTool',
522  'TauAnalysisTools::TauEfficiencyCorrectionsTool' )
523  # SFTriggerHadTau correction type from
524  # https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h#L79
525  alg.efficiencyCorrectionsTool.EfficiencyCorrectionTypes = [12]
526  if config.geometry() is LHCPeriod.Run2:
527  alg.efficiencyCorrectionsTool.Campaign = "mc20"
528  else:
529  alg.efficiencyCorrectionsTool.Campaign = config.campaign().value
530  alg.efficiencyCorrectionsTool.TriggerName = chain
531 
532  # JetIDLevel from
533  # https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h#L79
534  if self.tauID=="Loose":
535  JetIDLevel = 7
536  elif self.tauID=="Medium":
537  JetIDLevel = 8
538  elif self.tauID=="Tight":
539  JetIDLevel = 9
540  else:
541  raise ValueError ("invalid tauID: \"" + self.tauID + "\". Allowed values are loose, medium, tight")
542  alg.efficiencyCorrectionsTool.JetIDLevel = JetIDLevel
543  alg.efficiencyCorrectionsTool.TriggerSFMeasurement = "combined"
544  alg.efficiencyCorrectionsTool.useFastSim = config.dataType() is DataType.FastSim
545 
546  alg.scaleFactorDecoration = f"tau_{self.prefixSF}_{chain_out}_%SYS%"
547  alg.outOfValidity = 2 #silent
548  alg.outOfValidityDeco = f"bad_eff_tautrig_{chain_out}"
549  alg.taus = config.readName (self.containerName)
550  alg.preselection = config.getPreselection (self.containerName, self.tauID)
551  config.addOutputVar (self.containerName, alg.scaleFactorDecoration, f"{self.prefixSF}_{chain_out}")

Member Data Documentation

◆ tauID

python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.tauID

Definition at line 534 of file TauAnalysisConfig.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
python.TriggerAnalysisSFConfig.trigger_set
def trigger_set(config, triggerChainsPerYear, includeAllYearsPerRun)
Definition: TriggerAnalysisSFConfig.py:64