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

Public Member Functions

def root_name (self, name)
 
def setUp (self)
 
def test_compare_profiles (self)
 
def test_compare_profiles_identical (self)
 
def test_compare_identical_profiles_kolmogorov (self)
 
def test_compare_profiles_almost_equal (self)
 
def test_compare_zero_error_profiles (self)
 
def test_compare_histograms (self)
 
def test_compare_unsupported_object (self)
 
def test_compare_differing_objects (self)
 
def test_compare_tefficiencies (self)
 
def test_compare_tefficiencies_same (self)
 
def test_compare_differing_bins (self)
 

Static Public Member Functions

def create_profile (name, entries=5000, mu=10, sigma=0.3, max_fill=50, fixed_number=None)
 
def create_teff (name, bins=20, eff=0.9)
 
def create_histogram (name, entries=5000, mu=10, sigma=3)
 

Public Attributes

 call_iteration
 if we would at some point later want to implement several runs, we use this as a counter variable to set up different names. More...
 
 profileA
 Profile A.
 
 profileB
 Profile B.
 
 profileC
 Profile C.
 
 profileZeroErrorBins
 Profile with bins with 0 error.
 
 profileZeroErrorBinsTwo
 Profile with bins with 0 error.
 
 histogramA
 Histogram A.
 
 histogramB
 Histogram B (should be almost equal to profile A)
 
 profileAequal
 Profile should be almost equal to A.
 
 profileBequal
 Profile should be almost equal to B.
 
 profileDifferentBins
 Profile with different bins.
 
 teffA
 TEfficiemcy A.
 
 teffB
 TEfficiency B.
 

Detailed Description

Various test cases for the Chi2Test wrapper class

Definition at line 60 of file test_comparison.py.

Member Function Documentation

◆ create_histogram()

def create_histogram (   name,
  entries = 5000,
  mu = 10,
  sigma = 3 
)
static
Create a TH1D and fill with random content

Definition at line 97 of file test_comparison.py.

97  def create_histogram(name, entries=5000, mu=10, sigma=3):
98  """
99  Create a TH1D and fill with random content
100  """
101  p = ROOT.TH1D(name, name, 50, 0, 20.0)
102  for i in range(0, entries):
103  p.Fill(random.gauss(mu, sigma))
104  return p
105 

◆ create_profile()

def create_profile (   name,
  entries = 5000,
  mu = 10,
  sigma = 0.3,
  max_fill = 50,
  fixed_number = None 
)
static
Create a TProfile object with various content

Definition at line 66 of file test_comparison.py.

◆ create_teff()

def create_teff (   name,
  bins = 20,
  eff = 0.9 
)
static
Creates and fills a root TEfficiency plot

Definition at line 82 of file test_comparison.py.

◆ root_name()

def root_name (   self,
  name 
)
Generates unique names for ROOT objects

Definition at line 106 of file test_comparison.py.

◆ setUp()

def setUp (   self)
Setup method to generate profiles and histograms for tests

Definition at line 112 of file test_comparison.py.

◆ test_compare_differing_bins()

def test_compare_differing_bins (   self)
Test if the comparison attempt of profiles with differing bin count
fails properly

Definition at line 309 of file test_comparison.py.

◆ test_compare_differing_objects()

def test_compare_differing_objects (   self)
Test if the comparison of differing objects is rejected

Definition at line 269 of file test_comparison.py.

◆ test_compare_histograms()

def test_compare_histograms (   self)
Test comparison of regular histograms

Definition at line 247 of file test_comparison.py.

◆ test_compare_identical_profiles_kolmogorov()

def test_compare_identical_profiles_kolmogorov (   self)
Test if comparing to identical TProfiles with Kolmo Test works

Definition at line 203 of file test_comparison.py.

◆ test_compare_profiles()

def test_compare_profiles (   self)
Test if comparing two similar TProfiles works

Definition at line 183 of file test_comparison.py.

◆ test_compare_profiles_almost_equal()

def test_compare_profiles_almost_equal (   self)
Test if the comparison of two TProfiles with very similar content works

Definition at line 210 of file test_comparison.py.

◆ test_compare_profiles_identical()

def test_compare_profiles_identical (   self)
Test if comparing two identical TProfiles works

Definition at line 193 of file test_comparison.py.

◆ test_compare_tefficiencies()

def test_compare_tefficiencies (   self)
Test if two TEfficiency objects can be compared. Is a bit tricky
as TEfficiency does not support

Definition at line 279 of file test_comparison.py.

◆ test_compare_tefficiencies_same()

def test_compare_tefficiencies_same (   self)
Test if two TEfficiency objects can be compared. Is a bit tricky as
TEfficiency does not support Comparing the exact same TEfficiency
object should give back 100% agreement

Definition at line 294 of file test_comparison.py.

◆ test_compare_unsupported_object()

def test_compare_unsupported_object (   self)
Test if unsupported ROOT objects are treated properly

Definition at line 261 of file test_comparison.py.

◆ test_compare_zero_error_profiles()

def test_compare_zero_error_profiles (   self)
Test if bins with zero error are treated properly

Definition at line 222 of file test_comparison.py.

Member Data Documentation

◆ call_iteration

call_iteration

if we would at some point later want to implement several runs, we use this as a counter variable to set up different names.

However not implemented yet.

Definition at line 121 of file test_comparison.py.


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