Belle II Software  release-05-02-19
ResolutionAnalysis Class Reference
Inheritance diagram for ResolutionAnalysis:
Collaboration diagram for ResolutionAnalysis:

Public Member Functions

def __init__ (self, quantity_name, bin_spacing, bin_name, bin_unit=None, unit=None, outlier_z_score=None, contact='', plot_name=None, plot_title=None, min_required_entries=None, plot_name_prefix='', plot_name_postfix='', plot_title_postfix='', referenceFileName=None)
 
def analyse (self, bin_values, truths, estimates, which_plots=None, is_expert=None)
 
def contact (self)
 
def contact (self, contact)
 
def write (self, tDirectory=None)
 

Public Attributes

 quantity_name
 cached name of the quantity in the truth-classification analysis
 
 unit
 cached measurement unit for this truth-classification analysis
 
 bin_spacing
 cached value of the histogram bin spacing
 
 bin_name
 cached value of the bin name
 
 bin_unit
 cached value of the bin measurement unit
 
 outlier_z_score
 cached value of the Z-score (for outlier detection)
 
 min_required_entries
 cached value of the minimum number of entries
 
 plot_name
 cached value of the base name of the plot
 
 plot_title
 cached value of the plot title
 
 plot_name_prefix
 cached value of the prefix prepended to the plot name
 
 plot_name_postfix
 cached value of the suffix appended to the plot name
 
 plot_title_postfix
 cached value of the suffix appended to the plot title
 
 plots
 cached value of the dictionary of plots to be created
 
 referenceFileName
 cached value of the reference filename
 
 contact
 Forward the contact to all plots by reassigning the contact.
 

Static Public Attributes

float default_outlier_z_score = 5.0
 default Z-score (for outlier detection)
 
int default_min_required_entries = 50
 default minimum number of entries
 
string default_plot_name = "{plot_name_prefix}_{subplot_name}{plot_name_postfix}"
 default plot name
 
string default_plot_title = "{subplot_title} of {quantity_name}{plot_title_postfix}"
 default plot title
 
list default_which_plots
 default list of plots to create More...
 
bool default_is_expert = True
 by default, create expert plots
 

Private Attributes

 _contact
 cached value of the contact person
 

Detailed Description

Perform resolution analysis

Definition at line 20 of file resolution.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  quantity_name,
  bin_spacing,
  bin_name,
  bin_unit = None,
  unit = None,
  outlier_z_score = None,
  contact = '',
  plot_name = None,
  plot_title = None,
  min_required_entries = None,
  plot_name_prefix = '',
  plot_name_postfix = '',
  plot_title_postfix = '',
  referenceFileName = None 
)
Performs a comparison of an estimated quantity to their truths by generating standardized validation plots.

Definition at line 39 of file resolution.py.

39  def __init__(
40  self,
41  quantity_name,
42  bin_spacing, # can be [0,0.5,1.0] will have 2 bins
43  bin_name,
44  bin_unit=None,
45  unit=None,
46  outlier_z_score=None,
47  contact='',
48  plot_name=None,
49  plot_title=None,
50  min_required_entries=None, # minimum number of entries in a bin for the resolution fit
51  plot_name_prefix='', # depricated use plot_name instead
52  plot_name_postfix='', # depricated use plot_name instead
53  plot_title_postfix='', # depricated use plot_title instead
54  referenceFileName=None, # if set binnings of histograms will be read from corresponding histogram in this file
55  ):
56  """Performs a comparison of an estimated quantity to their truths by generating standardized validation plots."""
57 
58 
59  self.quantity_name = quantity_name
60 
61  self.unit = unit or get_unit(quantity_name)
62 
63  self.bin_spacing = bin_spacing
64 
65  self.bin_name = bin_name
66 
67  self.bin_unit = bin_unit
68 
69  if outlier_z_score is None:
70 
71  self.outlier_z_score = self.default_outlier_z_score
72  else:
73  self.outlier_z_score = outlier_z_score
74 
75 
76  self.min_required_entries = min_required_entries
77  if self.min_required_entries is None:
78  self.min_required_entries = self.default_min_required_entries
79 
80 
81  self.plot_name = plot_name
82 
83  self.plot_title = plot_title
84 
85 
86  self.plot_name_prefix = plot_name_prefix or root_save_name(quantity_name)
87 
88  self.plot_name_postfix = plot_name_postfix
89 
90  self.plot_title_postfix = plot_title_postfix
91 
92 
93  self._contact = contact
94 
95  self.plots = collections.OrderedDict()
96 
97 
98  self.referenceFileName = referenceFileName
99 

Member Function Documentation

◆ analyse()

def analyse (   self,
  bin_values,
  truths,
  estimates,
  which_plots = None,
  is_expert = None 
)
Compares the concrete estimate to the truth and generates plots of the resolution

Parameters
----------
bin_values : array_like(float
    The parametr used for binning
truths : array_like(float)
    Sample of the true values
estimates : array_like(float)
    Corresponding estimations

Definition at line 100 of file resolution.py.

◆ contact() [1/2]

def contact (   self)
Get the contact person's name

Definition at line 236 of file resolution.py.

◆ contact() [2/2]

def contact (   self,
  contact 
)
Set the contact person's name

Definition at line 241 of file resolution.py.

◆ write()

def write (   self,
  tDirectory = None 
)
Write all validation plot to the given Root directory

Definition at line 247 of file resolution.py.

Member Data Documentation

◆ default_which_plots

list default_which_plots
static
Initial value:
= [
"resolution",
]

default list of plots to create

Definition at line 32 of file resolution.py.


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