Belle II Software development
QAM Class Reference

Public Member Functions

 __init__ (self, fname='input.root')
 
 pull (self, key='d0')
 
 getMean (self, key='pt')
 
 getRms (self, key='pt')
 
 graph (self, key='pt')
 
 reso (self, key='pt')
 
 draw (self, key='pt', option='all', gopt='')
 
 print (self, fname='test.png')
 
 div (self, i=1, j=1)
 

Public Attributes

 f = TFile(fname)
 input file name
 
dict histHelix
 Histograms for helix parameters etc...
 
dict histReso
 Resolution histograms.
 
dict histPull
 Pull histograms.
 
dict graphPt
 Graph, resolution as a function of pt.
 
 canvas = TCanvas("canvas", "canvas", 800, 800)
 canvas
 
int ndiv = 1
 Number of division for canvas.
 
int index = 1
 Index of canvas position.
 

Detailed Description

QAM class.

Definition at line 16 of file qam.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
fname = 'input.root' )
call constructor of base class, required.

Definition at line 22 of file qam.py.

22 def __init__(self, fname='input.root'):
23 """
24 call constructor of base class, required.
25 """
26
27 super().__init__()
28
29
30 self.f = TFile(fname)
31
32 self.histHelix = {'ndf': {'all': self.f.Get('h17;1'),
33 'up': self.f.Get('h00;1'),
34 'down': self.f.Get('h01;1')},
35 'pval': {'all': self.f.Get('h18;1'),
36 'up': self.f.Get('h02;1'),
37 'down': self.f.Get('h03;1')},
38 'd0': {'all': self.f.Get('h11;1'),
39 'up': self.f.Get('h04;1'),
40 'down': self.f.Get('h05;1')},
41 'phi0': {'all': self.f.Get('h12;1'),
42 'up': self.f.Get('h06;1'),
43 'down': self.f.Get('h07;1')},
44 'omega': {'all': self.f.Get('h13;1'),
45 'up': self.f.Get('h08;1'),
46 'down': self.f.Get('h09;1')},
47 'z0': {'all': self.f.Get('h14;1'),
48 'up': self.f.Get('h0a;1'),
49 'down': self.f.Get('h0b;1')},
50 'tanl': {'all': self.f.Get('h15;1'),
51 'up': self.f.Get('h0c;1'),
52 'down': self.f.Get('h0d;1')},
53 'pt': {'all': self.f.Get('h16;1'),
54 'up': self.f.Get('h0e;1'),
55 'down': self.f.Get('h0f;1')}
56 }
57
58
59 self.histReso = {'d0': self.f.Get('h1;1'),
60 'phi0': self.f.Get('h2;1'),
61 'omega': self.f.Get('h3;1'),
62 'z0': self.f.Get('h4;1'),
63 'tanl': self.f.Get('h5;1'),
64 'pt': self.f.Get('h6;1')}
65
66
67 self.histPull = {'d0': self.f.Get('h21;1'),
68 'phi0': self.f.Get('h22;1'),
69 'omega': self.f.Get('h23;1'),
70 'z0': self.f.Get('h24;1'),
71 'tanl': self.f.Get('h25;1')}
72
73
74 self.graphPt = {'d0': self.f.Get('Graph;2'),
75 'phi0': self.f.Get('Graph;3'),
76 'omega': self.f.Get('Graph;4'),
77 'z0': self.f.Get('Graph;5'),
78 'pt': self.f.Get('Graph;1')}
79
80 self.canvas = TCanvas("canvas", "canvas", 800, 800)
81
82 self.ndiv = 1
83
84 self.index = 1
85

Member Function Documentation

◆ div()

div ( self,
i = 1,
j = 1 )
Divide Tcanvas by (i,j).

Definition at line 146 of file qam.py.

146 def div(self, i=1, j=1):
147 """
148 Divide Tcanvas by (i,j).
149 """
150 self.canvas.Clear()
151 self.canvas.Divide(i, j)
152 self.ndiv = i * j
153 self.index = 1
154
155

◆ draw()

draw ( self,
key = 'pt',
option = 'all',
gopt = '' )
Plot histogram of helix parameters etc..

Definition at line 131 of file qam.py.

131 def draw(self, key='pt', option='all', gopt=''):
132 '''
133 Plot histogram of helix parameters etc..
134 '''
135 self.canvas.cd(self.index)
136 self.histHelix[key][option].Draw(gopt)
137 self.canvas.Update()
138 self.index = self.index + 1
139

◆ getMean()

getMean ( self,
key = 'pt' )
Getter for mean of helix parameter.

Definition at line 95 of file qam.py.

95 def getMean(self, key='pt'):
96 '''
97 Getter for mean of helix parameter.
98 '''
99 h = self.histReso[key]
100 m = h.GetMean()
101 dm = h.GetMeanError()
102 return [m, dm]
103

◆ getRms()

getRms ( self,
key = 'pt' )
Getter for rms of helix parameter.

Definition at line 104 of file qam.py.

104 def getRms(self, key='pt'):
105 '''
106 Getter for rms of helix parameter.
107 '''
108 h = self.histReso[key]
109 s = h.GetRMS()
110 ds = h.GetRMSError()
111 return [s, ds]
112

◆ graph()

graph ( self,
key = 'pt' )
Plot graph of resolution as a function of Pt.

Definition at line 113 of file qam.py.

113 def graph(self, key='pt'):
114 '''
115 Plot graph of resolution as a function of Pt.
116 '''
117 self.canvas.cd(self.index)
118 self.graphPt[key].Draw('AP')
119 self.canvas.Update()
120 self.index = self.index + 1
121

◆ print()

print ( self,
fname = 'test.png' )
Print the current plot.

Definition at line 140 of file qam.py.

140 def print(self, fname='test.png'):
141 """
142 Print the current plot.
143 """
144 self.canvas.Print(fname)
145

◆ pull()

pull ( self,
key = 'd0' )
Plot pull distribution

Definition at line 86 of file qam.py.

86 def pull(self, key='d0'):
87 '''
88 Plot pull distribution
89 '''
90 self.canvas.cd(self.index)
91 self.histPull[key].Draw()
92 self.canvas.Update()
93 self.index = self.index + 1
94

◆ reso()

reso ( self,
key = 'pt' )
Plot resolution histogram.

Definition at line 122 of file qam.py.

122 def reso(self, key='pt'):
123 '''
124 Plot resolution histogram.
125 '''
126 self.canvas.cd(self.index)
127 self.histReso[key].Draw()
128 self.canvas.Update()
129 self.index = self.index + 1
130

Member Data Documentation

◆ canvas

canvas = TCanvas("canvas", "canvas", 800, 800)

canvas

Definition at line 80 of file qam.py.

◆ f

f = TFile(fname)

input file name

Definition at line 30 of file qam.py.

◆ graphPt

dict graphPt
Initial value:
= {'d0': self.f.Get('Graph;2'),
'phi0': self.f.Get('Graph;3'),
'omega': self.f.Get('Graph;4'),
'z0': self.f.Get('Graph;5'),
'pt': self.f.Get('Graph;1')}

Graph, resolution as a function of pt.

Definition at line 74 of file qam.py.

◆ histHelix

dict histHelix
Initial value:
= {'ndf': {'all': self.f.Get('h17;1'),
'up': self.f.Get('h00;1'),
'down': self.f.Get('h01;1')},
'pval': {'all': self.f.Get('h18;1'),
'up': self.f.Get('h02;1'),
'down': self.f.Get('h03;1')},
'd0': {'all': self.f.Get('h11;1'),
'up': self.f.Get('h04;1'),
'down': self.f.Get('h05;1')},
'phi0': {'all': self.f.Get('h12;1'),
'up': self.f.Get('h06;1'),
'down': self.f.Get('h07;1')},
'omega': {'all': self.f.Get('h13;1'),
'up': self.f.Get('h08;1'),
'down': self.f.Get('h09;1')},
'z0': {'all': self.f.Get('h14;1'),
'up': self.f.Get('h0a;1'),
'down': self.f.Get('h0b;1')},
'tanl': {'all': self.f.Get('h15;1'),
'up': self.f.Get('h0c;1'),
'down': self.f.Get('h0d;1')},
'pt': {'all': self.f.Get('h16;1'),
'up': self.f.Get('h0e;1'),
'down': self.f.Get('h0f;1')}
}

Histograms for helix parameters etc...

Definition at line 32 of file qam.py.

◆ histPull

dict histPull
Initial value:
= {'d0': self.f.Get('h21;1'),
'phi0': self.f.Get('h22;1'),
'omega': self.f.Get('h23;1'),
'z0': self.f.Get('h24;1'),
'tanl': self.f.Get('h25;1')}

Pull histograms.

Definition at line 67 of file qam.py.

◆ histReso

dict histReso
Initial value:
= {'d0': self.f.Get('h1;1'),
'phi0': self.f.Get('h2;1'),
'omega': self.f.Get('h3;1'),
'z0': self.f.Get('h4;1'),
'tanl': self.f.Get('h5;1'),
'pt': self.f.Get('h6;1')}

Resolution histograms.

Definition at line 59 of file qam.py.

◆ index

index = 1

Index of canvas position.

Definition at line 84 of file qam.py.

◆ ndiv

int ndiv = 1

Number of division for canvas.

Definition at line 82 of file qam.py.


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