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

Constructor & Destructor Documentation

◆ __init__()

def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.__init__ (   self)

Definition at line 110 of file DiTauAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

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

Definition at line 129 of file DiTauAnalysisConfig.py.

129  def instanceName (self) :
130  """Return the instance name for this block"""
131  if self.postfix is not None:
132  return self.containerName + '_' + self.selectionName + self.postfix
133  else:
134  return self.containerName + '_' + self.selectionName
135 

◆ makeAlgs()

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

Definition at line 136 of file DiTauAnalysisConfig.py.

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

Member Data Documentation

◆ quality

python.DiTauAnalysisConfig.DiTauWorkingPointConfig.quality

Definition at line 150 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