AFI Electronics
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • FirstPage
  • ADC
  • TDC
  • Logical
  • Interfaces
  • Systems
  • Documentation
  • Contacts
  • PrivatePage
  • RecentChanges
PCI Digitizer, VME TDC, PCI VME Master, Data Acquisition System

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment

  • MpdDeviceRawDataFormat

Contents

  1. MPD Raw Data Format
    1. TLV block
    2. Regular event block payload
      1. Device Event Block
        1. MStream Block
    3. Statistic block payload
    4. Complex TLV Block (Start/Stop of Run/File)
      1. Run Number Record
      2. Run Index Record
      3. Event order Record
      4. File Id Record
    5. JSON block
    6. Non-TLV blocks
    7. Virtual devices
  2. Data Samples

MPD Raw Data Format

Data file constructed with following TLV-like block.

TLV block

Block Header

word #

byte offset

description

0

0

Sync word (32-bit integer)

1

4

Block payload length: N bytes (32-bit integer)

Block Payload

2

8

Block payload

...

...

N+1

4(N+1)

Sync words can be one of these:

  • 0x2A50D5AF - Regular event block

  • 0x4A62B59D - Statistic block (aka End-of-burst)

  • 0x72617453 - Start run block 'Star'

  • 0x706F7453 - Stop run block 'Stop'

  • 0x67654246 - Start file block 'FBeg'

  • 0x646E4546 - Stop file block 'FEnd'

  • 0x4E4F534A - JSON block 'JSON'

Previously there were blocks that doesn't suit TLV-format:

  • 0x2A502A50 - Regular event block (old format)

  • 0x4A624A62 - End-of-burst block (old format)

Regular event block payload

Event payload

32-bit word #

description

0

Event number

Devices Payload

Device Event Block #1

1

Device Block from a device (S1 bytes)

...

1+(S1/4-1)

Device Event Block #2

1+S1/4

Device Block from a device (S2 bytes)

...

1+S1/4+(S2/4-1)

...

Till the last block

...

In this case Regular event block payload length should be equated to the sum of the event number field and all blocks length: (4 + S1 + S2 + ...) bytes.

Device Event Block

Device Event Header

word #

byte offset

bits

description

0

0

31:0

Device Serial Number

1

4

31:24

Device ID

23:0

Device Event Payload Length: 4*N bytes

Device Event Payload

2

8

Block payload

...

...

N+1

4(N+1)

Some devices splits their payload onto MStream Block. In this case Device Event Payload will be foloving:

Device Event Payload

MStream Block #1

32-bit word #

description

0

MStream Block (S1 32-bit words)

...

S1-1

MStream Block #2

S1

MStream Block (S2 32-bit words)

...

S1+(S2-1)

...

In this case Device Event Payload Length should be equaled to: 4*N = 4*(S1+S2+...) bytes.

MStream Block

MStream Header

0

0

31:24

Subtype-defined bits

23:2

MStream Payload Length: S 32-bit words

1:0

MStream Subtype

MStream payload

1

4

31:0

MStream payload

...

S

4*S

31:0

Statistic block payload

Statistic payload

32-bit word #

description

0

Reserved 32-bit field

Devices Payload

Device Event Block #1

1

Device Block from a device (S1 bytes)

...

1+(S1/4-1)

Device Event Block #2

1+S1/4

Device Block from a device (S2 bytes)

...

1+S1/4+(S2/4-1)

...

Till the last block

...

Statistic block is a successor of End-of-burst block (old format) Instead of the event number field, there will be a reserved 32-bit field. The remainder is a sequence of Device Event Blocks (same as in Regular event block)

Complex TLV Block (Start/Stop of Run/File)

Start/Stop Header

32-bit word #

description

0

Sync word:
0x72617453 - run start
0x706F7453 - run stop
0x67654246 - file begin
0x646E4546 - file end

1

Payload length: (S1+S2+...) bytes

Start/Stop Payload

TLV Record #1

2

TLV Record (S1 bytes)

...

2+(S1/4-1)

TLV Record #2

2+S1/4

TLV Record (S2 bytes)

...

2+S1/4+(S2/4-1)

...

At this moment Start/Stop Run payload can contains:

  • Run Number Record

  • Run Index Record

File begin/end contains following payloads:

  • Run Number Record

  • Run Index Record

  • Event order Record (optional)

  • File Id Record

Run Number Record

Run Number Record

32-bit word #

description

0

Sync word 0x236E7552

1

Block length: 4 bytes

2

Run number

Run Index Record

Run Index Record

32-bit word #

description

0

Sync word 0x78646E49

1

Block length: index length in bytes (N-2)*4

2

Run index (in Latin1)

...

N-1

Event order Record

Run Number Record

32-bit word #

description

0

Sync word 0x71655345

1

Block length: 4 bytes

2

Event number order

This field defines what event numbers will be stored in current file.

Only those that meet the following condition will be saved:

EvNum % EvNumShift == EvNumOrder

File Id Record

Run Number Record

32-bit word #

description

0

Sync word 0x64496946

1

Block length: 4 bytes

2

File id

'File id' is sequential number of file since Star Run (0 - for 1st file).

JSON block

This type reserved for future usage such as:

  • device configuration
  • device status

Non-TLV blocks

Block Header

word #

byte offset

description

0

0

Sync word (32-bit integer)

1

4

Block payload length: N bytes (32-bit integer)

2

8

Event number (32-bit integer)

Block Payload

3

12

Block payload

...

...

N+1

4(N+1)

This blocks has sync-word 0x2A502A50 (Regular event) or 0x4A624A62 (EOB). The difference between Regular event block and old format block (sync:0x2A502A50) is including of event number field into block payload. This type of block is deprecated. Since Run of 2022, they will be excluded.

Virtual devices

List of virtual deices:

  • T0 configuration and status: {0x56 (DEVICE_ID_SOFTWARE), 0x30543074} ('t0T0')

  • Run configuration: {0x56 (DEVICE_ID_SOFTWARE), 0x43526372} ('rcRC')

Data Samples

Some real data captures: MpdDaqSampleData


MPD MStream RawData