Belle II Software  release-08-01-10
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 15 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 18 of file root_handler.py.

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

Member Function Documentation

◆ append_to_dataframe()

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

Definition at line 179 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 60 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 77 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 97 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 120 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 130 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 113 of file root_handler.py.

◆ plot_finding_efficiency()

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

Definition at line 143 of file root_handler.py.

◆ plot_hit_efficiency()

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

Definition at line 152 of file root_handler.py.

◆ print_useful_information()

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

Definition at line 161 of file root_handler.py.


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