MIDAS
|
#include <stdio.h>
#include "midas.h"
#include "mevb.h"
#include "msystem.h"
#include "mdsupport.h"
#include "mfe.h"
Go to the source code of this file.
Macros | |
#define | SERVER_CACHE_SIZE 100000 /* event cache before buffer */ |
#define | ODB_UPDATE_TIME 1000 /* 1 seconds for ODB update */ |
#define | DEFAULT_FE_TIMEOUT 60000 /* 60 seconds for watchdog timeout */ |
#define | TIMEOUT_ABORT 300 /* seconds waiting for data before aborting run */ |
#define | EQUIPMENT_STATISTICS_STR "\Events sent = DOUBLE : 0\n\Events per sec. = DOUBLE : 0\n\kBytes per sec. = DOUBLE : 0\n\" |
Functions | |
INT | handFlush (void) |
INT | source_booking (void) |
INT | source_unbooking (void) |
INT | close_buffers (void) |
INT | source_scan (INT fmt, EQUIPMENT_INFO *eq_info) |
INT | eb_mfragment_add (char *pdest, char *psrce, INT *size) |
INT | eb_yfragment_add (char *pdest, char *psrce, INT *size) |
INT | eb_begin_of_run (INT, char *, char *) |
INT | eb_end_of_run (INT, char *) |
INT | eb_user (INT, BOOL mismatch, EBUILDER_CHANNEL *, EVENT_HEADER *, void *, INT *) |
INT | load_fragment (void) |
INT | scan_fragment (void) |
INT | ebuilder_init (void) |
INT | ebuilder_exit (void) |
INT | ebuilder_loop (void) |
INT | md_event_swap (INT fmt, void *pevt) |
INT | register_equipment (void) |
INT | tr_start (INT rn, char *error) |
INT | tr_resume (INT rn, char *error) |
INT | tr_pause (INT rn, char *error) |
INT | tr_stop (INT rn, char *error) |
void | free_event_buffer (INT nfrag) |
int | main (int argc, char **argv) |
Definition at line 935 of file mevb.cxx.
Hook to the event builder task at PreStart transition.
rn | run number |
UserField | argument from /Ebuilder/Settings |
error | error string to be passed back to the system. |
Definition at line 106 of file ebuser.cxx.
Hook to the event builder task at completion of event collection after receiving the Stop transition.
rn | run number |
error | error string to be passed back to the system. |
Definition at line 121 of file ebuser.cxx.
Definition at line 473 of file mevb.cxx.
INT eb_user | ( | INT | nfrag, |
BOOL | mismatch, | ||
EBUILDER_CHANNEL * | ebch, | ||
EVENT_HEADER * | pheader, | ||
void * | pevent, | ||
INT * | dest_size | ||
) |
Hook to the event builder task after the reception of all fragments of the same serial number. The destination event has already the final EVENT_HEADER setup with the data size set to 0. It is than possible to add private data at this point using the proper bank calls. Therefore any new banks created within eb_user will be appearing before the collected banks from the fragments. When using the eb_user with the ODB flag "user build=y" (equipments/EB/settings) the automatic event builder is skipped. This allow the user to extract selectively from the different fragments the appropriate banks and compose the final destination event. In order to do so, the function "bk_copy(pevent, ebch[i].pfragment, bankname)" will copy a particular bank from a given fragment.
Note: It exists two Midas event format to address bank size less than 32KB and larger bank size <4GB. This distinction is done by the call bk_init(pevent) for the small bank size and bk_init32(pevent) for large bank size. Within an experiment, this declaration has to be consistant. Therefore the bk_init in the eb_user should follow as well the type of the frontends.
The ebch[] array structure points to nfragment channel structure with the following content:
The correct code for including your own MIDAS bank is shown below where TID_xxx is one of the valid Bank type starting with TID_ for midas format bank_name is a 4 character descriptor. pdata has to be declared accordingly with the bank type. Refers to the ebuser.c source code for further description.
It is not possible to mix within the same destination event different event format! No bk_swap performed when user build is requested.
nfrag | Number of fragment. |
mismatch | Midas Serial number mismatch flag. |
ebch | Structure to all the fragments. |
pheader | Destination pointer to the header. |
pevent | Destination pointer to the bank header. |
dest_size | Destination event size in bytes. |
Definition at line 192 of file ebuser.cxx.
Definition at line 529 of file mevb.cxx.
Definition at line 93 of file ebuser.cxx.
Definition at line 786 of file mevb.cxx.
Definition at line 230 of file mevb.cxx.
Definition at line 1140 of file mevb.cxx.
Definition at line 94 of file mevb.cxx.
Definition at line 312 of file mevb.cxx.
Definition at line 820 of file mevb.cxx.
INT source_scan | ( | INT | fmt, |
EQUIPMENT_INFO * | eq_info | ||
) |
Scan all the fragment source once per call.
fmt | Fragment format type |
eq_info | Equipement pointer |
Definition at line 984 of file mevb.cxx.
Definition at line 901 of file mevb.cxx.
Definition at line 601 of file mevb.cxx.
char buffer_name[NAME_LENGTH] |
|
extern |
EBUILDER_CHANNEL ebch[MAX_CHANNELS] |
EBUILDER_SETTINGS ebset |
|
extern |
char expt_name[NAME_LENGTH] |
char host_name[HOST_NAME_LENGTH] |
|
extern |
|
extern |