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; try 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. If left empty, apply the OR decision to the entire input containers.",
19 meta={'role':'selection'})
20 self.addOption ('linkOverlapObjects', False, type=bool,
21 info="whether to set up an element link between overlapping objects.")
22 self.addOption ('enableUserPriority', False, type=bool,
23 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).")
24 self.addOption ('forceOROutputFlags', False, type=bool,
25 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.")
26 self.addOption ('forceOROutputFlagName', '', type=str,
27 info="override the default output name for the OR decisions, which is otherwise automatically constructed dependent on the configuration.")
28 self.addOption ('bJetLabel', '', type=str,
29 info="flag to select b-jets with. If left empty, no b-jets are used in the overlap removal.")
30 self.addOption ('InnerDR', 0.2, type=float,
31 info="radius of the inner cone for removing jets (`EleJetORT`/`MuJetORT`).")
32 self.addOption ('OuterDR', 0.4, type=float,
33 info="radius of the outer cone for removing leptons (`EleJetORT`/`MuJetORT`).")
34 self.addOption ('boostedLeptons', False, type=bool,
35 info="whether to enable boosted lepton overlap removal (toggles on the property `UseSlidingDR` of the `ORUtils::EleJetOverlapTool` and `ORUtils::MuJetOverlapTool` tools).")
36 self.addOption ('nominalOnly', False, type=bool,
37 info="(experimental) toggle off the running of overlap removal on systematically-varied objects (instead, copy from nominal).",
38 expertMode=True)
39 self.addOption ('nominalOnlyUnifiedSelection', False, type=bool,
40 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).",
41 expertMode=True)
42 self.addOption ('jets', "", type=str,
43 info="the input jet container.",
44 meta={'role':'containerRef'})
45 self.addOption ('fatJets', "", type=str,
46 info="the input large-R jet container.",
47 meta={'role':'containerRef'})
48 self.addOption ('electrons', "", type=str,
49 info="the input electron container.",
50 meta={'role':'containerRef'})
51 self.addOption ('muons', "", type=str,
52 info="the input muon container.",
53 meta={'role':'containerRef'})
54 self.addOption ('photons', "", type=str,
55 info="the input photon container.",
56 meta={'role':'containerRef'})
57 self.addOption ('taus', "", type=str,
58 info="the input tau-jet container.",
59 meta={'role':'containerRef'})
60 self.addOption ('antiTauIDTauLabel', '', type=str,
61 info="flag to select the ID tau-jet for the tau-antitau-jet overlap removal.")
62 self.addOption ('antiTauLabel', '', type=str,
63 info="flag to select the anti-tau-jet for the tau-antitau-jet overlap removal.")
64 self.addOption ('antiTauBJetLabel', '', type=str,
65 info="flag to select b-jets for the tau-antitau-jet overlap removal.")
66 self.addOption ('addToAllSelections', None, type=bool,
67 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.")
68 self.addOption ('addPreselection', None, type=bool,
69 info="add preselection decorations without systematics. If set to `None`, will be turned on in case of multiple Overlap Removal setups.")
70 self.addOption ('preselectLabel', None, type=str,
71 info="label to use when adding preselection decorations. If set to `None`, uses the `outputLabel` instead.")
72 self.addOption ('jetsSelectionName', None, type=str,
73 info="name of the selection on the jet container to create/append the OR decision. If set to `None`, uses the `selectionName` instead.",
74 meta={'role':'selection'})
75 self.addOption ('fatJetsSelectionName', None, type=str,
76 info="name of the selection on the large-R jet container to create/append the OR decision. If set to `None`, uses the `selectionName` instead.",
77 meta={'role':'selection'})
78 self.addOption ('electronsSelectionName', None, type=str,
79 info="name of the selection on the electron container to create/append the OR decision. If set to `None`, uses the `selectionName` instead.",
80 meta={'role':'selection'})
81 self.addOption ('muonsSelectionName', None, type=str,
82 info="name of the selection on the muon container to create/append the OR decision. If set to `None`, uses the `selectionName` instead.",
83 meta={'role':'selection'})
84 self.addOption ('photonsSelectionName', None, type=str,
85 info="name of the selection on the photon container to create/append the OR decision. If set to `None`, uses the `selectionName` instead.",
86 meta={'role':'selection'})
87 self.addOption ('tausSelectionName', None, type=str,
88 info="name of the selection on the tau-jet container to create/append the OR decision. If set to `None`, uses the `selectionName` instead.",
89 meta={'role':'selection'})
90 self.addOption ('doEleEleOR', False, type=bool,
91 info="whether to perform the overlap removal amongst electrons.")
92 self.addOption ('doEleMuOR', True, type=bool,
93 info="whether to perform the overlap removal between electrons and muons.")
94 self.addOption ('doEleJetOR', True, type=bool,
95 info="whether to perform the overlap removal between electrons and jets.")
96 self.addOption ('doMuJetOR', True, type=bool,
97 info="whether to perform the overlap removal between muons and jets.")
98 self.addOption ('doTauEleOR', True, type=bool,
99 info="whether to perform the overlap removal between tau-jets and electrons.")
100 self.addOption ('doTauMuOR', True, type=bool,
101 info="whether to perform the overlap removal between tau-jets and muons.")
102 self.addOption ('doTauJetOR', True, type=bool,
103 info="whether to perform the overlap removal between tau-jets and jets.")
104 self.addOption ('doTauAntiTauJetOR', False, type=bool,
105 info="whether to perform the overlap removal between tau-jets and anti-tau-jets.")
106 self.addOption ('doPhEleOR', True, type=bool,
107 info="whether to perform the overlap removal between photons and electrons.")
108 self.addOption ('doPhMuOR', True, type=bool,
109 info="whether to perform the overlap removal between photons and muons.")
110 self.addOption ('doPhJetOR', True, type=bool,
111 info="whether to perform the overlap removal between photons and jets.")
112 self.addOption ('doEleFatJetOR', True, type=bool,
113 info="whether to perform the overlap removal between electrons and large-R jets.")
114 self.addOption ('doJetFatJetOR', True, type=bool,
115 info="whether to perform the overlap removal between jets and large-R jets.")
116 self.addOption ('favourPhotonOverLepton', False, type=bool,
117 info="whether to give priority to photons in the overlap removal between leptons and photons.")
118 self.addOption ('allowNoPV', False, type=bool,
119 info="whether to allow proceeding with overlap removal even when no primary vertex is found.")
120
121

Member Function Documentation

◆ instanceName()

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

Definition at line 122 of file OverlapAnalysisConfig.py.

122 def instanceName (self) :
123 """Return the instance name for this block"""
124 if self.selectionName is not None:
125 return self.selectionName
126 return self.outputLabel
127

◆ makeAlgs()

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

Definition at line 141 of file OverlapAnalysisConfig.py.

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

◆ 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 128 of file OverlapAnalysisConfig.py.

128 def makeUnionPreselectionAlg(self, config, inputCollection):
129 """
130 Create a new selection for the inputCollection ('container.selection')
131 that is the union over all systematics of 'selection'. This allows us
132 to run nominal-only overlap removal while taking into account the impact
133 of systematics on object acceptance.
134 """
135 container, selection = config.readNameAndSelection( inputCollection )
136 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlgForOR_' + inputCollection.split(".")[0] )
137 alg.preselection = selection
138 alg.particles = container
139 alg.selectionDecoration = 'unifiedSelectForOR'
140

Member Data Documentation

◆ addPreselection

bool python.OverlapAnalysisConfig.OverlapAnalysisConfig.addPreselection = False

Definition at line 159 of file OverlapAnalysisConfig.py.

◆ addToAllSelections

bool python.OverlapAnalysisConfig.OverlapAnalysisConfig.addToAllSelections = True

Definition at line 157 of file OverlapAnalysisConfig.py.

◆ doEleEleOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleEleOR

Definition at line 418 of file OverlapAnalysisConfig.py.

◆ doEleFatJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleFatJetOR

Definition at line 536 of file OverlapAnalysisConfig.py.

◆ doEleJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleJetOR

Definition at line 436 of file OverlapAnalysisConfig.py.

◆ doEleMuOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doEleMuOR

Definition at line 427 of file OverlapAnalysisConfig.py.

◆ doJetFatJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doJetFatJetOR

Definition at line 546 of file OverlapAnalysisConfig.py.

◆ doMuJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doMuJetOR

Definition at line 450 of file OverlapAnalysisConfig.py.

◆ doPhEleOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doPhEleOR

Definition at line 504 of file OverlapAnalysisConfig.py.

◆ doPhJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doPhJetOR

Definition at line 526 of file OverlapAnalysisConfig.py.

◆ doPhMuOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doPhMuOR

Definition at line 515 of file OverlapAnalysisConfig.py.

◆ doTauAntiTauJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauAntiTauJetOR

Definition at line 486 of file OverlapAnalysisConfig.py.

◆ doTauEleOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauEleOR

Definition at line 465 of file OverlapAnalysisConfig.py.

◆ doTauJetOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauJetOR

Definition at line 485 of file OverlapAnalysisConfig.py.

◆ doTauMuOR

python.OverlapAnalysisConfig.OverlapAnalysisConfig.doTauMuOR

Definition at line 475 of file OverlapAnalysisConfig.py.

◆ electrons

python.OverlapAnalysisConfig.OverlapAnalysisConfig.electrons

Definition at line 273 of file OverlapAnalysisConfig.py.

◆ electronsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.electronsSelectionName

Definition at line 187 of file OverlapAnalysisConfig.py.

◆ fatJets

python.OverlapAnalysisConfig.OverlapAnalysisConfig.fatJets

Definition at line 358 of file OverlapAnalysisConfig.py.

◆ fatJetsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.fatJetsSelectionName

Definition at line 207 of file OverlapAnalysisConfig.py.

◆ favourPhotonOverLepton

python.OverlapAnalysisConfig.OverlapAnalysisConfig.favourPhotonOverLepton

Definition at line 511 of file OverlapAnalysisConfig.py.

◆ forceOROutputFlagName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.forceOROutputFlagName

Definition at line 282 of file OverlapAnalysisConfig.py.

◆ forceOROutputFlags

python.OverlapAnalysisConfig.OverlapAnalysisConfig.forceOROutputFlags

Definition at line 252 of file OverlapAnalysisConfig.py.

◆ jets

python.OverlapAnalysisConfig.OverlapAnalysisConfig.jets

Definition at line 341 of file OverlapAnalysisConfig.py.

◆ jetsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.jetsSelectionName

Definition at line 203 of file OverlapAnalysisConfig.py.

◆ muons

python.OverlapAnalysisConfig.OverlapAnalysisConfig.muons

Definition at line 307 of file OverlapAnalysisConfig.py.

◆ muonsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.muonsSelectionName

Definition at line 191 of file OverlapAnalysisConfig.py.

◆ nominalOnlyUnifiedSelection

python.OverlapAnalysisConfig.OverlapAnalysisConfig.nominalOnlyUnifiedSelection

Definition at line 272 of file OverlapAnalysisConfig.py.

◆ photons

python.OverlapAnalysisConfig.OverlapAnalysisConfig.photons

Definition at line 290 of file OverlapAnalysisConfig.py.

◆ photonsSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.photonsSelectionName

Definition at line 195 of file OverlapAnalysisConfig.py.

◆ taus

python.OverlapAnalysisConfig.OverlapAnalysisConfig.taus

Definition at line 324 of file OverlapAnalysisConfig.py.

◆ tausSelectionName

python.OverlapAnalysisConfig.OverlapAnalysisConfig.tausSelectionName

Definition at line 199 of file OverlapAnalysisConfig.py.


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