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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 780 of file AsgAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

python.AsgAnalysisConfig.EventCutFlowBlock.instanceName ( self)

Definition at line 798 of file AsgAnalysisConfig.py.

798 def instanceName(self):
799 return 'EventInfo_' + self.selectionName
800

◆ makeAlgs()

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

Definition at line 801 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 819 of file AsgAnalysisConfig.py.

◆ cutFlowHistograms

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistograms

Definition at line 802 of file AsgAnalysisConfig.py.

◆ cutFlowHistogramsWithSystematics

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistogramsWithSystematics

Definition at line 805 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 822 of file AsgAnalysisConfig.py.


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