8 def creatGraph(xs, ys, x_errs, y_errs, g_name, g_title, g_Xtitle, g_Ytitle):
13 x_arr = array.array(
"f",xs)
14 y_arr = array.array(
"f",ys)
15 x_err_arr = array.array(
"f",x_errs)
16 y_err_arr = array.array(
"f",y_errs)
18 g1 = ROOT.TGraphErrors(len(x_arr),x_arr,y_arr, x_err_arr, y_err_arr)
20 g1.SetNameTitle(g_name, g_title)
22 g1.GetXaxis().SetTitle(g_Xtitle)
23 g1.GetYaxis().SetTitle(g_Ytitle)
24 g1.GetYaxis().SetRangeUser(0.8*
min(y_arr),1.2*
max(y_arr))
36 default_dic = {
"p0": 0.,
"p0_err":0.,
"p1": -1.,
"p1_err":-1.,
"chi2":-1.,
"mean":0.,
"mean_err":0.}
47 return (Qtag, default_dic)
51 return (Qtag, default_dic)
54 fit_result = h_temp.Fit(
"pol1", opt)
56 par_a =
round(fit_result.Value(0), 2)
57 par_a_E =
round(fit_result.ParError(0), 2)
58 par_b =
round(fit_result.Value(1), 2)
59 par_b_E =
round(fit_result.ParError(1), 2)
61 if fit_result.Ndf() == 0:
65 chi2 =
round(fit_result.Chi2()/fit_result.Ndf(), 2)
67 mean =
round(h_temp.GetMean(2), 2)
68 mean_rms=
round(h_temp.GetRMS(2), 2)
70 dic = {
"p0": par_a,
"p0_err":par_a_E,
"p1": par_b,
"p1_err":par_b_E,
"chi2":chi2,
"mean":mean,
"mean_err":mean_rms}
100 return (sector, layer)
104 self.
stationNames = {2:
'BML', 3:
'BMS', 4:
'BOL', 5:
'BOS', 8:
'BMF' , 9:
'BOF', 10:
'BOG', 53:
'BME'}
109 str_gap =
"Ly" +
str(self.
gasGap - 1) +
"."
125 str_phi =
"0" +
str(myphi_part)
127 str_phi =
str(myphi_part)
152 self.
panel_name = str_name + str_eta + str_side + str_phi + str_PICO + str_dPhi + str_gap + str_dZ + str_ETAPHI
174 etaStation = 2*etaStation
176 etaStation = 2*etaStation-1
184 if __name__ ==
'__main__':
185 print (
"RPCRawDataMonUtils: Hello, World !")