RIBF Data Format (RIDF)
Nov. 12, 2010
Version 1.5
Hidetada Baba

Version information
X

1.5
X 1.4
X 1.3
X 1.2
X 1.1
X 1.0

Status Data (with XML Comment)
Time stamp
Global block number
Global block ender
Definition of Segment ID
First version

Types of blocks
X

Global blockContains the following blocks
X A delimiter of data
X

X

Event block
X

X

Segment block
X

X

Contains acquired scaler data

Status block
X

X

Contains acquired raw data

Scaler block
X

X

Contains segment blocks and scaler blocks

Contains status data

Comment blockX

Contains comments such as run information

General rule (Header word)
2bit 2bit
RLy

6bit

22bit

Class ID

SizeAddress
32bit

X
X
X
X

Every block has this header
Revision: Revision bit (2bit=4), 0 = Version 1.x
Layer : The layer depth of this block (2bit=4)
Class ID: Definition of this block
X

X

Block Size : Size of this block including this header
X
X
X

X

Data format of this block is determined by Class ID
Short word unit, 22 Bit = 4 M
The maximum size of 1 Block is 8 MB
Usual size = 128 KB max.

AddressX
X: Identification of the generator of this block (32bit)

It will corresponds to Event Fragment ID
Usually, only lowest 8 bits are used.

For example, with event data
RLyClass ID

SizeAddress-00

Block Size
Address-

13

Event Size
Address
Event Number-

14Segment Size
Address
Segment ID
Data

For example, with status data-00

Block Size
Address-

13

Event Size
Address
Event Number-

24Segment Size
Address
Segment ID
Data-

110Status Size
Address
Status ID
Status Data

Hierarchical structure
X Block header
X Event data

Segment data
X Analyzed segment data
X Scaler dataX Status data
X

X Scaler data
X Status data
X Comment data

Class ID List
X
X
X
X
X
X
X
X
X
X
X
X
X
X

012345678910111213

Event Fragment
Event Assembly
Event Assembly Fragment
EventSegment
Comment
Event with Time StampX
X
X
X
X
X
X
X

Block Number
End of BlockXX
X

Non Clear Scaler 24bit
Clear Scaler 24bit
Non clear Scaler 32bit

X
X
X

14151617
18
192021222324252627

Time Stamp Data

Status DataGlobal block header
Class ID = 0 : Event Fragment
1 : Event Assembly
2 : Event Assembly Fragment
Layer = 0-00

Block Size
Address

X The delimiter of buffered dataGlobal block enderfrom version 1.2
Class ID = 9 : End of this block
Layer = 0 or 1-1

9Block Size
Address
Size of this block

X The delimiter of buffered data (optional)
X To seek data from the end of file
X “Block size” = 6
X “Size of this block” equal to “Block size” of Global

block header

Global block number
from version 1.3
Class ID = 8 : Block number
Layer = 1-18Block Size
Address
Number of block

X Counter of the number of block (optional)X This header should insert the next of Global blockheader
X The first block, which includes header comment only,
does not have this header, usually

Event data header
Class ID = 3

Layer =1-1

3

Event Size
Address
Event Number

Event data with Time stampfrom version 1.4

Class ID = 6Layer =1-1

6

Event Size
Address
Event Number

Reserved 16 bit

Time Stamp 32-47 bit

Time Stamp 0-31 bit

X The depth of time stamp is 48 bit
X When you use a long long int variable for the time stamp in astructure with 64 bit CPU, take care the total size of the structure
and the pointer of the time stamp variable.

Segment data
Class ID = 4

Layer = 2-24Segment Size
AddressSegment ID
Data

Segment ID is used by analysis software
It should have a unique number(please refer next page)

The rule of Segment ID
6bit

6bit

6bit

6bit

8bit

Revision

DeviceFPDetector

ModuleX Revision : Revision of Segment ID, 0 = Version 1
X Module: Unique number of ADC module
X CAMAC 16bit=0, CAEN V785=21, ...
X Device: Indicates device
X BigRIPS=0, ZDS=1, DALI=20 …
X FP: ID of Focal PlaneX F1=1, F2=2, F3=3, ...
X Detector : ID of detector
X PPACQ=0, PPACT=1, PlasticQ=2, PlasticT=3,...

Scaler data
Class ID 11 = no clear (24bit)
Layer = 1 or 2
Class ID 12 = clear every buffer
If synchronize with event, Scaler ID will be 2
Class ID 13 = no clear (32bit)
And followed by Event data header
Class ID = 11 or 12 or 13-

1

11Scaler Size
Address
DateScaler ID
Scaler Data

Scaler ID should be same as
Address

Date is the time since 1970,
measured in seconds

Status data
Layer = 1 or 2Class ID = 21-1

21Scaler Size
Address
Date
Status ID
Status Data

Status ID
0 = Reserved
11 = Run start status by XML
12 = Run end status by XML

Date is the time since 1970,
measured in seconds

Status ID 11 and 12 are from version 1.5

Comment data
Layer = 1 or 2
Class ID = 5-15

Comment Size
Address
Date
Comment ID
Comment Data

Comment ID
0 = Header
1 = Ender
2 = Warning

Date is the time since 1970,
measured in seconds

Time stamp datafrom version 1.4

Class ID = 16

Layer =2-216

Time stamp data Size
Address

EFN (8bit)

Rev (8bit)

Time Stamp 32-47 bit

Time Stamp 0-31 bit
EFN (8bit)

Rev (8bit)

Time Stamp 32-47 bit

Time Stamp 0-31 bit

X

Meaning = This event is made of these time stamped data
EFN = only lowest 8bits
X This header should be put the next of Event header
XFor example, event fragment
12345678

FEC 1
Block Header
Event Header
Segment
Event Header
Segment
Event Header
Segment
Event Header
Segment
Block Header
Event Header
Segment
Event Header
Segment
Event Header
Segment
Event Header
Segment

123456FEC 2Block Header
Event Header
Segment
Event Header
Segment
Event Header
SegmentStatus (H.V.)
Status (NMR)
Block Header
Event Header
Segment
Event Header
Segment
Event Header
Segment
Status (H.V.)
Status (NMR)

12345

FEC 3
Block Header
Event Header
Segment
ScalerBlock Header
Event Header
Segment
ScalerBlock Header
Event Header
Segment
ScalerBlock Header
Event Header
Segment
ScalerBlock Header
Event Header
Segment
ScalerEvent builder
Block Header
HeaderBlock Header
Ender

Block ender is notimportant for event build

For example, event assembly

111222Block Header
HeaderBlock Ender
Block Header
Event Header
Segment
SegmentSegment
ScalerEvent Header
Segment
Segment
Segment
ScalerBlock Ender

Block Header
3 Event Header
Segment
3Segment
Status (H.V.)
Status (NMR)
Segment
3Scaler
4 Event Header
Segment
4Segment
Segment
4Scaler
Block Ender

Block Header
5 Event Header
Segment
5
Segment
Segment
5Scaler
Block Ender

Block Header
Ender
Block Ender