the ConfigBlock for output thinning
Definition at line 626 of file AsgAnalysisConfig.py.
◆ __init__()
| def python.AsgAnalysisConfig.OutputThinningBlock.__init__ |
( |
|
self | ) |
|
Definition at line 629 of file AsgAnalysisConfig.py.
630 super (OutputThinningBlock, self).__init__ ()
631 self.addOption (
'containerName',
'', type=str,
633 info=
"the name of the input container.")
634 self.addOption (
'postfix',
'', type=str,
635 info=
"a postfix to apply to decorations and algorithm names. "
636 "Typically not needed here.")
637 self.addOption (
'selection',
'', type=str,
638 info=
"the name of an optional selection decoration to use.")
639 self.addOption (
'selectionName',
'', type=str,
640 info=
"the name of the selection to append this to. The default is "
641 "'' (empty string), meaning that the cuts are applied to every "
642 "object within the container. Specifying a name (e.g. loose) "
643 "applies the cut only to those object who also pass that selection.")
644 self.addOption (
'outputName',
None, type=str,
645 info=
"an optional name for the output container.")
647 self.addOption (
'deepCopy',
False, type=bool,
649 self.addOption (
'sortPt',
False, type=bool,
650 info=
"whether to sort objects in pt")
652 self.addOption (
'noUniformSelection',
False, type=bool,
◆ instanceName()
| def python.AsgAnalysisConfig.OutputThinningBlock.instanceName |
( |
|
self | ) |
|
Return the instance name for this block
Definition at line 655 of file AsgAnalysisConfig.py.
655 def instanceName (self) :
656 """Return the instance name for this block"""
657 return self.containerName +
'_' + self.selectionName + self.postfix
◆ makeAlgs()
| def python.AsgAnalysisConfig.OutputThinningBlock.makeAlgs |
( |
|
self, |
|
|
|
config |
|
) |
| |
Definition at line 659 of file AsgAnalysisConfig.py.
659 def makeAlgs (self, config) :
661 postfix = self.postfix
662 if postfix !=
'' and postfix[0] !=
'_' :
663 postfix =
'_' + postfix
665 selection = config.getFullSelection (self.containerName, self.selectionName)
667 selection = self.selection
668 elif self.selection !=
'' :
669 selection = selection +
'&&' + self.selection
671 if selection !=
'' and not self.noUniformSelection :
672 alg = config.createAlgorithm(
'CP::AsgUnionSelectionAlg',
'UnionSelectionAlg')
673 alg.preselection = selection
674 alg.particles = config.readName (self.containerName)
675 alg.selectionDecoration =
'outputSelect' + postfix
676 config.addSelection (self.containerName, alg.selectionDecoration, selection)
677 selection =
'outputSelect' + postfix
679 alg = config.createAlgorithm(
'CP::AsgViewFromSelectionAlg',
'DeepCopyAlg' )
680 alg.input = config.readName (self.containerName)
681 if self.outputName
is not None :
682 alg.output = self.outputName +
'_%SYS%'
683 config.addOutputContainer (self.containerName, self.outputName)
685 alg.output = config.copyName (self.containerName)
687 alg.selection = [selection]
690 alg.deepCopy = self.deepCopy
691 if self.sortPt
and not config.noSystematics() :
692 raise ValueError (
"Sorting by pt is not supported with systematics")
693 alg.sortPt = self.sortPt
The documentation for this class was generated from the following file: