Belle II Software  release-06-01-15
defaultEvaluationParameters.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # ************** Flavor Tagging **************
13 # * *
14 # * This script sets global parameters for the *
15 # * evaluation of the flavor tagger's *
16 # * performance. *
17 # * *
18 # ***********************************************
19 
20 import ROOT
21 from array import array
22 import numpy as np
23 
24 
25 class Quiet:
26  """Context handler class to quiet errors in a 'with' statement"""
27 
28  def __init__(self, level=ROOT.kInfo + 1):
29  """Class constructor"""
30 
31  self.levellevel = level
32 
33  def __enter__(self):
34  """Enter the context"""
35 
36  self.oldleveloldlevel = ROOT.gErrorIgnoreLevel
37  ROOT.gErrorIgnoreLevel = self.levellevel
38 
39  def __exit__(self, type, value, traceback):
40  """Exit the context"""
41  ROOT.gErrorIgnoreLevel = self.oldleveloldlevel
42 
43 
44 # dilution factor binning of Belle
45 r_subsample = array('d', [
46  0.0,
47  0.1,
48  0.25,
49  0.5,
50  0.625,
51  0.75,
52  0.875,
53  1.0])
54 r_size = len(r_subsample)
55 rbins = np.array(r_subsample)
56 
57 # All possible tagging categories
58 categories = [
59  'Electron',
60  'IntermediateElectron',
61  'Muon',
62  'IntermediateMuon',
63  'KinLepton',
64  'IntermediateKinLepton',
65  'Kaon',
66  'KaonPion',
67  'SlowPion',
68  'FSC',
69  'MaximumPstar',
70  'FastHadron',
71  'Lambda']
oldlevel
the previously set level to be ignored
def __exit__(self, type, value, traceback)
def __init__(self, level=ROOT.kInfo+1)