FAQ:How do I get the board and connector information from a CalibReadoutPmtChannel object?

From Daya Bay

Jump to: navigation, search

You need to use the cable svc to convert (the packed data in a pmt ID and a channel ID are *not* equivalent). Currently you need to use the "static" cable service:


which uses some text files as the backing DB.

There are some example usages in the Tutorial packages. But here is the gist:

 def configure(argv=[]):
   # Setup Service to get cable mapping of electronics to PMTs
   from DataSvc.DataSvcConf import StaticCableSvc
   cableSvc = StaticCableSvc()
   cableSvc.FeeCableMap = '<cablemapfile>'
def initialize(self):
    # electronics channels and pmts in the detector.
    self.cableSvc = self.svc('ICableSvc','StaticCableSvc')
    if self.cableSvc == None:
        self.error("Failed to get StaticCableSvc")
        return FAILURE
def execute(self):
    croHdr = evt["/Event/CalibReadout/CalibReadoutHeader"]
    calibReadout = croHdr.calibReadout()
    svcMode = ServiceMode( roHdr.context(), 0 )
    for channel in calibReadout.channelReadout(): 
         pmtID = channel.pmtSensorId()
         channelId=self.cableSvc.elecChannelId(pmtID, svcMode)
Personal tools