CMS 3D CMS Logo

Functions
DeadROCCounter_Phase1 Namespace Reference

Functions

def countBadROCBarrel (fin, layerNo, os)
 barrel######################################################## More...
 
def countBadROCForward (fin, ringNo, os)
 endacp######################################### More...
 
def getRunNumber (filename)
 

Function Documentation

def DeadROCCounter_Phase1.countBadROCBarrel (   fin,
  layerNo,
  os 
)

barrel########################################################

Definition at line 13 of file DeadROCCounter_Phase1.py.

References objects.autophobj.float, reco.if(), and harvestTrackValidationPlots.str.

Referenced by countBadROCForward().

13 def countBadROCBarrel(fin, layerNo, os):
14  barrelPath = commonPath + "PXBarrel/";
15  histoname = ["digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_1", "digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_2",
16  "digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_3", "digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_4"]
17  digi2D = fin.Get(barrelPath + histoname[layerNo-1])
18  #return status flag is histogram is empty!
19  if digi2D.GetEntries() == 0 :
20  return 1;
21  Nrocspopulated = 0
22  totalEntries = 0
23  NexpectedROC = [1536, 3584, 5632, 8192]
24  nLadders_bpx = [6, 14, 22, 32]
25  nx = digi2D.GetNbinsX()
26  ny = digi2D.GetNbinsY()
27  for xbin in range(1,nx+1):
28  if xbin >= 33 and xbin <= 40: continue;#region of cross on x-axis
29  for ybin in range(1,ny+1):
30  if (ybin == 2*nLadders_bpx[layerNo-1] + 1) or (ybin == 2*nLadders_bpx[layerNo-1] + 2): continue;#region of cross on y-axis
31  bentries = digi2D.GetBinContent(xbin,ybin)
32  if(bentries > 0):
33  Nrocspopulated+=1
34  totalEntries += bentries
35  meanEntries = float(totalEntries)/Nrocspopulated
36  NineffROC = 0
37  #Loop to chek inefficient ROC per layer
38  for xbin in range(1,nx+1):
39  if xbin >= 33 and xbin <= 40:
40  continue;#region of cross on x-axis
41  for ybin in range(1,ny+1):
42  if (ybin == 2*nLadders_bpx[layerNo-1] + 1) or (ybin == 2*nLadders_bpx[layerNo-1] + 2): continue;#region of cross on y-axis
43  bentries = digi2D.GetBinContent(xbin,ybin);
44  if(bentries > 0 and bentries < meanEntries/4. ):#Assume < 25% of MEAN = inefficient
45  NineffROC+=1;
46  ##Printing Layer no., #dead ROC, #inefficienct ROC, #mean occupancy of Non-zer roc
47  tmpstr = "BPix L" + str(layerNo)
48  print >> os, tmpstr, '{0:4d} {1:4d} {2:4.1f}'.format(NexpectedROC[layerNo-1] - Nrocspopulated, NineffROC, round(meanEntries,1))
49  return 0;
def countBadROCBarrel(fin, layerNo, os)
barrel########################################################
if(dp >Float(M_PI)) dp-
def DeadROCCounter_Phase1.countBadROCForward (   fin,
  ringNo,
  os 
)

endacp#########################################

Definition at line 51 of file DeadROCCounter_Phase1.py.

References countBadROCBarrel(), objects.autophobj.float, getRunNumber(), reco.if(), createfilelist.int, and harvestTrackValidationPlots.str.

51 def countBadROCForward(fin, ringNo, os):
52  forwardPath = commonPath + "PXForward/";
53  histoname = ["digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_1",
54 "digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_2"]
55  digi2D = fin.Get(forwardPath + histoname[ringNo-1])
56  #return status flag is histogram is empty!
57  if digi2D.GetEntries() == 0 :
58  return 1;
59  nblades_perRing_fpx = [22, 34]
60  NexpectedROC_perRing = [704, 1088]
61  Nrocspopulated = [0] * 6
62  totalEntries = [0] * 6
63  dcounter = 0
64  nx = digi2D.GetNbinsX()
65  ny = digi2D.GetNbinsY()
66  for xbin in range(1,nx+1):
67  if xbin >= 25 and xbin <= 32: continue;#region of cross on x-axis
68  if xbin > 1 and (xbin-1)%8 == 0: dcounter += 1;
69  for ybin in range(1,ny+1):
70  if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1) and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
71  continue;#region of cross on y-axis
72  bentries = digi2D.GetBinContent(xbin,ybin)
73  if(bentries > 0):
74  Nrocspopulated[dcounter] += 1
75  totalEntries[dcounter] += bentries
76  #Loop to find inefficient modules
77  meanEntries = [6] * 6
78  for d in range(0,6):
79  meanEntries[d] = float(totalEntries[d])/Nrocspopulated[d]
80  NineffROC = [6] * 6
81  #set disc counter to 0 since it is now 5
82  dcounter = 0;
83  for xbin in range(1,nx+1):
84  if xbin >= 25 and xbin <= 32: continue;#region of cross on x-axis
85  if xbin > 1 and (xbin-1)%8 == 0: dcounter += 1
86  for ybin in range(1,ny+1):
87  if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1) and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
88  continue;#region of cross on y-axis
89  bentries = digi2D.GetBinContent(xbin,ybin)
90  if(bentries > 0):#//Assume < 25% of MEAN = inefficient
91  if bentries > 0 and bentries < meanEntries[dcounter]/4.:
92  NineffROC[dcounter] += 1
93 
94  print >> os, "#Summary for FPix Ring", ringNo
95  for d in range(0,6):
96  disc = 0
97  if d < 3: disc = "M" + str(3 - d)
98  else: disc = "P" + str(d - 2)
99  ##Printing Disc no., #dead ROC, #inefficienct ROC, #mean occupancy of Non-zer roc
100  tmpstr = "FPix R" + str(ringNo) + "D" + str(disc)
101  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))
102  return 0;
def countBadROCForward(fin, ringNo, os)
endacp#########################################
if(dp >Float(M_PI)) dp-
def DeadROCCounter_Phase1.getRunNumber (   filename)

Definition at line 6 of file DeadROCCounter_Phase1.py.

References createfilelist.int.

Referenced by countBadROCForward().

6 def getRunNumber(filename):
7  global runNumber
8  pos=filename.find("__")
9  runNumber=int(filename[pos-6:pos])
10  #print runNumber
11