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, configName='')
 
list get_year_data (self, dict dictionary, int|str year)
 
def makeAlgs (self, config)
 

Public Attributes

 tauID
 

Detailed Description

Definition at line 351 of file TauAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.__init__ (   self,
  configName = '' 
)

Definition at line 353 of file TauAnalysisConfig.py.

353  def __init__ (self, configName='') :
354  super (TauTriggerAnalysisSFBlock, self).__init__ ()
355 
356  self.addOption ('triggerChainsPerYear', {}, type=None,
357  info="a dictionary with key (string) the year and value (list of "
358  "strings) the trigger chains. The default is {} (empty dictionary).")
359  self.addOption ('tauID', '', type=str,
360  info="the tau quality WP (string) to use.")
361  self.addOption ('containerName', '', type=str,
362  info="the input tau container, with a possible selection, in "
363  "the format container or container.selection.")
364 

Member Function Documentation

◆ get_year_data()

list python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.get_year_data (   self,
dict  dictionary,
int | str  year 
)

Definition at line 365 of file TauAnalysisConfig.py.

365  def get_year_data(self, dictionary: dict, year: int | str) -> list:
366  return dictionary.get(int(year), dictionary.get(str(year), []))
367 

◆ makeAlgs()

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

Definition at line 368 of file TauAnalysisConfig.py.

368  def makeAlgs (self, config) :
369 
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)
374  # Remove potential duplicates
375  triggers = list(set(triggers))
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)
384  else:
385  logging.warning("unknown campaign, skipping triggers: " + str(config.campaign()))
386  triggers = []
387 
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' )
394  # SFTriggerHadTau correction type from
395  # https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h#L79
396  alg.efficiencyCorrectionsTool.EfficiencyCorrectionTypes = [12]
397  alg.efficiencyCorrectionsTool.TriggerName = 'HLT_' + trig
398 
399  # JetIDLevel from
400  # https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h#L79
401  if self.tauID=="Loose":
402  JetIDLevel = 7
403  elif self.tauID=="Medium":
404  JetIDLevel = 8
405  elif self.tauID=="Tight":
406  JetIDLevel = 9
407  else:
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
412 
413  alg.scaleFactorDecoration = 'tau_trigEffSF_' + trig + '_%SYS%'
414  alg.outOfValidity = 2 #silent
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)
419 
420  return

Member Data Documentation

◆ tauID

python.TauAnalysisConfig.TauTriggerAnalysisSFBlock.tauID

Definition at line 401 of file TauAnalysisConfig.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.TriggerAnalysisSFConfig.get_year_data
list get_year_data(dict dictionary, int|str year)
Definition: TriggerAnalysisSFConfig.py:28
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
str
Definition: BTagTrackIpAccessor.cxx:11