BufferToRing

Name

BufferToRing -- Convert old buffered data to ring buffer format.

Synopsis

$DAQROOT/bin/BufferToRing [buffer-size]

DESCRIPTION

Converts NSCLDAQ buffered data into ring items. Input is always taken from stdin and output ring items are emitted on stdout. This allows you, by constructing appropriate pipelines or using I/O redirection to convert event files from buffered to ring format. Buffered data can be turned into a SpecTcl piped data source and can, with the help of stdintoring be placed in a ringbuffer.

The program takes an optional parameter; buffer-size which is the size of the input buffer in bytes. The default is 8192 which covers most of the buffered event files created by versions of nscldaq prior to 10..0.

OPTIONS

--buffersize

The parameter to this option is the buffer size of the input stream in bytes. This defaults to 8192, the default buffersize of NSCLDAQ 8.x.

--incremental-scalers

This option can have the value yes or no. If yes scaler ring items are formatted as incremental scalers. If no they are formatted as non-incremental scaler items.

--create-body-header

This option can take the values yes or no. If yes, body headers are created when ring items are formatted. If no then body headerrs are not created. When body headers are being created, values must be specified for the following options:

--sourceid

Must be an integer that will be used as the source id field of the body header for ring items produced by this program.

--ts-extract

The value of this option must point to a shared library file. The shared library must have at least one of the following entry points:

uint64_t getEventTimestamp(void*). This function, if provided, is intended to take as a parameter a pointer to an event and return the timestamp for this event.

If this function is not provided and a physics event is encountered on the input stream, a warning will be output once to the program's stderr, and from then on, physics events will be created without a body header.

uint64_t getScalerTimestamp(void*). If provided, this function takes as a parameter a pointer to the body of a scaler buffer and is intended to return the event building timestamp for the body header of that scaler event item. If not provided, the first scaler buffer will emit a warning on stderr and from then on, if body headers are enabled, the timestamp will be picked out of buffer header fields that the S800 uses for that purpose. Note that these fields are 0 in NSCLDAQ-8.x for data that does not come from the S800.