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

Public Member Functions

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

Public Attributes

 quality
 

Detailed Description

the ConfigBlock for the tau working point

This may at some point be split into multiple blocks (16 Mar 22).

Definition at line 59 of file DiTauAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.__init__ (   self)

Definition at line 64 of file DiTauAnalysisConfig.py.

64  def __init__ (self) :
65  super (DiTauWorkingPointConfig, self).__init__ ()
66  self.addOption ('containerName', '', type=str,
67  noneAction='error',
68  info="the name of the input container.")
69  self.addOption ('selectionName', '', type=str,
70  noneAction='error',
71  info="the name of the tau-jet selection to define (e.g. tight or "
72  "loose).")
73  self.addOption ('postfix', None, type=str,
74  info="a postfix to apply to decorations and algorithm names. "
75  "Typically not needed here as selectionName is used internally.")
76  self.addOption ('quality', None, type=str,
77  info="the ID WP (string) to use. Supported ID WPs: Tight, Medium, "
78  "Loose, VeryLoose, Baseline, BaselineForFakes.")
79  self.addOption ('addSelectionToPreselection', True, type=bool,
80  info="whether to retain only ditau-jets satisfying the working point "
81  "requirements. The default is True.")
82 

Member Function Documentation

◆ instanceName()

def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.instanceName (   self)
Return the instance name for this block

Definition at line 83 of file DiTauAnalysisConfig.py.

83  def instanceName (self) :
84  """Return the instance name for this block"""
85  if self.postfix is not None:
86  return self.containerName + '_' + self.selectionName + self.postfix
87  else:
88  return self.containerName + '_' + self.selectionName
89 

◆ makeAlgs()

def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.makeAlgs (   self,
  config 
)

Definition at line 90 of file DiTauAnalysisConfig.py.

90  def makeAlgs (self, config) :
91 
92  selectionPostfix = self.selectionName
93  if selectionPostfix != '' and selectionPostfix[0] != '_' :
94  selectionPostfix = '_' + selectionPostfix
95 
96  postfix = self.postfix
97  if postfix is None :
98  postfix = self.selectionName
99  if postfix != '' and postfix[0] != '_' :
100  postfix = '_' + postfix
101 
102  # using enum value from: https://gitlab.cern.ch/atlas/athena/blob/21.2/PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h
103  # the dictionary is missing in Athena, so hard-coding values here
104  if self.quality == 'Tight' :
105  IDLevel = 4 # ROOT.TauAnalysisTools.JETIDBDTTIGHT
106  elif self.quality == 'Medium' :
107  IDLevel = 3 # ROOT.TauAnalysisTools.JETIDBDTMEDIUM
108  elif self.quality == 'Loose' :
109  IDLevel = 2 # ROOT.TauAnalysisTools.JETIDBDTLOOSE
110  else :
111  raise ValueError ("invalid tau quality: \"" + self.quality +
112  "\", allowed values are Tight, Medium, Loose")
113 
114  inputfile = 'TauAnalysisAlgorithms/ditau_selection_highpt.conf'
115  if "DiTauJetsLowPt" in self.containerName:
116  inputfile = 'TauAnalysisAlgorithms/ditau_selection_lowpt.conf'
117 
118  # Set up the algorithm selecting taus:
119  alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'DiTauSelectionAlg' )
120  config.addPrivateTool( 'selectionTool', 'TauAnalysisTools::DiTauSelectionTool' )
121  alg.selectionTool.ConfigPath = inputfile
122  alg.selectionDecoration = 'selected_ditau' + selectionPostfix + ',as_char'
123  alg.particles = config.readName (self.containerName)
124  alg.preselection = config.getPreselection (self.containerName, self.selectionName)
125  config.addSelection (self.containerName, self.selectionName, alg.selectionDecoration,
126  preselection=self.addSelectionToPreselection)
127 
128 
129  # Set up the algorithm calculating the efficiency scale factors for the
130  # taus:
131  if config.dataType() is not DataType.Data:
132  alg = config.createAlgorithm( 'CP::DiTauEfficiencyCorrectionsAlg',
133  'DiTauEfficiencyCorrectionsAlg' )
134  config.addPrivateTool( 'efficiencyCorrectionsTool',
135  'TauAnalysisTools::DiTauEfficiencyCorrectionsTool' )
136  alg.efficiencyCorrectionsTool.JetIDLevel = IDLevel
137  alg.scaleFactorDecoration = 'tau_effSF' + postfix + '_%SYS%'
138  # alg.outOfValidity = 2 #silent
139  # alg.outOfValidityDeco = "bad_eff"
140  alg.taus = config.readName (self.containerName)
141  alg.preselection = config.getPreselection (self.containerName, self.selectionName)
142  config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
143  'effSF' + postfix)
144 

Member Data Documentation

◆ quality

python.DiTauAnalysisConfig.DiTauWorkingPointConfig.quality

Definition at line 104 of file DiTauAnalysisConfig.py.


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