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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.OutputThinningBlock.__init__ ( self)

Definition at line 666 of file AsgAnalysisConfig.py.

666 def __init__ (self) :
667 super (OutputThinningBlock, self).__init__ ()
668 self.addOption ('containerName', '', type=str,
669 noneAction='error',
670 info="the name of the input container.")
671 self.addOption ('postfix', '', type=str,
672 info="a postfix to apply to decorations and algorithm names. "
673 "Typically not needed here.")
674 self.addOption ('selection', '', type=str,
675 info="the name of an optional selection decoration to use.")
676 self.addOption ('selectionName', '', type=str,
677 info="the name of the selection to append this to. If left empty, "
678 "the cuts are applied to every "
679 "object within the container. Specifying a name (e.g. `loose`) "
680 "applies the cut only to those object who also pass that selection.")
681 self.addOption ('outputName', None, type=str,
682 info="an optional name for the output container.")
683 self.addOption ('deepCopy', False, type=bool,
684 info="run a deep copy of the container.")
685 self.addOption ('sortPt', False, type=bool,
686 info=r"whether to sort objects in $p_\mathrm{T}.")
687 self.addOption ('noUniformSelection', False, type=bool,
688 info="do not run the union over all selections.")
689

Member Function Documentation

◆ instanceName()

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

Definition at line 690 of file AsgAnalysisConfig.py.

690 def instanceName (self) :
691 """Return the instance name for this block"""
692 return self.containerName + '_' + self.selectionName + self.postfix
693

◆ makeAlgs()

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

Definition at line 694 of file AsgAnalysisConfig.py.

694 def makeAlgs (self, config) :
695
696 postfix = self.postfix
697 if postfix != '' and postfix[0] != '_' :
698 postfix = '_' + postfix
699
700 selection = config.getFullSelection (self.containerName, self.selectionName)
701 if selection == '' :
702 selection = self.selection
703 elif self.selection != '' :
704 selection = selection + '&&' + self.selection
705
706 if selection != '' and not self.noUniformSelection :
707 alg = config.createAlgorithm( 'CP::AsgUnionSelectionAlg', 'UnionSelectionAlg')
708 alg.preselection = selection
709 alg.particles = config.readName (self.containerName)
710 alg.selectionDecoration = 'outputSelect' + postfix
711 config.addSelection (self.containerName, alg.selectionDecoration, selection)
712 selection = 'outputSelect' + postfix
713
714 alg = config.createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'DeepCopyAlg' )
715 alg.input = config.readName (self.containerName)
716 if self.outputName is not None :
717 alg.output = self.outputName + '_%SYS%'
718 config.addOutputContainer (self.containerName, self.outputName)
719 else :
720 alg.output = config.copyName (self.containerName)
721 if selection != '' :
722 alg.selection = [selection]
723 else :
724 alg.selection = []
725 alg.deepCopy = self.deepCopy
726 if self.sortPt and not config.noSystematics() :
727 raise ValueError ("Sorting by pt is not supported with systematics")
728 alg.sortPt = self.sortPt
729
730

Member Data Documentation

◆ containerName

python.AsgAnalysisConfig.OutputThinningBlock.containerName

Definition at line 711 of file AsgAnalysisConfig.py.

◆ outputName

python.AsgAnalysisConfig.OutputThinningBlock.outputName

Definition at line 718 of file AsgAnalysisConfig.py.


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