13 from ROOT
import TCanvas, TFile
25 call constructor of base class, required.
31 self.
ff = TFile(fname)
33 self.
histHelixhistHelix = {
'ndf': {
'all': self.
ff.Get(
'h17;1'),
34 'up': self.
ff.Get(
'h00;1'),
35 'down': self.
ff.Get(
'h01;1')},
36 'pval': {
'all': self.
ff.Get(
'h18;1'),
37 'up': self.
ff.Get(
'h02;1'),
38 'down': self.
ff.Get(
'h03;1')},
39 'd0': {
'all': self.
ff.Get(
'h11;1'),
40 'up': self.
ff.Get(
'h04;1'),
41 'down': self.
ff.Get(
'h05;1')},
42 'phi0': {
'all': self.
ff.Get(
'h12;1'),
43 'up': self.
ff.Get(
'h06;1'),
44 'down': self.
ff.Get(
'h07;1')},
45 'omega': {
'all': self.
ff.Get(
'h13;1'),
46 'up': self.
ff.Get(
'h08;1'),
47 'down': self.
ff.Get(
'h09;1')},
48 'z0': {
'all': self.
ff.Get(
'h14;1'),
49 'up': self.
ff.Get(
'h0a;1'),
50 'down': self.
ff.Get(
'h0b;1')},
51 'tanl': {
'all': self.
ff.Get(
'h15;1'),
52 'up': self.
ff.Get(
'h0c;1'),
53 'down': self.
ff.Get(
'h0d;1')},
54 'pt': {
'all': self.
ff.Get(
'h16;1'),
55 'up': self.
ff.Get(
'h0e;1'),
56 'down': self.
ff.Get(
'h0f;1')}
61 'phi0': self.
ff.Get(
'h2;1'),
62 'omega': self.
ff.Get(
'h3;1'),
63 'z0': self.
ff.Get(
'h4;1'),
64 'tanl': self.
ff.Get(
'h5;1'),
65 'pt': self.
ff.Get(
'h6;1')}
68 self.
histPullhistPull = {
'd0': self.
ff.Get(
'h21;1'),
69 'phi0': self.
ff.Get(
'h22;1'),
70 'omega': self.
ff.Get(
'h23;1'),
71 'z0': self.
ff.Get(
'h24;1'),
72 'tanl': self.
ff.Get(
'h25;1')}
75 self.
graphPtgraphPt = {
'd0': self.
ff.Get(
'Graph;2'),
76 'phi0': self.
ff.Get(
'Graph;3'),
77 'omega': self.
ff.Get(
'Graph;4'),
78 'z0': self.
ff.Get(
'Graph;5'),
79 'pt': self.
ff.Get(
'Graph;1')}
81 self.
canvascanvas = TCanvas(
"canvas",
"canvas", 800, 800)
89 Plot pull distribution
98 Getter for mean of helix parameter.
102 dm = h.GetMeanError()
107 Getter for rms of helix parameter.
116 Plot graph of resolution as a function of Pt.
119 self.
graphPtgraphPt[key].Draw(
'AP')
120 self.
canvascanvas.Update()
125 Plot resolution histogram.
129 self.
canvascanvas.Update()
132 def draw(self, key='pt', option='all', gopt=''):
134 Plot histogram of helix parameters etc..
137 self.
histHelixhistHelix[key][option].Draw(gopt)
138 self.
canvascanvas.Update()
143 Print the current plot.
145 self.
canvascanvas.Print(fname)
149 Divide Tcanvas by (i,j).
152 self.
canvascanvas.Divide(i, j)
153 self.
ndivndiv = i * j
157 if __name__ ==
"__main__":
160 parser = argparse.ArgumentParser()
161 parser.add_argument(
'input', help=
'Input file to be processed (unpacked CDC data).')
162 args = parser.parse_args()
163 qam =
QAM(args.input)
def print(self, fname='test.png')
histHelix
Histograms for helix parameters etc...
graphPt
Graph, resolution as a function of pt.
def __init__(self, fname='input.root')
index
Index of canvas position.
histReso
Resolution histograms.
def draw(self, key='pt', option='all', gopt='')
def graph(self, key='pt')
def getMean(self, key='pt')
def getRms(self, key='pt')
ndiv
Number of division for canvas.