CMS 3D CMS Logo

BadCellDisplay Namespace Reference


Classes

class  CellStat
class  RunStatusGui

Functions

def calcDetID
def convertID

Variables

tuple x = RunStatusGui(debug=True)


Function Documentation

def BadCellDisplay::calcDetID (   ID  ) 

expect ID in form <subdet> (eta,phi,depth) 

Definition at line 37 of file BadCellDisplay.py.

00037                  :
00038     ''' expect ID in form <subdet> (eta,phi,depth) '''
00039     ID=string.replace(ID,","," ")
00040     ID=string.replace(ID,")"," ")
00041     ID=string.replace(ID,"("," ")
00042     ID=string.split(ID)
00043     subdetmap={"HB":1,"HE":2,"HO":3,"HF":4}
00044     subdet=ID[0]
00045     if subdet not in subdetmap.keys():
00046         print "ERROR in calcDetID -- can't ID subdet '%s'"%subdet
00047         return
00048     subdet=subdetmap[subdet]
00049     eta=string.atoi(ID[1])
00050     phi=string.atoi(ID[2])
00051     depth=string.atoi(ID[3])
00052     etaplus=True
00053     if (eta<0):        
00054         eta=abs(eta)
00055         etaplus=False
00056     # Now calculate detID
00057     detid=4<<28
00058     detid=detid|((subdet&0x7)<<25)
00059     detid=detid|((depth&0x7)<<14)
00060     detid=detid|((eta&0x3f)<<7)
00061     if (etaplus):
00062         detid=detid|(0x2000)
00063     detid=detid|(phi&0x7f)
00064     name="%x"%detid
00065     name=string.upper(name)
00066     return name
00067 
00068 
00069 
class CellStat:

def BadCellDisplay::convertID (   ID  ) 

Definition at line 18 of file BadCellDisplay.py.

00018                  :
00019     try:
00020         id=int(ID,16)
00021         eta=(id>>7)&0x3f
00022         if (id&0x2000==0):
00023             eta=eta*-1
00024         phi=id&0x7f
00025         depth=(id>>14)&0x7
00026         subdet=(id>>25)&0x7
00027         subdetmap={1:"HB",2:"HE",3:"HO",4:"HF"}
00028         if (subdet in subdetmap.keys()):
00029             subdet=subdetmap[subdet]
00030         else:
00031             subdet="Unknown"
00032         name="%s(%i,%i,%i)"%(subdet,eta,phi,depth)
00033     except:
00034         name="???"
00035     return name
00036 
def calcDetID(ID):


Variable Documentation

tuple BadCellDisplay::x = RunStatusGui(debug=True) [static]

Definition at line 655 of file BadCellDisplay.py.


Generated on Tue Jun 9 18:36:14 2009 for CMSSW by  doxygen 1.5.4