AlcapDAQ
1
|
Go to the source code of this file.
Macros | |
#define | SERVER_CACHE_SIZE 0 /* 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 | EQUIPMENT_COMMON_STR "\Event ID = WORD : 0\n\Trigger mask = WORD : 0\n\Buffer = STRING : [32] SYSTEM\n\Type = INT : 0\n\Source = INT : 0\n\Format = STRING : [8] FIXED\n\Enabled = BOOL : 0\n\Read on = INT : 0\n\Period = INT : 0\n\Event limit = DOUBLE : 0\n\Num subevents = DWORD : 0\n\Log history = INT : 0\n\Frontend host = STRING : [32] \n\Frontend name = STRING : [32] \n\Frontend file name = STRING : [256] \n\" |
#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 | ybos_event_swap (DWORD *pevt) |
INT | register_equipment (void) |
INT | tr_start (INT rn, char *error) |
INT | tr_stop (INT rn, char *error) |
void | free_event_buffer (INT nfrag) |
int | main (unsigned int argc, char **argv) |
Variables | |
EBUILDER_SETTINGS | ebset |
EBUILDER_CHANNEL | ebch [MAX_CHANNELS] |
INT | run_state |
INT | run_number |
DWORD | last_time |
DWORD | actual_time |
DWORD | actual_millitime |
char | host_name [HOST_NAME_LENGTH] |
char | expt_name [NAME_LENGTH] |
char | full_frontend_name [256] |
char | buffer_name [NAME_LENGTH] |
INT | nfragment |
char * | dest_event |
HNDLE | hDB |
HNDLE | hKey |
HNDLE | hStatKey |
HNDLE | hSubkey |
HNDLE | hEqKey |
HNDLE | hESetKey |
BOOL | debug = FALSE |
BOOL | debug1 = FALSE |
BOOL | wheel = FALSE |
char | bars [] = "|\\-/" |
int | i_bar |
BOOL | abort_requested = FALSE |
BOOL | stop_requested = TRUE |
DWORD | stop_time = 0 |
DWORD | request_stop_time = 0 |
INT(* | meb_fragment_add )(char *, char *, INT *) |
char * | frontend_name |
char * | frontend_file_name |
BOOL | frontend_call_loop |
INT | max_event_size |
INT | max_event_size_frag |
INT | event_buffer_size |
INT | display_period |
EQUIPMENT | equipment [] |
#define EQUIPMENT_COMMON_STR "\Event ID = WORD : 0\n\Trigger mask = WORD : 0\n\Buffer = STRING : [32] SYSTEM\n\Type = INT : 0\n\Source = INT : 0\n\Format = STRING : [8] FIXED\n\Enabled = BOOL : 0\n\Read on = INT : 0\n\Period = INT : 0\n\Event limit = DOUBLE : 0\n\Num subevents = DWORD : 0\n\Log history = INT : 0\n\Frontend host = STRING : [32] \n\Frontend name = STRING : [32] \n\Frontend file name = STRING : [256] \n\" |
Definition at line 140 of file mevb.cpp.
Referenced by register_equipment().
#define EQUIPMENT_STATISTICS_STR "\Events sent = DOUBLE : 0\n\Events per sec. = DOUBLE : 0\n\kBytes per sec. = DOUBLE : 0\n\" |
Definition at line 158 of file mevb.cpp.
Referenced by register_equipment().
#define SERVER_CACHE_SIZE 0 /* event cache before buffer */ |
INT close_buffers | ( | void | ) |
Definition at line 866 of file mevb.cpp.
References abort_requested, eb_end_of_run(), eq, equipment, FALSE, handFlush(), request_stop_time, run_number, run_state, source_unbooking(), sprintf(), status, and stop_time.
Referenced by scan_fragment().
INT eb_begin_of_run | ( | INT | , |
char * | , | ||
char * | |||
) |
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. |
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. |
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.
INT eb_end_of_run | ( | INT | , |
char * | |||
) |
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. |
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. |
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.
INT eb_mfragment_add | ( | char * | pdest, |
char * | psrce, | ||
INT * | size | ||
) |
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.
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 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!
For YBOS format, use the following example.
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 259 of file ebuser.cpp.
INT eb_yfragment_add | ( | char * | pdest, |
char * | psrce, | ||
INT * | size | ||
) |
Definition at line 527 of file mevb.cpp.
References size, status, and ybos_event_swap().
Referenced by load_fragment(), and main().
INT ebuilder_exit | ( | void | ) |
Definition at line 126 of file ebuser.cpp.
INT ebuilder_init | ( | void | ) |
Definition at line 120 of file ebuser.cpp.
INT ebuilder_loop | ( | void | ) |
Definition at line 132 of file ebuser.cpp.
void free_event_buffer | ( | INT | nfrag) |
Definition at line 712 of file mevb.cpp.
References i, and EBUILDER_CHANNEL::pfragment.
Referenced by main(), source_booking(), and source_unbooking().
INT handFlush | ( | void | ) |
INT load_fragment | ( | void | ) |
Definition at line 292 of file mevb.cpp.
References buffer_name, debug, dest_event, EB_ERROR, eb_mfragment_add(), EB_SUCCESS, eb_yfragment_add(), enabled, equipment, event_id, FALSE, full_frontend_name, hDB, hEqKey, hSubkey, i, key, max_event_size, meb_fragment_add, nfragment, printf(), and size.
Referenced by main().
int main | ( | unsigned int | argc, |
char ** | argv | ||
) |
Definition at line 1092 of file mevb.cpp.
References buffer_name, cm_get_environment(), debug, debug1, EB_SUCCESS, ebuilder_exit(), ebuilder_init(), expt_name, FALSE, free_event_buffer(), frontend_name, full_frontend_name, hDB, hKey, host_name, i, load_fragment(), EBUILDER_SETTINGS::nfragment, printf(), register_equipment(), scan_fragment(), source_unbooking(), status, SUCCESS, tr_start(), tr_stop, TRUE, usage(), and wheel.
INT register_equipment | ( | void | ) |
Definition at line 165 of file mevb.cpp.
References EB_SUCCESS, equipment, EQUIPMENT_COMMON_STR, EQUIPMENT_STATISTICS_STR, frontend_file_name, full_frontend_name, hDB, hKey, printf(), run_number, run_state, SERVER_CACHE_SIZE, size, sprintf(), status, SUCCESS, and TRUE.
INT scan_fragment | ( | void | ) |
Definition at line 370 of file mevb.cpp.
References abort_requested, actual_millitime, bars, close_buffers(), debug, EB_ERROR, EB_SKIP, EB_SUCCESS, EB_USER_ERROR, eq, equipment, full_frontend_name, i_bar, last_time, nfragment, printf(), run_state, source_scan(), status, stop_requested, timeout, TIMEOUT, TRUE, and wheel.
Referenced by main().
INT source_booking | ( | void | ) |
Definition at line 756 of file mevb.cpp.
References debug, event_id, free_event_buffer(), i, max_event_size, EBUILDER_SETTINGS::nfragment, nfragment, EBUILDER_CHANNEL::pfragment, EBUILDER_SETTINGS::preqfrag, printf(), status, and SUCCESS.
Referenced by tr_prestart(), and tr_start().
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 |
dest_hBuf | Destination buffer handle |
Definition at line 916 of file mevb.cpp.
References debug, debug1, dest_event, EB_ERROR, EB_SKIP, EB_SUCCESS, eb_user(), equipment, event_mismatch, FALSE, found, full_frontend_name, i, max_event_size, meb_fragment_add, nfragment, EBUILDER_CHANNEL::pfragment, EBUILDER_SETTINGS::preqfrag, printf(), psbh, EBUILDER_SETTINGS::received, EBUILDER_CHANNEL::serial, size, sprintf(), status, stop_requested, SUCCESS, EBUILDER_CHANNEL::timeout, TRUE, EBUILDER_SETTINGS::user_build, and ybos_event_swap().
Referenced by main(), and scan_fragment().
INT source_unbooking | ( | void | ) |
Definition at line 826 of file mevb.cpp.
References debug, EB_SUCCESS, free_event_buffer(), i, nfragment, printf(), and status.
Referenced by close_buffers(), and main().
INT tr_start | ( | INT | rn, |
char * | error | ||
) |
Definition at line 599 of file mevb.cpp.
References abort_requested, eb_begin_of_run(), EB_SUCCESS, EBUILDER, equipment, FALSE, full_frontend_name, hDB, hKey, i, key, EBUILDER_SETTINGS::nfragment, nfragment, EBUILDER_SETTINGS::preqfrag, printf(), EBUILDER_SETTINGS::received, run_number, run_state, size, source_booking(), sprintf(), status, stop_requested, SUCCESS, TRUE, EBUILDER_SETTINGS::user_build, and EBUILDER_SETTINGS::user_field.
INT tr_stop | ( | INT | rn, |
char * | error | ||
) |
Definition at line 699 of file mevb.cpp.
References full_frontend_name, printf(), request_stop_time, stop_requested, and TRUE.
INT ybos_event_swap | ( | DWORD * | pevt) |
Referenced by eb_yfragment_add(), and source_scan().
BOOL abort_requested = FALSE |
Definition at line 106 of file mevb.cpp.
Referenced by close_buffers(), main(), scan_fragment(), source_scan(), tr_prestart(), and tr_start().
char bars[] = "|\\-/" |
Definition at line 104 of file mevb.cpp.
Referenced by main(), process_event(), scan_fragment(), and source_scan().
char buffer_name[NAME_LENGTH] |
Definition at line 97 of file mevb.cpp.
Referenced by load_fragment(), and main().
BOOL debug1 = FALSE |
Definition at line 101 of file mevb.cpp.
Referenced by handFlush(), main(), and source_scan().
char* dest_event |
Definition at line 99 of file mevb.cpp.
Referenced by load_fragment(), main(), and source_scan().
EBUILDER_CHANNEL ebch[MAX_CHANNELS] |
Definition at line 86 of file mevb.cpp.
Referenced by eb_begin_of_run().
EBUILDER_SETTINGS ebset |
Definition at line 85 of file mevb.cpp.
Referenced by eb_begin_of_run().
HNDLE hEqKey |
Definition at line 100 of file mevb.cpp.
Referenced by load_fragment().
HNDLE hKey |
Definition at line 100 of file mevb.cpp.
Referenced by dt5720_init(), epics_ca(), frontend_init(), logger_root(), main(), MCaenCompProcessRaw_init(), MDQ_DAQLivetime_eor(), MDQ_IslandRate_eor(), MDQ_RunTime_eor(), MDQ_TDCCheck_eor(), MDQ_Thresholds_eor(), odb_connect(), odb_find_key(), register_equipment(), tr_start(), UpdateDetectorBankNameMap(), and v1724_init().
HNDLE hStatKey |
Definition at line 100 of file mevb.cpp.
Referenced by main(), and tr_prestart().
HNDLE hSubkey |
Definition at line 100 of file mevb.cpp.
Referenced by load_fragment(), and main().
int i_bar |
Definition at line 105 of file mevb.cpp.
Referenced by main(), process_event(), scan_fragment(), and source_scan().
DWORD last_time |
Definition at line 90 of file mevb.cpp.
Referenced by main(), and scan_fragment().
INT(* meb_fragment_add)(char *, char *, INT *) |
Definition at line 109 of file mevb.cpp.
Referenced by load_fragment(), main(), and source_scan().
INT nfragment |
Definition at line 98 of file mevb.cpp.
Referenced by handFlush(), load_fragment(), main(), scan_fragment(), source_booking(), source_scan(), source_unbooking(), and tr_start().
DWORD request_stop_time = 0 |
Definition at line 107 of file mevb.cpp.
Referenced by close_buffers(), main(), and tr_stop().
INT run_state |
BOOL stop_requested = TRUE |
Definition at line 106 of file mevb.cpp.
Referenced by main(), scan_fragment(), source_scan(), tr_prestart(), tr_start(), and tr_stop().
DWORD stop_time = 0 |
Definition at line 107 of file mevb.cpp.
Referenced by close_buffers(), and main().
BOOL wheel = FALSE |
Definition at line 103 of file mevb.cpp.
Referenced by main(), scan_fragment(), and source_scan().