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
 cutFlowHistogramsWithSystematics
 customSelections
 selectionName

Detailed Description

the ConfigBlock for an event-level cutflow

Definition at line 704 of file AsgAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 707 of file AsgAnalysisConfig.py.

707 def __init__(self):
708 super(EventCutFlowBlock, self).__init__()
709 self.addOption('selectionName', '', type=str,
710 noneAction='error',
711 info="the name of the event selection to generate cutflow histograms for. "
712 "If left blank, all selections on EventInfo will be used.",
713 meta={'role':'region'})
714 self.addOption('customSelections', [], type=None,
715 info="explicit list of selection decorations to use for the cutflow. "
716 "If provided, takes precedence over selectionName.")
717 self.addOption('cutFlowHistograms', True, type=bool,
718 info="whether to generate cutflow histograms for the selection cuts.")
719 self.addOption('cutFlowHistogramsWithSystematics', True, type=bool,
720 info="whether to generate cutflow histograms for the selection cuts"
721 "when running with systematics.")
722 self.addOption ('streamName', None, type=str,
723 info="name of the output stream to save the cut bookkeeper in.")
724

Member Function Documentation

◆ instanceName()

python.AsgAnalysisConfig.EventCutFlowBlock.instanceName ( self)

Definition at line 725 of file AsgAnalysisConfig.py.

725 def instanceName(self):
726 return 'EventInfo_' + self.selectionName
727

◆ makeAlgs()

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

Definition at line 728 of file AsgAnalysisConfig.py.

728 def makeAlgs(self, config):
729 if not self.cutFlowHistograms:
730 return
731
732 if not config.noSystematics() and not self.cutFlowHistogramsWithSystematics:
733 return
734
735 # Setup stream name
736 streamName = self.streamName or config.defaultHistogramStream()
737
738 postfix = ('_' + self.selectionName) if self.selectionName else ''
739
740 alg = config.createAlgorithm('CP::EventCutFlowHistAlg', 'CutFlowDumperAlg')
741 alg.RootStreamName = streamName
742 alg.histPattern = 'cflow_EventInfo' + postfix + '_%SYS%'
743 alg.eventInfo = config.readName('EventInfo')
744 alg.histTitle = 'Event Cutflow: EventInfo.' + self.selectionName
745
746 if isinstance(self.customSelections, list) and len(self.customSelections) > 0:
747 # user provides a hardcoded list of selections
748 alg.selections = self.customSelections
749 elif self.selectionName:
750 # resolve selectionName to the list of cuts registered by EventSelectionConfig
751 alg.selections = config.getEventCutFlow(self.selectionName)
752 else:
753 # fallback: get all available selections from EventInfo
754 alg.selections = config.getSelectionCutFlow('EventInfo', '')
755
756 alg.selections = [sel + ',as_char' for sel in alg.selections]
757

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 746 of file AsgAnalysisConfig.py.

◆ cutFlowHistograms

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistograms

Definition at line 729 of file AsgAnalysisConfig.py.

◆ cutFlowHistogramsWithSystematics

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistogramsWithSystematics

Definition at line 732 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 749 of file AsgAnalysisConfig.py.


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