CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
DeadROCCounter_Phase1 Namespace Reference

Functions

def countBadROCBarrel
 barrel######################################################## More...
 
def countBadROCForward
 endacp######################################### More...
 
def getRunNumber
 

Variables

int bpix_tot_deadROC = 0
 
int bpix_tot_ineffROC = 0
 
int bpix_tot_Nrocspopulated = 0
 
int bpix_tot_totalentries = 0
 
string commonPath = "DQMData/Run "
 
tuple fin = TFile(fname)
 
list fname = sys.argv[1]
 main####################################### More...
 
int fpix_tot_deadROC = 0
 
int fpix_tot_ineffROC = 0
 
int fpix_tot_Nrocspopulated = 0
 
int fpix_tot_totalentries = 0
 
tuple hnpixclus_bpix = fin.Get(commonPath + "charge_PXBarrel")
 
tuple hnpixclus_fpix = fin.Get(commonPath + "charge_PXForward")
 
tuple out_file = open(outname, "w")
 
string outname = "PixZeroOccROCs_run"
 

Function Documentation

def DeadROCCounter_Phase1.countBadROCBarrel (   fin,
  layerNo,
  os 
)

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

Definition at line 14 of file DeadROCCounter_Phase1.py.

References if(), print(), sistrip::SpyUtilities.range(), and str.

14 
15 def countBadROCBarrel(fin, layerNo, os):
16  global bpix_tot_deadROC
17  global bpix_tot_ineffROC
18  global bpix_tot_Nrocspopulated
19  global bpix_tot_totalentries
20 
21  barrelPath = commonPath + "PXBarrel/";
22  histoname = ["digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_1", "digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_2",
23  "digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_3", "digi_occupancy_per_SignedModuleCoord_per_SignedLadderCoord_PXLayer_4"]
24  digi2D = fin.Get(barrelPath + histoname[layerNo-1])
25  #return status flag is histogram is empty!
26  if digi2D.GetEntries() == 0 :
27  return 1;
28  Nrocspopulated = 0
29  totalEntries = 0
30  NexpectedROC = [1536, 3584, 5632, 8192]
31  nLadders_bpx = [6, 14, 22, 32]
32  nx = digi2D.GetNbinsX()
33  ny = digi2D.GetNbinsY()
34  for xbin in range(1,nx+1):
35  if xbin >= 33 and xbin <= 40: continue;#region of cross on x-axis
36  for ybin in range(1,ny+1):
37  if (ybin == 2*nLadders_bpx[layerNo-1] + 1) or (ybin == 2*nLadders_bpx[layerNo-1] + 2): continue;#region of cross on y-axis
38  bentries = digi2D.GetBinContent(xbin,ybin)
39  if(bentries > 0):
40  Nrocspopulated+=1
41  totalEntries += bentries
42  meanEntries = float(totalEntries)/Nrocspopulated
43  NineffROC = 0
44  #Loop to chek inefficient ROC per layer
45  for xbin in range(1,nx+1):
46  if xbin >= 33 and xbin <= 40:
47  continue;#region of cross on x-axis
48  for ybin in range(1,ny+1):
49  if (ybin == 2*nLadders_bpx[layerNo-1] + 1) or (ybin == 2*nLadders_bpx[layerNo-1] + 2): continue;#region of cross on y-axis
50  bentries = digi2D.GetBinContent(xbin,ybin);
51  if(bentries > 0 and bentries < meanEntries/4. ):#Assume < 25% of MEAN = inefficient
52  NineffROC+=1;
53  ##Printing Layer no., #dead ROC, #inefficienct ROC, #mean occupancy of Non-zer roc
54  tmpstr = "BPix L" + str(layerNo)
55  print(tmpstr, '{0:4d} {1:4d} {2:4.1f}'.format(NexpectedROC[layerNo-1] - Nrocspopulated, NineffROC, round(meanEntries,1)), file=os)
56  bpix_tot_deadROC += NexpectedROC[layerNo-1] - Nrocspopulated
57  bpix_tot_ineffROC += NineffROC
58  bpix_tot_Nrocspopulated += Nrocspopulated
59  bpix_tot_totalentries += float(totalEntries)
return 0;
const uint16_t range(const Frame &aFrame)
def countBadROCBarrel
barrel########################################################
if(conf_.getParameter< bool >("UseStripCablingDB"))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def DeadROCCounter_Phase1.countBadROCForward (   fin,
  ringNo,
  os 
)

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

Definition at line 61 of file DeadROCCounter_Phase1.py.

References if(), print(), sistrip::SpyUtilities.range(), and str.

61 
62 def countBadROCForward(fin, ringNo, os):
63  global fpix_tot_deadROC
64  global fpix_tot_ineffROC
65  global fpix_tot_Nrocspopulated
66  global fpix_tot_totalentries
67 
68  forwardPath = commonPath + "PXForward/";
69  histoname = ["digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_1",
70 "digi_occupancy_per_SignedDiskCoord_per_SignedBladePanelCoord_PXRing_2"]
71  digi2D = fin.Get(forwardPath + histoname[ringNo-1])
72  #return status flag is histogram is empty!
73  if digi2D.GetEntries() == 0 :
74  return 1;
75  nblades_perRing_fpx = [22, 34]
76  NexpectedROC_perRing = [704, 1088]
77  Nrocspopulated = [0] * 6
78  totalEntries = [0] * 6
79  dcounter = 0
80  nx = digi2D.GetNbinsX()
81  ny = digi2D.GetNbinsY()
82  for xbin in range(1,nx+1):
83  if xbin >= 25 and xbin <= 32: continue;#region of cross on x-axis
84  if xbin > 1 and (xbin-1)%8 == 0: dcounter += 1;
85  for ybin in range(1,ny+1):
86  if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1) and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
87  continue;#region of cross on y-axis
88  bentries = digi2D.GetBinContent(xbin,ybin)
89  if(bentries > 0):
90  Nrocspopulated[dcounter] += 1
91  totalEntries[dcounter] += bentries
92  #Loop to find inefficient modules
93  meanEntries = [6] * 6
94  for d in range(0,6):
95  meanEntries[d] = float(totalEntries[d])/Nrocspopulated[d]
96  NineffROC = [6] * 6
97  #set disc counter to 0 since it is now 5
98  dcounter = 0;
99  for xbin in range(1,nx+1):
100  if xbin >= 25 and xbin <= 32: continue;#region of cross on x-axis
101  if xbin > 1 and (xbin-1)%8 == 0: dcounter += 1
102  for ybin in range(1,ny+1):
103  if (ybin >= 2*nblades_perRing_fpx[ringNo-1] + 1) and (ybin <= 2*nblades_perRing_fpx[ringNo-1] + 4):
104  continue;#region of cross on y-axis
105  bentries = digi2D.GetBinContent(xbin,ybin)
106  if(bentries > 0):#//Assume < 25% of MEAN = inefficient
107  if bentries > 0 and bentries < meanEntries[dcounter]/4.:
108  NineffROC[dcounter] += 1
109 
110  print("#Summary for FPix Ring", ringNo, file=os)
111  for d in range(0,6):
112  disc = 0
113  if d < 3: disc = "M" + str(3 - d)
114  else: disc = "P" + str(d - 2)
115  ##Printing Disc no., #dead ROC, #inefficienct ROC, #mean occupancy of Non-zer roc
116  tmpstr = "FPix R" + str(ringNo) + "D" + str(disc)
117  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)
118  fpix_tot_deadROC += NexpectedROC_perRing[ringNo-1] - Nrocspopulated[d]
119  fpix_tot_ineffROC += NineffROC[d]
120  fpix_tot_Nrocspopulated += Nrocspopulated[d]
121  fpix_tot_totalentries += float(totalEntries[d])
122 
return 0;
def countBadROCForward
endacp#########################################
const uint16_t range(const Frame &aFrame)
if(conf_.getParameter< bool >("UseStripCablingDB"))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def DeadROCCounter_Phase1.getRunNumber (   filename)

Definition at line 7 of file DeadROCCounter_Phase1.py.

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

Variable Documentation

int DeadROCCounter_Phase1.bpix_tot_deadROC = 0

Definition at line 128 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.bpix_tot_ineffROC = 0

Definition at line 129 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.bpix_tot_Nrocspopulated = 0

Definition at line 130 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.bpix_tot_totalentries = 0

Definition at line 131 of file DeadROCCounter_Phase1.py.

string DeadROCCounter_Phase1.commonPath = "DQMData/Run "

Definition at line 139 of file DeadROCCounter_Phase1.py.

tuple DeadROCCounter_Phase1.fin = TFile(fname)

Definition at line 126 of file DeadROCCounter_Phase1.py.

list DeadROCCounter_Phase1.fname = sys.argv[1]

main#######################################

Definition at line 124 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.fpix_tot_deadROC = 0

Definition at line 133 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.fpix_tot_ineffROC = 0

Definition at line 134 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.fpix_tot_Nrocspopulated = 0

Definition at line 135 of file DeadROCCounter_Phase1.py.

int DeadROCCounter_Phase1.fpix_tot_totalentries = 0

Definition at line 136 of file DeadROCCounter_Phase1.py.

tuple DeadROCCounter_Phase1.hnpixclus_bpix = fin.Get(commonPath + "charge_PXBarrel")

Definition at line 141 of file DeadROCCounter_Phase1.py.

tuple DeadROCCounter_Phase1.hnpixclus_fpix = fin.Get(commonPath + "charge_PXForward")

Definition at line 142 of file DeadROCCounter_Phase1.py.

tuple DeadROCCounter_Phase1.out_file = open(outname, "w")

Definition at line 144 of file DeadROCCounter_Phase1.py.

string DeadROCCounter_Phase1.outname = "PixZeroOccROCs_run"

Definition at line 127 of file DeadROCCounter_Phase1.py.

Referenced by compileDMRTrends(), main(), and SideBandSubtract.printResults().