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