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.
◆ __init__()
| def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.__init__ |
( |
|
self | ) |
|
Definition at line 115 of file DiTauAnalysisConfig.py.
116 super (DiTauWorkingPointConfig, self).__init__ ()
117 self.addOption (
'containerName',
'', type=str,
119 info=
"the name of the input container.")
120 self.addOption (
'selectionName',
'', type=str,
122 info=
"the name of the tau-jet selection to define (e.g. tight or "
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.")
◆ 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
139 return self.containerName +
'_' + self.selectionName
◆ makeAlgs()
| def python.DiTauAnalysisConfig.DiTauWorkingPointConfig.makeAlgs |
( |
|
self, |
|
|
|
config |
|
) |
| |
Definition at line 141 of file DiTauAnalysisConfig.py.
141 def makeAlgs (self, config) :
143 selectionPostfix = self.selectionName
144 if selectionPostfix !=
'' and selectionPostfix[0] !=
'_' :
145 selectionPostfix =
'_' + selectionPostfix
147 postfix = self.postfix
149 postfix = self.selectionName
150 if postfix !=
'' and postfix[0] !=
'_' :
151 postfix =
'_' + postfix
155 if self.quality ==
'Tight' :
157 elif self.quality ==
'Medium' :
159 elif self.quality ==
'Loose' :
162 raise ValueError (
"invalid tau quality: \"" + self.quality +
163 "\", allowed values are Tight, Medium, Loose")
165 inputfile =
'TauAnalysisAlgorithms/ditau_selection_highpt.conf'
166 if "DiTauJetsLowPt" in self.containerName:
167 inputfile =
'TauAnalysisAlgorithms/ditau_selection_lowpt.conf'
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)
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%'
191 alg.taus = config.readName (self.containerName)
192 alg.preselection = config.getPreselection (self.containerName, self.selectionName)
193 config.addOutputVar (self.containerName, alg.scaleFactorDecoration,
◆ quality
| python.DiTauAnalysisConfig.DiTauWorkingPointConfig.quality |
The documentation for this class was generated from the following file: