61 global fpix_tot_deadROC
62 global fpix_tot_ineffROC
63 global fpix_tot_Nrocspopulated
64 global fpix_tot_totalentries
66 forwardPath = commonPath +
"PXForward/";
67 histoname = [
"digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_1",
68 "digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_2"]
69 digi2D = fin.Get(forwardPath + histoname[ringNo-1])
71 if digi2D.GetEntries() == 0 :
73 nblades_perRing_fpx = [22, 34]
74 NexpectedROC_perRing = [704, 1088]
75 Nrocspopulated = [0] * 6
76 totalEntries = [0] * 6
78 nx = digi2D.GetNbinsX()
79 ny = digi2D.GetNbinsY()
80 for xbin
in range(1,nx+1):
81 if xbin >= 25
and xbin <= 32:
continue;
82 if xbin > 1
and (xbin-1)%8 == 0: dcounter += 1;
83 for ybin
in range(1,ny+1):
84 if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1)
and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
86 bentries = digi2D.GetBinContent(xbin,ybin)
88 Nrocspopulated[dcounter] += 1
89 totalEntries[dcounter] += bentries
93 meanEntries[d] =
float(totalEntries[d])/Nrocspopulated[d]
97 for xbin
in range(1,nx+1):
98 if xbin >= 25
and xbin <= 32:
continue;
99 if xbin > 1
and (xbin-1)%8 == 0: dcounter += 1
100 for ybin
in range(1,ny+1):
101 if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1)
and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
103 bentries = digi2D.GetBinContent(xbin,ybin)
105 if bentries > 0
and bentries < meanEntries[dcounter]/4.:
106 NineffROC[dcounter] += 1
108 print >> os,
"#Summary for FPix Ring", ringNo
111 if d < 3: disc =
"M" +
str(3 - d)
112 else: disc =
"P" +
str(d - 2)
114 tmpstr =
"FPix R" +
str(ringNo) +
"D" +
str(disc)
115 print >> os,
'{0:10s} {1:4d} {2:4d} {3:4.1f}'.
format(tmpstr, NexpectedROC_perRing[ringNo-1] - Nrocspopulated[d], NineffROC[d], round(meanEntries[d],1))
116 fpix_tot_deadROC += NexpectedROC_perRing[ringNo-1] - Nrocspopulated[d]
117 fpix_tot_ineffROC += NineffROC[d]
118 fpix_tot_Nrocspopulated += Nrocspopulated[d]
119 fpix_tot_totalentries +=
float(totalEntries[d])
def countBadROCForward(fin, ringNo, os)
endacp#########################################