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 110 of file DiTauAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.__init__ (   self)

Definition at line 115 of file DiTauAnalysisConfig.py.

115  def __init__ (self) :
116  super (DiTauWorkingPointConfig, self).__init__ ()
117  self.addOption ('containerName', '', type=str,
118  noneAction='error',
119  info="the name of the input container.")
120  self.addOption ('selectionName', '', type=str,
121  noneAction='error',
122  info="the name of the tau-jet selection to define (e.g. tight or "
123  "loose).")
124  self.addOption ('postfix', None, type=str,
125  info="a postfix to apply to decorations and algorithm names. "
126  "Typically not needed here as selectionName is used internally.")
127  self.addOption ('quality', None, type=str,
128  info="the ID WP (string) to use. Supported ID WPs: Tight, Medium, "
129  "Loose, VeryLoose, Baseline, BaselineForFakes.")
130  self.addOption ('addSelectionToPreselection', True, type=bool,
131  info="whether to retain only ditau-jets satisfying the working point "
132  "requirements. The default is True.")
133 

Member Function Documentation

◆ instanceName()

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

Definition at line 134 of file DiTauAnalysisConfig.py.

134  def instanceName (self) :
135  """Return the instance name for this block"""
136  if self.postfix is not None:
137  return self.containerName + '_' + self.selectionName + self.postfix
138  else:
139  return self.containerName + '_' + self.selectionName
140 

◆ makeAlgs()

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

Definition at line 141 of file DiTauAnalysisConfig.py.

141  def makeAlgs (self, config) :
142 
143  selectionPostfix = self.selectionName
144  if selectionPostfix != '' and selectionPostfix[0] != '_' :
145  selectionPostfix = '_' + selectionPostfix
146 
147  postfix = self.postfix
148  if postfix is None :
149  postfix = self.selectionName
150  if postfix != '' and postfix[0] != '_' :
151  postfix = '_' + postfix
152 
153  # using enum value from: https://gitlab.cern.ch/atlas/athena/blob/21.2/PhysicsAnalysis/TauID/TauAnalysisTools/TauAnalysisTools/Enums.h
154  # the dictionary is missing in Athena, so hard-coding values here
155  if self.quality == 'Tight' :
156  IDLevel = 4 # ROOT.TauAnalysisTools.JETIDBDTTIGHT
157  elif self.quality == 'Medium' :
158  IDLevel = 3 # ROOT.TauAnalysisTools.JETIDBDTMEDIUM
159  elif self.quality == 'Loose' :
160  IDLevel = 2 # ROOT.TauAnalysisTools.JETIDBDTLOOSE
161  else :
162  raise ValueError ("invalid tau quality: \"" + self.quality +
163  "\", allowed values are Tight, Medium, Loose")
164 
165  inputfile = 'TauAnalysisAlgorithms/ditau_selection_highpt.conf'
166  if "DiTauJetsLowPt" in self.containerName:
167  inputfile = 'TauAnalysisAlgorithms/ditau_selection_lowpt.conf'
168 
169  # Set up the algorithm selecting taus:
170  alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'DiTauSelectionAlg' )
171  config.addPrivateTool( 'selectionTool', 'TauAnalysisTools::DiTauSelectionTool' )
172  alg.selectionTool.ConfigPath = inputfile
173  alg.selectionDecoration = 'selected_ditau' + selectionPostfix + ',as_char'
174  alg.particles = config.readName (self.containerName)
175  alg.preselection = config.getPreselection (self.containerName, self.selectionName)
176  config.addSelection (self.containerName, self.selectionName, alg.selectionDecoration,
177  preselection=self.addSelectionToPreselection)
178 
179 
180  # Set up the algorithm calculating the efficiency scale factors for the
181  # taus:
182  if config.dataType() is not DataType.Data:
183  alg = config.createAlgorithm( 'CP::DiTauEfficiencyCorrectionsAlg',
184  'DiTauEfficiencyCorrectionsAlg' )
185  config.addPrivateTool( 'efficiencyCorrectionsTool',
186  'TauAnalysisTools::DiTauEfficiencyCorrectionsTool' )
187  alg.efficiencyCorrectionsTool.JetIDLevel = IDLevel
188  alg.scaleFactorDecoration = 'tau_effSF' + postfix + '_%SYS%'
189  # alg.outOfValidity = 2 #silent
190  # alg.outOfValidityDeco = "bad_eff"
191  alg.taus = config.readName (self.containerName)
192  alg.preselection = config.getPreselection (self.containerName, self.selectionName)
193  config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
194  'effSF' + postfix)
195 

Member Data Documentation

◆ quality

python.DiTauAnalysisConfig.DiTauWorkingPointConfig.quality

Definition at line 155 of file DiTauAnalysisConfig.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