ATLAS Offline Software
Loading...
Searching...
No Matches
python.AsgAnalysisConfig.EventCutFlowBlock Class Reference
Inheritance diagram for python.AsgAnalysisConfig.EventCutFlowBlock:
Collaboration diagram for python.AsgAnalysisConfig.EventCutFlowBlock:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

 customSelections
 selectionName

Detailed Description

the ConfigBlock for an event-level cutflow

Definition at line 629 of file AsgAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 632 of file AsgAnalysisConfig.py.

632 def __init__ (self) :
633 super (EventCutFlowBlock, self).__init__ ()
634 self.addOption ('containerName', '', type=str,
635 noneAction='error',
636 info="the name of the input container, typically `EventInfo`.")
637 self.addOption ('selectionName', '', type=str,
638 noneAction='error',
639 info="the name of an optional selection decoration to use.")
640 self.addOption ('customSelections', [], type=None,
641 info="the selections for which to generate cutflow histograms. If "
642 "a single string, corresponding to a particular event selection, "
643 "the event cutflow for that selection will be looked up. If a list "
644 "of strings, will use explicitly those selections. If left blank, "
645 "all selections attached to the container will be looked up.")
646 self.addOption ('postfix', '', type=str,
647 info="a postfix to apply in the naming of cutflow histograms. Set "
648 "it when defining multiple cutflows.")
649

Member Function Documentation

◆ instanceName()

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

Definition at line 650 of file AsgAnalysisConfig.py.

650 def instanceName (self) :
651 """Return the instance name for this block"""
652 return self.containerName + '_' + self.selectionName + self.postfix
653

◆ makeAlgs()

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

Definition at line 654 of file AsgAnalysisConfig.py.

654 def makeAlgs (self, config) :
655
656 postfix = self.postfix
657 if postfix != '' and postfix[0] != '_' :
658 postfix = '_' + postfix
659
660 alg = config.createAlgorithm( 'CP::EventCutFlowHistAlg', 'CutFlowDumperAlg' )
661 alg.histPattern = 'cflow_' + self.containerName + "_" + self.selectionName + postfix + '_%SYS%'
662 # find out which selection decorations to use
663 if isinstance(self.customSelections, str):
664 # user provides a dynamic reference to selections, corresponding to an EventSelection alg
665 alg.selections = config.getEventCutFlow(self.customSelections)
666 elif len(self.customSelections) > 0:
667 # user provides a list of hardcoded selections
668 alg.selections = self.customSelections
669 else:
670 # user provides nothing: get all available selections from EventInfo directly
671 alg.selections = config.getSelectionCutFlow (self.containerName, self.selectionName)
672 alg.selections = [sel+',as_char' for sel in alg.selections]
673 if self.selectionName:
674 alg.preselection = self.selectionName + '_%SYS%'
675 alg.eventInfo = config.readName (self.containerName)
676 alg.histTitle = "Event Cutflow: " + self.containerName + "." + self.selectionName
677
678

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 663 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 673 of file AsgAnalysisConfig.py.


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