00001 #ifndef _RTS_MONITOR_H_
00002 #define _RTS_MONITOR_H_
00003
00004
00005 #include <RC_Config.h>
00006
00007
00008 #ifndef SHM_SHARE_MMU
00009 #define SHM_SHARE_MMU 0
00010 #endif
00011
00012
00013
00014
00015 #define RTS_MON_SHM_KEY 0xffab0000
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #define RTS_MON_PORT 8100
00026
00027
00028 #ifdef RTS_PROJECT_PP
00029 #define RTS_MON_HOST "130.199.91.18"
00030 #else
00031 #ifdef RTS_DAQMAN
00032 #define RTS_MON_HOST RTS_DAQMAN
00033 #else
00034 #define RTS_MON_HOST "boothost"
00035 #endif
00036 #endif
00037
00038
00039 #define RTS_MON_FILE "/RTS/log/monServer.dta"
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 #define RTS_MON_VERSION_OLD 0x000000003
00054 #define RTS_MON_VERSION 0x000000003
00055
00056 #define RTS_MON_VERSION_X_FLAG 0x10000000
00057 #define RTS_MON_VERSION_X (RTS_MON_VERSION_X_FLAG | RTS_MON_VERSION)
00058
00059
00060 #define RTS_MON_MAX_NODES 256
00061
00062 #define RTS_MON_USER_WORDS 100
00063 #define RTS_MON_SYS_WORDS 17
00064
00065 struct rtsMonRequired
00066 {
00067 unsigned int size ;
00068 unsigned int node ;
00069 unsigned int task ;
00070 unsigned int version ;
00071 unsigned int tim ;
00072 unsigned int state ;
00073 };
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 struct rtsMonHeader {
00087 unsigned int size ;
00088 unsigned int node ;
00089 unsigned int task ;
00090 unsigned int version ;
00091 unsigned int tim ;
00092 unsigned int state ;
00093 unsigned int tknIn ;
00094 unsigned int tknOut ;
00095 unsigned int tknBad ;
00096 unsigned int couEvtsIn ;
00097 unsigned int couEvtsRun ;
00098 unsigned int couEvtsAll ;
00099 unsigned int couEvtsBad ;
00100 unsigned int busy ;
00101 unsigned int evtsSec ;
00102 unsigned int kbSecEvb ;
00103 unsigned int kbSecAux ;
00104 };
00105
00106 struct rtsMonStruct {
00107
00108 unsigned int size ;
00109 unsigned int node ;
00110 unsigned int task ;
00111 unsigned int version ;
00112 unsigned int tim ;
00113 unsigned int state ;
00114
00115 unsigned int tknIn ;
00116 unsigned int tknOut ;
00117 unsigned int tknBad ;
00118 unsigned int couEvtsIn ;
00119 unsigned int couEvtsRun ;
00120 unsigned int couEvtsAll ;
00121 unsigned int couEvtsBad ;
00122 unsigned int busy ;
00123 unsigned int evtsSec ;
00124 unsigned int kbSecEvb ;
00125 unsigned int kbSecAux ;
00126
00127 unsigned int user[RTS_MON_USER_WORDS] ;
00128 } ;
00129
00130
00131
00132 #define RTS_MON_DATA_SIZE_V3 (sizeof(struct rtsMonStruct)*RTS_MON_MAX_NODES)
00133
00134
00135 #define RTS_MON_PACKET_SIZE (10*1024)
00136 #define RTS_MON_DATA_SIZE (RTS_MON_PACKET_SIZE*RTS_MON_MAX_NODES)
00137
00138
00139
00140
00141
00142
00143
00144 #define RTS_MON_NAME_MAX 12
00145 #define RTS_MON_VAL_MAX 24
00146
00147
00148
00149 #define RTS_MON_NA 0xFFFFFFFF
00150 #define RTS_MON_NA_STRING "N.A."
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 struct rtsMonGB {
00163 struct {
00164 char name[32] ;
00165 u_int off_id ;
00166 u_int fired ;
00167 u_int rate ;
00168 u_int l3_sent ;
00169 u_int aborted_gb ;
00170 u_int aborted_l3 ;
00171 u_int aborted_l25 ;
00172 u_int err ;
00173 u_int built ;
00174 u_int xpress ;
00175 } trgs[TRIGGERS_MAX+1] ;
00176 } ;
00177
00178
00179 struct rtsMonTCD {
00180 u_int deadtime[32] ;
00181 } ;
00182
00183
00184 struct rtsMonSCA {
00185 struct {
00186 char name[32] ;
00187 u_int rate ;
00188 } trgs[TRIGGERS_MAX] ;
00189
00190 } ;
00191
00192 struct rtsMonL1Counters {
00193 struct {
00194
00195 u_int enabled;
00196 u_int rate;
00197 u_int deadtime;
00198 } trgs[TRIGGERS_MAX+1];
00199 u_int detector_deadtime[16];
00200 };
00201
00202 struct rtsMonEVB {
00203 u_int mb_run ;
00204 u_int gb_free ;
00205 u_int gb_all ;
00206
00207
00208 u_int run_number ;
00209 struct rtsMonGB gb ;
00210 } ;
00211
00212 struct rtsMonEVB_supertask {
00213 u_int mon[RTS_MON_SYS_WORDS];
00214
00215 u_int mb_run;
00216 u_int gb_free;
00217 u_int gb_all;
00218
00219
00220 u_int files_sent;
00221 u_int files_waiting;
00222
00223
00224 struct {
00225 u_int off_id ;
00226
00227 u_int fired ;
00228 u_int rate ;
00229 u_int built ;
00230
00231 u_int aborted_l25 ;
00232 u_int err ;
00233 u_int spurious;
00234
00235 u_int stream;
00236
00237 } trgs[TRIGGERS_MAX+1] ;
00238 };
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250 struct rtsMonRCF {
00251 char type[20];
00252 int curr_run;
00253 int curr_idx;
00254 struct {
00255 u_int run ;
00256 u_int mb_done ;
00257 u_int mb_all ;
00258 u_int seq_done ;
00259 u_int seq_all ;
00260 } runs[11] ;
00261
00262
00263
00264
00265
00266
00267 };
00268
00269
00270
00271
00272
00273
00274
00275
00276 struct rtsMonRC {
00277 u_int run ;
00278 u_int type ;
00279 char config[128] ;
00280 char dest[64] ;
00281 u_int t_start ;
00282 u_int t_end ;
00283 u_int accepted ;
00284 u_int node_count ;
00285 u_short err_node ;
00286 u_short n_err_node;
00287 struct {
00288 u_short node ;
00289 u_short task ;
00290 u_int state ;
00291 } nodes[256] ;
00292 struct {
00293 char name[32] ;
00294 u_int off_id ;
00295 } trgs[TRIGGERS_MAX] ;
00296 } ;
00297
00298
00299 struct rtsMonL1 {
00300 u_int late_events ;
00301 u_int max_us ;
00302 struct {
00303 u_int off_id ;
00304 u_int accepted ;
00305 u_int rate ;
00306 u_int aborted ;
00307 } trgs[TRIGGERS_MAX+1] ;
00308 } ;
00309
00310 struct rtsMonDET {
00311 u_int val_rbs ;
00312 u_int cfg_rbs ;
00313 u_int buffs ;
00314 u_int evtsSpur ;
00315 u_char rb_status[12] ;
00316 u_int dbg_ctrs[10] ;
00317 } ;
00318
00319
00320
00322
00324
00325
00326
00327
00328
00329 struct rts2011MonL0 {
00330 rtsMonHeader head;
00331
00332 struct {
00333 u_int off_id;
00334 u_int fired;
00335 u_int rate;
00336 } trg[TRIGGERS_MAX + 1];
00337 };
00338
00339
00340
00341
00342
00343 struct rts2011MonL1 {
00344 rtsMonHeader head;
00345
00346 struct {
00347 u_int rate;
00348 u_int deadtime;
00349 } scaler[TRIGGERS_MAX + 1];
00350
00351 u_int detector_dead[16];
00352 };
00353
00354
00355
00356
00357 struct rts2011EvbxSuperMon {
00358 rtsMonHeader head;
00359
00360
00361 u_int mb_run;
00362 u_int gb_free;
00363 u_int gb_all;
00364
00365
00366 u_int files_sent;
00367 u_int files_waiting;
00368
00369
00370 struct {
00371 u_int off_id ;
00372
00373 u_int fired ;
00374 u_int fired_rate;
00375
00376 u_int built ;
00377 u_int built_rate;
00378
00379 u_int l1_abort;
00380 u_int l1_abort_rate;
00381
00382 u_int l2_abort;
00383 u_int l2_abort_rate;
00384
00385 u_int l3_abort;
00386 u_int l3_abort_rate;
00387
00388 u_int err;
00389 u_int err_rate;
00390
00391 u_int stream;
00392 } trgs[TRIGGERS_MAX+1] ;
00393
00394 u_int detectorErrors[32];
00395 };
00396
00397
00398 struct rtsMonSC {
00399 rtsMonHeader head ;
00400
00401 int rich_scalers[32] ;
00402 float mag_field ;
00403
00404 short blu_ions ;
00405 short blu_energy ;
00406 char blu_status[32] ;
00407
00408 short yel_ions ;
00409 short yel_energy ;
00410 char yel_status[32] ;
00411
00412 char mcr_vote[32] ;
00413
00414 u_int phys_on ;
00415 u_int phys_off ;
00416 };
00417
00418
00419 #endif