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 711 of file AsgAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 714 of file AsgAnalysisConfig.py.

714 def __init__ (self) :
715 super (OutputThinningBlock, self).__init__ ()
716 self.setBlockName('Thinning')
717 self.addOption ('containerName', '', type=str,
718 noneAction='error',
719 info="the name of the input container.")
720 self.addOption ('postfix', '', type=str,
721 info="a postfix to apply to decorations and algorithm names. "
722 "Typically not needed here.")
723 self.addOption ('selection', '', type=str,
724 info="the name of an optional selection decoration to use.")
725 self.addOption ('selectionName', '', type=str,
726 info="the name of the selection to append this to. If left empty, "
727 "the cuts are applied to every "
728 "object within the container. Specifying a name (e.g. `loose`) "
729 "applies the cut only to those object who also pass that selection.")
730 self.addOption ('outputName', None, type=str,
731 info="an optional name for the output container.")
732 self.addOption ('deepCopy', False, type=bool,
733 info="run a deep copy of the container.")
734 self.addOption ('sortPt', False, type=bool,
735 info=r"whether to sort objects in $p_\mathrm{T}$.")
736 self.addOption ('noUniformSelection', False, type=bool,
737 info="do not run the union over all selections.")
738 self.addOption ('containerType', None, type=str,
739 info="the type of the container to thin. Only needed in AthenaMT, and only if subsequent code has a data dependency on the created container under that type.")
740

Member Function Documentation

◆ instanceName()

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

Definition at line 741 of file AsgAnalysisConfig.py.

741 def instanceName (self) :
742 """Return the instance name for this block"""
743 return self.containerName + '_' + self.selectionName + self.postfix
744

◆ makeAlgs()

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

Definition at line 745 of file AsgAnalysisConfig.py.

745 def makeAlgs (self, config) :
746
747 postfix = self.postfix
748 if postfix != '' and postfix[0] != '_' :
749 postfix = '_' + postfix
750
751 selection = config.getFullSelection (self.containerName, self.selectionName)
752 if selection == '' :
753 selection = self.selection
754 elif self.selection != '' :
755 selection = selection + '&&' + self.selection
756
757 if selection != '' and not self.noUniformSelection :
758 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlg')
759 alg.preselection = selection
760 alg.particles = config.readName (self.containerName)
761 alg.selectionDecoration = 'outputSelect' + postfix
762 config.addSelection (self.containerName, alg.selectionDecoration, selection)
763 selection = 'outputSelect' + postfix
764
765 alg = config.createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'DeepCopyAlg' )
766 alg.input = config.readName (self.containerName)
767 if self.outputName is not None :
768 alg.output = self.outputName + '_%SYS%'
769 config.addOutputContainer (self.containerName, self.outputName)
770 else :
771 alg.output = config.copyName (self.containerName)
772 if self.containerType is not None :
773 alg.outputType = self.containerType
774 if selection != '' :
775 alg.selection = [selection]
776 else :
777 alg.selection = []
778 alg.deepCopy = self.deepCopy
779 if self.sortPt and not config.noSystematics() :
780 raise ValueError ("Sorting by pt is not supported with systematics")
781 alg.sortPt = self.sortPt
782
783

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 762 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 769 of file AsgAnalysisConfig.py.


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