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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 617 of file AsgAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

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

Definition at line 635 of file AsgAnalysisConfig.py.

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

◆ makeAlgs()

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

Definition at line 639 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 648 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 658 of file AsgAnalysisConfig.py.


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