Defines | |
#define | SWAP_D2WORD(_d2w) |
#define | EVID_TRINAT |
#define | YBOS_EVID_BANK(__a, __b, __c,__d,__e) |
#define | MIDAS_EVID_BANK(__a, __b, __c,__d,__e) |
#define EVID_TRINAT |
As soon as the Midas header is striped out from the event, the YBOS remaining data has lost the event synchonization unless included by the user. It is therefore necessary to have a YBOS bank duplicating this information usually done in the FE by creating a "EVID" bank filled with the Midas info and other user information.
Unfortunately the format of this EVID is flexible and I couldn't force user to use a default structure. For this reason, I'm introducing a preprocessor flag for selecting such format.
Omitting the declaration of the pre-processor flag the EVID_TRINAT is taken by default see Midas build options and operation considerations.
Special macros are avaialbe to retrieve this information based on the EVID content and the type of EVID structure.
The Macro parameter should point to the first data of the EVID bank.
// check if EVID is present if so display its content if ((status = ybk_find (pybos, "EVID", &bklen, &bktyp, (void *)&pybk)) == YB_SUCCESS) { pdata = (DWORD *)((YBOS_BANK_HEADER *)pybk + 1); pevent->event_id = YBOS_EVID_EVENT_ID(pdata); pevent->trigger_mask = YBOS_EVID_TRIGGER_MASK(pdata); pevent->serial_number = YBOS_EVID_SERIAL(pdata); pevent->time_stamp = YBOS_EVID_TIME(pdata); pevent->data_size = pybk->length; }
The current type of EVID bank are:
ybk_create((DWORD *)pevent, "EVID", I4_BKTYPE, (DWORD *)(&pbkdat)); *((WORD *)pbkdat) = EVENT_ID(pevent); ((WORD *)pbkdat)++; *((WORD *)pbkdat) = TRIGGER_MASK(pevent); ((WORD *)pbkdat)++; *(pbkdat)++ = SERIAL_NUMBER(pevent); *(pbkdat)++ = TIME_STAMP(pevent); *(pbkdat)++ = gbl_run_number; // run number
ybk_create((DWORD *)pevent, "EVID", I4_BKTYPE, &pbkdat); *((WORD *)pbkdat) = EVENT_ID(pevent); ((WORD *)pbkdat)++; *((WORD *)pbkdat) = TRIGGER_MASK(pevent); ((WORD *)pbkdat)++; *(pbkdat)++ = SERIAL_NUMBER(pevent); *(pbkdat)++ = TIME_STAMP(pevent); *(pbkdat)++ = gbl_run_number; // run number *(pbkdat)++ = *((DWORD *)frontend_name); // frontend name ybk_close((DWORD *)pevent, pbkdat);
#define MIDAS_EVID_BANK | ( | __a, | |||
__b, | |||||
__c, | |||||
__d, | |||||
__e | ) |
#define SWAP_D2WORD | ( | _d2w | ) |
#define YBOS_EVID_BANK | ( | __a, | |||
__b, | |||||
__c, | |||||
__d, | |||||
__e | ) |
Value:
{\ DWORD * _pbuf;\ ybk_create(__a, "EVID", I4_BKTYPE, &_pbuf);\ *(_pbuf)++ = (DWORD)__b;\ *(_pbuf)++ = (DWORD)__c;\ *(_pbuf)++ = (DWORD)__d;\ *(_pbuf)++ = (DWORD)ss_millitime();\ *(_pbuf)++ = (DWORD)__e;\ ybk_close(__a, _pbuf);\ }