class rivet::plotinfo::PlotParser
rivet::plotinfo::PlotParser
Inherits from object, object, object
Public Functions
Name | |
---|---|
def | getSection(self self, section section, hpath hpath) |
def | getSections(self self, sections sections, hpath hpath) |
def | getHeaders(self self, hpath hpath) |
def | getSpecial(self self, hpath hpath) |
def | getSpecials(self self, hpath hpath) |
def | getHistogramOptions(self self, hpath hpath) |
def | isEndMarker(self self, line line, blockname blockname) |
def | isComment(self self, line line) |
def | updateHistoHeaders(self self, hist hist) |
def | getSection(self self, section section, hpath hpath) |
def | getSections(self self, sections sections, hpath hpath) |
def | getHeaders(self self, hpath hpath) |
def | getSpecial(self self, hpath hpath) |
def | getSpecials(self self, hpath hpath) |
def | getHistogramOptions(self self, hpath hpath) |
def | isEndMarker(self self, line line, blockname blockname) |
def | isComment(self self, line line) |
def | updateHistoHeaders(self self, hist hist) |
def | getSection(self self, section section, hpath hpath) |
def | getSections(self self, sections sections, hpath hpath) |
def | getHeaders(self self, hpath hpath) |
def | getSpecial(self self, hpath hpath) |
def | getSpecials(self self, hpath hpath) |
def | getHistogramOptions(self self, hpath hpath) |
def | isEndMarker(self self, line line, blockname blockname) |
def | isComment(self self, line line) |
def | updateHistoHeaders(self self, hist hist) |
Public Attributes
Name | |
---|---|
pat_begin_block | |
pat_begin_name_block | |
pat_end_block | |
pat_comment | |
pat_property | |
pat_property_opt | |
pat_path_property | |
dictionary | pat_paths |
def | getPlot Alias. |
addfiles | |
plotpaths |
Detailed Description
class rivet::plotinfo::PlotParser;
Reads Rivet's .plot files and determines which attributes to apply to each histo path.
Public Functions Documentation
function getSection
def getSection(
self self,
section section,
hpath hpath
)
Get a section for a histogram from a .plot file.
Parameters
----------
section : ('PLOT'|'SPECIAL'|'HISTOGRAM')
The section that should be extracted.
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
TODO:
* Caching! The result of the lookup is not cached so every call requires a file to be searched for and opened.
function getSections
def getSections(
self self,
sections sections,
hpath hpath
)
Get all sections for a histogram from a .plot file.
Parameters
----------
section : ('SPECIAL')
The section that should be extracted. Only Specials allowed to occur multiple times.
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
TODO:
* Caching! The result of the lookup is not cached so every call requires a file to be searched for and opened.
function getHeaders
def getHeaders(
self self,
hpath hpath
)
Get the plot headers for histogram hpath.
This returns the PLOT section.
Parameters
----------
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
Returns
-------
plot_section : dict
The dictionary usually contains the 'Title', 'XLabel' and
'YLabel' properties of the respective plot.
See also
--------
:meth:`getSection`
function getSpecial
def getSpecial(
self self,
hpath hpath
)
Get a SPECIAL section for histogram hpath.
The SPECIAL section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSection`
function getSpecials
def getSpecials(
self self,
hpath hpath
)
Get all SPECIAL sections for histogram hpath.
The SPECIAL section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSections`
function getHistogramOptions
def getHistogramOptions(
self self,
hpath hpath
)
Get a HISTOGRAM section for histogram hpath.
The HISTOGRAM section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSection`
function isEndMarker
def isEndMarker(
self self,
line line,
blockname blockname
)
function isComment
def isComment(
self self,
line line
)
function updateHistoHeaders
def updateHistoHeaders(
self self,
hist hist
)
function getSection
def getSection(
self self,
section section,
hpath hpath
)
Get a section for a histogram from a .plot file.
Parameters
----------
section : ('PLOT'|'SPECIAL'|'HISTOGRAM')
The section that should be extracted.
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
TODO:
* Caching! The result of the lookup is not cached so every call requires a file to be searched for and opened.
function getSections
def getSections(
self self,
sections sections,
hpath hpath
)
Get all sections for a histogram from a .plot file.
Parameters
----------
section : ('SPECIAL')
The section that should be extracted. Only Specials allowed to occur multiple times.
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
TODO:
* Caching! The result of the lookup is not cached so every call requires a file to be searched for and opened.
function getHeaders
def getHeaders(
self self,
hpath hpath
)
Get the plot headers for histogram hpath.
This returns the PLOT section.
Parameters
----------
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
Returns
-------
plot_section : dict
The dictionary usually contains the 'Title', 'XLabel' and
'YLabel' properties of the respective plot.
See also
--------
:meth:`getSection`
function getSpecial
def getSpecial(
self self,
hpath hpath
)
Get a SPECIAL section for histogram hpath.
The SPECIAL section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSection`
function getSpecials
def getSpecials(
self self,
hpath hpath
)
Get all SPECIAL sections for histogram hpath.
The SPECIAL section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSections`
function getHistogramOptions
def getHistogramOptions(
self self,
hpath hpath
)
Get a HISTOGRAM section for histogram hpath.
The HISTOGRAM section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSection`
function isEndMarker
def isEndMarker(
self self,
line line,
blockname blockname
)
function isComment
def isComment(
self self,
line line
)
function updateHistoHeaders
def updateHistoHeaders(
self self,
hist hist
)
function getSection
def getSection(
self self,
section section,
hpath hpath
)
Get a section for a histogram from a .plot file.
Parameters
----------
section : ('PLOT'|'SPECIAL'|'HISTOGRAM')
The section that should be extracted.
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
TODO:
* Caching! The result of the lookup is not cached so every call requires a file to be searched for and opened.
function getSections
def getSections(
self self,
sections sections,
hpath hpath
)
Get all sections for a histogram from a .plot file.
Parameters
----------
section : ('SPECIAL')
The section that should be extracted. Only Specials allowed to occur multiple times.
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
TODO:
* Caching! The result of the lookup is not cached so every call requires a file to be searched for and opened.
function getHeaders
def getHeaders(
self self,
hpath hpath
)
Get the plot headers for histogram hpath.
This returns the PLOT section.
Parameters
----------
hpath : str
The histogram path, i.e. /AnalysisID/HistogramID .
Returns
-------
plot_section : dict
The dictionary usually contains the 'Title', 'XLabel' and
'YLabel' properties of the respective plot.
See also
--------
:meth:`getSection`
function getSpecial
def getSpecial(
self self,
hpath hpath
)
Get a SPECIAL section for histogram hpath.
The SPECIAL section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSection`
function getSpecials
def getSpecials(
self self,
hpath hpath
)
Get all SPECIAL sections for histogram hpath.
The SPECIAL section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSections`
function getHistogramOptions
def getHistogramOptions(
self self,
hpath hpath
)
Get a HISTOGRAM section for histogram hpath.
The HISTOGRAM section is only available in a few analyses.
Parameters
----------
hpath : str
Histogram path. Must have the form /AnalysisID/HistogramID .
See also
--------
:meth:`getSection`
function isEndMarker
def isEndMarker(
self self,
line line,
blockname blockname
)
function isComment
def isComment(
self self,
line line
)
function updateHistoHeaders
def updateHistoHeaders(
self self,
hist hist
)
Public Attributes Documentation
variable pat_begin_block
static pat_begin_block = re.compile(r'^(#*\s*)?BEGIN (\w+) ?(\S+)?');
variable pat_begin_name_block
static pat_begin_name_block = re.compile(r'^(#*\s*)?BEGIN (\w+) ?(\S+)? ?(\w+)?');
variable pat_end_block
static pat_end_block = re.compile(r'^(#*\s*)?END (\w+)');
variable pat_comment
static pat_comment = re.compile(r'^\s*#|^\s*$');
variable pat_property
static pat_property = re.compile(r'^(\w+?)\s*=\s*(.*)$');
variable pat_property_opt
static pat_property_opt = re.compile('^ReplaceOption\[(\w+=\w+)\]=(.*)$');
variable pat_path_property
static pat_path_property = re.compile(r'^(\S+?)::(\w+?)=(.*)$');
variable pat_paths
static dictionary pat_paths = {};
variable getPlot
static def getPlot = getHeaders;
Alias.
variable addfiles
addfiles;
variable plotpaths
plotpaths;
Updated on 2022-08-07 at 20:46:08 +0100