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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 724 of file AsgAnalysisConfig.py.

724 def __init__ (self) :
725 super (OutputThinningBlock, self).__init__ ()
726 self.setBlockName('Thinning')
727 self.addOption ('containerName', '', type=str,
728 noneAction='error',
729 info="the name of the input container.")
730 self.addOption ('postfix', '', type=str,
731 info="a postfix to apply to decorations and algorithm names. "
732 "Typically not needed here.")
733 self.addOption ('selection', '', type=str,
734 info="the name of an optional selection decoration to use.")
735 self.addOption ('selectionName', '', type=str,
736 info="the name of the selection to append this to. If left empty, "
737 "the cuts are applied to every "
738 "object within the container. Specifying a name (e.g. `loose`) "
739 "applies the cut only to those object who also pass that selection.")
740 self.addOption ('outputName', None, type=str,
741 info="an optional name for the output container.")
742 self.addOption ('deepCopy', False, type=bool,
743 info="run a deep copy of the container.")
744 self.addOption ('sortPt', False, type=bool,
745 info=r"whether to sort objects in $p_\mathrm{T}$.")
746 self.addOption ('noUniformSelection', False, type=bool,
747 info="do not run the union over all selections.")
748 self.addOption ('containerType', None, type=str,
749 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.")
750

Member Function Documentation

◆ instanceName()

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

Definition at line 751 of file AsgAnalysisConfig.py.

751 def instanceName (self) :
752 """Return the instance name for this block"""
753 return self.containerName + '_' + self.selectionName + self.postfix
754

◆ makeAlgs()

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

Definition at line 755 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 772 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 779 of file AsgAnalysisConfig.py.


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