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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 772 of file AsgAnalysisConfig.py.

772 def __init__(self):
773 super().__init__()
774 self.addOption('selectionName', '', type=str,
775 noneAction='error',
776 info="the name of the event selection to generate cutflow histograms for. "
777 "If left blank, all selections on EventInfo will be used.",
778 meta={'role':'region'})
779 self.addOption('customSelections', [], type=None,
780 info="explicit list of selection decorations to use for the cutflow. "
781 "If provided, takes precedence over selectionName.")
782 self.addOption('cutFlowHistograms', True, type=bool,
783 info="whether to generate cutflow histograms for the selection cuts.")
784 self.addOption('cutFlowHistogramsWithSystematics', True, type=bool,
785 info="whether to generate cutflow histograms for the selection cuts "
786 "when running with systematics.")
787 self.addOption ('streamName', None, type=str,
788 info="name of the output stream to save the cut bookkeeper in.")
789

Member Function Documentation

◆ instanceName()

python.AsgAnalysisConfig.EventCutFlowBlock.instanceName ( self)

Definition at line 790 of file AsgAnalysisConfig.py.

790 def instanceName(self):
791 return 'EventInfo_' + self.selectionName
792

◆ makeAlgs()

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

Definition at line 793 of file AsgAnalysisConfig.py.

793 def makeAlgs(self, config):
794 if not self.cutFlowHistograms:
795 return
796
797 if not config.noSystematics() and not self.cutFlowHistogramsWithSystematics:
798 return
799
800 # Setup stream name
801 streamName = self.streamName or config.defaultHistogramStream()
802
803 postfix = ('_' + self.selectionName) if self.selectionName else ''
804
805 alg = config.createAlgorithm('CP::EventCutFlowHistAlg', 'CutFlowDumperAlg')
806 alg.RootStreamName = streamName
807 alg.histPattern = 'cflow_EventInfo' + postfix + '_%SYS%'
808 alg.eventInfo = config.readName('EventInfo')
809 alg.histTitle = 'Event Cutflow: EventInfo.' + self.selectionName
810
811 if isinstance(self.customSelections, list) and len(self.customSelections) > 0:
812 # user provides a hardcoded list of selections
813 alg.selections = self.customSelections
814 elif self.selectionName:
815 # resolve selectionName to the list of cuts registered by EventSelectionConfig
816 alg.selections = config.getEventCutFlow(self.selectionName)
817 else:
818 # fallback: get all available selections from EventInfo
819 alg.selections = config.getSelectionCutFlow('EventInfo', '')
820
821 alg.selections = [sel + ',as_char' for sel in alg.selections]
822

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 811 of file AsgAnalysisConfig.py.

◆ cutFlowHistograms

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistograms

Definition at line 794 of file AsgAnalysisConfig.py.

◆ cutFlowHistogramsWithSystematics

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistogramsWithSystematics

Definition at line 797 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 814 of file AsgAnalysisConfig.py.


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