the ConfigBlock for output thinning
Definition at line 600 of file AsgAnalysisConfig.py.
◆ __init__()
def python.AsgAnalysisConfig.OutputThinningBlock.__init__ |
( |
|
self | ) |
|
Definition at line 603 of file AsgAnalysisConfig.py.
604 super (OutputThinningBlock, self).__init__ ()
605 self.addOption (
'containerName',
'', type=str,
607 info=
"the name of the input container.")
608 self.addOption (
'postfix',
'', type=str,
609 info=
"a postfix to apply to decorations and algorithm names. "
610 "Typically not needed here.")
611 self.addOption (
'selection',
'', type=str,
612 info=
"the name of an optional selection decoration to use.")
613 self.addOption (
'selectionName',
'', type=str,
614 info=
"the name of the selection to append this to. The default is "
615 "'' (empty string), meaning that the cuts are applied to every "
616 "object within the container. Specifying a name (e.g. loose) "
617 "applies the cut only to those object who also pass that selection.")
618 self.addOption (
'outputName',
None, type=str,
619 info=
"an optional name for the output container.")
621 self.addOption (
'deepCopy',
False, type=bool,
623 self.addOption (
'sortPt',
False, type=bool,
624 info=
"whether to sort objects in pt")
626 self.addOption (
'noUniformSelection',
False, type=bool,
◆ instanceName()
def python.AsgAnalysisConfig.OutputThinningBlock.instanceName |
( |
|
self | ) |
|
Return the instance name for this block
Definition at line 629 of file AsgAnalysisConfig.py.
629 def instanceName (self) :
630 """Return the instance name for this block"""
631 return self.containerName +
'_' + self.selectionName + self.postfix
◆ makeAlgs()
def python.AsgAnalysisConfig.OutputThinningBlock.makeAlgs |
( |
|
self, |
|
|
|
config |
|
) |
| |
Definition at line 633 of file AsgAnalysisConfig.py.
633 def makeAlgs (self, config) :
635 postfix = self.postfix
636 if postfix !=
'' and postfix[0] !=
'_' :
637 postfix =
'_' + postfix
639 selection = config.getFullSelection (self.containerName, self.selectionName)
641 selection = self.selection
642 elif self.selection !=
'' :
643 selection = selection +
'&&' + self.selection
645 if selection !=
'' and not self.noUniformSelection :
646 alg = config.createAlgorithm(
'CP::AsgUnionSelectionAlg',
'UnionSelectionAlg')
647 alg.preselection = selection
648 alg.particles = config.readName (self.containerName)
649 alg.selectionDecoration =
'outputSelect' + postfix
650 config.addSelection (self.containerName, alg.selectionDecoration, selection)
651 selection =
'outputSelect' + postfix
653 alg = config.createAlgorithm(
'CP::AsgViewFromSelectionAlg',
'DeepCopyAlg' )
654 alg.input = config.readName (self.containerName)
655 if self.outputName
is not None :
656 alg.output = self.outputName +
'_%SYS%'
657 config.addOutputContainer (self.containerName, self.outputName)
659 alg.output = config.copyName (self.containerName)
661 alg.selection = [selection]
664 alg.deepCopy = self.deepCopy
665 if self.sortPt
and not config.noSystematics() :
666 raise ValueError (
"Sorting by pt is not supported with systematics")
667 alg.sortPt = self.sortPt
The documentation for this class was generated from the following file: