-
Notifications
You must be signed in to change notification settings - Fork 0
/
longevity.py
180 lines (164 loc) · 7.54 KB
/
longevity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/usr/bin/env python3
#
# longevity.py -- set of macros to plot data that explore the aging
# of the tagger microscope detector and readout electronics.
#
# author: richard.t.jones at uconn.edu
# version: january 22, 2022
import ROOT
import fityields
runrange = {20000: "4-21-2016",
30000: "2-23-2017",
40000: "12-5-2017",
50000: "9-29-2018",
60000: "2-9-2019",
70000: "12-9-2019",
80000: "9-23-2021",
}
setVbias = {}
globhists = {}
def read_setVbias(run):
"""
Fetch setVbias.conf calibration data from disk and store in the
internal hash setVbias.
"""
setVbias.clear()
fityields.loadVbias("setVbias_fulldetector-" +
runrange[run] + ".conf")
for row in range(1,6):
for col in range(1,103):
name = "Gr{0}c{1}".format(row,col)
title = "TAGM gain vs run number, row={0}, col={1}".format(row,col)
if not name in globhists:
globhists[name] = ROOT.TH1D(name, title, 10, 0, 100000)
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM gain (pF / V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
g = fityields.setVbias_gain[row][col]
globhists[name].Fill(run, g)
globhists[name].SetBinError(globhists[name].FindBin(run), g/20.)
name = "Gc{0}".format(col)
title = "TAGM gain vs run number, row=all, col={0}".format(col)
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM gain (pF / V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
globhists[name].Fill(run, g)
name = "Gc1-42"
title = "TAGM gain vs run number, row=all, col=1-42"
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM gain (pF / V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
if col <= 42:
globhists[name].Fill(run, g)
name = "Gc43-102"
title = "TAGM gain vs run number, row=all, col=43-102"
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM gain (pF / V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
if col > 42:
globhists[name].Fill(run, g)
name = "Yr{0}c{1}".format(row,col)
title = "TAGM yield vs run number, row={0}, col={1}".format(row,col)
if not name in globhists:
globhists[name] = ROOT.TH1D(name, title, 10, 0, 100000)
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM yield (pix/V/tag)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
y = fityields.setVbias_yield[row][col]
globhists[name].Fill(run, y)
globhists[name].SetBinError(globhists[name].FindBin(run), y/20.)
name = "Yc{0}".format(col)
title = "TAGM yield vs run number, all rows, col={0}".format(col)
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1000, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM yield (pix/V/tag)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
globhists[name].Fill(run, y)
name = "Yc1-42"
title = "TAGM yield vs run number, all rows, col=1-42"
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1000, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM yield (pix/V/tag)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
if col <= 42:
globhists[name].Fill(run, y)
name = "Yc43-102"
title = "TAGM yield vs run number, all rows, col=43-102"
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1000, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM yield (pix/V/tag)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
if col > 42:
globhists[name].Fill(run, y)
name = "Vbr{0}c{1}".format(row,col)
title = "TAGM Vbreakdown vs run number, row={0}, col={1}".format(row,col)
if not name in globhists:
globhists[name] = ROOT.TH1D(name, title, 10, 0, 100000)
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM Vbreakdown (V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
V = fityields.setVbias_threshold[row][col]
globhists[name].Fill(run, V)
globhists[name].SetBinError(globhists[name].FindBin(run), V/20.)
name = "Vbc{0}".format(col)
title = "TAGM Vbreakdown vs run number, all rows, col={0}".format(col)
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1000, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM Vbreakdown (V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
globhists[name].Fill(run, V)
name = "Vbc1-42"
title = "TAGM Vbreakdown vs run number, all rows, col=1-42"
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1000, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM Vbreakdown (V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
if col <= 42 and V > 65:
globhists[name].Fill(run, V)
name = "Vbc43-102"
title = "TAGM Vbreakdown vs run number, all rows, col=43-102"
if not name in globhists:
globhists[name] = ROOT.TProfile(name, title, 10, 0, 100000,
0, 1000, 's')
globhists[name].GetXaxis().SetTitle("run number")
globhists[name].GetYaxis().SetTitle("SiPM Vbreakdown (V)")
globhists[name].SetStats(0)
globhists[name].Sumw2()
if col > 42 and V > 65:
globhists[name].Fill(run, V)
return globhists
def read_all_setVbias():
hlist = []
for run in runrange.keys():
hlist.append(read_setVbias(run))
return hlist