141 def makeAlgs (self, config) :
142
143 import logging, sys
144 log = logging.getLogger('OverlapRemovalConfig')
145
146 if self.addToAllSelections is None:
147
148
149
150
151
152
153
154 numORblocks = OverlapAnalysisConfig.get_instance_count()
155 if numORblocks == 1:
156
157 self.addToAllSelections = True
158 if self.addPreselection is None:
159 self.addPreselection = False
160 else:
161
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
182 if OverlapAnalysisConfig.get_instance_count() > 1:
183
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
212
213
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
240
241
242
243
244
245
246
247
248
249
250 def enableOutput(containerName, selectionName):
251
252 if self.forceOROutputFlags:
253 return True
254
255
256 if selectionName == '':
257 return False
258
259
260 if selectionName in config.getSelectionNames(containerName.split(".")[0]):
261 return False
262
263
264 return True
265
266
267
268
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
375
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
406 config.addPrivateTool( 'overlapTool', 'ORUtils::OverlapRemovalTool' )
407 alg.overlapTool.InputLabel = inputLabel
408 alg.overlapTool.OutputLabel = outputLabel
409
410
411
412
413
414
415 alg.overlapTool.OutputPassValue = True
416
417
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
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
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
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
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
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
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
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
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
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
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
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
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=":")