8 return (
"0%X" % n)[-2:]
15 This function converts channel to pmt or pmt to channel number.
16 Valid for Barrel only!
19 pmtOrChannel =
int(pmtOrChannel)
20 channelOrPmt = pmtOrChannel;
26 if mod==0: channelOrPmt = pmtOrChannel+2
27 elif mod==2: channelOrPmt = pmtOrChannel-2
34 modToFrag = {
'LBA' :
'0x1',
44 lines =
open(inFile,
"r").readlines()
47 if not len(field):
continue
49 modNum =
int(field[0][3:]) - 1
51 chanOffsets = field[2:]
52 hexModule = modToFrag[module] +
dec2hex(modNum)
59 print "%s ---> Found %i channels, sum of first 6 is %f" % ( field[0] , len(chanOffsets) , sum )
65 tdlas = tdlas+
"Tdlas\t%s\t0\t%s\n" % (hexModule,drawerOffset)
71 offset = chanOffsets[chan]
72 tclas = tclas+
"Tclas\t%s\t%i\t%s\t%s\n" % (hexModule,chan,offset,offset)
74 tdlasFile =
open(
"Tile.tdlas",
"w")
75 tdlasFile.write(tdlas)
78 tclasFile =
open(
"Tile.tclas",
"w")
79 tclasFile.write(tclas)