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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 826 of file AsgAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

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

Definition at line 857 of file AsgAnalysisConfig.py.

857 def instanceName (self) :
858 """Return the instance name for this block"""
859 return self.containerName + '_' + self.selectionName + self.postfix
860

◆ makeAlgs()

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

Definition at line 861 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 878 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 885 of file AsgAnalysisConfig.py.


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