MIDAS
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sched.h>
#include <sys/resource.h>
#include <vector>
#include "midas.h"
#include "CAENComm.h"
#include "ov1720drv.h"
#include "v1720CONET2.hxx"
Go to the source code of this file.
Macros | |
#define | NBLINKSPERA3818 1 |
Number of optical links used per A3818. | |
#define | NBLINKSPERFE 1 |
Number of optical links controlled by each frontend. | |
#define | NB1720PERLINK 2 |
Number of daisy-chained v1720s per optical link. | |
#define | NBV1720TOTAL 2 |
Number of v1720 boards in total. | |
#define | EQ_EVID 1 |
Event ID. | |
#define | EQ_TRGMSK 0 |
Trigger mask. | |
#define | FE_NAME "feov1720" |
Frontend name. | |
#define | UNUSED(x) ((void)(x)) |
Suppress compiler warnings. | |
Functions | |
INT | frontend_init () |
Frontend initialization. | |
INT | frontend_exit () |
Frontend exit. | |
INT | begin_of_run (INT run_number, char *error) |
Begin of Run. | |
INT | end_of_run (INT run_number, char *error) |
End of Run. | |
INT | pause_run (INT run_number, char *error) |
Pause Run. | |
INT | resume_run (INT run_number, char *error) |
Resume Run. | |
INT | frontend_loop () |
Frontend loop. | |
void | interrupt_routine (void) |
Interrupt Service Routine. | |
INT | read_trigger_event (char *pevent, INT off) |
Event readout. | |
INT | read_scaler_event (char *pevent, INT off) |
Placeholder. | |
void | seq_callback (INT hDB, INT hseq, void *info) |
Sequencer callback info. | |
INT | poll_event (INT source, INT count, BOOL test) |
Polling routine for events. | |
INT | interrupt_configure (INT cmd, INT source, POINTER_T adr) |
Interrupt configuration (not implemented) | |
Variables | |
HNDLE | hDB |
main ODB handle | |
BOOL | debug |
debug printouts | |
BOOL | debugpolling = false |
debug msgs polling loop | |
BOOL | debugtrigger = false |
debug msgs read trigger event | |
char * | frontend_name = (char*)FE_NAME |
The frontend name (client name) as seen by other MIDAS clients. | |
char * | frontend_file_name = (char*)__FILE__ |
The frontend file name, don't change it. | |
BOOL | frontend_call_loop = FALSE |
frontend_loop is called periodically if this variable is TRUE | |
INT | display_period = 000 |
a frontend status page is displayed with this frequency in ms | |
INT | max_event_size = 32 * 34000 |
maximum event size produced by this frontend | |
INT | max_event_size_frag = 5 * 1024 * 1024 |
maximum event size for fragmented events (EQ_FRAGMENTED) | |
INT | event_buffer_size = 200 * max_event_size + 10000 |
buffer size to hold events | |
bool | runInProgress = false |
run is in progress | |
bool | runOver = false |
run is over | |
bool | runStopRequested = false |
stop run requested | |
EQUIPMENT | equipment [] |
Main structure for midas equipment. | |
vector< v1720CONET2 > | ov1720 |
objects for the v1720 modules controlled by this frontend | |
vector< v1720CONET2 >::iterator | itv1720 |
iterator | |
int | Nloop |
Number of loops executed in event polling. | |
int | Ncount |
Loop count for event polling timeout. | |
#define EQ_EVID 1 |
Event ID.
Definition at line 128 of file feoV1720.cxx.
#define EQ_TRGMSK 0 |
Trigger mask.
Definition at line 129 of file feoV1720.cxx.
#define FE_NAME "feov1720" |
Frontend name.
Definition at line 133 of file feoV1720.cxx.
#define NB1720PERLINK 2 |
Number of daisy-chained v1720s per optical link.
Definition at line 124 of file feoV1720.cxx.
#define NBLINKSPERA3818 1 |
Number of optical links used per A3818.
Definition at line 122 of file feoV1720.cxx.
#define NBLINKSPERFE 1 |
Number of optical links controlled by each frontend.
Definition at line 123 of file feoV1720.cxx.
#define NBV1720TOTAL 2 |
Number of v1720 boards in total.
Definition at line 125 of file feoV1720.cxx.
Suppress compiler warnings.
Definition at line 136 of file feoV1720.cxx.
Begin of Run.
Called every run start transition. Set equipment status in ODB, start acquisition on the modules.
[in] | run_number | Number of the run being started |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 471 of file feoV1720.cxx.
End of Run.
Called every stop run transition. Set equipment status in ODB, stop acquisition on the modules.
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 509 of file feoV1720.cxx.
Frontend exit.
Runs at frontend shutdown. Disconnect hardware and set equipment status in ODB
Definition at line 449 of file feoV1720.cxx.
Frontend initialization.
Runs once at application startup. We initialize the hardware and optical interfaces and set the equipment status in ODB. We also lock the frontend to once physical cpu core.
Definition at line 280 of file feoV1720.cxx.
Frontend loop.
If frontend_call_loop is true, this routine gets called when the frontend is idle or once between every event.
Definition at line 584 of file feoV1720.cxx.
Interrupt configuration (not implemented)
Routine for interrupt configuration if equipment is set in EQ_INTERRUPT mode. Not implemented right now, returns SUCCESS.
[in] | cmd | Command for interrupt events (see midas.h) |
[in] | source | Equipment index number |
[in] | adr | Interrupt routine (see mfe.c) |
Definition at line 663 of file feoV1720.cxx.
Pause Run.
Called every pause run transition.
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 554 of file feoV1720.cxx.
Polling routine for events.
[in] | source | Event source (LAM/IRQ) |
[in] | count | Loop count for event polling timeout |
[in] | test | flag used to time the polling |
Definition at line 619 of file feoV1720.cxx.
Placeholder.
Placeholder.
Scaler event readout routine. Not used in this example.
[in] | pevent | Pointer to event buffer |
[in] | off | Caller info (unused here), see mfe.c |
Definition at line 295 of file ebfe.cxx.
Event readout.
Event readout routine. This is called by the polling or interrupt routines. (see mfe.c). For each module, read the event buffer into a midas data bank. If ZLE data exists, create another bank for it. Finally, create a statistical bank for data throughput analysis.
[in] | pevent | Pointer to event buffer |
[in] | off | Caller info (unused here), see mfe.c |
Definition at line 691 of file feoV1720.cxx.
Resume Run.
Called every resume run transition.
[in] | run_number | Number of the run being ended |
[out] | error | Can be used to write a message string to midas.log |
Definition at line 570 of file feoV1720.cxx.
Sequencer callback info.
Function which gets called when record is updated
[in] | hDB | main ODB handle |
[in] | hseq | Handle for key where search starts in ODB, zero for root. |
[in] | info | Record descriptor additional info |
Definition at line 258 of file feoV1720.cxx.
debug msgs polling loop
Definition at line 143 of file feoV1720.cxx.
debug msgs read trigger event
Definition at line 144 of file feoV1720.cxx.
INT display_period = 000 |
a frontend status page is displayed with this frequency in ms
Definition at line 160 of file feoV1720.cxx.
EQUIPMENT equipment[] |
Main structure for midas equipment.
Definition at line 191 of file feoV1720.cxx.
INT event_buffer_size = 200 * max_event_size + 10000 |
buffer size to hold events
Definition at line 166 of file feoV1720.cxx.
frontend_loop is called periodically if this variable is TRUE
Definition at line 158 of file feoV1720.cxx.
The frontend file name, don't change it.
Definition at line 156 of file feoV1720.cxx.
The frontend name (client name) as seen by other MIDAS clients.
Definition at line 154 of file feoV1720.cxx.
vector<v1720CONET2>::iterator itv1720 |
iterator
Definition at line 242 of file feoV1720.cxx.
INT max_event_size = 32 * 34000 |
maximum event size produced by this frontend
Definition at line 162 of file feoV1720.cxx.
INT max_event_size_frag = 5 * 1024 * 1024 |
maximum event size for fragmented events (EQ_FRAGMENTED)
Definition at line 164 of file feoV1720.cxx.
int Ncount |
Loop count for event polling timeout.
Definition at line 606 of file feoV1720.cxx.
int Nloop |
Number of loops executed in event polling.
Definition at line 605 of file feoV1720.cxx.
vector<v1720CONET2> ov1720 |
objects for the v1720 modules controlled by this frontend
Definition at line 241 of file feoV1720.cxx.
run is in progress
Definition at line 168 of file feoV1720.cxx.
run is over
Definition at line 169 of file feoV1720.cxx.
stop run requested
Definition at line 170 of file feoV1720.cxx.