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

Public Member Functions

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

Public Attributes

bool addToAllSelections = True
bool addPreselection = False
 electronsSelectionName
 muonsSelectionName
 photonsSelectionName
 tausSelectionName
 jetsSelectionName
 fatJetsSelectionName
 forceOROutputFlags
 nominalOnlyUnifiedSelection
 electrons
 forceOROutputFlagName
 photons
 muons
 taus
 jets
 fatJets
 doEleEleOR
 doEleMuOR
 doEleJetOR
 doMuJetOR
 doTauEleOR
 doTauMuOR
 doTauJetOR
 doTauAntiTauJetOR
 doPhEleOR
 favourPhotonOverLepton
 doPhMuOR
 doPhJetOR
 doEleFatJetOR
 doJetFatJetOR

Detailed Description

the ConfigBlock for the OverlapRemoval configuration

Definition at line 7 of file OverlapAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.OverlapAnalysisConfig.OverlapAnalysisConfig.__init__ ( self)

Definition at line 10 of file OverlapAnalysisConfig.py.

10 def __init__ (self) :
11 super (OverlapAnalysisConfig, self).__init__ ()
12 self.setBlockName('OverlapRemoval')
13 self.addOption ('inputLabel', '', type=str,
14 info="any possible label used to pick up the selected objects with. This should not be a label already used elsewhere, e.g. preselectOR.")
15 self.addOption ('outputLabel', 'passesOR', type=str,
16 info="decoration applied (internally) to the output objects, e.g. passesOR.")
17 self.addOption ('selectionName', None, type=str,
18 info="name of the common selection to which to append the OR decision, needed to distinguish between the various overlap removal strategies that may be set up. The default is '' (empty string), which applies the OR decision to the entire input containers.")
19 self.addOption ('linkOverlapObjects', False, type=bool,
20 info="whether to set up an element link between overlapping objects. The default is False.")
21 self.addOption ('enableUserPriority', False, type=bool,
22 info="whether to use the user's custom priority ranking, instead of the recommended one. If set to True, will respect the priorities set with inputLabel (e.g. in SUSYTools, every object gets priority 2, but pre-selected jets get priority 1). The default is False.")
23 self.addOption ('forceOROutputFlags', False, type=bool,
24 info="whether to add the OR decisions to the output in any case. As default, the OR decisions are only added if the OR is a standalone selection and not added to any other selection. The default is False.")
25 self.addOption ('forceOROutputFlagName', '', type=str,
26 info="override the default output name for the OR decisions, which is otherwise automatically constructed dependent on the configuration. The default is '' (empty string), which does not override the default.")
27 self.addOption ('bJetLabel', '', type=str,
28 info="flag to select b-jets with. If left empty, no b-jets are used in the overlap removal. The default is '' (empty string).")
29 self.addOption ('InnerDR', 0.2, type=float,
30 info="radius of the inner cone for removing jets. The default is 0.2.")
31 self.addOption ('OuterDR', 0.4, type=float,
32 info="radius of the outer cone for removing leptons. The default is 0.4.")
33 self.addOption ('boostedLeptons', False, type=bool,
34 info="whether to enable boosted lepton overlap removal (toggles on the property UseSlidingDR of the ORUtils::EleJetOverlapTool and ORUtils::MuJetOverlapTool tools). The default is False.")
35 self.addOption ('nominalOnly', False, type=bool,
36 info="(experimental) toggle off the running of overlap removal on systematically-varied objects (instead, copy from nominal). The default is False.",
37 expertMode=True)
38 self.addOption ('nominalOnlyUnifiedSelection', False, type=bool,
39 info="(experimental) toggle off the running of overlap removal on systematically-varied objects (instead, copy from nominal), but consider the union of all systematically-varied object selections (not just nominal). The default is False.",
40 expertMode=True)
41 self.addOption ('jets', "", type=str,
42 info="the input jet container.")
43 self.addOption ('fatJets', "", type=str,
44 info="the input large-R jet container.")
45 self.addOption ('electrons', "", type=str,
46 info="the input electron container.")
47 self.addOption ('muons', "", type=str,
48 info="the input muon container.")
49 self.addOption ('photons', "", type=str,
50 info="the input photon container.")
51 self.addOption ('taus', "", type=str,
52 info="the input tau-jet container.")
53 self.addOption ('antiTauIDTauLabel', '', type=str,
54 info="flag to select the ID tau-jet for the tau-antitau-jet overlap removal. The default is '' (empty string).")
55 self.addOption ('antiTauLabel', '', type=str,
56 info="flag to select the anti-tau-jet for the tau-antitau-jet overlap removal. The default is '' (empty string).")
57 self.addOption ('antiTauBJetLabel', '', type=str,
58 info="flag to select b-jets for the tau-antitau-jet overlap removal. The default is '' (empty string).")
59 self.addOption ('addToAllSelections', None, type=bool,
60 info="add OR selection decision into all object selections. For most users, this should only be set to 'True' if there is only one Overlap Removal setup, and to 'False' otherwise. If set to 'None', this is handled automatically.")
61 self.addOption ('addPreselection', None, type=bool,
62 info="add preselection decorations without systematics. If set To 'None', will be turned on in case of multiple Overlap Removal setups.")
63 self.addOption ('preselectLabel', None, type=str,
64 info="label for preselection decorations")
65 self.addOption ('jetsSelectionName', None, type=str,
66 info="name of the selection on the jet container to create/append the OR decision. Defaults to 'selectionName'.")
67 self.addOption ('fatJetsSelectionName', None, type=str,
68 info="name of the selection on the large-R jet container to create/append the OR decision. Defaults to 'selectionName'.")
69 self.addOption ('electronsSelectionName', None, type=str,
70 info="name of the selection on the electron container to create/append the OR decision. Defaults to 'selectionName'.")
71 self.addOption ('muonsSelectionName', None, type=str,
72 info="name of the selection on the muon container to create/append the OR decision. Defaults to 'selectionName'.")
73 self.addOption ('photonsSelectionName', None, type=str,
74 info="name of the selection on the photon container to create/append the OR decision. Defaults to 'selectionName'.")
75 self.addOption ('tausSelectionName', None, type=str,
76 info="name of the selection on the tau-jet container to create/append the OR decision. Defaults to 'selectionName'.")
77 self.addOption ('doEleEleOR', False, type=bool,
78 info="whether to perform the overlap removal amongst electrons. The default is False.")
79 self.addOption ('doEleMuOR', True, type=bool,
80 info="whether to perform the overlap removal between electrons and muons. The default is True.")
81 self.addOption ('doEleJetOR', True, type=bool,
82 info="whether to perform the overlap removal between electrons and jets. The default is True.")
83 self.addOption ('doMuJetOR', True, type=bool,
84 info="whether to perform the overlap removal between muons and jets. The default is True.")
85 self.addOption ('doTauEleOR', True, type=bool,
86 info="whether to perform the overlap removal between tau-jets and electrons. The default is True.")
87 self.addOption ('doTauMuOR', True, type=bool,
88 info="whether to perform the overlap removal between tau-jets and muons. The default is True.")
89 self.addOption ('doTauJetOR', True, type=bool,
90 info="whether to perform the overlap removal between tau-jets and jets. The default is True.")
91 self.addOption ('doTauAntiTauJetOR', False, type=bool,
92 info="whether to perform the overlap removal between tau-jets and anti-tau-jets. The default is False.")
93 self.addOption ('doPhEleOR', True, type=bool,
94 info="whether to perform the overlap removal between photons and electrons. The default is True.")
95 self.addOption ('doPhMuOR', True, type=bool,
96 info="whether to perform the overlap removal between photons and muons. The default is True.")
97 self.addOption ('doPhJetOR', True, type=bool,
98 info="whether to perform the overlap removal between photons and jets. The default is True.")
99 self.addOption ('doEleFatJetOR', True, type=bool,
100 info="whether to perform the overlap removal between electrons and large-R jets. The default is True.")
101 self.addOption ('doJetFatJetOR', True, type=bool,
102 info="whether to perform the overlap removal between jets and large-R jets. The default is True.")
103 self.addOption ('favourPhotonOverLepton', False, type=bool,
104 info="whether to give priority to photons in OR. The default is False.")
105 self.addOption ('allowNoPV', False, type=bool,
106 info="whether to allow proceeding with overlap removal even when no primary vertex is found. The default is False.")
107
108

Member Function Documentation

◆ instanceName()

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

Definition at line 109 of file OverlapAnalysisConfig.py.

109 def instanceName (self) :
110 """Return the instance name for this block"""
111 if self.selectionName is not None:
112 return self.selectionName
113 return self.outputLabel
114

◆ makeAlgs()

python.OverlapAnalysisConfig.OverlapAnalysisConfig.makeAlgs ( self,
config )

Definition at line 128 of file OverlapAnalysisConfig.py.

128 def makeAlgs (self, config) :
129
130 import logging, sys
131 log = logging.getLogger('OverlapRemovalConfig')
132
133 if self.addToAllSelections is None:
134 # we resolve this automatically for the user:
135 # - if there is only one OverlapRemoval config block setup registered,
136 # we set addToAllSections to True so that the OR decision is propagated
137 # to all relevant particles
138 # - if there is more than one, then we set it to False
139 # this is the desired behaviour in most cases! If not, set addToAllSelections
140 # yourself :)
141 numORblocks = OverlapAnalysisConfig.get_instance_count()
142 if numORblocks == 1:
143 # there is only one OR setup
144 self.addToAllSelections = True
145 if self.addPreselection is None:
146 self.addPreselection = False
147 else:
148 # there are more than one OR setups
149 self.addToAllSelections = False
150 if self.addPreselection is None:
151 self.addPreselection = True
152
153 if self.selectionName is not None:
154 selectionName = self.selectionName
155 outputLabel = self.outputLabel + '_' + selectionName
156 inputLabel = self.inputLabel + '_' + selectionName
157 select_or_decoration = 'select_or_' + self.selectionName
158 else:
159 if self.addToAllSelections:
160 selectionName = ""
161 select_or_decoration = 'select_or'
162 else:
163 selectionName = self.outputLabel
164 select_or_decoration = 'select_' + self.outputLabel
165 outputLabel = self.outputLabel
166 inputLabel = self.inputLabel
167
168 # in case of multiple ORs, enforce that users explicitly specify the selection name for each input container: either create a new selection or attach the OR decision to an existing one
169 if OverlapAnalysisConfig.get_instance_count() > 1:
170 # warn about a potential misconfiguration
171 if self.addToAllSelections:
172 log.warning("More than one OverlapRemoval config scheduled but 'addToAllSelections' is set to True. This is probably not what you want.")
173
174 if self.electrons and not self.electronsSelectionName:
175 log.error("More than one OverlapRemoval config scheduled: please explicitly specify the selection name of the OR decision for electrons with 'electronsSelectionName'.")
176 sys.exit(1)
177
178 if self.muons and not self.muonsSelectionName:
179 log.error("More than one OverlapRemoval config scheduled: please explicitly specify the selection name of the OR decision for muons with 'muonsSelectionName'.")
180 sys.exit(1)
181
182 if self.photons and not self.photonsSelectionName:
183 log.error("More than one OverlapRemoval config scheduled: please explicitly specify the selection name of the OR decision for photons with 'photonsSelectionName'.")
184 sys.exit(1)
185
186 if self.taus and not self.tausSelectionName:
187 log.error("More than one OverlapRemoval config scheduled: please explicitly specify the selection name of the OR decision for tau-jets with 'tausSelectionName'.")
188 sys.exit(1)
189
190 if self.jets and not self.jetsSelectionName:
191 log.error("More than one OverlapRemoval config scheduled: please explicitly specify the selection name of the OR decision for jets with 'jetsSelectionName'.")
192 sys.exit(1)
193
194 if self.fatJets and not self.fatJetsSelectionName:
195 log.error("More than one OverlapRemoval config scheduled: please explicitly specify the selection name of the OR decision for large-R jets with 'fatJetsSelectionName'.")
196 sys.exit(1)
197
198 # here the logic is:
199 # - either the user has provided a specific selection name for the object, and we use that one
200 # - or they haven't and then we use selectionName (which is either specified or '', i.e. everything)
201 if self.jetsSelectionName is not None:
202 jetsSelectionName = self.jetsSelectionName
203 else:
204 jetsSelectionName = selectionName
205 if self.fatJetsSelectionName is not None:
206 fatJetsSelectionName = self.fatJetsSelectionName
207 else:
208 fatJetsSelectionName = selectionName
209 if self.electronsSelectionName is not None:
210 electronsSelectionName = self.electronsSelectionName
211 else:
212 electronsSelectionName = selectionName
213 if self.muonsSelectionName is not None:
214 muonsSelectionName = self.muonsSelectionName
215 else:
216 muonsSelectionName = selectionName
217 if self.photonsSelectionName is not None:
218 photonsSelectionName = self.photonsSelectionName
219 else:
220 photonsSelectionName = selectionName
221 if self.tausSelectionName is not None:
222 tausSelectionName = self.tausSelectionName
223 else:
224 tausSelectionName = selectionName
225
226 # For now we have to decorate our selections on the objects in
227 # separate algorithms beforehand, so that the overlap
228 # algorithm can read them. This should probably be changed at
229 # some point. For one, this seems like an unnecessary
230 # complication in the configuration. For another, it requires
231 # that all selection systematics applied so far have dedicated
232 # shallow copies for all objects and systematics, i.e. be
233 # kinematic systematics. While that is technically the case
234 # right now, I'd prefer if I didn't force that.
235
236 # helper function to decide whether to propagate OR flags to output
237 def enableOutput(containerName, selectionName):
238 # if we force the output, add them
239 if self.forceOROutputFlags:
240 return True
241
242 # if selection name is '' the OR selection gets automatically applied everywhere, no point in adding to output
243 if selectionName == '':
244 return False
245
246 # if OR decision is added to selection of input container, there is also no point in adding to output
247 if len(containerName.split(".")) > 1 and containerName.split(".")[1] == selectionName:
248 return False
249
250 # otherwise, OR decision is standalone selection, so add it to output
251 return True
252
253 # the logic to define the output name of the OR decision is as follows:
254 # - if the user specified a selection name for the container, use that to construct the output name
255 # - otherwise, use the generic 'select_or_decoration' label defined above
256
257 electrons = None
258 if self.electrons != "" :
259 if self.nominalOnlyUnifiedSelection:
260 self.makeUnionPreselectionAlg(config, self.electrons)
261 alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORElectronsSelectAlg' )
262 electrons, alg.preselection = config.readNameAndSelection (self.electrons)
263 alg.particles = electrons
264 alg.selectionDecoration = inputLabel + ',as_char'
265 if enableOutput(self.electrons, electronsSelectionName):
266 outputName = "select_" + self.electronsSelectionName if self.electronsSelectionName else select_or_decoration
267 config.addOutputVar (self.electrons.split('.')[0],
268 outputLabel + '_%SYS%',
269 outputName if not self.forceOROutputFlagName else "select_" + self.forceOROutputFlagName,
270 noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
271 if self.nominalOnlyUnifiedSelection:
272 alg.preselection = 'unifiedSelectForOR'
273
274 photons = None
275 if self.photons != "" :
276 if self.nominalOnlyUnifiedSelection:
277 self.makeUnionPreselectionAlg(config, self.photons)
278 alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORPhotonsSelectAlg' )
279 photons, alg.preselection = config.readNameAndSelection (self.photons)
280 alg.particles = photons
281 alg.selectionDecoration = inputLabel + ',as_char'
282 if enableOutput(self.photons, photonsSelectionName):
283 outputName = "select_" + self.photonsSelectionName if self.photonsSelectionName else select_or_decoration
284 config.addOutputVar (self.photons.split('.')[0],
285 outputLabel + '_%SYS%',
286 outputName if not self.forceOROutputFlagName else "select_" + self.forceOROutputFlagName,
287 noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
288 if self.nominalOnlyUnifiedSelection:
289 alg.preselection = 'unifiedSelectForOR'
290
291 muons = None
292 if self.muons != "" :
293 if self.nominalOnlyUnifiedSelection:
294 self.makeUnionPreselectionAlg(config, self.muons)
295 alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORMuonsSelectAlg' )
296 muons, alg.preselection = config.readNameAndSelection (self.muons)
297 alg.particles = muons
298 alg.selectionDecoration = inputLabel + ',as_char'
299 if enableOutput(self.muons, muonsSelectionName):
300 outputName = "select_" + self.muonsSelectionName if self.muonsSelectionName else select_or_decoration
301 config.addOutputVar (self.muons.split('.')[0],
302 outputLabel + '_%SYS%',
303 outputName if not self.forceOROutputFlagName else "select_" + self.forceOROutputFlagName,
304 noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
305 if self.nominalOnlyUnifiedSelection:
306 alg.preselection = 'unifiedSelectForOR'
307
308 taus = None
309 if self.taus != "" :
310 if self.nominalOnlyUnifiedSelection:
311 self.makeUnionPreselectionAlg(config, self.taus)
312 alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORTausSelectAlg' )
313 taus, alg.preselection = config.readNameAndSelection (self.taus)
314 alg.particles = taus
315 alg.selectionDecoration = inputLabel + ',as_char'
316 if enableOutput(self.taus, tausSelectionName):
317 outputName = "select_" + self.tausSelectionName if self.tausSelectionName else select_or_decoration
318 config.addOutputVar (self.taus.split('.')[0],
319 outputLabel + '_%SYS%',
320 outputName if not self.forceOROutputFlagName else "select_" + self.forceOROutputFlagName,
321 noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
322 if self.nominalOnlyUnifiedSelection:
323 alg.preselection = 'unifiedSelectForOR'
324
325 jets = None
326 if self.jets != "" :
327 if self.nominalOnlyUnifiedSelection:
328 self.makeUnionPreselectionAlg(config, self.jets)
329 alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORJetsSelectAlg' )
330 jets, alg.preselection = config.readNameAndSelection (self.jets)
331 alg.particles = jets
332 alg.selectionDecoration = inputLabel + ',as_char'
333 if enableOutput(self.jets, jetsSelectionName):
334 outputName = "select_" + self.jetsSelectionName if self.jetsSelectionName else select_or_decoration
335 config.addOutputVar (self.jets.split('.')[0],
336 outputLabel + '_%SYS%',
337 outputName if not self.forceOROutputFlagName else "select_" + self.forceOROutputFlagName,
338 noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
339 if self.nominalOnlyUnifiedSelection:
340 alg.preselection = 'unifiedSelectForOR'
341
342 fatJets = None
343 if self.fatJets != "" :
344 if self.nominalOnlyUnifiedSelection:
345 self.makeUnionPreselectionAlg(config, self.fatJets)
346 alg = config.createAlgorithm( 'CP::AsgSelectionAlg','ORFatJetsSelectAlg' )
347 fatJets, alg.preselection = config.readNameAndSelection (self.fatJets)
348 alg.particles = fatJets
349 alg.selectionDecoration = inputLabel + ',as_char'
350 if enableOutput(self.fatJets, fatJetsSelectionName):
351 outputName = "select_" + self.fatJetsSelectionName if self.fatJetsSelectionName else select_or_decoration
352 config.addOutputVar (self.fatJets.split('.')[0],
353 outputLabel + '_%SYS%',
354 outputName if not self.forceOROutputFlagName else "select_" + self.forceOROutputFlagName,
355 noSys=self.nominalOnly or self.nominalOnlyUnifiedSelection)
356 if self.nominalOnlyUnifiedSelection:
357 alg.preselection = 'unifiedSelectForOR'
358
359
360
361 # Create the overlap removal algorithm:
362 # Note: we use writeToOutput=False for the selections defined below as we add them manually to the output above already, otherwise they are picked up by createSelectionFlagBranches() of the OutputAnalysisConfig again
363 alg = config.createAlgorithm( 'CP::OverlapRemovalAlg', 'OverlapRemovalAlg' )
364 alg.OutputLabel = outputLabel
365 if self.nominalOnly or self.nominalOnlyUnifiedSelection :
366 alg.affectingSystematicsFilter = '.*'
367 if electrons :
368 alg.electrons = electrons
369 alg.electronsDecoration = outputLabel + '_%SYS%,as_char'
370 config.addSelection (self.electrons.split('.')[0], electronsSelectionName, alg.electronsDecoration, preselection=False, comesFrom='or', writeToOutput=False)
371 if muons :
372 alg.muons = muons
373 alg.muonsDecoration = outputLabel + '_%SYS%,as_char'
374 config.addSelection (self.muons.split('.')[0], muonsSelectionName, alg.muonsDecoration, preselection=False, comesFrom='or', writeToOutput=False)
375 if taus :
376 alg.taus = taus
377 alg.tausDecoration = outputLabel + '_%SYS%,as_char'
378 config.addSelection (self.taus.split('.')[0], tausSelectionName, alg.tausDecoration, preselection=False, comesFrom='or', writeToOutput=False)
379 if jets :
380 alg.jets = jets
381 alg.jetsDecoration = outputLabel + '_%SYS%,as_char'
382 config.addSelection (self.jets.split('.')[0], jetsSelectionName, alg.jetsDecoration, preselection=False, comesFrom='or', writeToOutput=False)
383 if photons :
384 alg.photons = photons
385 alg.photonsDecoration = outputLabel + '_%SYS%,as_char'
386 config.addSelection (self.photons.split('.')[0], photonsSelectionName, alg.photonsDecoration, preselection=False, comesFrom='or', writeToOutput=False)
387 if fatJets :
388 alg.fatJets = fatJets
389 alg.fatJetsDecoration = outputLabel + '_%SYS%,as_char'
390 config.addSelection (self.fatJets.split('.')[0], fatJetsSelectionName, alg.fatJetsDecoration, preselection=False, comesFrom='or', writeToOutput=False)
391
392 # Create its main tool, and set its basic properties:
393 config.addPrivateTool( 'overlapTool', 'ORUtils::OverlapRemovalTool' )
394 alg.overlapTool.InputLabel = inputLabel
395 alg.overlapTool.OutputLabel = outputLabel
396
397 # By default the OverlapRemovalTool would flag objects that need to be
398 # suppressed, with a "true" value. But since the analysis algorithms expect
399 # the opposite behaviour from selection flags, we need to tell the tool
400 # explicitly to use the "true" flag on objects that pass the overlap
401 # removal.
402 alg.overlapTool.OutputPassValue = True
403
404 # Set up the electron-electron overlap removal, if requested.
405 if electrons and self.doEleEleOR:
406 config.addPrivateTool( 'overlapTool.EleEleORT',
407 'ORUtils::EleEleOverlapTool' )
408 alg.overlapTool.EleEleORT.InputLabel = inputLabel
409 alg.overlapTool.EleEleORT.OutputLabel = outputLabel
410 alg.overlapTool.EleEleORT.LinkOverlapObjects = self.linkOverlapObjects
411 alg.overlapTool.EleEleORT.OutputPassValue = True
412
413 # Set up the electron-muon overlap removal.
414 if electrons and muons and self.doEleMuOR:
415 config.addPrivateTool( 'overlapTool.EleMuORT',
416 'ORUtils::EleMuSharedTrkOverlapTool' )
417 alg.overlapTool.EleMuORT.InputLabel = inputLabel
418 alg.overlapTool.EleMuORT.OutputLabel = outputLabel
419 alg.overlapTool.EleMuORT.LinkOverlapObjects = self.linkOverlapObjects
420 alg.overlapTool.EleMuORT.OutputPassValue = True
421
422 # Set up the electron-(narrow-)jet overlap removal.
423 if electrons and jets and self.doEleJetOR:
424 config.addPrivateTool( 'overlapTool.EleJetORT',
425 'ORUtils::EleJetOverlapTool' )
426 alg.overlapTool.EleJetORT.InputLabel = inputLabel
427 alg.overlapTool.EleJetORT.OutputLabel = outputLabel
428 alg.overlapTool.EleJetORT.LinkOverlapObjects = self.linkOverlapObjects
429 alg.overlapTool.EleJetORT.BJetLabel = self.bJetLabel
430 alg.overlapTool.EleJetORT.InnerDR = self.InnerDR
431 alg.overlapTool.EleJetORT.OuterDR = self.OuterDR
432 alg.overlapTool.EleJetORT.UseSlidingDR = self.boostedLeptons
433 alg.overlapTool.EleJetORT.EnableUserPriority = self.enableUserPriority
434 alg.overlapTool.EleJetORT.OutputPassValue = True
435
436 # Set up the muon-(narrow-)jet overlap removal.
437 if muons and jets and self.doMuJetOR:
438 config.addPrivateTool( 'overlapTool.MuJetORT',
439 'ORUtils::MuJetOverlapTool' )
440 alg.overlapTool.MuJetORT.InputLabel = inputLabel
441 alg.overlapTool.MuJetORT.OutputLabel = outputLabel
442 alg.overlapTool.MuJetORT.LinkOverlapObjects = self.linkOverlapObjects
443 alg.overlapTool.MuJetORT.BJetLabel = self.bJetLabel
444 alg.overlapTool.MuJetORT.InnerDR = self.InnerDR
445 alg.overlapTool.MuJetORT.OuterDR = self.OuterDR
446 alg.overlapTool.MuJetORT.UseSlidingDR = self.boostedLeptons
447 alg.overlapTool.MuJetORT.EnableUserPriority = self.enableUserPriority
448 alg.overlapTool.MuJetORT.OutputPassValue = True
449 alg.overlapTool.MuJetORT.AllowNoPV = self.allowNoPV
450
451 # Set up the tau-electron overlap removal.
452 if taus and electrons and self.doTauEleOR:
453 config.addPrivateTool( 'overlapTool.TauEleORT',
454 'ORUtils::DeltaROverlapTool' )
455 alg.overlapTool.TauEleORT.InputLabel = inputLabel
456 alg.overlapTool.TauEleORT.OutputLabel = outputLabel
457 alg.overlapTool.TauEleORT.LinkOverlapObjects = self.linkOverlapObjects
458 alg.overlapTool.TauEleORT.DR = 0.2
459 alg.overlapTool.TauEleORT.OutputPassValue = True
460
461 # Set up the tau-muon overlap removal.
462 if taus and muons and self.doTauMuOR:
463 config.addPrivateTool( 'overlapTool.TauMuORT',
464 'ORUtils::DeltaROverlapTool' )
465 alg.overlapTool.TauMuORT.InputLabel = inputLabel
466 alg.overlapTool.TauMuORT.OutputLabel = outputLabel
467 alg.overlapTool.TauMuORT.LinkOverlapObjects = self.linkOverlapObjects
468 alg.overlapTool.TauMuORT.DR = 0.2
469 alg.overlapTool.TauMuORT.OutputPassValue = True
470
471 # Set up the tau-(narrow-)jet overlap removal.
472 if taus and jets and self.doTauJetOR:
473 if self.doTauAntiTauJetOR:
474 config.addPrivateTool( 'overlapTool.TauJetORT',
475 'ORUtils::TauAntiTauJetOverlapTool' )
476 alg.overlapTool.TauJetORT.TauLabel = self.antiTauIDTauLabel
477 alg.overlapTool.TauJetORT.AntiTauLabel = self.antiTauLabel
478 alg.overlapTool.TauJetORT.BJetLabel = self.antiTauBJetLabel
479 else:
480 config.addPrivateTool( 'overlapTool.TauJetORT',
481 'ORUtils::DeltaROverlapTool' )
482
483 alg.overlapTool.TauJetORT.InputLabel = inputLabel
484 alg.overlapTool.TauJetORT.OutputLabel = outputLabel
485 alg.overlapTool.TauJetORT.LinkOverlapObjects = self.linkOverlapObjects
486 alg.overlapTool.TauJetORT.DR = 0.2
487 alg.overlapTool.TauJetORT.EnableUserPriority = self.enableUserPriority
488 alg.overlapTool.TauJetORT.OutputPassValue = True
489
490 # Set up the photon-electron overlap removal.
491 if photons and electrons and self.doPhEleOR:
492 config.addPrivateTool( 'overlapTool.PhoEleORT',
493 'ORUtils::DeltaROverlapTool' )
494 alg.overlapTool.PhoEleORT.InputLabel = inputLabel
495 alg.overlapTool.PhoEleORT.OutputLabel = outputLabel
496 alg.overlapTool.PhoEleORT.LinkOverlapObjects = self.linkOverlapObjects
497 alg.overlapTool.PhoEleORT.OutputPassValue = True
498 if self.favourPhotonOverLepton:
499 alg.overlapTool.PhoEleORT.SwapContainerPrecedence = True
500
501 # Set up the photon-muon overlap removal.
502 if photons and muons and self.doPhMuOR:
503 config.addPrivateTool( 'overlapTool.PhoMuORT',
504 'ORUtils::DeltaROverlapTool' )
505 alg.overlapTool.PhoMuORT.InputLabel = inputLabel
506 alg.overlapTool.PhoMuORT.OutputLabel = outputLabel
507 alg.overlapTool.PhoMuORT.LinkOverlapObjects = self.linkOverlapObjects
508 alg.overlapTool.PhoMuORT.OutputPassValue = True
509 if self.favourPhotonOverLepton:
510 alg.overlapTool.PhoMuORT.SwapContainerPrecedence = True
511
512 # Set up the photon-(narrow-)jet overlap removal.
513 if photons and jets and self.doPhJetOR:
514 config.addPrivateTool( 'overlapTool.PhoJetORT',
515 'ORUtils::DeltaROverlapTool' )
516 alg.overlapTool.PhoJetORT.InputLabel = inputLabel
517 alg.overlapTool.PhoJetORT.OutputLabel = outputLabel
518 alg.overlapTool.PhoJetORT.LinkOverlapObjects = self.linkOverlapObjects
519 alg.overlapTool.PhoJetORT.EnableUserPriority = self.enableUserPriority
520 alg.overlapTool.PhoJetORT.OutputPassValue = True
521
522 # Set up the electron-fat-jet overlap removal.
523 if electrons and fatJets and self.doEleFatJetOR:
524 config.addPrivateTool( 'overlapTool.EleFatJetORT',
525 'ORUtils::DeltaROverlapTool' )
526 alg.overlapTool.EleFatJetORT.InputLabel = inputLabel
527 alg.overlapTool.EleFatJetORT.OutputLabel = outputLabel
528 alg.overlapTool.EleFatJetORT.LinkOverlapObjects = self.linkOverlapObjects
529 alg.overlapTool.EleFatJetORT.DR = 1.0
530 alg.overlapTool.EleFatJetORT.OutputPassValue = True
531
532 # Set up the (narrow-)jet-fat-jet overlap removal.
533 if jets and fatJets and self.doJetFatJetOR:
534 config.addPrivateTool( 'overlapTool.JetFatJetORT',
535 'ORUtils::DeltaROverlapTool' )
536 alg.overlapTool.JetFatJetORT.InputLabel = inputLabel
537 alg.overlapTool.JetFatJetORT.OutputLabel = outputLabel
538 alg.overlapTool.JetFatJetORT.LinkOverlapObjects = self.linkOverlapObjects
539 alg.overlapTool.JetFatJetORT.DR = 1.0
540 alg.overlapTool.JetFatJetORT.OutputPassValue = True
541
542 if self.nominalOnly or self.nominalOnlyUnifiedSelection :
543 if electrons :
544 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORElectronsCopyAlg')
545 alg.particles = electrons
546 alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
547 if muons :
548 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORMuonsCopyAlg')
549 alg.particles = muons
550 alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
551 if taus :
552 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORTausCopyAlg')
553 alg.particles = taus
554 alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
555 if jets :
556 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORJetsCopyAlg')
557 alg.particles = jets
558 alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
559 if photons :
560 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORPhotonsCopyAlg')
561 alg.particles = photons
562 alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
563 if fatJets :
564 alg = config.createAlgorithm( 'CP::CopyNominalSelectionAlg', 'ORFatJetsCopyAlg')
565 alg.particles = fatJets
566 alg.selectionDecoration = outputLabel + '_%SYS%,as_char'
567
568 # provide a preselection if requested
569 if self.addPreselection:
570 if self.preselectLabel is not None :
571 preselectLabel = self.preselectLabel
572 else :
573 preselectLabel = outputLabel
574
575 if electrons :
576 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORElectronsPreselectionAlg')
577 alg.particles = electrons
578 alg.preselection = '&&'.join (config.getPreselection (self.electrons.split('.')[0], electronsSelectionName, asList=True)
579 + [outputLabel + '_%SYS%,as_char'])
580 alg.selectionDecoration = preselectLabel
581 config.addSelection (self.electrons.split('.')[0], electronsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or', writeToOutput=False)
582 if muons :
583 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORMuonsPreselectionAlg')
584 alg.particles = muons
585 alg.preselection = '&&'.join (config.getPreselection (self.muons.split('.')[0], muonsSelectionName, asList=True)
586 + [outputLabel + '_%SYS%,as_char'])
587 alg.selectionDecoration = preselectLabel
588 config.addSelection (self.muons.split('.')[0], muonsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or', writeToOutput=False)
589 if taus :
590 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORTausPreselectionAlg')
591 alg.particles = taus
592 alg.preselection = '&&'.join (config.getPreselection (self.taus.split('.')[0], tausSelectionName, asList=True)
593 + [outputLabel + '_%SYS%,as_char'])
594 alg.selectionDecoration = preselectLabel
595 config.addSelection (self.taus.split('.')[0], tausSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or', writeToOutput=False)
596 if jets :
597 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORJetsPreselectionAlg')
598 alg.particles = jets
599 alg.preselection = '&&'.join (config.getPreselection (self.jets.split('.')[0], jetsSelectionName, asList=True)
600 + [outputLabel + '_%SYS%,as_char'])
601 alg.selectionDecoration = preselectLabel
602 config.addSelection (self.jets.split('.')[0], jetsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or', writeToOutput=False)
603 if photons :
604 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORPhotonsPreselectionAlg')
605 alg.particles = photons
606 alg.preselection = '&&'.join (config.getPreselection (self.photons.split('.')[0], photonsSelectionName, asList=True)
607 + [outputLabel + '_%SYS%,as_char'])
608 alg.selectionDecoration = preselectLabel
609 config.addSelection (self.photons.split('.')[0], photonsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or', writeToOutput=False)
610 if fatJets :
611 alg = config.createAlgorithm( 'CP::AsgUnionPreselectionAlg','ORFatJetsPreselectionAlg')
612 alg.particles = fatJets
613 alg.preselection = '&&'.join (config.getPreselection (self.fatJets.split('.')[0], fatJetsSelectionName, asList=True)
614 + [outputLabel + '_%SYS%,as_char'])
615 alg.selectionDecoration = preselectLabel
616 config.addSelection (self.fatJets.split('.')[0], fatJetsSelectionName, alg.selectionDecoration+',as_char', bits=1, preselection=True, comesFrom='or', writeToOutput=False)
617
618
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ makeUnionPreselectionAlg()

python.OverlapAnalysisConfig.OverlapAnalysisConfig.makeUnionPreselectionAlg ( self,
config,
inputCollection )
Create a new selection for the inputCollection ('container.selection')
that is the union over all systematics of 'selection'. This allows us
to run nominal-only overlap removal while taking into account the impact
of systematics on object acceptance.

Definition at line 115 of file OverlapAnalysisConfig.py.

115 def makeUnionPreselectionAlg(self, config, inputCollection):
116 """
117 Create a new selection for the inputCollection ('container.selection')
118 that is the union over all systematics of 'selection'. This allows us
119 to run nominal-only overlap removal while taking into account the impact
120 of systematics on object acceptance.
121 """
122 container, selection = config.readNameAndSelection( inputCollection )
123 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlgForOR_' + inputCollection.split(".")[0] )
124 alg.preselection = selection
125 alg.particles = container
126 alg.selectionDecoration = 'unifiedSelectForOR'
127

Member Data Documentation

◆ addPreselection

bool python.OverlapAnalysisConfig.OverlapAnalysisConfig.addPreselection = False

Definition at line 146 of file OverlapAnalysisConfig.py.

◆ addToAllSelections

bool python.OverlapAnalysisConfig.OverlapAnalysisConfig.addToAllSelections = True

Definition at line 144 of file OverlapAnalysisConfig.py.

◆ doEleEleOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleEleOR

Definition at line 405 of file OverlapAnalysisConfig.py.

◆ doEleFatJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleFatJetOR

Definition at line 523 of file OverlapAnalysisConfig.py.

◆ doEleJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleJetOR

Definition at line 423 of file OverlapAnalysisConfig.py.

◆ doEleMuOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleMuOR

Definition at line 414 of file OverlapAnalysisConfig.py.

◆ doJetFatJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doJetFatJetOR

Definition at line 533 of file OverlapAnalysisConfig.py.

◆ doMuJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doMuJetOR

Definition at line 437 of file OverlapAnalysisConfig.py.

◆ doPhEleOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doPhEleOR

Definition at line 491 of file OverlapAnalysisConfig.py.

◆ doPhJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doPhJetOR

Definition at line 513 of file OverlapAnalysisConfig.py.

◆ doPhMuOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doPhMuOR

Definition at line 502 of file OverlapAnalysisConfig.py.

◆ doTauAntiTauJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauAntiTauJetOR

Definition at line 473 of file OverlapAnalysisConfig.py.

◆ doTauEleOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauEleOR

Definition at line 452 of file OverlapAnalysisConfig.py.

◆ doTauJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauJetOR

Definition at line 472 of file OverlapAnalysisConfig.py.

◆ doTauMuOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauMuOR

Definition at line 462 of file OverlapAnalysisConfig.py.

◆ electrons

python.OverlapAnalysisConfig.OverlapAnalysisConfig.electrons

Definition at line 260 of file OverlapAnalysisConfig.py.

◆ electronsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.electronsSelectionName

Definition at line 174 of file OverlapAnalysisConfig.py.

◆ fatJets

python.OverlapAnalysisConfig.OverlapAnalysisConfig.fatJets

Definition at line 345 of file OverlapAnalysisConfig.py.

◆ fatJetsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.fatJetsSelectionName

Definition at line 194 of file OverlapAnalysisConfig.py.

◆ favourPhotonOverLepton

python.OverlapAnalysisConfig.OverlapAnalysisConfig.favourPhotonOverLepton

Definition at line 498 of file OverlapAnalysisConfig.py.

◆ forceOROutputFlagName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.forceOROutputFlagName

Definition at line 269 of file OverlapAnalysisConfig.py.

◆ forceOROutputFlags

python.OverlapAnalysisConfig.OverlapAnalysisConfig.forceOROutputFlags

Definition at line 239 of file OverlapAnalysisConfig.py.

◆ jets

python.OverlapAnalysisConfig.OverlapAnalysisConfig.jets

Definition at line 328 of file OverlapAnalysisConfig.py.

◆ jetsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.jetsSelectionName

Definition at line 190 of file OverlapAnalysisConfig.py.

◆ muons

python.OverlapAnalysisConfig.OverlapAnalysisConfig.muons

Definition at line 294 of file OverlapAnalysisConfig.py.

◆ muonsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.muonsSelectionName

Definition at line 178 of file OverlapAnalysisConfig.py.

◆ nominalOnlyUnifiedSelection

python.OverlapAnalysisConfig.OverlapAnalysisConfig.nominalOnlyUnifiedSelection

Definition at line 259 of file OverlapAnalysisConfig.py.

◆ photons

python.OverlapAnalysisConfig.OverlapAnalysisConfig.photons

Definition at line 277 of file OverlapAnalysisConfig.py.

◆ photonsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.photonsSelectionName

Definition at line 182 of file OverlapAnalysisConfig.py.

◆ taus

python.OverlapAnalysisConfig.OverlapAnalysisConfig.taus

Definition at line 311 of file OverlapAnalysisConfig.py.

◆ tausSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.tausSelectionName

Definition at line 186 of file OverlapAnalysisConfig.py.


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