EDOC073

 

 


Output Data Format


 

Edition 2.2
Dec 2009

 

STFC Nuclear Physics Group
Daresbury Laboratory


Introduction

The basic unit of data is the 32bit word consisting of a 16bit data value, a 14bit data address and a 2bit word-type. Data is written as separate 16bit words, each of which would be byte-swapped if an endian change were required. Alignment is therefore kept to 32bit units. The defined data word format types are summarised in the final section of this document.

There may be many events in an event block. The length of an event block is variable and terminated by the end block token.

The grouped data word format is defined primarily for compactness. Groups of 1 or 2 items occupy the same space as simple words, but space savings occur for 3 items and more. The philosophy of groups is explained more fully in the next section.

Parameter Groupings

It has been noted that most modern detector systems consist of many similar detectors with several related parameters repeated for each detector. This natural grouping of related parameters can be exploited to make the user interface more understandable.

Each group maps onto a software record or structure. This makes it easy to process the information from a particular detector. With this scheme all parameters related to a particular detector are kept together. This allows access to individual parameters within a record, but also allows whole records to be accessed and moved around efficiently by using pointers.

Each data parameter has a unique 14bit address which is allocated when the data acquisition is setup. In order to make the processing of the data words easier, it has been decided to logically divide the address into two parts (an 8bit group number and a 6bit item). This subdivision is somewhat arbitary, but allows the group number to be extracted easily as a byte. The item numbers within a group are sequential starting from zero.

The main point to note is that whether event parameters are kept as simple variables or as groups, then each parameter still has a unique 14bit address. If a group with several items is defined, then each item within the group has a particular 14bit address which cannot also be allocated to another simple variable or another group item. Similarly, there cannot be more than one group with the same group number.

Since the item field is in the most significant 6 bits of the address, then the resultant addresses of items in a group will not be consecutive. However, when viewed as a hexadecimal number the address is trivially decoded into detector number and parameter offset.

Group 255 is defined as the system or trigger group. If present, it will normally be positioned immediately following the event header token. Others group numbers are freely available to be allocated as and when necessary for particular acquisition sub-systems (Ge/BGO,Clover,Cluster,...).

This ordering of parameters into associated groups should make event processing easier to accomplish. Several of the operations to be applied to each event will be group oriented. For example, the sum energy calculation will include the same words from each of the Ge groups. Also, a typical operation may be to filter on all Ge TDC words ... again the same operation performed on the same word from each group.

Variable length groups

The complex detectors (.eg. Clovers, Clusters,...) consist of more than one Ge segment enclosed within a BGO shield. The problem is whether a complex detector is best considered as a single detector grouping or as N separate detector groupings. To treat a complex detector as a single group of parameters, we need a data format extension, since the detector group of parameters will now be of variable length - 1,2,3 or more segments may appear in an event. The variable length group format allows for an initial fixed length section followed by one or more variable length sections. The user must know the number of parameters in both the fixed and the variable parts of the group.

Event Format Summary

There are four basic format word variants. For each event there is a unique separator word called the Start Event token. This is followed by an optional number of simple and group formatted data words. A data block will consist of one or more such events terminated by the End Block Token. Events will not be split across block boundaries.

The Start Event Token is two 16 bit data words which mark the start of the event.

2 bits
11
6 bits
0x3f
8 bits
0xff

16 bits

Total event length including header in bytes

The End Block Token is two 16 bit data words which mark the end of valid information in the current data block.

2 bits
11
6 bits
0x3f
8 bits
0xff

16 bits

0x0000

The Simple Data Word Item is two 16 bit data words which form a single data item.

2 bits
00
14 bits
address

16 bits

data word

The Group Data Item is a sequence of 16 bit data words which form a data item.

2 bits
01
6 bits
item count
8 bits
group number

16 bits

data word #1

16 bits

data word #2

16 bits

data word #3

The number of data words is given by the item count field in the header word.

Extended group format

For large detector systems it has become necessary to allow more than 256 groups. Group numbers of 256 and above are treated as extended format.

The Extended Group Data Item is a sequence of 16 bit data words which form a data item.

2 bits
10
14 bits
item count

16 bits

group number

16 bits

item count (high) [optional]

16 bits

item count (low) [optional]

16 bits

data word #1

16 bits

data word #2

The number of data words is given by the item count field in the header word.

As an optional enhancement (Version 2.2) the item count field in the header word may be zero. In this case the item count is given by the (optional) 32 bit value following the group number. If the item count field in the header word is non zero then the optional words MUST be omitted to give backwards compatibility.

This format may also be used to store array data, for example, as collected from flash adcs. Using the optional extension to the item count arrays having more than 16K elements can be handled.