133 std::cout <<
"Starting deferred transition" << std::endl;
145#define SIMDAQSETTINGS_STR(_name) const char *_name[] = {\
147"Descrip = STRING : [256] ",\
148"Parameter AAA = INT : 0",\
149"Parameter BB2 = INT : 0", \
150"Parameter CC22 = INT : 0",\
162 printf(
"Status %i\n",
status);
164 cm_msg(
MERROR,
"init_simdaqsettings",
"Aborting on mismatching /Equipment/SIMDAQ/Settings");
180 printf(
"Exiting fedcrc!\n");
275 double u = ((double) rand() / (RAND_MAX)) * 2 - 1;
276 double v = ((double) rand() / (RAND_MAX)) * 2 - 1;
277 double r = u * u + v * v;
279 double c = sqrt(-2 * log(r) / r);
302 *pdata32++ = 0xfa000200;
305 if((rand() % 100) > 80) sample += 200;
306 *pdata32++ = 0xf800406b + sample;
309 *pdata32++ = 0xf801405e + sample2;
312 *pdata32++ = 0xf802405e + sample3;
315 *pdata32++ = 0xf803405e + sample4;
318 *pdata32++ = 0xf804405e + sample5;
321 *pdata32++ = 0xf805405e + sample6;
325 *pdata32++ = 0xfcfd57e8;
328 int size2 =
bk_close(pevent, pdata32);
344 *pdata720++ = 0xa00001f8;
345 *pdata720++ = 0xfff703;
347 *pdata720++ = 0x13132f;
350 for(
int j = 0;
j < 2;
j++){
352 if (
j==1) pulse_position+= 5;
354 pulse_height = pulse_height * (1.0 - ((double)pulse_position)/600.0);
356 for(
int i = 0;
i < 504;
i++){
359 if(
i == pulse_position) sample += 0.2 * pulse_height;
360 if(
i == pulse_position+1) sample += 0.8 * pulse_height;
361 if(
i == pulse_position+2) sample += 1.0 * pulse_height;
362 if(
i == pulse_position+3) sample += 0.9 * pulse_height;
363 if(
i == pulse_position+4) sample += 0.5 * pulse_height;
364 if(
i == pulse_position+5) sample += 0.3 * pulse_height;
365 if(
i == pulse_position+6) sample += 0.1 * pulse_height;
370 if(
i == pulse_position) sample += 0.2 * pulse_height;
371 if(
i == pulse_position+1) sample += 0.8 * pulse_height;
372 if(
i == pulse_position+2) sample += 1.0 * pulse_height;
373 if(
i == pulse_position+3) sample += 0.9 * pulse_height;
374 if(
i == pulse_position+4) sample += 0.5 * pulse_height;
375 if(
i == pulse_position+5) sample += 0.3 * pulse_height;
376 if(
i == pulse_position+6) sample += 0.1 * pulse_height;
378 word += (sample << 16);
389 struct timeval start,
end;
391 if(0)printf (
"simdaq request: %f\n",start.tv_sec
392 + 0.000001*start.tv_usec);
401 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)