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

 cutFlowHistograms
 customSelections
 selectionName

Detailed Description

the ConfigBlock for an event-level cutflow

Definition at line 661 of file AsgAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 664 of file AsgAnalysisConfig.py.

664 def __init__(self):
665 super(EventCutFlowBlock, self).__init__()
666 self.addOption('selectionName', '', type=str,
667 noneAction='error',
668 info="the name of the event selection to generate cutflow histograms for. "
669 "If left blank, all selections on EventInfo will be used.")
670 self.addOption('customSelections', [], type=None,
671 info="explicit list of selection decorations to use for the cutflow. "
672 "If provided, takes precedence over selectionName.")
673 self.addOption('cutFlowHistograms', True, type=bool,
674 info="whether to generate cutflow histograms for the selection cuts.")
675

Member Function Documentation

◆ instanceName()

python.AsgAnalysisConfig.EventCutFlowBlock.instanceName ( self)

Definition at line 676 of file AsgAnalysisConfig.py.

676 def instanceName(self):
677 return 'EventInfo_' + self.selectionName
678

◆ makeAlgs()

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

Definition at line 679 of file AsgAnalysisConfig.py.

679 def makeAlgs(self, config):
680
681 if not self.cutFlowHistograms:
682 return
683
684 postfix = ('_' + self.selectionName) if self.selectionName else ''
685
686 alg = config.createAlgorithm('CP::EventCutFlowHistAlg', 'CutFlowDumperAlg')
687 alg.histPattern = 'cflow_EventInfo' + postfix + '_%SYS%'
688 alg.eventInfo = config.readName('EventInfo')
689 alg.histTitle = 'Event Cutflow: EventInfo.' + self.selectionName
690
691 if isinstance(self.customSelections, list) and len(self.customSelections) > 0:
692 # user provides a hardcoded list of selections
693 alg.selections = self.customSelections
694 elif self.selectionName:
695 # resolve selectionName to the list of cuts registered by EventSelectionConfig
696 alg.selections = config.getEventCutFlow(self.selectionName)
697 else:
698 # fallback: get all available selections from EventInfo
699 alg.selections = config.getSelectionCutFlow('EventInfo', '')
700
701 alg.selections = [sel + ',as_char' for sel in alg.selections]
702

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 691 of file AsgAnalysisConfig.py.

◆ cutFlowHistograms

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistograms

Definition at line 681 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 694 of file AsgAnalysisConfig.py.


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