128 std::cout <<
"Starting deferred transition" << std::endl;
140#define SIMDAQSETTINGS_STR(_name) const char *_name[] = {\
142"Descrip = STRING : [256] ",\
143"Parameter AAA = INT : 0",\
144"Parameter BB2 = INT : 0", \
145"Parameter CC22 = INT : 0",\
157 printf(
"Status %i\n",
status);
159 cm_msg(
MERROR,
"init_simdaqsettings",
"Aborting on mismatching /Equipment/SIMDAQ/Settings");
175 printf(
"Exiting fedcrc!\n");
268 double u = ((double) rand() / (RAND_MAX)) * 2 - 1;
269 double v = ((double) rand() / (RAND_MAX)) * 2 - 1;
270 double r = u * u + v * v;
272 double c = sqrt(-2 * log(r) / r);
295 *pdata32++ = 0xfa000200;
298 if((rand() % 100) > 80) sample += 200;
299 *pdata32++ = 0xf800406b + sample;
302 *pdata32++ = 0xf801405e + sample2;
305 *pdata32++ = 0xf802405e + sample3;
308 *pdata32++ = 0xf803405e + sample4;
311 *pdata32++ = 0xf804405e + sample5;
314 *pdata32++ = 0xf805405e + sample6;
318 *pdata32++ = 0xfcfd57e8;
321 int size2 =
bk_close(pevent, pdata32);
337 *pdata720++ = 0xa00001f8;
338 *pdata720++ = 0xfff703;
340 *pdata720++ = 0x13132f;
343 for(
int j = 0;
j < 2;
j++){
345 if (
j==1) pulse_position+= 5;
347 pulse_height = pulse_height * (1.0 - ((double)pulse_position)/600.0);
349 for(
int i = 0;
i < 504;
i++){
352 if(
i == pulse_position) sample += 0.2 * pulse_height;
353 if(
i == pulse_position+1) sample += 0.8 * pulse_height;
354 if(
i == pulse_position+2) sample += 1.0 * pulse_height;
355 if(
i == pulse_position+3) sample += 0.9 * pulse_height;
356 if(
i == pulse_position+4) sample += 0.5 * pulse_height;
357 if(
i == pulse_position+5) sample += 0.3 * pulse_height;
358 if(
i == pulse_position+6) sample += 0.1 * pulse_height;
363 if(
i == pulse_position) sample += 0.2 * pulse_height;
364 if(
i == pulse_position+1) sample += 0.8 * pulse_height;
365 if(
i == pulse_position+2) sample += 1.0 * pulse_height;
366 if(
i == pulse_position+3) sample += 0.9 * pulse_height;
367 if(
i == pulse_position+4) sample += 0.5 * pulse_height;
368 if(
i == pulse_position+5) sample += 0.3 * pulse_height;
369 if(
i == pulse_position+6) sample += 0.1 * pulse_height;
371 word += (sample << 16);
382 struct timeval start;
384 if(0)printf (
"simdaq request: %f\n",start.tv_sec
385 + 0.000001*start.tv_usec);
394 std::cout <<
"Finished readout... " << std::endl;
INT transition(INT run_number, char *error)
INT bk_close(void *event, void *pdata)
void bk_init32(void *event)
void bk_create(void *event, const char *name, WORD type, void **pdata)
INT bk_size(const void *event)
INT cm_disconnect_experiment(void)
INT cm_register_deferred_transition(INT transition, BOOL(*func)(INT, BOOL))
#define DB_STRUCT_MISMATCH
#define CMD_INTERRUPT_ATTACH
#define CMD_INTERRUPT_DISABLE
#define CMD_INTERRUPT_ENABLE
#define CMD_INTERRUPT_DETACH
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
std::string strcomb1(const char **list)
INT db_check_record(HNDLE hDB, HNDLE hKey, const char *keyname, const char *rec_str, BOOL correct)
const char * frontend_file_name
INT frontend_exit()
Frontend exit.
INT frontend_init()
Frontend initialization.
BOOL wait_end_cycle(int transition, BOOL first)
INT interrupt_configure(INT cmd, INT source, POINTER_T adr)
INT poll_event(INT source, INT count, BOOL test)
INT read_trigger_event(char *pevent, INT off)
#define SIMDAQSETTINGS_STR(_name)
const char * frontend_name
INT begin_of_run(INT run_number, char *error)
Begin of Run.
INT frontend_loop()
Frontend loop.
INT end_of_run(INT run_number, char *error)
End of Run.
INT read_scaler_event(char *pevent, INT off)
Scaler event readout.
int gettimeofday(struct timeval *tp, void *tzp)