5 import MMRawDataMonitoring.MMRawMonLabels
as labels
6 from ROOT
import TF1, TMath
9 labelx = getattr(labels, x)
10 labely = getattr(labels, y)
14 labely = getattr(labels, y)
18 labelx = getattr(labels, x)
22 flandau = TF1(
"flandau",
"landau",0,800)
23 histo.Fit(
"flandau",
"QRN")
24 mpv = flandau.GetParameter(1)
28 fgaus = TF1(
"fgaus",
"gaus",minval,maxval)
29 histo.Fit(
"fgaus",
"QRN")
30 mean = fgaus.GetParameter(1)
31 sigma = fgaus.GetParameter(2)
34 def getXYbins(nPCB, iphi, start0, histoname, histo_list):
38 ind = histo_list[iphi].
index(histoname)
40 ind = histo_list[iphi-1].
index(histoname)
41 xbin = (ind+1) + (nPCB-1)*ind
45 fermiDirac= par[0]/( 1 + TMath.Exp( (par[1]-x[0])/par[2] ) + TMath.Exp( (x[0]-par[3])/par[4] ))
48 tf1_fd = TF1(
"fd", fitFermiDirac, 0., 700., 5)
52 p0=histo.GetMaximum()/4.
53 p1=histo.GetBinLowEdge(histo.FindFirstBinAbove())
55 p3=histo.GetBinLowEdge(histo.FindLastBinAbove())
59 fd.SetParameters(p0, p1, p2, p3, p4)
60 fd.SetParLimits(0, 0, histo.GetMaximum())
61 fd.SetParLimits(1, histo.GetBinLowEdge(histo.FindFirstBinAbove())-5, histo.GetBinLowEdge(histo.FindFirstBinAbove())+10)
62 fd.SetParLimits(2, 0.001, 10)
63 fd.SetParLimits(3, histo.GetBinLowEdge(histo.FindFirstBinAbove()), histo.GetBinLowEdge(histo.FindLastBinAbove())+5)
64 fd.SetParLimits(4, 0.001, 10)
68 t0 = fd.GetParameter(1)
69 tmax = fd.GetParameter(3)
74 def poi(histo_name, side, eta):
76 if histo_name==
'Charge_vs_PCB':
77 poi = f
'{side}: MPV of Landau Fit to Cluster charge {eta}'
78 elif histo_name==
'Charge_vs_PCB_ontrack':
79 poi = f
'{side}: MPV of Landau Fit to Cluster charge {eta} ontrack'
80 elif histo_name==
'Charge_vs_PCB_onseg':
81 poi = f
'{side}: MPV of Landau Fit to Cluster charge {eta} onseg'
82 elif histo_name==
'Cluster_size_vs_PCB':
83 poi = f
'Cluster size {side} {eta} per PCB'
84 elif histo_name==
'Cluster_size_vs_PCB_ontrack':
85 poi = f
'Cluster size {side} {eta} ontrack per PCB'
86 elif histo_name==
'Cluster_size_vs_PCB_onseg':
87 poi = f
'Cluster size {side} {eta} onseg per PCB'
88 elif histo_name==
'Cluster_time_vs_PCB':
89 poi = f
'Cluster time {side} {eta} per PCB'
90 elif histo_name==
'Cluster_time_ontrack_vs_PCB':
91 poi = f
'Cluster time {side} {eta} ontrack per PCB'
92 elif histo_name==
'Cluster_time_onseg_vs_PCB':
93 poi = f
'Cluster time {side} {eta} on seg per PCB'
94 elif histo_name==
'Strip_time_vs_PCB':
95 poi = f
'Strip time {side} {eta} per PCB'
96 elif histo_name==
'Strip_time_vs_PCB':
97 poi = f
'Strip time {side} {eta} per PCB'
98 elif histo_name==
'Strip_time_onseg_vs_PCB':
99 poi = f
'Strip time on seg {side} {eta} per PCB'
100 elif histo_name==
'Strip_time_ontrack_vs_PCB':
101 poi = f
'Strip time on track {side} {eta} per PCB'