Feature #539
add cabling to cdb
0%
Description
for the TOF we have
adc(computer_id, geo_no, channel), tdc(computer_id, geo_no, channel), station, plane, slab, pmt
for the tracker we have
computer_id, geo_no, channel, tracker_no, station, plane, channel
so in python we could have a namedtuple representing the Channel_Data and a namedtuple representing the Cabling which would include a number of Channel_Data plus other bits. e.g.
Cabling(detector_name='TOF1', adc=Channel_Data(computer_id=1, geo_no=1, channel=1), tdc=Channel_Data( computer_id=1, geo_no=1, channel=2), station=2, plane=3, slab=4, pmt=5)
Cabling(detector_name='SciFi', vlsb=Channel_Data(computer_id=2, geo_no=1, channel=1), tracker_no=1, station=2, plane=3, channel=9)
the python cdb cabling api would have a number of method
get_current_cabling(detector_name)
get_cabling_for_run(detector_name, run_no)
get_cabling_for_date(detector_name, date)
these would all return the data described above
example for accessing the data
from cdb import Cabling
cabling=Cabling()
data=cabling.get_cabling_for_run('TOF1', 5)
adc=getattr(data, 'adc')
adc_channel=getattr(adc, 'channel')
station=getattr(data, 'station')
Subtasks
Updated by Wilson, Antony over 12 years ago
Having thought about this some more I think I should use dictionaries in place of namedtuple. This will then be more in line with the other calls to the cdb.
Any comments on any of this from anyone? I hope to get some of this implemented in the next week, so if you want any other methods or you are unhappy with the sugested methods or data structurre then type now.