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

Public Member Functions

def __init__ (self, configName='')
 
def makeAlgs (self, config)
 

Detailed Description

Definition at line 380 of file MuonAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.MuonAnalysisConfig.MuonTriggerAnalysisSFBlock.__init__ (   self,
  configName = '' 
)

Definition at line 382 of file MuonAnalysisConfig.py.

382  def __init__ (self, configName='') :
383  super (MuonTriggerAnalysisSFBlock, self).__init__ ()
384 
385  self.addOption ('triggerChainsPerYear', {}, type=None,
386  info="a dictionary with key (string) the year and value (list of "
387  "strings) the trigger chains. The default is {} (empty dictionary).")
388  self.addOption ('muonID', '', type=str,
389  info="the muon quality WP (string) to use.")
390  self.addOption ('saveEff', False, type=bool,
391  info="define whether we decorate also the trigger scale efficiency "
392  "The default is false.")
393  self.addOption ('containerName', '', type=str,
394  info="the input muon container, with a possible selection, in "
395  "the format container or container.selection.")
396 

Member Function Documentation

◆ makeAlgs()

def python.MuonAnalysisConfig.MuonTriggerAnalysisSFBlock.makeAlgs (   self,
  config 
)

Definition at line 397 of file MuonAnalysisConfig.py.

397  def makeAlgs (self, config) :
398 
399  if config.dataType() is not DataType.Data:
400 
401  # Dictionary from TrigGlobalEfficiencyCorrection/Triggers.cfg
402  # Key is trigger chain (w/o HLT prefix)
403  # Value is empty for single leg trigger or list of legs
404  triggerDict = TriggerDict()
405 
406  if config.campaign() is Campaign.MC20a:
407  years = ['2015', '2016']
408  elif config.campaign() is Campaign.MC20d:
409  years = ['2017']
410  elif config.campaign() is Campaign.MC20e:
411  years = ['2018']
412  elif config.campaign() in [Campaign.MC21a, Campaign.MC23a]:
413  years = ['2022']
414  elif config.campaign() in [Campaign.MC23c, Campaign.MC23d]:
415  years = ['2023']
416 
417  triggerConfigs = {}
418  triggerConfigYears = {}
419  for year in years:
420  triggerChains = self.triggerChainsPerYear.get(year,[])
421  for chain in triggerChains:
422  chain = chain.replace(" || ", "_OR_")
423  chain_noHLT = chain.replace("HLT_","")
424  legs = triggerDict[chain_noHLT]
425  if len(legs)==0:
426  if chain_noHLT.startswith('mu') and chain_noHLT[2].isdigit:
427  # Need to support HLT_mu26_ivarmedium_OR_HLT_mu50
428  triggerConfigs[chain_noHLT] = chain
429  if chain_noHLT in triggerConfigYears.keys():
430  triggerConfigYears[chain_noHLT].append(year)
431  else:
432  triggerConfigYears[chain_noHLT] = [year]
433  else:
434  for leg in legs:
435  if leg.startswith('mu') and leg[2].isdigit:
436  # Need to support HLT_mu14_ivarloose
437  triggerConfigs[leg] = 'HLT_' + leg
438  if chain_noHLT in triggerConfigYears.keys():
439  triggerConfigYears[leg].append(year)
440  else:
441  triggerConfigYears[leg] = [year]
442 
443  for trig_short, trig in triggerConfigs.items():
444  alg = config.createAlgorithm('CP::MuonTriggerEfficiencyScaleFactorAlg',
445  'MuonTrigEfficiencyCorrectionsAlg_' + trig_short)
446  config.addPrivateTool( 'efficiencyScaleFactorTool',
447  'CP::MuonTriggerScaleFactors' )
448 
449  # Reproduce config from TrigGlobalEfficiencyAlg
450  alg.efficiencyScaleFactorTool.MuonQuality = self.muonID
451  alg.efficiencyScaleFactorTool.AllowZeroSF = True
452 
453  # Avoid warnings for MC20a 2015-2016 triggers covering a single year
454  if config.campaign() is Campaign.MC20a:
455  if triggerConfigYears[trig_short] == ['2015']:
456  alg.maxRunNumber = 290000
457  elif triggerConfigYears[trig_short] == ['2016']:
458  alg.minRunNumber = 290000
459 
460  alg.trigger = trig
461  alg.scaleFactorDecoration = 'muon_trigEffSF_' + trig_short + '_%SYS%'
462  if(self.saveEff):
463  alg.mcEfficiencyDecoration = 'muon_trigEff_' + trig_short + '_%SYS%'
464  alg.outOfValidity = 2 #silent
465  alg.outOfValidityDeco = 'bad_eff_muontrig_' + trig_short
466  alg.muons = config.readName (self.containerName)
467  alg.preselection = config.getPreselection (self.containerName, '')
468  config.addOutputVar (self.containerName, alg.scaleFactorDecoration, 'trigEffSF_' + trig_short)
469  if(self.saveEff):
470  config.addOutputVar (self.containerName, alg.scaleFactorDecoration, 'trigEff_' + trig_short)

The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
TriggerLeg_DictHelpers.TriggerDict
def TriggerDict()
Definition: TriggerLeg_DictHelpers.py:7
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127