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

Constructor & Destructor Documentation

◆ __init__()

python.AsgAnalysisConfig.EventCutFlowBlock.__init__ ( self)

Definition at line 671 of file AsgAnalysisConfig.py.

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

Member Function Documentation

◆ instanceName()

python.AsgAnalysisConfig.EventCutFlowBlock.instanceName ( self)

Definition at line 688 of file AsgAnalysisConfig.py.

688 def instanceName(self):
689 return 'EventInfo_' + self.selectionName
690

◆ makeAlgs()

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

Definition at line 691 of file AsgAnalysisConfig.py.

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

Member Data Documentation

◆ customSelections

python.AsgAnalysisConfig.EventCutFlowBlock.customSelections

Definition at line 709 of file AsgAnalysisConfig.py.

◆ cutFlowHistograms

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistograms

Definition at line 692 of file AsgAnalysisConfig.py.

◆ cutFlowHistogramsWithSystematics

python.AsgAnalysisConfig.EventCutFlowBlock.cutFlowHistogramsWithSystematics

Definition at line 695 of file AsgAnalysisConfig.py.

◆ selectionName

python.AsgAnalysisConfig.EventCutFlowBlock.selectionName

Definition at line 712 of file AsgAnalysisConfig.py.


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