22 hist = inputs[1][0][
'histogram'][9:]
23 element = inputs[1][0][
'element']
26 titleElement =
'Straws'
29 titleElement =
'Chips'
30 if hist ==
'hHitHWonTMap': title =
'HL Hit(In time Window) on Track: '
31 if hist ==
'hHitWonTMap': title =
'Leading Edge on Track in Time Window: '
32 if hist ==
'hHitAonTMap': title =
'Any LL Bit on Track: '
33 if hist ==
'hHitAWonTMap': title =
'Any LL Bit on Track in Time Window: '
34 if hist ==
'hHitHonTMap': title =
'HL Hit on Track: '
35 rh = ROOT.TH1F(name, title + titleElement, 1, 0, 1)
36 rh.GetXaxis().SetTitle(titleElement[:-1] +
' Number in Stack')
37 rh.GetYaxis().SetTitle(
'Probability')
38 for i
in range(len(inputs[0][1])):
39 plots = [_[1][i]
for _
in inputs]
41 for m
in range(int(len(plots)/2)):
43 plot1 = plots[2*m + 1]
44 nBins = plots[0].GetNbinsX()
45 rh.SetBins(nBins, 0, nBins)
46 for j
in range(nBins):
47 if plot0.GetBinEntries(j + 1) > 0:
48 rh.SetBinContent(j + 1, plot1.GetBinContent(j + 1)*1./plot0.GetBinEntries(j + 1))
50 rh.SetBinContent(j + 1, 0)
56 hist = inputs[0][0][
'histogram']
57 element = inputs[0][0][
'element']
60 titleElement =
'Straws'
63 titleElement =
'Chips'
64 if hist ==
'hHitHWonTMap': title =
'HL Hit(In time Window) on Track: '
65 if hist ==
'hHitWonTMap': title =
'Leading Edge on Track in Time Window: '
66 if hist ==
'hHitAonTMap': title =
'Any LL Bit on Track: '
67 if hist ==
'hHitAWonTMap': title =
'Any LL Bit on Track in Time Window: '
68 if hist ==
'hHitHonTMap': title =
'HL Hit on Track: '
69 rh = ROOT.TProfile(name, title + titleElement, 1, 0, 1)
70 rh.GetXaxis().SetTitle(titleElement[:-1] +
' Number in Stack')
71 rh.GetYaxis().SetTitle(
'Probability')
73 plot0 = inputs[0][1][1]
74 plot1 = inputs[0][1][0]
75 nBins = plot1.GetNbinsX()
76 rh.SetBins(nBins, 0, nBins)
77 for j
in range(1,nBins+2):
78 if plot0.GetBinEntries(j) > 0:
79 rh.Fill(j, plot1.GetBinContent(j)*1./plot0.GetBinEntries(j))
84 element = inputs[0][0][
'element']
87 titleElement =
'Straws'
90 titleElement =
'Chips'
91 rh = ROOT.TH1F(
'hHitonTrackVsAll' + name,
'(Hit on Track) / (Any LL Bit): ' + titleElement, 1, 0, 1)
92 rh.GetXaxis().SetTitle(titleElement[:-1] +
' Number in Stack')
93 rh.GetYaxis().SetTitle(
'Ratio')
94 for i
in range(len(inputs[0][1])):
95 plots = [_[1][i]
for _
in inputs]
97 for m
in range(int(len(plots)/3)):
99 plot1 = plots[3*m + 1]
100 plot2 = plots[3*m + 2]
101 nBins = plots[0].GetNbinsX()
102 rh.SetBins(nBins, 0, nBins)
103 for j
in range(nBins):
104 if (plot0.GetBinContent(j + 1)*plot1.GetBinContent(j + 1)) > 0:
105 rh.SetBinContent(j + 1, plot2.GetBinContent(j + 1)/(plot0.GetBinContent(j + 1)*plot1.GetBinContent(j + 1)))
107 rh.SetBinContent(j + 1, 0)
130 region = inputs[0][0][
'region']
131 side = inputs[0][0][
'side']
132 if region ==
'Barrel':
133 name =
'hEfficiencyBarrel' + str(side)
134 if region ==
'Endcap':
135 name =
'hEfficiencyEndCap' + str(side)
136 rh = ROOT.TH1F(name,
'Straw Efficiency (' + name[11:] +
')', 500, -0.01, 1.01)
137 rh.GetXaxis().SetTitle(
'Efficiency')
138 rh.GetYaxis().SetTitle(
'Fraction of Straws')
139 for i
in range(len(inputs[0][1])):
140 plots = [_[1][i]
for _
in inputs]
142 for nStraw
in range(plot.GetXaxis().GetNbins()):
143 rh.Fill(plot.GetBinContent(nStraw + 1))
145 entries = rh.GetEntries()
146 for nStraw
in range(rh.GetXaxis().GetNbins()):
147 totalEntries += rh.GetBinContent(nStraw + 1)
148 rh.SetBinContent(nStraw + 1, totalEntries/float(entries))
hEfficiencyIntegral(inputs)