62 global fpix_tot_deadROC
63 global fpix_tot_ineffROC
64 global fpix_tot_Nrocspopulated
65 global fpix_tot_totalentries
67 forwardPath = commonPath +
"PXForward/";
68 histoname = [
"digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_1",
69 "digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_2"]
70 digi2D = fin.Get(forwardPath + histoname[ringNo-1])
72 if digi2D.GetEntries() == 0 :
74 nblades_perRing_fpx = [22, 34]
75 NexpectedROC_perRing = [704, 1088]
76 Nrocspopulated = [0] * 6
77 totalEntries = [0] * 6
79 nx = digi2D.GetNbinsX()
80 ny = digi2D.GetNbinsY()
81 for xbin
in range(1,nx+1):
82 if xbin >= 25
and xbin <= 32:
continue;
83 if xbin > 1
and (xbin-1)%8 == 0: dcounter += 1;
84 for ybin
in range(1,ny+1):
85 if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1)
and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
87 bentries = digi2D.GetBinContent(xbin,ybin)
89 Nrocspopulated[dcounter] += 1
90 totalEntries[dcounter] += bentries
94 meanEntries[d] =
float(totalEntries[d])/Nrocspopulated[d]
98 for xbin
in range(1,nx+1):
99 if xbin >= 25
and xbin <= 32:
continue;
100 if xbin > 1
and (xbin-1)%8 == 0: dcounter += 1
101 for ybin
in range(1,ny+1):
102 if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1)
and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
104 bentries = digi2D.GetBinContent(xbin,ybin)
106 if bentries > 0
and bentries < meanEntries[dcounter]/4.:
107 NineffROC[dcounter] += 1
109 print(
"#Summary for FPix Ring", ringNo, file=os)
112 if d < 3: disc =
"M" +
str(3 - d)
113 else: disc =
"P" +
str(d - 2)
115 tmpstr =
"FPix R" +
str(ringNo) +
"D" +
str(disc)
116 print(
'{0:10s} {1:4d} {2:4d} {3:4.1f}'.
format(tmpstr, NexpectedROC_perRing[ringNo-1] - Nrocspopulated[d], NineffROC[d], round(meanEntries[d],1)), file=os)
117 fpix_tot_deadROC += NexpectedROC_perRing[ringNo-1] - Nrocspopulated[d]
118 fpix_tot_ineffROC += NineffROC[d]
119 fpix_tot_Nrocspopulated += Nrocspopulated[d]
120 fpix_tot_totalentries +=
float(totalEntries[d])
S & print(S &os, JobReport::InputFile const &f)
def countBadROCForward(fin, ringNo, os)
endacp#########################################