Go to the source code of this file.
Functions | |
ASUM_BANK_STR (asum_bank_str) | |
INT | analyzer_init () |
INT | analyzer_exit () |
INT | ana_begin_of_run (INT run_number, char *error) |
INT | ana_end_of_run (INT run_number, char *error) |
INT | ana_pause_run (INT run_number, char *error) |
INT | ana_resume_run (INT run_number, char *error) |
INT | analyzer_loop () |
Variables | |
char * | analyzer_name = "Analyzer" |
INT | analyzer_loop_period = 0 |
INT | odb_size = DEFAULT_ODB_SIZE |
RUNINFO | runinfo |
GLOBAL_PARAM | global_param |
EXP_PARAM | exp_param |
TRIGGER_SETTINGS | trigger_settings |
ANA_MODULE | scaler_accum_module |
ANA_MODULE | adc_calib_module |
ANA_MODULE | adc_summing_module |
ANA_MODULE * | scaler_module [] |
ANA_MODULE * | trigger_module [] |
BANK_LIST | ana_trigger_bank_list [] |
BANK_LIST | ana_scaler_bank_list [] |
ANALYZE_REQUEST | analyze_request [] |
Definition at line 206 of file analyzer.c.
00207 { 00208 FILE *f; 00209 time_t now; 00210 char str[256]; 00211 int size; 00212 double n; 00213 HNDLE hDB; 00214 BOOL flag; 00215 00216 cm_get_experiment_database(&hDB, NULL); 00217 00218 /* update run log if run was written and running online */ 00219 00220 size = sizeof(flag); 00221 db_get_value(hDB, 0, "/Logger/Write data", &flag, &size, TID_BOOL, TRUE); 00222 if (flag && runinfo.online_mode == 1) { 00223 /* update run log */ 00224 size = sizeof(str); 00225 str[0] = 0; 00226 db_get_value(hDB, 0, "/Logger/Data Dir", str, &size, TID_STRING, TRUE); 00227 if (str[0] != 0) 00228 if (str[strlen(str) - 1] != DIR_SEPARATOR) 00229 strcat(str, DIR_SEPARATOR_STR); 00230 strcat(str, "runlog.txt"); 00231 00232 f = fopen(str, "a"); 00233 00234 time(&now); 00235 strcpy(str, ctime(&now)); 00236 str[10] = 0; 00237 00238 fprintf(f, "%s\t%3d\t", str, runinfo.run_number); 00239 00240 strcpy(str, runinfo.start_time); 00241 str[19] = 0; 00242 fprintf(f, "%s\t", str + 11); 00243 00244 strcpy(str, ctime(&now)); 00245 str[19] = 0; 00246 fprintf(f, "%s\t", str + 11); 00247 00248 size = sizeof(n); 00249 db_get_value(hDB, 0, "/Equipment/Trigger/Statistics/Events sent", &n, &size, 00250 TID_DOUBLE, TRUE); 00251 00252 fprintf(f, "%5.1lfk\t", n / 1000); 00253 fprintf(f, "%s\n", exp_param.comment); 00254 00255 fclose(f); 00256 } 00257 00258 return CM_SUCCESS; 00259 }
INT analyzer_exit | ( | void | ) |
INT analyzer_init | ( | void | ) |
Definition at line 137 of file analyzer.c.
00138 { 00139 HNDLE hDB, hKey; 00140 char str[80]; 00141 00142 RUNINFO_STR(runinfo_str); 00143 EXP_PARAM_STR(exp_param_str); 00144 GLOBAL_PARAM_STR(global_param_str); 00145 TRIGGER_SETTINGS_STR(trigger_settings_str); 00146 00147 /* open ODB structures */ 00148 cm_get_experiment_database(&hDB, NULL); 00149 db_create_record(hDB, 0, "/Runinfo", strcomb((const char **)runinfo_str)); 00150 db_find_key(hDB, 0, "/Runinfo", &hKey); 00151 if (db_open_record(hDB, hKey, &runinfo, sizeof(runinfo), MODE_READ, NULL, NULL) != 00152 DB_SUCCESS) { 00153 cm_msg(MERROR, "analyzer_init", "Cannot open \"/Runinfo\" tree in ODB"); 00154 return 0; 00155 } 00156 00157 db_create_record(hDB, 0, "/Experiment/Run Parameters", strcomb((const char **)exp_param_str)); 00158 db_find_key(hDB, 0, "/Experiment/Run Parameters", &hKey); 00159 if (db_open_record(hDB, hKey, &exp_param, sizeof(exp_param), MODE_READ, NULL, NULL) != 00160 DB_SUCCESS) { 00161 cm_msg(MERROR, "analyzer_init", 00162 "Cannot open \"/Experiment/Run Parameters\" tree in ODB"); 00163 return 0; 00164 } 00165 00166 sprintf(str, "/%s/Parameters/Global", analyzer_name); 00167 db_create_record(hDB, 0, str, strcomb((const char **)global_param_str)); 00168 db_find_key(hDB, 0, str, &hKey); 00169 if (db_open_record 00170 (hDB, hKey, &global_param, sizeof(global_param), MODE_READ, NULL, 00171 NULL) != DB_SUCCESS) { 00172 cm_msg(MERROR, "analyzer_init", "Cannot open \"%s\" tree in ODB", str); 00173 return 0; 00174 } 00175 00176 db_create_record(hDB, 0, "/Equipment/Trigger/Settings", strcomb((const char **)trigger_settings_str)); 00177 db_find_key(hDB, 0, "/Equipment/Trigger/Settings", &hKey); 00178 00179 if (db_open_record 00180 (hDB, hKey, &trigger_settings, sizeof(trigger_settings), MODE_READ, NULL, 00181 NULL) != DB_SUCCESS) { 00182 cm_msg(MERROR, "analyzer_init", 00183 "Cannot open \"/Equipment/Trigger/Settings\" tree in ODB"); 00184 return 0; 00185 } 00186 00187 return SUCCESS; 00188 }
INT analyzer_loop | ( | void | ) |
ASUM_BANK_STR | ( | asum_bank_str | ) |
Definition at line 48 of file adccalib.c.
Initial value:
{ {"SCLR", TID_DWORD, N_ADC, NULL}, {"ACUM", TID_DOUBLE, N_ADC, NULL}, {""}, }
Definition at line 88 of file analyzer.c.
Initial value:
{ {"ADC0", TID_WORD, N_ADC, NULL}, {"TDC0", TID_WORD, N_TDC, NULL}, {"CADC", TID_FLOAT, N_ADC, NULL}, {"ASUM", TID_STRUCT, sizeof(ASUM_BANK), asum_bank_str}, {""}, }
Definition at line 75 of file analyzer.c.
Definition at line 99 of file analyzer.c.
Definition at line 43 of file analyzer.c.
char* analyzer_name = "Analyzer" |
Definition at line 40 of file analyzer.c.
Definition at line 51 of file analyzer.c.
Referenced by ana_end_of_run(), analyzer_init(), and frontend_init().
Definition at line 46 of file analyzer.c.
Definition at line 49 of file analyzer.c.
Referenced by ana_end_of_run(), analyzer_init(), and show_status_page().
Initial value:
{ &adc_calib_module, &adc_summing_module, NULL }
Definition at line 65 of file analyzer.c.