46 def __init__(self, fname='output.root'):
47 """
48 call constructor of base class, required.
49 """
50
51 super().__init__()
52
53
54 self.f = TFile(fname)
55
56 self.type = 'adc'
57
58 self.histADC = [self.f.Get('h' + str(100000 + i))
59 for i in range(14336)]
60
61 self.histTDC = [self.f.Get('h' + str(200000 + i))
62 for i in range(14336)]
63
64 self.histHit = [self.f.Get('h' + str(400000 + i))
65 for i in range(56)]
66
67 self.lines = []
68 for h in self.histTDC:
69 y = h.GetMaximum()
70 line = TLine(refT0, 0, refT0, y)
71 line.SetLineColor(2)
72 self.lines.append(line)
73
74
75 self.lineMPVs = []
76 for h in self.histADC:
77 y = h.GetMaximum()
78 line = TLine(refMPV, 0, refMPV, y)
79 line.SetLineColor(2)
80 self.lineMPVs.append(line)
81
82
83
84
85 self.sig = TF1("sig", "landau", 0, 200)
86
87
88
89 self.ft0 = TF1("ft0", "[0]+[1]*(exp([2]*([3]-x))/(1+exp(-([4]-x)/[5])))", 2000, 4000)
90 self.ft0.SetParameters(0, 10, 0, 0, 3800, 3.)
91 self.ft0.FixParameter(0, 0.)
92
93 self.m_fitStatus = False
94
95 self.canvas = TCanvas("canvas", "canvas", 800, 800)
96
97 self.hid = 0
98
99 self.ndiv = 1
100
101 self.par = [-1.0 for i in range(14336)]
102
103 self.parADCinLayer = [-1.0 for i in range(56)]
104
105 self.parT0 = [0.0 for i in range(14336)]
106
107 self.h2 = TH2D("h2d", "MPV of all ADCs", 15000,
108 -500, 14500, 100, 0, 200)
109
110 self.h2.SetStats(0)
111
112 self.h2.GetXaxis().SetTitle('Cell ID')
113
114 self.h2.GetYaxis().SetTitle('MPV')
115
116 self.h2ADCvsLayer = TH2D("h2dl", "MPV for every Layer", 56,
117 0, 56, 100, 0, 200)
118
119 self.h2ADCvsLayer.SetStats(0)
120
121 self.h2ADCvsLayer.GetXaxis().SetTitle('Layer')
122
123 self.h2ADCvsLayer.GetYaxis().SetTitle('MPV (adc count)')
124
125 self.x = array("d", [i for i in range(14336)])
126
127 self.l_array = array("d", [i for i in range(56)])
128
129 self.graph = TGraph(len(self.x))
130
131 self.graph.SetMarkerStyle(kFullCircle)
132
133 self.graph.SetMarkerSize(0.3)
134
135
136 self.graph2 = TGraph(len(self.l_array))
137
138 self.graph2.SetMarkerStyle(kFullCircle)
139
140 self.graph2.SetMarkerSize(1.0)
141
142 self.line = [TLine(0, 0, 0, 200)]
143
144 x0 = 0
145 for i in range(9):
146 x0 = x0 + nWiresSL[i]
147 line = TLine(x0, 0, x0, 200)
148 self.line.append(line)
149 for l_i in self.line:
150 l_i.SetLineColorAlpha(8, 0.5)
151 l_i.SetLineStyle(2)
152