Reading CODA data
Event Stucture
The CODA event structure is to write "Banks" which are in the form headers containing 2 long words (32 x 2 = 64 bits)
Below is an example of a hex dump of a CODA file
hex dump
Using the unix command "od -h filename" on a coda data file I saw the following table of hexadecimal shorts
0000000 2000 0000 0000 0000 0008 0000 0008 0000 0000020 01a3 0000 0002 0000 0027 0000 0100 c0da 0000040 0004 0000 01cc 0011 e7ff 4730 0078 0000 0000060 0001 0000 0004 0000 01cc 0012 e804 4730 0000100 0000 0000 0000 0000 000a 0000 10cc 0001 0000120 0004 0000 0100 c000 0001 0000 0001 0000 0000140 0000 0000 0003 0000 0101 0002 4c52 5343 0000160 0000 0000 000a 0000 10cc 0001 0004 0000 0000200 0100 c000 0002 0000 0001 0000 0000 0000 0000220 0003 0000 0102 0002 4c52 5343 0000 0000 0000240 000a 0000 10cc 0001 0004 0000 0100 c000 0000260 0003 0000 0001 0000 0000 0000 0003 0000 0000300 0103 0002 4c52 5343 0000 0000 000a 0000 0000320 10cc 0001 0004 0000 0100 c000 0004 0000 0000340 0001 0000 0000 0000 0003 0000 0104 0002 0000360 4c52 5343 0000 0000 000a 0000 10cc 0001
Perhaps the most obvious hex is the value "c0da" at the end of line 20.
The first two lines contain file information
0000000 2000 0000 0000 0000 0008 0000 0008 0000
0000020 01a3 0000 0002 0000 0027 0000 0100 c0da
The next line
0000040 0004 0000 01cc 0011 e7ff 4730 0078 0000
tells you that the bank length is "0x0004 = 0d4 " which is saying there are 4 long words (including this one) in the bank.
the next hex words
"01cc 0011 " represent the next 32 bit long word where "0xcc" is the least significant bit 0 to bit 7 (first 8 bits = 1101100 b). The hex constant "0xcc" is used to indicate the this is an event header word. The next hex snipet "0x10" is also used. The event type "0x0011 = 17 d = 10001 b is the highest 16 bits of the 32 bit long word which tells you that this event is #17 which corresponts to a prestart event.
The first 32 bits of the file is the part of the Bank header which tells you what the length of the fragment is in long words.
Go Events
Bank Names
In the CODA readout list (gen_int_list.crl) I will write a 4 letter string with the name of the bank via the command
*rol->dabufp++ = *((unsigned long*)"SCLR");
You can see it in the raw CODA data file using
od -c v260_sclr.dat | less 0000000 \0 \0 \0 \0 \0 \0 \0 \b \0 \0 \0 \b \0 \0 \0 0000020 243 001 \0 \0 002 \0 \0 \0 ' \0 \0 \0 \0 001 332 300 0000040 004 \0 \0 \0 314 001 021 \0 377 347 0 G x \0 \0 \0 0000060 001 \0 \0 \0 004 \0 \0 \0 314 001 022 \0 004 350 0 G 0000100 \0 \0 \0 \0 \0 \0 \0 \0 \n \0 \0 \0 314 020 001 \0 0000120 004 \0 \0 \0 \0 001 \0 300 001 \0 \0 \0 001 \0 \0 \0 0000140 \0 \0 \0 \0 003 \0 \0 \0 001 001 002 \0 R L C S 0000160 \0 \0 \0 \0 \n \0 \0 \0 314 020 001 \0 004 \0 \0 \0
It appears in reverse order at the end of line 140.