00001 #ifndef RC_CONFIG_HH
00002 #define RC_CONFIG_HH
00003
00004 #include <sys/types.h>
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <stdio.h>
00019 #include <string.h>
00020
00021 #define CONFIG_VERSION 902
00022 #define RC_PARAM_FILE_BASE_PATH "/RTS/conf/handler/"
00023 #define TRG_CONFIG_FILE_NAME ""
00024 #define DAQ_CONFIG_FILE_NAME ""
00025 #define SC_CONFIG_FILE_NAME ""
00026 #define L3_CONFIG_FILE_NAME ""
00027
00028 #define TRG_BASE_PATH "/home/startrg/trg/handler/conf"
00029 #define DAQ_BASE_PATH "/RTS/conf/handler"
00030
00031 #define MAX_TRG_DICT_ENTRIES 200
00032 #define MAX_L0_DSM 16
00033 #define MAX_TW 100
00034 #define MAX_NUMBER_L1_ALG 20
00035 #define MAX_NUMBER_L2_ALG 20
00036 #define MAX_L1_TRG 10
00037 #define MAX_L2_TRG 10
00038 #define MAX_TRG_ALG_PARAM 10
00039 #define N_SPEC_TRG 20
00040 #define GL3_ALG_MAX_NUM 20
00041
00042 #define MAX_ID 16
00043 #define MAX_SUB 4
00044 #define MAX_INST 100
00045 #define MAX_NODES 200
00046 #define MAX_THREADS 400
00047
00048 #define MAX_STR_LEN 40
00049
00050 #define RTS_STAT_TOKENS_DONE 8
00051 #define RTS_STAT_FORCE 9
00052 #define RTS_STAT_REQUEST 10
00053
00054 #define RTS_ICCP_MSG_LEN 120
00055
00056 #define TRG_INVALID_WORD 0xffffffff
00057
00058 #define RTS_STARTRUN_FLAG 1
00059 #define RTS_STOPRUN_FLAG 2
00060 #define RTS_SENDCONFIG_FLAG 4
00061
00062
00063
00064
00065 struct TASK
00066 {
00067 u_short node;
00068 u_char task;
00069 u_char inrun;
00070 u_char stoprun;
00071 u_char start_order;
00072 u_char typically_inrun;
00073 u_char res2;
00074 };
00075
00076 struct SUBSYS_TASKS
00077 {
00078 TASK nodes[MAX_NODES];
00079 };
00080
00081
00082
00083
00084 struct GLB_CAL
00085 {
00086 float t0;
00087 float driftVelocity;
00088 float driftLength;
00089 float szError;
00090 float xyError;
00091 float xVertex;
00092 float yVertex;
00093 float dxVertex;
00094 float dyVertex;
00095 };
00096
00097 struct GLB_SETUP
00098 {
00099 char filename_base[MAX_STR_LEN];
00100 char GLB_SETUP_name[MAX_STR_LEN];
00101 char TRG_SETUP_name[MAX_STR_LEN];
00102 char DAQ_SETUP_name[MAX_STR_LEN];
00103 char L3_SETUP_name[MAX_STR_LEN];
00104 char SC_SETUP_name[MAX_STR_LEN];
00105 };
00106
00107 struct GLB_RUN
00108 {
00109 int run_number;
00110 int run_type;
00111 GLB_CAL cal;
00112 char GLB_SETUP_name[MAX_STR_LEN];
00113 float bField;
00114 };
00115
00116
00117
00118
00119
00120 struct TRG_DICT_ENTRY
00121 {
00122 char field[MAX_STR_LEN];
00123 int objectIdx;
00124 int registerIdx;
00125 char label[MAX_STR_LEN];
00126 };
00127
00128 struct TRG_DICT
00129 {
00130 char name[MAX_STR_LEN];
00131 TRG_DICT_ENTRY entry[MAX_TRG_DICT_ENTRIES];
00132 char comment[2000];
00133 };
00134
00135
00136 struct TW_DEF
00137 {
00138 char trgLabel[MAX_STR_LEN];
00139 int TW;
00140 int AW;
00141 int PS;
00142 int nPre;
00143 int nPost;
00144 int off;
00145 int on;
00146 int enabled;
00147 };
00148
00149 struct TRG_ALG
00150 {
00151 int trgId;
00152 int preScale;
00153 int inputParam[MAX_TRG_ALG_PARAM];
00154 int threshold[MAX_TRG_ALG_PARAM];
00155 };
00156
00157 struct TCD_SETUP
00158 {
00159 int tcdId;
00160 int trgCmd;
00161 int seconds;
00162 };
00163
00164 struct TRG_SETUP
00165 {
00166 char name[MAX_STR_LEN];
00167 char TIER1_name[MAX_STR_LEN];
00168 char TRG_DICT_name[MAX_STR_LEN];
00169
00170 int L1_DSM_Reg_Data_values[MAX_L0_DSM][32];
00171 int DC_DSM_Reg_Data_values[MAX_L0_DSM][32];
00172 int CTB_DSM_Reg_Data_values[MAX_L0_DSM][32];
00173 int BEMC_DSM_Reg_Data_values[MAX_L0_DSM][32];
00174 int MWC_DSM_Reg_Data_values[MAX_L0_DSM][32];
00175
00176 TRG_ALG L1trg[MAX_L1_TRG];
00177 TRG_ALG L2trg[MAX_L2_TRG];
00178
00179 TCD_SETUP special[N_SPEC_TRG];
00180
00181 TW_DEF tw_def[MAX_TW];
00182 };
00183
00184 struct TRG_RUN
00185 {
00186
00187 int configOpt;
00188
00189 int l1LogOpt;
00190 int l1LogThr;
00191
00192 int dcLogOpt;
00193 int dcLogThr;
00194
00195 int ctbLogOpt;
00196 int ctbLogThr;
00197
00198 int bemcLogOpt;
00199 int bemcLogThr;
00200
00201 int l2LogOpt;
00202 int l2LogThr;
00203
00204 int mwcLogOpt;
00205 int mwcLogThr;
00206
00207 int rccLogOpt;
00208 int rccLogThr;
00209
00210 int tcdLogThr;
00211
00212 int nTokenReturn;
00213 int maxTknInSystem;
00214 int minTknInSystem;
00215 int tokenMod;
00216 int tokenTimer;
00217
00218 int clockSource;
00219 int numClockTicks;
00220 int stopRunOnError;
00221
00222 int l2DataWrite;
00223 int dataWriteTimer;
00224 int everyNEvents;
00225 int nAbort;
00226 };
00227
00228
00229
00230
00231
00232 struct DAQ_DAQ
00233 {
00234 int force_reset;
00235 int evp_suppression;
00236 int event_suppression;
00237 int evb_log_level;
00238 int myri_log_level;
00239 int bb_log_level;
00240 int gb_log_level;
00241 int destination;
00242 int test_run;
00243 int write_pedestals;
00244 int force_det_announce;
00245 };
00246
00247 struct DAQ_DET_SETUP
00248 {
00249 int ped_mode;
00250 int gain_mode;
00251 int analysis;
00252 int default_format;
00253
00254 u_char asic_seq_hi;
00255 u_char asic_seq_lo;
00256 u_char asic_thr_hi;
00257 u_char asic_thr_lo;
00258 int time_bin_lo;
00259 int time_bin_hi;
00260 int clust_charge_lo;
00261 };
00262
00263 struct DAQ_SUBDET
00264 {
00265 u_int rb_mask;
00266 };
00267
00268 struct DAQ_DET
00269 {
00270 int log_level;
00271 int use_sl3;
00272
00273 int res1;
00274 int res2;
00275 int res3;
00276 int res4;
00277
00278 DAQ_SUBDET sub[24];
00279 };
00280
00281
00282
00283 struct DAQ_SETUP
00284 {
00285 char DAQ_SETUP_name[MAX_STR_LEN];
00286 int run_type;
00287
00288 DAQ_DET_SETUP detectors[MAX_ID];
00289 };
00290
00291 struct DAQ_RUN
00292 {
00293 DAQ_DAQ daq;
00294
00295 DAQ_DET detectors[MAX_ID];
00296 };
00297
00298
00299
00300
00301 struct L3_GL3_RUN
00302 {
00303 int write_daq;
00304 int write_local;
00305 int log_level;
00306
00307 int accept_triggered;
00308 int accept_automatic;
00309 };
00310
00311 struct L3_GL3_SETUP
00312 {
00313 int formats;
00314 int formats_local;
00315 };
00316
00317 struct L3_ALGORITHMS
00318 {
00319 int alg_id;
00320 int preScale;
00321 int postScale;
00322 int GI1;
00323 int GI2;
00324 int GI3;
00325 int GI4;
00326 int GI5;
00327 float GF1;
00328 float GF2;
00329 float GF3;
00330 float GF4;
00331 float GF5;
00332 };
00333
00334 struct L3_SL3_SETUP
00335 {
00336 int algorithm;
00337 int version;
00338
00339 short minHitsPerTrack;
00340 short nEta;
00341 short nPhi;
00342 short padding;
00343 float maxChi2Primary;
00344 short rowInnerMost;
00345 short rowOuterMost;
00346 short rowStart;
00347 short rowEnd;
00348 float hitChi2Cut;
00349 float goodHitChi2;
00350 float trackChi2Cut;
00351 float deta;
00352 float dphi;
00353 float ptMinHelixFit;
00354 float maxTime;
00355
00356 int TX0;
00357 int TX1;
00358 int TX2;
00359 int TX3;
00360 int TX4;
00361 int TX5;
00362 int TX6;
00363 int TX7;
00364 int TX8;
00365 int TX9;
00366 };
00367
00368 struct L3_SL3_RUN
00369 {
00370 int log_level;
00371 };
00372
00373 struct L3_SETUP
00374 {
00375 char name[MAX_STR_LEN];
00376 L3_GL3_SETUP gl3;
00377 L3_ALGORITHMS gl3_algorithms[GL3_ALG_MAX_NUM];
00378 L3_SL3_SETUP sl3;
00379 };
00380
00381
00382 struct L3_RUN
00383 {
00384 L3_GL3_RUN gl3;
00385 L3_SL3_RUN sl3;
00386 };
00387
00388 struct SC_SETUP {
00389 char name[MAX_STR_LEN];
00390 };
00391 struct SC_RUN
00392 {
00393 int reserved;
00394 };
00395
00396
00397
00398
00399
00400 struct STAR_CFG
00401 {
00402 SUBSYS_TASKS subsys_tasks;
00403
00404 GLB_SETUP glb_setup;
00405 GLB_RUN glb_run;
00406
00407 TRG_DICT trg_dict;
00408 TRG_SETUP trg_setup;
00409 TRG_RUN trg_run;
00410
00411 DAQ_SETUP daq_setup;
00412 DAQ_RUN daq_run;
00413
00414 L3_SETUP l3_setup;
00415 L3_RUN l3_run;
00416
00417 SC_SETUP sc_setup;
00418 SC_RUN sc_run;
00419 };
00420
00421
00422
00423
00424
00425 struct TRG_CFG
00426 {
00427 SUBSYS_TASKS subsys_tasks;
00428 GLB_RUN glb_run;
00429 GLB_SETUP glb_setup;
00430 TRG_RUN trg_run;
00431 TRG_SETUP trg_setup;
00432 };
00433
00434
00435
00436
00437
00438 struct DAQ_CFG
00439 {
00440 SUBSYS_TASKS subsys_tasks;
00441 GLB_RUN glb_run;
00442 GLB_SETUP glb_setup;
00443 DAQ_RUN daq_run;
00444 DAQ_SETUP daq_setup;
00445 };
00446
00447
00448
00449
00450
00451 struct L3_CFG
00452 {
00453 SUBSYS_TASKS subsys_tasks;
00454 GLB_RUN glb_run;
00455 GLB_SETUP glb_setup;
00456 L3_RUN l3_run;
00457 L3_SETUP l3_setup;
00458 };
00459
00460
00461
00462
00463
00464 struct SC_CFG
00465 {
00466 SUBSYS_TASKS subsys_tasks;
00467 GLB_RUN glb_run;
00468 GLB_SETUP glb_setup;
00469 SC_RUN sc_run;
00470 SC_SETUP sc_setup;
00471 };
00472 #endif
00473
00474
00475
00476
00477