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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 682 of file AsgAnalysisConfig.py.

682 def __init__ (self) :
683 super (OutputThinningBlock, self).__init__ ()
684 self.setBlockName('Thinning')
685 self.addOption ('containerName', '', type=str,
686 noneAction='error',
687 info="the name of the input container.")
688 self.addOption ('postfix', '', type=str,
689 info="a postfix to apply to decorations and algorithm names. "
690 "Typically not needed here.")
691 self.addOption ('selection', '', type=str,
692 info="the name of an optional selection decoration to use.")
693 self.addOption ('selectionName', '', type=str,
694 info="the name of the selection to append this to. If left empty, "
695 "the cuts are applied to every "
696 "object within the container. Specifying a name (e.g. `loose`) "
697 "applies the cut only to those object who also pass that selection.")
698 self.addOption ('outputName', None, type=str,
699 info="an optional name for the output container.")
700 self.addOption ('deepCopy', False, type=bool,
701 info="run a deep copy of the container.")
702 self.addOption ('sortPt', False, type=bool,
703 info=r"whether to sort objects in $p_\mathrm{T}$.")
704 self.addOption ('noUniformSelection', False, type=bool,
705 info="do not run the union over all selections.")
706 self.addOption ('containerType', None, type=str,
707 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.")
708

Member Function Documentation

◆ instanceName()

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

Definition at line 709 of file AsgAnalysisConfig.py.

709 def instanceName (self) :
710 """Return the instance name for this block"""
711 return self.containerName + '_' + self.selectionName + self.postfix
712

◆ makeAlgs()

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

Definition at line 713 of file AsgAnalysisConfig.py.

713 def makeAlgs (self, config) :
714
715 postfix = self.postfix
716 if postfix != '' and postfix[0] != '_' :
717 postfix = '_' + postfix
718
719 selection = config.getFullSelection (self.containerName, self.selectionName)
720 if selection == '' :
721 selection = self.selection
722 elif self.selection != '' :
723 selection = selection + '&&' + self.selection
724
725 if selection != '' and not self.noUniformSelection :
726 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlg')
727 alg.preselection = selection
728 alg.particles = config.readName (self.containerName)
729 alg.selectionDecoration = 'outputSelect' + postfix
730 config.addSelection (self.containerName, alg.selectionDecoration, selection)
731 selection = 'outputSelect' + postfix
732
733 alg = config.createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'DeepCopyAlg' )
734 alg.input = config.readName (self.containerName)
735 if self.outputName is not None :
736 alg.output = self.outputName + '_%SYS%'
737 config.addOutputContainer (self.containerName, self.outputName)
738 else :
739 alg.output = config.copyName (self.containerName)
740 if self.containerType is not None :
741 alg.outputType = self.containerType
742 if selection != '' :
743 alg.selection = [selection]
744 else :
745 alg.selection = []
746 alg.deepCopy = self.deepCopy
747 if self.sortPt and not config.noSystematics() :
748 raise ValueError ("Sorting by pt is not supported with systematics")
749 alg.sortPt = self.sortPt
750
751

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 730 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 737 of file AsgAnalysisConfig.py.


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