Belle II Software  release-08-01-10
PullAnalysis Class Reference
Inheritance diagram for PullAnalysis:
Collaboration diagram for PullAnalysis:

Public Member Functions

def __init__ (self, quantity_name, unit=None, outlier_z_score=None, absolute=False, contact='', plot_name=None, plot_title=None, plot_name_prefix='', plot_name_postfix='', plot_title_postfix='', referenceFileName=None # if set binnings of plots will be read from corresponding histograms)
 
def analyse (self, truths, estimates, variances=None, auxiliaries={}, which_plots=None, is_expert=None)
 
def contact (self)
 
def contact (self, contact)
 
def write (self, tDirectory=None)
 

Public Attributes

 quantity_name
 name of the quantity the analysis is performed on
 
 unit
 unit the quanitity is given in
 
 outlier_z_score
 the outlier score defines in terms of how many std deviations a data point is considered as an outlier
 
 absolute
 if true only the absolute value is compared
 
 plot_name
 name of the plot
 
 plot_title
 title of the plot
 
 plot_name_prefix
 prefix to be prepended to the plot name
 
 plot_name_postfix
 post fix to be append after the plot name
 
 plot_title_postfix
 postfix to be appended after the title
 
 plots
 dictionary to store the plots
 
 referenceFileName
 name of the reference file, if set the binnings of plots will be read from the corresponding object in that file
 
 contact
 Forward the contract to all plots by reassigning the contact.
 

Static Public Attributes

float default_outlier_z_score = 5.0
 default outlier z score
 
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 be created in this analysis More...
 
bool default_is_expert = True
 if true the plots created here are declared as expert plots in the validation
 

Private Attributes

 _contact
 contact information
 

Detailed Description

Performs a comparision of an estimated quantity to their truths by generating standardized validation plots.

Definition at line 27 of file pull.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  quantity_name,
  unit = None,
  outlier_z_score = None,
  absolute = False,
  contact = '',
  plot_name = None,
  plot_title = None,
  plot_name_prefix = '',
  plot_name_postfix = '',
  plot_title_postfix = '',
  referenceFileName = None  # if set binnings of plots will be read from corresponding histograms 
)
Performs a comparision of an estimated quantity to their truths by generating standardized validation plots.

Definition at line 54 of file pull.py.

67  ):
68  """Performs a comparision of an estimated quantity to their truths by generating standardized validation plots."""
69 
70 
71  self.quantity_name = quantity_name
72 
73  self.unit = unit or get_unit(quantity_name)
74 
75 
76  if outlier_z_score is None:
77  self.outlier_z_score = self.default_outlier_z_score
78  else:
79  self.outlier_z_score = outlier_z_score
80 
81 
82  self.absolute = absolute
83 
84 
85  self.plot_name = plot_name
86 
87  self.plot_title = plot_title
88 
89 
90  self.plot_name_prefix = plot_name_prefix or root_save_name(quantity_name)
91 
92  self.plot_name_postfix = plot_name_postfix
93 
94  self.plot_title_postfix = plot_title_postfix
95 
96 
97  self._contact = contact
98 
99  self.plots = collections.OrderedDict()
100 
101 
102  self.referenceFileName = referenceFileName
103 

Member Function Documentation

◆ analyse()

def analyse (   self,
  truths,
  estimates,
  variances = None,
  auxiliaries = {},
  which_plots = None,
  is_expert = None 
)
Compares the concrete estimate to the truth and generates plots of the estimates, residuals, pulls and p-values.
Close indicates if the figure shall be closed after they are saved.

Parameters
----------
truths : array_like(float)
    Sample of the true values
estimates : array_like(float)
    Corresponding estimations
variances : array_like(float), optional
    Corresponding variance estimations
auxiliaries : Dict[name, array_like(float)], optional
    Auxiliary variable to show distribution of residuals and pull as function
selected_plots : list(str), optional
    List of analysis plots to be generated. All if not given.
    Currently valid names are
    truths, estimates, diag_profile, diag_scatter, residuals,
    sigmas, pulls, p_values

Definition at line 104 of file pull.py.

◆ contact() [1/2]

def contact (   self)
 returns the contact 

Definition at line 403 of file pull.py.

◆ contact() [2/2]

def contact (   self,
  contact 
)
  sets the contact

  parameters:
  contact: new contact information

Definition at line 408 of file pull.py.

◆ write()

def write (   self,
  tDirectory = None 
)
 Write all validation plot to the given Root directory
    parameters:
    tDirectory - the root directory were to write to

Definition at line 419 of file pull.py.

Member Data Documentation

◆ default_which_plots

list default_which_plots
static
Initial value:
= [
"truths",
"estimates",
"diag_profile",
"diag_scatter",
"residuals",
"sigmas",
"pulls",
"p_values",
"aux_residual_hist2d",
"aux_residual_profile",
"aux_pull_hist2d",
"aux_pull_profile",
]

default list of plots to be created in this analysis

Definition at line 36 of file pull.py.


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