BuildSSPChannelMap.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 
4 # Define the (current) hardware mapping
5 SSP = {}
6 
7 # Two special cases
8 SSP[1] = [ (0, 8), (2, 2) ] # CSU + LSU Module
9 SSP[2] = [ (1, 12) ] # IU Module
10 
11 # IU/LBNL modules where SSP=PD Number
12 for i in [ 3, 5, 7 ]:
13  SSP[i] = [ (i, 12) ]
14 
15 # CSU modules where SSP=PD Number
16 for i in [ 4, 6 ]:
17  SSP[i] = [ (i, 8) ]
18 
19 
20 # Convert OpDet, Hardware Channel to offline channel
21 def OfflineChannel(OpDet, HardwareChannel):
22  return 12*OpDet + HardwareChannel
23 
24 
25 # Convert SSP, Hardware Channel to daqheader->group2
26 def OnlineHeader(ModuleNo, ChannelNo):
27  return 16*ModuleNo + ChannelNo
28 
29 
30 for SSPNum in sorted(SSP.keys()):
31  SSPChannel = 0
32  for OpDet, NChannels in SSP[SSPNum]:
33  for PDChannel in range(NChannels):
34  offline = OfflineChannel(OpDet, PDChannel)
35  online = OnlineHeader(SSPNum, SSPChannel)
36  SSPChannel += 1
37  print online, offline
38 
39 
40 
41 
42 
def OnlineHeader(ModuleNo, ChannelNo)
def OfflineChannel(OpDet, HardwareChannel)