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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 667 of file AsgAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

python.AsgAnalysisConfig.EventCutFlowBlock.instanceName ( self)

Definition at line 681 of file AsgAnalysisConfig.py.

681 def instanceName(self):
682 return 'EventInfo_' + self.selectionName
683

◆ makeAlgs()

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

Definition at line 684 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 699 of file AsgAnalysisConfig.py.

◆ cutFlowHistograms

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistograms

Definition at line 685 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 702 of file AsgAnalysisConfig.py.


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