AlcapDAQ
1
|
#include <stdio.h>
#include "midas.h"
#include "mevb.h"
#include "ybos.h"
#include "mucap_compress.h"
Go to the source code of this file.
Macros | |
#define | NUMCRATES 5 |
Functions | |||||||||||
INT | eb_begin_of_run (INT, char *, char *) | ||||||||||
INT | eb_end_of_run (INT, char *) | ||||||||||
INT | ebuser (INT, EBUILDER_CHANNEL *, EVENT_HEADER *, void *, INT *) | ||||||||||
eb_user() | |||||||||||
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. The ebch[] array structure points to nfragment channel structure with the following content: {verbatim} typedef struct { char name[32]; // Fragment name (Buffer name). DWORD serial; // Serial fragment number. char *pfragment; // Pointer to fragment (EVENT_HEADER *) ... } EBUILDER_CHANNEL; {verbatim} 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 or { xxx_BKTYPE} for Ybos data 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!} {verbatim} Event is empty, fill it with BANK_HEADER If you need to add your own bank at this stage bk_init(pevent); bk_create(pevent, bank_name, TID_xxxx, &pdata); pdata++ = ...; dest_size = bk_close(pevent, pdata); pheader->data_size = *dest_size + sizeof(EVENT_HEADER); {verbatim} For YBOS format, use the following example. {verbatim} ybk_init(pevent); ybk_create(pevent, "EBBK", I4_BKTYPE, &pdata); pdata++ = 0x12345678; pdata++ = 0x87654321; dest_size = ybk_close(pevent, pdata); dest_size *= 4; pheader->data_size = *dest_size + sizeof(YBOS_BANK_HEADER); {verbatim}
| |||||||||||
INT | eb_user (INT nfrag, EBUILDER_CHANNEL *ebch, EVENT_HEADER *pheader, void *pevent, INT *dest_size) | ||||||||||
Variables | |
INT | lModulo = 100 |
#define NUMCRATES 5 |
Definition at line 52 of file old_ebuser.cpp.
INT eb_begin_of_run | ( | INT | rn, |
char * | UserField, | ||
char * | error | ||
) |
eb_begin_of_run()
Hook to the event builder task at PreStart transition. {verbatim} {verbatim}
rn | run number |
UserField | argument from /Ebuilder/Settings |
error | error string to be passed back to the system. |
Definition at line 145 of file ebuser.cpp.
References compress_load_all(), EB_SUCCESS, ebch, ebset, enabled, FALSE, hDB, MAX_CHANNELS, NUMCRATES, size, sprintf(), EBUILDER_SETTINGS::trigger_mask, and EBUILDER_CHANNEL::trigger_mask.
INT eb_end_of_run | ( | INT | rn, |
char * | error | ||
) |
eb_end_of_run()
Hook to the event builder task at completion of event collection after receiving the Stop transition. {verbatim} {verbatim}
rn | run number |
error | error string to be passed back to the system. |
Definition at line 193 of file ebuser.cpp.
References EB_SUCCESS.
INT eb_user | ( | INT | nfrag, |
EBUILDER_CHANNEL * | ebch, | ||
EVENT_HEADER * | pheader, | ||
void * | pevent, | ||
INT * | dest_size | ||
) |
Definition at line 187 of file old_ebuser.cpp.
References compress_event(), EB_SUCCESS, i, EBUILDER_CHANNEL::pfragment, and printf().
INT ebuser | ( | INT | , |
EBUILDER_CHANNEL * | , | ||
EVENT_HEADER * | , | ||
void * | , | ||
INT * | |||
) |
INT lModulo = 100 |
Definition at line 59 of file old_ebuser.cpp.