Belle II Software development
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
19import ROOT
20from array import array
21import numpy as np
22
23
24class 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.level = level
31
32 def __enter__(self):
33 """Enter the context"""
34
35 self.oldlevel = ROOT.gErrorIgnoreLevel
36 ROOT.gErrorIgnoreLevel = self.level
37
38 def __exit__(self, type, value, traceback):
39 """Exit the context"""
40 ROOT.gErrorIgnoreLevel = self.oldlevel
41
42
43# dilution factor binning of Belle
44r_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])
53r_size = len(r_subsample)
54rbins = np.array(r_subsample)
55
56# All possible tagging categories
57categories = [
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)