Public Member Functions | |
def | __init__ |
def | initialize |
def | spin |
def | execute |
Public Attributes | |
pgis |
Definition at line 22 of file test.py.
def DetHelpers::test::MyAlg::__init__ | ( | self, | ||
name | ||||
) |
Definition at line 23 of file test.py.
00023 : 00024 GaudiAlgo.__init__(self,name) 00025 print "Making MyAlg",name 00026 def initialize(self):
def DetHelpers::test::MyAlg::initialize | ( | self | ) |
Definition at line 27 of file test.py.
00027 : 00028 status = GaudiAlgo.initialize(self) 00029 print "Init MyAlg",self.name 00030 if status.isFailure(): return status 00031 app = AppMgr() 00032 app.DLLs += [ "DetHelpersLib", 'DetHelpers', 'DetHelpersDict' ] 00033 self.pgis = self.svc('IPmtGeomInfoSvc','PmtGeomInfoSvc') 00034 print self.pgis 00035 return self.spin() 00036 def spin(self):
def DetHelpers::test::MyAlg::spin | ( | self | ) |
Definition at line 37 of file test.py.
00037 : 00038 # check all AD pmts 00039 import time 00040 start = time.time() 00041 count = 0 00042 for site,nads in [(0x01,2),(0x02,2),(0x04,4)]: 00043 print "Site:",site, 00044 for iad in range(0,nads): 00045 iad += 1 00046 print "[",iad,"]", 00047 for icol in range(0,24): 00048 icol +=1 00049 for iring in range(0,8): 00050 iring += 1 00051 pmtid = (site<<24)|(iad<<16)|(iring<<8)|icol 00052 00053 pgi = self.pgis.get(pmtid) 00054 if not pgi: 00055 print "PmtGeomInfoSvc returned None" 00056 return FAILURE 00057 if pmtid != pgi.pmtid(): 00058 print "Ask for PMT ID %d, got %d"%(pmtid,pgi.pmtid()) 00059 return FAILURE 00060 count += 1 00061 continue 00062 continue 00063 continue 00064 print "\n", 00065 continue 00066 stop = time.time() 00067 print "Found %d PMTs in %f seconds"%(count,stop-start) 00068 00069 00070 return SUCCESS 00071 def execute(self):
def DetHelpers::test::MyAlg::execute | ( | self | ) |