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