ATLAS Offline Software
Loading...
Searching...
No Matches
python.DiTauAnalysisConfig.DiTauWorkingPointConfig Class Reference
Inheritance diagram for python.DiTauAnalysisConfig.DiTauWorkingPointConfig:
Collaboration diagram for python.DiTauAnalysisConfig.DiTauWorkingPointConfig:

Public Member Functions

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

Public Attributes

str quality = 'Tight' :
 containerName
 selectionName

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

Constructor & Destructor Documentation

◆ __init__()

python.DiTauAnalysisConfig.DiTauWorkingPointConfig.__init__ ( self)

Definition at line 116 of file DiTauAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

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

Definition at line 135 of file DiTauAnalysisConfig.py.

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

◆ makeAlgs()

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

Definition at line 142 of file DiTauAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.DiTauAnalysisConfig.DiTauWorkingPointConfig.containerName

Definition at line 167 of file DiTauAnalysisConfig.py.

◆ quality

str python.DiTauAnalysisConfig.DiTauWorkingPointConfig.quality = 'Tight' :

Definition at line 156 of file DiTauAnalysisConfig.py.

◆ selectionName

python.DiTauAnalysisConfig.DiTauWorkingPointConfig.selectionName

Definition at line 177 of file DiTauAnalysisConfig.py.


The documentation for this class was generated from the following file: