Compressed-format-27-apr-2013

From GlueXWiki
Jump to: navigation, search
Hi,

To get the ball rolling, below I describe what I did to drop our MC event size by approximately 
a factor of 3.  Currently we only generate data for FADC250, FADC125, F1TDC32 and F1TDC48 modules,
and for the ADC's only in "pulse integral" mode.  I know nothing about other modules or other
readout modes.  I currently only deal with disentangled events.

Starting with mc2coda output:

1.  ignore all filler words.
2.  remove module if it has no hit data
3.  remove crate if it has no hit data in any module.

For modules with hit data:

1.  replace 4 words overhead per module (block header, event header, trigger time, block trailer)
with a single leading word encoding info from header/trailer words, as well as the number of hits
for this module.  I encode the single header word as below, the unchanged data words follow
the header word:

>               *iter3=0xe0000000;                 // 5 bits slot header
>               (*iter3)|=(slot&0x1f)<<22;         // 5 bits slot number
>               (*iter3)|=(type&0xf) <<18;         // 4 bits module type
>               (*iter3)|=nhitwords&0xffff;        // 16 bits hit count (could be smaller)

2.  store trigger time once-only in a header bank at the beginning of the event.