ATLAS Offline Software
Loading...
Searching...
No Matches
python.AsgAnalysisConfig.OutputThinningBlock Class Reference
Inheritance diagram for python.AsgAnalysisConfig.OutputThinningBlock:
Collaboration diagram for python.AsgAnalysisConfig.OutputThinningBlock:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

 containerName
 outputName

Detailed Description

the ConfigBlock for output thinning

Definition at line 666 of file AsgAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 669 of file AsgAnalysisConfig.py.

669 def __init__ (self) :
670 super (OutputThinningBlock, self).__init__ ()
671 self.addOption ('containerName', '', type=str,
672 noneAction='error',
673 info="the name of the input container.")
674 self.addOption ('postfix', '', type=str,
675 info="a postfix to apply to decorations and algorithm names. "
676 "Typically not needed here.")
677 self.addOption ('selection', '', type=str,
678 info="the name of an optional selection decoration to use.")
679 self.addOption ('selectionName', '', type=str,
680 info="the name of the selection to append this to. The default is "
681 "'' (empty string), meaning that the cuts are applied to every "
682 "object within the container. Specifying a name (e.g. loose) "
683 "applies the cut only to those object who also pass that selection.")
684 self.addOption ('outputName', None, type=str,
685 info="an optional name for the output container.")
686 # TODO: add info string
687 self.addOption ('deepCopy', False, type=bool,
688 info="")
689 self.addOption ('sortPt', False, type=bool,
690 info="whether to sort objects in pt")
691 # TODO: add info string
692 self.addOption ('noUniformSelection', False, type=bool,
693 info="")
694

Member Function Documentation

◆ instanceName()

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

Definition at line 695 of file AsgAnalysisConfig.py.

695 def instanceName (self) :
696 """Return the instance name for this block"""
697 return self.containerName + '_' + self.selectionName + self.postfix
698

◆ makeAlgs()

python.AsgAnalysisConfig.OutputThinningBlock.makeAlgs ( self,
config )

Definition at line 699 of file AsgAnalysisConfig.py.

699 def makeAlgs (self, config) :
700
701 postfix = self.postfix
702 if postfix != '' and postfix[0] != '_' :
703 postfix = '_' + postfix
704
705 selection = config.getFullSelection (self.containerName, self.selectionName)
706 if selection == '' :
707 selection = self.selection
708 elif self.selection != '' :
709 selection = selection + '&&' + self.selection
710
711 if selection != '' and not self.noUniformSelection :
712 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlg')
713 alg.preselection = selection
714 alg.particles = config.readName (self.containerName)
715 alg.selectionDecoration = 'outputSelect' + postfix
716 config.addSelection (self.containerName, alg.selectionDecoration, selection)
717 selection = 'outputSelect' + postfix
718
719 alg = config.createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'DeepCopyAlg' )
720 alg.input = config.readName (self.containerName)
721 if self.outputName is not None :
722 alg.output = self.outputName + '_%SYS%'
723 config.addOutputContainer (self.containerName, self.outputName)
724 else :
725 alg.output = config.copyName (self.containerName)
726 if selection != '' :
727 alg.selection = [selection]
728 else :
729 alg.selection = []
730 alg.deepCopy = self.deepCopy
731 if self.sortPt and not config.noSystematics() :
732 raise ValueError ("Sorting by pt is not supported with systematics")
733 alg.sortPt = self.sortPt
734
735

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 716 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 723 of file AsgAnalysisConfig.py.


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