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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 834 of file AsgAnalysisConfig.py.

834 def __init__ (self) :
835 super().__init__ ()
836 self.setBlockName('Thinning')
837 self.addOption ('containerName', '', type=str,
838 noneAction='error',
839 info="the name of the input container.",
840 meta={'role':'containerRef'})
841 self.addOption ('postfix', '', type=str,
842 info="a postfix to apply to decorations and algorithm names. "
843 "Typically not needed here.")
844 self.addOption ('selection', '', type=str,
845 info="the name of an optional selection decoration to use.",
846 meta={'role':'selection'})
847 self.addOption ('selectionName', '', type=str,
848 info="the name of the selection to append this to. If left empty, "
849 "the cuts are applied to every "
850 "object within the container. Specifying a name (e.g. `loose`) "
851 "applies the cut only to those object who also pass that selection.",
852 meta={'role':'selection'})
853 self.addOption ('outputName', None, type=str,
854 info="an optional name for the output container.",
855 meta={'role':'container'})
856 self.addOption ('deepCopy', False, type=bool,
857 info="run a deep copy of the container.")
858 self.addOption ('sortPt', False, type=bool,
859 info=r"whether to sort objects in $p_\mathrm{T}$.")
860 self.addOption ('noUniformSelection', False, type=bool,
861 info="do not run the union over all selections.")
862 self.addOption ('containerType', None, type=str,
863 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.")
864

Member Function Documentation

◆ instanceName()

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

Definition at line 865 of file AsgAnalysisConfig.py.

865 def instanceName (self) :
866 """Return the instance name for this block"""
867 return self.containerName + '_' + self.selectionName + self.postfix
868

◆ makeAlgs()

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

Definition at line 869 of file AsgAnalysisConfig.py.

869 def makeAlgs (self, config) :
870
871 postfix = self.postfix
872 if postfix != '' and postfix[0] != '_' :
873 postfix = '_' + postfix
874
875 selection = config.getFullSelection (self.containerName, self.selectionName)
876 if selection == '' :
877 selection = self.selection
878 elif self.selection != '' :
879 selection = selection + '&&' + self.selection
880
881 if selection != '' and not self.noUniformSelection :
882 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlg')
883 alg.preselection = selection
884 alg.particles = config.readName (self.containerName)
885 alg.selectionDecoration = 'outputSelect' + postfix
886 config.addSelection (self.containerName, alg.selectionDecoration, selection)
887 selection = 'outputSelect' + postfix
888
889 alg = config.createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'DeepCopyAlg' )
890 alg.input = config.readName (self.containerName)
891 if self.outputName is not None :
892 alg.output = self.outputName + '_%SYS%'
893 config.addOutputContainer (self.containerName, self.outputName)
894 else :
895 alg.output = config.copyName (self.containerName)
896 if self.containerType is not None :
897 alg.outputType = self.containerType
898 if selection != '' :
899 alg.selection = [selection]
900 else :
901 alg.selection = []
902 alg.deepCopy = self.deepCopy
903 if self.sortPt and not config.noSystematics() :
904 raise ValueError ("Sorting by pt is not supported with systematics")
905 alg.sortPt = self.sortPt
906
907

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 886 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 893 of file AsgAnalysisConfig.py.


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