137 def map_per_PCB(inputs, histo_name, start_index, proctype):
138 inputs =
list(inputs)
141 for i
in range(len(inputs)):
142 h=inputs[i][1][0].Clone()
143 histos_unsorted.append(h.GetName())
144 names.append(h.GetName())
150 if(
'eta1' in names[0]):
156 if(
'CSide' in names[0]):
158 list_of_all_histos=[]
159 for phi
in range(16):
161 for mult
in range(2):
163 test_list.append(f
'{histo_name}_{side}_{eta}_phi{phi+1}_ml{mult+1}_gap{gg+1}')
164 list_of_all_histos.append(test_list)
167 for ihisto
in range(len(names)):
168 ind = histos_unsorted.index(names[ihisto])
169 histos_sorted.append(inputs[ind][1][0])
170 if proctype==
'fermiDirac_tzero':
171 h_poi_per_PCB =
TH2F(f
'{histo_name}_{side}_{eta}_tzero_per_PCB',
poi(histo_name,side,eta)+
' tzero' , bins, 0, bins, 16, .5, 16.5)
172 elif proctype==
'fermiDirac_deltat':
173 h_poi_per_PCB =
TH2F(f
'{histo_name}_{side}_{eta}_tzero_per_PCB',
poi(histo_name,side,eta)+
' deltaT' , bins, 0, bins, 16, .5, 16.5)
175 h_poi_per_PCB =
TH2F(f
'{histo_name}_{side}_{eta}_per_PCB',
poi(histo_name,side,eta), bins, 0, bins, 16, .5, 16.5)
179 for xbin
in range(len(thisLabelx)):
180 h_poi_per_PCB.GetXaxis().SetBinLabel(xbin+1, thisLabelx[xbin])
181 h_poi_per_PCB.GetYaxis().SetTitle(
'Sector')
183 for ihisto
in range(len(histos_sorted)):
184 histo_name=histos_sorted[ihisto].GetName()
185 iphi = histos_sorted[ihisto].GetName()[start_index:start_index+2]
187 iphi = histos_sorted[ihisto].GetName()[start_index:start_index+1]
189 xbin,ybin =
getXYbins(nPCB,
int(iphi),
False, histos_sorted[ihisto].GetName(), list_of_all_histos)
190 for ipcb
in range(nPCB):
191 histo_tmp = histos_sorted[ihisto].ProjectionY(histos_sorted[ihisto].GetName()+
"_py_"+
str(ipcb+1),ipcb+1,ipcb+1)
193 if (histo_tmp.GetEntries()==0):
194 h_poi_per_PCB.SetBinContent(xbin, ybin, -999)
196 h_poi_per_PCB.SetBinContent(xbin, ybin, histo_tmp.GetMean())
197 h_poi_per_PCB.GetZaxis().SetRangeUser(0, 20)
199 if (histo_tmp.GetEntries()<100):
200 h_poi_per_PCB.SetBinContent(xbin, ybin, -999)
203 h_poi_per_PCB.SetBinContent(xbin, ybin, gmean)
204 h_poi_per_PCB.GetZaxis().SetRangeUser(-100, 700)
205 if proctype==
'landau':
206 if (histo_tmp.GetEntries()<100):
207 h_poi_per_PCB.SetBinContent(xbin, ybin, -999)
210 h_poi_per_PCB.SetBinContent(xbin, ybin, mpv)
211 h_poi_per_PCB.GetZaxis().SetRangeUser(0, 100)
212 if proctype==
'fermiDirac_tzero':
213 if (histo_tmp.GetEntries()<100):
214 h_poi_per_PCB.SetBinContent(xbin, ybin, -999)
217 h_poi_per_PCB.SetBinContent(xbin, ybin, t0)
218 h_poi_per_PCB.GetZaxis().SetRangeUser(-100, 700)
219 if proctype==
'fermiDirac_deltat':
220 if (histo_tmp.GetEntries()<100):
221 h_poi_per_PCB.SetBinContent(xbin, ybin, -999)
224 h_poi_per_PCB.SetBinContent(xbin, ybin, tmax-t0)
225 h_poi_per_PCB.GetZaxis().SetRangeUser(0, 300)
227 return[h_poi_per_PCB]