CMS 3D CMS Logo

BadCellDisplay::CellStat Class Reference

List of all members.

Public Member Functions

def __init__
def AlwaysDead
def AlwaysHot
def Dead
def Hot
def parseID
def read

Public Attributes

 Alwaysdead
 Alwayshot
 depth
 eta
 ID
 IDstring
 phi
 status
 subdet
 subdetmap


Detailed Description

Definition at line 70 of file BadCellDisplay.py.


Member Function Documentation

def BadCellDisplay::CellStat::__init__ (   self,
  ID = None 
)

Definition at line 72 of file BadCellDisplay.py.

00072                               :
00073         self.ID=ID
00074         self.IDstring=None
00075         self.eta=None
00076         self.phi=None
00077         self.depth=None
00078         self.subdet=None
00079         self.subdetmap={1:"HB",2:"HE",3:"HO",4:"HF"}
00080         self.parseID()
00081         
00082         self.Alwayshot=False
00083         self.Alwaysdead=False
00084         
00085         self.status={}
00086         return
00087 
00088     # Need to changes these once HcalChannelStatus is updated (should be shifting 5 and 6 bits, respectively, not 4 and 5)
    def Dead(self,run):

def BadCellDisplay::CellStat::AlwaysDead (   self  ) 

Definition at line 108 of file BadCellDisplay.py.

00108                         :
00109         count=0
00110         dead=0
00111         for i in self.status.keys():
00112             # bit 1 is a disabled/not present bit
00113             if (self.status[i]&0x1==0): # only count urns where cell is present
00114                 count=count+1
00115                 if ((self.status[i]>>4)&0x1):
00116                     dead=dead+1
00117         #if (self.status[i]):
00118         #    print "count = ",count,"  DEAD = ",dead
00119         if (count>0 and dead>=0.90*count):
00120             self.Alwaysdead=True
00121         return self.Alwaysdead
00122 
    def read(self,run,text,hot=False,dead=False):

def BadCellDisplay::CellStat::AlwaysHot (   self  ) 

Definition at line 95 of file BadCellDisplay.py.

00095                        :
00096         count=0
00097         hot=0
00098         for i in self.status.keys():
00099             if (self.status[i]&0x1==0): # only count runs where cell is present
00100                 count=count+1
00101                 if ((self.status[i]>>5)&0x1):
00102                     hot=hot+1
00103 
00104         if (count>0 and hot>=0.90*count):
00105             self.Alwayshot=True
00106         return self.Alwayshot
00107     
    def AlwaysDead(self):

def BadCellDisplay::CellStat::Dead (   self,
  run 
)

Definition at line 89 of file BadCellDisplay.py.

00089                       :
00090         return ((self.status[run]>>4)&0x1)
00091 
    def Hot(self,run):

def BadCellDisplay::CellStat::Hot (   self,
  run 
)

Definition at line 92 of file BadCellDisplay.py.

00092                      :
00093         return ((self.status[run]>>5)&0x1)
00094 
    def AlwaysHot(self):

def BadCellDisplay::CellStat::parseID (   self  ) 

Definition at line 148 of file BadCellDisplay.py.

00148                      :
00149         id=int(self.ID,16)
00150         eta=(id>>7)&0x3f
00151         if (id&0x2000==0):
00152             eta=eta*-1
00153         phi=id&0x7f
00154         depth=(id>>14)&0x7
00155         subdet=(id>>25)&0x7
00156         if (subdet in self.subdetmap.keys()):
00157             subdet=self.subdetmap[subdet]
00158         else:
00159             subdet="Unknown"
00160         name="%s(%i,%i,%i)"%(subdet,eta,phi,depth)
00161         self.eta=eta
00162         self.phi=phi
00163         self.depth=depth
00164         self.subdet=subdet
00165         self.IDstring=name
00166         return
00167         
###

def BadCellDisplay::CellStat::read (   self,
  run,
  text,
  hot = False,
  dead = False 
)

Definition at line 123 of file BadCellDisplay.py.

00123                                                 :
00124         temp=string.split(text)
00125         try:
00126             value=string.atoi(temp[4])
00127             ID=temp[5]
00128             
00129         except:
00130             print "Could not parse line '%s'"%text
00131             return
00132         if (self.ID==None):
00133             self.ID=ID
00134             self.parseID()
00135         elif (self.ID!=ID):
00136             print "Error, ID value mismatch"
00137             return
00138         if (hot):
00139             value=value*16
00140         elif (dead):
00141             value=value*32
00142         if run in self.status.keys():
00143             self.status[run]=(self.status[run]&value)
00144         else:
00145             self.status[run]=value
00146         return
00147 
    def parseID(self):


Member Data Documentation

BadCellDisplay::CellStat::Alwaysdead

Definition at line 83 of file BadCellDisplay.py.

BadCellDisplay::CellStat::Alwayshot

Definition at line 82 of file BadCellDisplay.py.

BadCellDisplay::CellStat::depth

Definition at line 77 of file BadCellDisplay.py.

BadCellDisplay::CellStat::eta

Definition at line 75 of file BadCellDisplay.py.

BadCellDisplay::CellStat::ID

Definition at line 73 of file BadCellDisplay.py.

BadCellDisplay::CellStat::IDstring

Definition at line 74 of file BadCellDisplay.py.

BadCellDisplay::CellStat::phi

Definition at line 76 of file BadCellDisplay.py.

BadCellDisplay::CellStat::status

Definition at line 85 of file BadCellDisplay.py.

BadCellDisplay::CellStat::subdet

Definition at line 78 of file BadCellDisplay.py.

BadCellDisplay::CellStat::subdetmap

Definition at line 79 of file BadCellDisplay.py.


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:36:14 2009 for CMSSW by  doxygen 1.5.4