ZBS primer

ZBS is a simple data management system based on ZEBRA in CERNLIB. In this system, a set of data banks can be easily read/written from/into a file (File Handling Subroutines). A set of data words, a "ZBS bank", has a unique name less than or equal to 32 characters. All "Bank Handling Subroutines" identify ZBS banks by their names.

Segment structure

The structure of a ZBS bank is very simple. It consists of some segments, which are the minimum unit of data stored in the bank. Within each ZBS bank, a segment is idenfied by a number (or a set of numbers). There are two cases: 1-dimensinal and 2-dimensional.

1-dimensional segment structure

       +----------+
       |segment-0 |
       +----------+
            |
       +----------+
       |segment-1 |
       +----------+
            |
       +----------+
       |segment-2 |
       +----------+
            |
            .
            .
            .
            |
       +----------+
       |segment-n |
       +----------+

2-dimensional segment structure

       +----------+
       |segment-0 |
       +----------+
            |
       +------------+ +------------+     +------------+
       |segment-1-1 |-|segment-1-2 |-...-|segment-1-n1|
       +------------+ +------------+     +------------+
            |
       +------------+ +------------+     +------------+
       |segment-2-1 |-|segment-2-2 |-...-|segment-1-n2|
       +------------+ +------------+     +------------+
            |
            .
            .
            .
            |
       +------------+ +------------+     +------------+
       |segment-m-1 |-|segment-m-2 |-...-|segment-m-nm|
       +------------+ +------------+     +------------+

Format of segments

There are two types of format of data within the segment. One is a fixed format and the other is a free format. For the fixed format segment, number of data and their data types are fixed. On the other hand, they can be changed from segment to segment for the free format segment. For both cases, 0-th segment in each bank can have a different format from other segments.

Fixed format segment

       +-+-+-+-+-+
    0: |F|F|I|I|I|
       +-+-+-+-+-+
            |
       +-+-+-+-+-+-+-+
    1: |F|F|I|F|F|I|I|
       +-+-+-+-+-+-+-+
            |
       +-+-+-+-+-+-+-+
    2: |F|F|I|F|F|I|I|
       +-+-+-+-+-+-+-+
            |
            .
            .
            .
            |
       +-+-+-+-+-+-+-+
    n: |F|F|I|F|F|I|I|
       +-+-+-+-+-+-+-+

       F: floating number
       I: integer

Free format segment

       +-+-+-+-+-+
    0: |F|F|I|I|I|
       +-+-+-+-+-+
            |
       +-+-+-+-+-+-+
    1: |F|I|F|F|I|I|
       +-+-+-+-+-+-+
            |
       +-+-+-+-+-+
    2: |F|F|I|I|I|
       +-+-+-+-+-+
            |
            .
            .
            .
            |
       +-+-+-+-+-+-+
    n: |F|F|I|F|I|I|
       +-+-+-+-+-+-+

       F: floating number
       I: integer

Type of ZBS banks

All ZBS banks can be classfied into three types according to their segment structure and segment format.

1-dim. 2-dim.
free Type-0 -
fixed Type-1 Type-2

They are handled by different subroutines, which can be distinguished by a number attached to the subroutine names. Banks are created or deleted by Bank Handling Subroutines. Data in segments are handled by Data Handling Subroutines.

Event

A set of ZBS banks can be read from a file into a memory by a call of one subroutine. This set can be thought as one event (Event Handling Subroutines). In the ZBS system, multiple events can exist in a memory at a time and they can be handled by a set of subroutines (Multi-Event Handling Subroutines). Only one of events in memory is called as a "current event" and all Bank Handling Subroutines and Data Handling Subroutines work on banks in the current event.

In the ZBS system, a set of events in memory can be merged into one super-event, which can be thought as ordinary one event at I/O time. Each event in the merged super-event is called as "sub-event". These sub-events are handled by Sub-Event Handling Subroutines. In the case the super-event is a current event, only one sub-event can be considered as a current event.