5 from ROOT
import TH1F, TF1
6 from .CscMonUtils
import getCSCLabelx, getCSCEfficiency
10 h_etaClusQSumHist = inputs[0][1][0].Clone()
15 if '_EA' not in h_etaClusQSumHist.GetName():
20 h_lfit =
TH1F(
"h1csc_clus_qsum_signal_E"+side+
"_lfitmean",
"EndCap"+side+
": MPV of Landau Fit to Cluster charge (Qsum)", nbins, minbin, maxbin)
22 for ibin
in range(len(xlabels)):
23 h_lfit.GetXaxis().SetBinLabel(ibin+1, xlabels[ibin])
24 h_lfit.GetYaxis().SetTitle(
"counts / layer")
26 for j
in range(5, 86):
30 h_proj = h_etaClusQSumHist.ProjectionX(
"_px", j, j)
35 entries = h_proj.GetEntries()
37 flandau = TF1(
"fland",
"landau", flmin, flmax)
38 fit_status = h_proj.Fit(flandau,
"LQRN",
"goff")
40 mpv = flandau.GetParameter(1)
41 mpv_err = flandau.GetParError(1)
42 h_lfit.SetBinContent(j, mpv)
43 h_lfit.SetBinError(j, mpv_err)
48 h_NumNClusSegm = inputs[0][1][0].Clone()
53 if '_EA' not in h_NumNClusSegm.GetName():
58 h_eff =
TH1F(
"Muon_Segm_Efficiency_E"+side,
"EndCap"+side+
": #eta-segment efficiency per sector", nbins, minbin, maxbin)
61 for ibin
in range(len(xlabels)):
62 h_eff.GetXaxis().SetBinLabel(ibin+1, xlabels[ibin])
63 h_eff.GetYaxis().SetTitle(
"efficiency")
65 for layer
in range(1,5):
67 for ichamber
in range(1,17):
68 num = h_NumNClusSegm.GetBinContent(46,1+5*ichamber)
69 num_err = h_NumNClusSegm.GetBinError(46,1+5*ichamber)
70 den = h_NumNClusSegm.GetBinContent(10*layer-4,1+5*ichamber)
71 den_err = h_NumNClusSegm.GetBinError(10*layer-4,1+5*ichamber)
73 h_eff.SetBinContent(5*ichamber+1+(layer-1),eff)
74 h_eff.SetBinError(5*ichamber+1+(layer-1),err)
77 for ichamber
in range(1,17):
78 num = h_NumNClusSegm.GetBinContent(46, 86-5*ichamber)
79 num_err = h_NumNClusSegm.GetBinError(46, 86-5*ichamber)
80 den = h_NumNClusSegm.GetBinContent(10*layer-4, 86-5*ichamber)
81 den_err = h_NumNClusSegm.GetBinError(10*layer-4, 86-5*ichamber)
83 h_eff.SetBinContent(90-layer-5*ichamber,eff)
84 h_eff.SetBinError(90-layer-5*ichamber,err)