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

Public Member Functions

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

Public Attributes

 containerName
str quality = 'NoID':
 selectionName

Detailed Description

the ConfigBlock for the tau working point selection

Definition at line 116 of file DiTauAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.DiTauAnalysisConfig.DiTauWorkingPointSelectionConfig.__init__ ( self)

Definition at line 119 of file DiTauAnalysisConfig.py.

119 def __init__ (self) :
120 super().__init__()
121 self.setBlockName('DiTauWorkingPointSelection')
122 self.addOption ('containerName', '', type=str,
123 noneAction='error',
124 info="the name of the input container.",
125 meta={'role':'containerRef'})
126 self.addOption ('selectionName', '', type=str,
127 noneAction='error',
128 info="the name of the ditau-jet selection to define (e.g. `tight` or "
129 "`loose`).",
130 meta={'role':'selection'})
131 self.addOption ('postfix', None, type=str,
132 info="a postfix to apply to decorations and algorithm names. "
133 "Typically not needed here as `selectionName` is used internally.")
134 self.addOption ('quality', None, type=str,
135 info="the ID WP to use for high-pt ditau-jets (ignored for `DiTauJetsLowPt` containers). "
136 "Supported ID WPs: `Tight`, `Medium`, `Loose`, `NoID`.",
137 meta={'choices':(['Tight','Medium','Loose','NoID'],1)})
138 self.addOption ('addSelectionToPreselection', True, type=bool,
139 info="whether to retain only ditau-jets satisfying the working point "
140 "requirements.")
141

Member Function Documentation

◆ instanceName()

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

Definition at line 142 of file DiTauAnalysisConfig.py.

142 def instanceName (self) :
143 """Return the instance name for this block"""
144 if self.postfix is not None:
145 return self.containerName + '_' + self.selectionName + self.postfix
146 else:
147 return self.containerName + '_' + self.selectionName
148

◆ makeAlgs()

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

Definition at line 149 of file DiTauAnalysisConfig.py.

149 def makeAlgs (self, config) :
150
151 selectionPostfix = self.selectionName
152 if selectionPostfix != '' and selectionPostfix[0] != '_' :
153 selectionPostfix = '_' + selectionPostfix
154
155 postfix = self.postfix
156 if postfix is None :
157 postfix = self.selectionName
158 if postfix != '' and postfix[0] != '_' :
159 postfix = '_' + postfix
160
161 if "DiTauJetsLowPt" in self.containerName:
162 inputfile = 'TauAnalysisAlgorithms/ditau_selection_lowpt.conf'
163 else:
164 if self.quality not in ['Tight', 'Medium', 'Loose', 'NoID'] :
165 raise ValueError (f"invalid ditau quality: \"{self.quality}\", allowed values are Tight, Medium, Loose, NoID")
166 if self.quality == 'NoID':
167 inputfile = 'TauAnalysisAlgorithms/ditau_selection_highpt.conf'
168 else:
169 inputfile = 'TauAnalysisAlgorithms/ditau_selection_highpt_'+self.quality.lower()+'.conf'
170
171 # Set up the algorithm selecting taus:
172 alg = config.createAlgorithm( 'CP::AsgSelectionAlg', 'DiTauSelectionAlg' )
173 config.addPrivateTool( 'selectionTool', 'TauAnalysisTools::DiTauSelectionTool' )
174 alg.selectionTool.ConfigPath = inputfile
175 alg.selectionDecoration = 'selected_ditau' + selectionPostfix + ',as_char'
176 alg.particles = config.readName (self.containerName)
177 alg.preselection = config.getPreselection (self.containerName, self.selectionName)
178 config.addSelection (self.containerName, self.selectionName, alg.selectionDecoration,
179 preselection=self.addSelectionToPreselection)
180
181

Member Data Documentation

◆ containerName

python.DiTauAnalysisConfig.DiTauWorkingPointSelectionConfig.containerName

Definition at line 161 of file DiTauAnalysisConfig.py.

◆ quality

str python.DiTauAnalysisConfig.DiTauWorkingPointSelectionConfig.quality = 'NoID':

Definition at line 166 of file DiTauAnalysisConfig.py.

◆ selectionName

python.DiTauAnalysisConfig.DiTauWorkingPointSelectionConfig.selectionName

Definition at line 178 of file DiTauAnalysisConfig.py.


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