Event Builder Functions

Each frontend channel needs to send its "midas event" (fragment in this case) to a dedicated midas buffer with a unique "Event Identifier". This is specified within the frontend code in the equipment definition ( BUF1 instead of default SYSTEM, see also ODB /Equipment Tree):
EQUIPMENT equipment[] = {

  { "Trigger1",            // equipment name
    1, 0,                  // event ID, trigger mask 
    "BUF1",                // event buffer
    ...

The user has the possibility of interfering into the event building process at several stages:

In the case of serial number mismatch or error returned from the user code, the event builder will abort by issuing a "stop run" transition and return to an "idle" state. THERE IS NO RECOVERY PROCESS AVAILABLE YET!

ODB/EBuilder Tree

The Event builder tree will be created with default settings from the mevb.h header file. The location of the tree is at the root level of the midas experiment. Each frontend fragment and the "built event" has its own subdirectory under the /EBuilder with a Settings tree defining the frontend characteristics and Statistics for status information.

The fields "Event ID", "Buffer" have to match the frontend equipment definition in order to garantee the proper data transfer.

[local:midas:S]/>ls -lr EBuilder
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
EBuilder                        DIR
    Settings                    DIR
        Event ID                WORD    1     2     35h  0   RWD  1
        Trigger mask            WORD    1     2     35h  0   RWD  1
        Buffer                  STRING  1     32    35h  0   RWD  SYSTEM
        Format                  STRING  1     32    35h  0   RWD  MIDAS
        User build              BOOL    1     4     35h  0   RWD  n
        User Field              STRING  1     64    3h   0   RWD  1024
  Event mask              DWORD   1     4     35h  0   RWD  3
        Hostname                STRING  1     64    43m  0   RWD  dasdevpc
    Statistics                  DIR
        Events sent             DOUBLE  1     8     38m  0   RWD  1883
        Events per sec.         DOUBLE  1     8     38m  0   RWD  0
        kBytes per sec.         DOUBLE  1     8     38m  0   RWD  0
    Channels                    DIR
        Frag1                   DIR
            Settings            DIR
                Event ID        WORD    1     2     35h  0   RWD  1
                Trigger mask    WORD    1     2     35h  0   RWD  65535
                Buffer          STRING  1     32    35h  0   RWD  BUF1
                Format          STRING  1     32    35h  0   RWD  MIDAS
                Event mask      DWORD   1     4     35h  0   RWD  1
            Statistics          DIR
                Events sent     DOUBLE  1     8     38m  0   RWD  1883
                Events per sec. DOUBLE  1     8     38m  0   RWD  1881.12
                kBytes per sec. DOUBLE  1     8     38m  0   RWD  0
        Frag2                   DIR
            Settings            DIR
                Event ID        WORD    1     2     35h  0   RWD  2
                Trigger mask    WORD    1     2     35h  0   RWD  65535
                Buffer          STRING  1     32    35h  0   RWD  BUF2
                Format          STRING  1     32    35h  0   RWD  MIDAS
                Event mask      DWORD   1     4     35h  0   RWD  2
            Statistics          DIR
                Events sent     DOUBLE  1     8     38m  0   RWD  1884
                Events per sec. DOUBLE  1     8     38m  0   RWD  1882.12
                kBytes per sec. DOUBLE  1     8     38m  0   RWD  0

EB Operation

Using the "eb>" as the cwd for the example, the test procedure is the following: cwd : midas/examples/eventbuilder -> refered as eb>

mevb Status/Bugs


Midas DOC Version 1.9.3 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Suzannah Daviel - Doxygen - Peter Green - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - Konstantin Olchanski - Renee Poutissou - Andreas Suter - Piotr Adam Zolnierczuk