The New VFAT zero suppression payload; familiar but with a few key differences
Details about the Data Structure
The first line up to BC (bunch cross count) is identical; the last 16 bits of this line is a control sequence.
2.The control sequence will detail which packet of 8 channels is nonzero (i.e. 1001 means first and last nonzero)
Afterwards a variable number of packets follow, each 8 bits, and then the 16 bit CRC as before.
Things to Tackle
Changing the last 16 digits of line 1 from data to control sequence is easy, but that control sequence is really imperative to keeping track of channels
I have implemented an array uint8_t packets[16] to hold the various packets upcoming, may not be the best way.
In order to correctly read off the CRC after all the packets, I needed to count the number of 1's in the control sequence. Method I used may not be optimal.
The variable position of the CRC means that there may be required a lot of empty space at the end of a particular line in order to keep the VFAT payload one block of 64 bit lines.
Context (for feature requests)
At the moment changes are just being made to the VFAT read_fw,sw,tw methods in GEMAMC13EventFormat.h, but changes will also need to be made to their instances in the unpacker c++ file (now read_fw accepts two arguments, one to switch modes).
I am just starting this project; at the moment the changes look like they made only need to be applied locally, but that may change as I look into the surroundings of the unpacker file.
Below is a schematic that compares the two types of VFAT payloads
@rodwyer100 can you please close this issue and open a new one, where you can fill the template please? It will just make the text a bit easier to read.
Can you create a new tab in this, the quality of the attached image is too low.
I note that in this format you are assuming a fixed setup for how the EC/BC bits are allocated, which is fine, but should be explicitly stated (this part of the VFAT is also configurable)
The New VFAT zero suppression payload; familiar but with a few key differences
Details about the Data Structure
2.The control sequence will detail which packet of 8 channels is nonzero (i.e. 1001 means first and last nonzero)
Things to Tackle
Changing the last 16 digits of line 1 from data to control sequence is easy, but that control sequence is really imperative to keeping track of channels
I have implemented an array uint8_t packets[16] to hold the various packets upcoming, may not be the best way.
In order to correctly read off the CRC after all the packets, I needed to count the number of 1's in the control sequence. Method I used may not be optimal.
The variable position of the CRC means that there may be required a lot of empty space at the end of a particular line in order to keep the VFAT payload one block of 64 bit lines.
Context (for feature requests)
At the moment changes are just being made to the VFAT read_fw,sw,tw methods in GEMAMC13EventFormat.h, but changes will also need to be made to their instances in the unpacker c++ file (now read_fw accepts two arguments, one to switch modes).
I am just starting this project; at the moment the changes look like they made only need to be applied locally, but that may change as I look into the surroundings of the unpacker file.
Below is a schematic that compares the two types of VFAT payloads