A concrete implementation of an histogram plots using the HwU format
for reading/writing histogram content.
|
__init__(self,
file_path=None,
weight_header=None,
**opts)
Read one plot from a file_path or a stream. |
source code
|
|
|
addEvent(self,
x_value,
weights=1.0)
Add an event to the current plot. |
source code
|
|
|
get_formatted_header(self)
Return a HwU formatted header for the weight label definition. |
source code
|
|
|
get_HwU_source(self,
print_header=True)
Returns the string representation of this histogram using the HwU
standard. |
source code
|
|
|
output(self,
path=None,
format=' HwU ' ,
print_header=True)
Ouput this histogram to a file, stream or string if path is kept to
None. |
source code
|
|
|
test_plot_compability(self,
other,
consider_type=True)
Test whether the defining attributes of self are identical to histo,
typically to make sure that they are the same plots but from
different runs, and they can be summed safely. |
source code
|
|
|
process_histogram_name(self,
histogram_name)
Parse the histogram name for tags which would set its various
attributes. |
source code
|
|
|
get_HwU_histogram_name(self,
format=' human ' )
Returns the histogram name in the HwU syntax or human readable. |
source code
|
|
|
|
|
trim_auxiliary_weights(self)
Remove all weights which are auxiliary (whose name end with '@aux')
so that they are not included (they will be regenerated anyway). |
source code
|
|
|
set_uncertainty(self,
type=' all_scale ' )
Adds a weight to the bins which is the envelope of the scale
uncertainty, for the scale specified which can be either 'mur',
'muf', 'all_scale' or 'PDF'. |
source code
|
|
|
rebin(self,
n_rebin)
Rebin the x-axis so as to merge n_rebin consecutive bins into a
single one. |
source code
|
|
Inherited from Histogram :
__add__ ,
__div__ ,
__mul__ ,
__setattr__ ,
__sub__ ,
__truediv__ ,
alter_weights ,
nice_string
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
|
allowed_dimensions = [ 2]
hash(x)
|
|
allowed_types = []
|
|
output_formats_implemented = [ ' HwU ' , ' gnuplot ' ]
|
|
mandatory_weights = { ' central value ' : ' central ' , ' dy ' : ' stat_e ...
|
|
weight_header_start_re = re.compile(r'^##.* ')
|
|
weight_header_re = re.compile(r'&\s* (?P< wgt_name > ( \S| ( \s(?! \s* ...
|
|
histo_start_re = re.compile(r'^\s* <histogram>\s* (?P< n_bins > \d+ ...
|
|
a_float_re = ' [\\+|-]?\\d+(\\.\\d*)?([EeDd][\\+|-]?\\d+)? '
|
|
histo_bin_weight_re = re.compile(r'(?P< weight > [ \+\|-] ? \d+ ( \.\d...
|
|
histo_end_re = re.compile(r'^\s* <\\histogram>\s* $')
|
|
weight_label_scale = re.compile(r'(?i) ^\s* mur\s* =\s* (?P< mur_fa ...
|
|
weight_label_PDF = re.compile(r'^\s* PDF\s* =\s* (?P< PDF_set > \d+ ) ...
|
Inherited from Histogram :
allowed_axis_modes
|