Functions | |
void | bk_init (void *event) |
void | bk_init32 (void *event) |
INT | bk_size (void *event) |
void | bk_create (void *event, const char *name, WORD type, void *pdata) |
INT | bk_close (void *event, void *pdata) |
INT | bk_list (void *event, char *bklist) |
INT | bk_locate (void *event, const char *name, void *pdata) |
INT | bk_find (BANK_HEADER *pbkh, const char *name, DWORD *bklen, DWORD *bktype, void **pdata) |
INT | bk_iterate (void *event, BANK **pbk, void *pdata) |
INT | bk_swap (void *event, BOOL force) |
|
Close the Midas bank priviously created by bk_create(). The data pointer pdata must be obtained by bk_create() and used as an address to fill a bank. It is incremented with every value written to the bank and finally points to a location just after the last byte of the bank. It is then passed to bk_close() to finish the bank creation
Definition at line 12255 of file midas.c. Referenced by adc_calib(), adc_summing(), eb_user(), read_scaler_event(), read_trigger_event(), and scaler_accum(). |
|
Create a Midas bank. The data pointer pdata must be used as an address to fill a bank. It is incremented with every value written to the bank and finally points to a location just after the last byte of the bank. It is then passed to the function bk_close() to finish the bank creation. INT *pdata; bk_init(pevent); bk_create(pevent, "ADC0", TID_INT, &pdata); *pdata++ = 123 *pdata++ = 456 bk_close(pevent, pdata);
Definition at line 12136 of file midas.c. Referenced by adc_calib(), adc_summing(), eb_user(), read_scaler_event(), read_trigger_event(), and scaler_accum(). |
|
Finds a MIDAS bank of given name inside an event.
|
|
Initializes an event for Midas banks structure. Before banks can be created in an event, bk_init() has to be called first.
Definition at line 12054 of file midas.c. Referenced by eb_user(), read_scaler_event(), and read_trigger_event(). |
|
Initializes an event for Midas banks structure for large bank size (> 32KBytes) Before banks can be created in an event, bk_init32() has to be called first.
|
|
Iterates through banks inside an event. The function can be used to enumerate all banks of an event. The returned pointer to the bank header has following structure: typedef struct { char name[4]; WORD type; WORD data_size; } BANK; BANK *pbk; INT size; void *pdata; char name[5]; pbk = NULL; do { size = bk_iterate(event, &pbk, &pdata); if (pbk == NULL) break; *((DWORD *)name) = *((DWORD *)(pbk)->name); name[4] = 0; printf("bank %s found\n", name); } while(TRUE);
Definition at line 12487 of file midas.c. Referenced by bk_list(), and update_odb(). |
|
Extract the MIDAS bank name listing of an event. The bklist should be dimensioned with STRING_BANKLIST_MAX which corresponds to a max of BANKLIST_MAX banks (midas.h: 32 banks max). INT adc_calib(EVENT_HEADER *pheader, void *pevent) { INT n_adc, nbanks; WORD *pdata; char banklist[STRING_BANKLIST_MAX]; // Display # of banks and list of banks in the event nbanks = bk_list(pevent, banklist); printf("#banks:%d List:%s\n", nbanks, banklist); // look for ADC0 bank, return if not present n_adc = bk_locate(pevent, "ADC0", &pdata); ... }
|
|
Locates a MIDAS bank of given name inside an event.
Definition at line 12353 of file midas.c. Referenced by adc_calib(), adc_summing(), and scaler_accum(). |
|
Returns the size of an event containing banks. The total size of an event is the value returned by bk_size() plus the size of the event header (sizeof(EVENT_HEADER)).
Definition at line 12109 of file midas.c. Referenced by read_scaler_event(). |
|
Swaps bytes from little endian to big endian or vice versa for a whole event. An event contains a flag which is set by bk_init() to identify the endian format of an event. If force is FALSE, this flag is evaluated and the event is only swapped if it is in the "wrong" format for this system. An event can be swapped to the "wrong" format on purpose for example by a front-end which wants to produce events in a "right" format for a back-end analyzer which has different byte ordering.
Definition at line 12564 of file midas.c. Referenced by eb_mfragment_add(), and source_scan(). |