Belle II Software  release-05-02-19
TrackingValidationResult Class Reference

Public Member Functions

def __init__ (self, filename, label=None, color_index=0, additional_information=None)
 
def get_figure_of_merits (self)
 
def get_figures_of_merit_latex (self)
 
def plot_efficiency_point (self)
 
def grouped_by_pt_data (self, mc_data=None)
 
def plot (self, data_x, data_y, loc=4, yerr=None)
 
def plot_finding_efficiency (self, data=None)
 
def plot_hit_efficiency (self, data=None)
 
def print_useful_information (self)
 
def append_to_dataframe (self, df)
 

Static Public Member Functions

def from_calculations (calculations, key="output_file_name", parameter_part=None)
 

Public Attributes

 filename
 The root filename.
 
 pr_data
 The pr data.
 
 mc_data
 the mc data
 
 mc_prompts
 the mc prompt data
 
 pr_prompts
 the pr prompt data
 
 label
 the label
 
 color
 the color index
 
 finding_efficiency
 the finding efficiency
 
 hit_efficiency
 the hit efficiency
 
 fake_rate
 the fake rate
 
 clone_rate
 the clone rate
 
 additional_information
 the additional information
 

Detailed Description

This class represents a loaded validation root file. It has methods for plotting the typically needed graphs.

Definition at line 8 of file root_handler.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  filename,
  label = None,
  color_index = 0,
  additional_information = None 
)
Create a new validation result from the given filename.
   Additional options for plotting (e.g. color or label) can be given.

Definition at line 11 of file root_handler.py.

11  def __init__(self, filename, label=None, color_index=0, additional_information=None):
12  """Create a new validation result from the given filename.
13  Additional options for plotting (e.g. color or label) can be given."""
14 
15  self.filename = filename
16 
17  self.pr_data = read_root(self.filename, tree_key="pr_tree/pr_tree")
18  self.pr_data["is_prompt"] = (
19  np.sqrt(self.pr_data.x_truth ** 2 + self.pr_data.y_truth ** 2) < 0.5) & (self.pr_data.is_primary == 1)
20 
21  self.mc_data = read_root(self.filename, tree_key="mc_tree/mc_tree")
22  self.mc_data["is_prompt"] = (
23  np.sqrt(self.mc_data.x_truth ** 2 + self.mc_data.y_truth ** 2) < 0.5) & (self.mc_data.is_primary == 1)
24 
25 
26  self.mc_prompts = self.mc_data[self.mc_data.is_prompt == 1]
27 
28  self.pr_prompts = self.pr_data[self.pr_data.is_prompt == 1]
29 
30  import seaborn as sb
31 
32  colors = sb.color_palette()
33 
34 
35  self.label = label
36 
37  self.color = colors[color_index % len(colors)]
38 
39 
40  self.finding_efficiency = None
41 
42  self.hit_efficiency = None
43 
44  self.fake_rate = None
45 
46  self.clone_rate = None
47  self.get_figure_of_merits()
48 
49 
50  self.additional_information = additional_information
51 

Member Function Documentation

◆ append_to_dataframe()

def append_to_dataframe (   self,
  df 
)
Append the main results to a already consisting dataframe.

Definition at line 168 of file root_handler.py.

◆ from_calculations()

def from_calculations (   calculations,
  key = "output_file_name",
  parameter_part = None 
)
static
Create validation results from an ipython calculation.

Definition at line 53 of file root_handler.py.

◆ get_figure_of_merits()

def get_figure_of_merits (   self)
Return the figures of merit from the file. Mosty used for internal seeting of the properties.

Definition at line 70 of file root_handler.py.

◆ get_figures_of_merit_latex()

def get_figures_of_merit_latex (   self)
Print out the figures of merit as a LaTeX-ready table.

Definition at line 86 of file root_handler.py.

◆ grouped_by_pt_data()

def grouped_by_pt_data (   self,
  mc_data = None 
)
Convenience function to return the input data (or the internal mc_data) grouped by pt.

Definition at line 109 of file root_handler.py.

◆ plot()

def plot (   self,
  data_x,
  data_y,
  loc = 4,
  yerr = None 
)
Plot data_y over data_x with the correct settings for this result. Mostly used internally.

Definition at line 119 of file root_handler.py.

◆ plot_efficiency_point()

def plot_efficiency_point (   self)
Plot a oint in the finding-efficiency/hit-efficiency plane.

Definition at line 102 of file root_handler.py.

◆ plot_finding_efficiency()

def plot_finding_efficiency (   self,
  data = None 
)
Plot the finding efficiency over pt.

Definition at line 132 of file root_handler.py.

◆ plot_hit_efficiency()

def plot_hit_efficiency (   self,
  data = None 
)
Plot the hit efficiency over pt.

Definition at line 141 of file root_handler.py.

◆ print_useful_information()

def print_useful_information (   self)
Print mostfully useful information about this result.

Definition at line 150 of file root_handler.py.


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