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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 706 of file AsgAnalysisConfig.py.

706 def __init__ (self) :
707 super (OutputThinningBlock, self).__init__ ()
708 self.setBlockName('Thinning')
709 self.addOption ('containerName', '', type=str,
710 noneAction='error',
711 info="the name of the input container.")
712 self.addOption ('postfix', '', type=str,
713 info="a postfix to apply to decorations and algorithm names. "
714 "Typically not needed here.")
715 self.addOption ('selection', '', type=str,
716 info="the name of an optional selection decoration to use.")
717 self.addOption ('selectionName', '', type=str,
718 info="the name of the selection to append this to. If left empty, "
719 "the cuts are applied to every "
720 "object within the container. Specifying a name (e.g. `loose`) "
721 "applies the cut only to those object who also pass that selection.")
722 self.addOption ('outputName', None, type=str,
723 info="an optional name for the output container.")
724 self.addOption ('deepCopy', False, type=bool,
725 info="run a deep copy of the container.")
726 self.addOption ('sortPt', False, type=bool,
727 info=r"whether to sort objects in $p_\mathrm{T}$.")
728 self.addOption ('noUniformSelection', False, type=bool,
729 info="do not run the union over all selections.")
730 self.addOption ('containerType', None, type=str,
731 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.")
732

Member Function Documentation

◆ instanceName()

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

Definition at line 733 of file AsgAnalysisConfig.py.

733 def instanceName (self) :
734 """Return the instance name for this block"""
735 return self.containerName + '_' + self.selectionName + self.postfix
736

◆ makeAlgs()

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

Definition at line 737 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 754 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 761 of file AsgAnalysisConfig.py.


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