/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

TestCableSvc.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 from GaudiPython import *
00004 from DybPython.DybPythonAlg import DybPythonAlg
00005 
00006 from DataSvc.TestCommon import get_sensors, service_mode, hw_string
00007 
00008 class TestAlg(DybPythonAlg):
00009     def __init__(self,name):
00010         DybPythonAlg.__init__(self,name)
00011         print "Making TestAlg",name
00012 
00013     def initialize(self):
00014         status = DybPythonAlg.initialize(self)
00015         print "Init TestAlg",self.name()
00016         if status.isFailure(): return status
00017         self.cableSvc = self.svc('ICableSvc','CableSvc')
00018         print "===========================================================\n\n"
00019 
00020         svcMode = service_mode()
00021         adPmtSensors = get_sensors(self.cableSvc,svcMode)
00022 
00023         print "  number of sensors =",adPmtSensors.size()
00024         print "  Detector \t Ring \t Colmn \t HrdwType  PmtHrdwId \t DAQChannel \t ElecHrdwType \t FEEHrdwId FEEHrdwConnector"
00025         for sens in adPmtSensors:
00026             pmtHrdw = self.cableSvc.pmtHardwareId(sens, svcMode)
00027             chan = self.cableSvc.feeChannelId(sens, svcMode)
00028             feeHrdw = self.cableSvc.feeHardwareId(chan, svcMode)
00029 
00030             #assert 1 <= pmtHrdw.type() <= 2, \
00031             #    'Got non PMT hardware type in context: %s, sens: %s, hrdw: %s ' % \
00032             #    (svcMode.context().AsString(),sens.asString(),hex(pmtHrdw.fullPackedData()))
00033 
00034             daqIndex = "%2d %2d" % (chan.board(), chan.connector())
00035             pmtHrdwId = "%4d" % pmtHrdw.id()
00036             print " ",sens.detName(),"\t ",sens.ring(),"\t ",sens.column(),"\t",\
00037                 hw_string(pmtHrdw.type()),"(",pmtHrdw.type(),")",\
00038                 " ",pmtHrdwId,"\t ",daqIndex,"\t ",hw_string(feeHrdw.type()),\
00039                 "\t\t ",feeHrdw.boardId(),"\t  ",feeHrdw.connector()
00040             
00041         print "\n\n==========================================================="
00042         return SUCCESS
00043 
00044     def execute(self):
00045         print "Executing TestAlg",self.name()
00046         return SUCCESS
00047 
00048     def finalize(self):
00049         print "Finalizing TestAlg",self.name()
00050         status = DybPythonAlg.finalize(self)
00051         return status
00052 
00053 def run(app):
00054     testAlg = TestAlg("TestAlg")
00055     app.addAlgorithm( testAlg )
00056     return
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:59:23 for DataSvc by doxygen 1.7.4