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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 619 of file AsgAnalysisConfig.py.

619 def __init__ (self) :
620 super (EventCutFlowBlock, self).__init__ ()
621 self.addOption ('containerName', '', type=str,
622 noneAction='error',
623 info="the name of the input container, typically EventInfo.")
624 self.addOption ('selectionName', '', type=str,
625 noneAction='error',
626 info="the name of an optional selection decoration to use.")
627 self.addOption ('customSelections', [], type=None,
628 info="the selections for which to generate cutflow histograms. If "
629 "a single string, corresponding to a particular event selection, "
630 "the event cutflow for that selection will be looked up. If a list "
631 "of strings, will use explicitly those selections. If left blank, "
632 "all selections attached to the container will be looked up.")
633 self.addOption ('postfix', '', type=str,
634 info="a postfix to apply in the naming of cutflow histograms. Set "
635 "it when defining multiple cutflows.")
636

Member Function Documentation

◆ instanceName()

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

Definition at line 637 of file AsgAnalysisConfig.py.

637 def instanceName (self) :
638 """Return the instance name for this block"""
639 return self.containerName + '_' + self.selectionName + self.postfix
640

◆ makeAlgs()

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

Definition at line 641 of file AsgAnalysisConfig.py.

641 def makeAlgs (self, config) :
642
643 postfix = self.postfix
644 if postfix != '' and postfix[0] != '_' :
645 postfix = '_' + postfix
646
647 alg = config.createAlgorithm( 'CP::EventCutFlowHistAlg', 'CutFlowDumperAlg' )
648 alg.histPattern = 'cflow_' + self.containerName + "_" + self.selectionName + postfix + '_%SYS%'
649 # find out which selection decorations to use
650 if isinstance(self.customSelections, str):
651 # user provides a dynamic reference to selections, corresponding to an EventSelection alg
652 alg.selections = config.getEventCutFlow(self.customSelections)
653 elif len(self.customSelections) > 0:
654 # user provides a list of hardcoded selections
655 alg.selections = self.customSelections
656 else:
657 # user provides nothing: get all available selections from EventInfo directly
658 alg.selections = config.getSelectionCutFlow (self.containerName, self.selectionName)
659 alg.selections = [sel+',as_char' for sel in alg.selections]
660 if self.selectionName:
661 alg.preselection = self.selectionName + '_%SYS%'
662 alg.eventInfo = config.readName (self.containerName)
663 alg.histTitle = "Event Cutflow: " + self.containerName + "." + self.selectionName
664
665

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 650 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 660 of file AsgAnalysisConfig.py.


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