Skip to content

Commit

Permalink
Disable DAQ logging when compiling outside of local domain
Browse files Browse the repository at this point in the history
  • Loading branch information
jml985 committed Jan 31, 2024
1 parent 270fafc commit b573b1d
Show file tree
Hide file tree
Showing 19 changed files with 359 additions and 134 deletions.
45 changes: 9 additions & 36 deletions StRoot/RTS/include/rtsLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,41 +93,14 @@ void rtsLogAddJmlFile (char *fname);



/*Tonko: not used Special (mis)handling for STAR Offline Code
#ifdef __ROOT__
#define RTS_DISABLE_LOG
#endif
*/

#ifdef RTS_DISABLE_LOG

#define RTS_ASSERT(expr) assert(expr)


#define LOG(SEV,STRING,ARGS...) \
do { \
const char *const yada = SEV ; \
if((*yada == 'E')) { \
fprintf(stderr,"" ANSI_RED "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\
} \
else if((*yada == 'C')) { \
fprintf(stderr,"" ANSI_RED "" ANSI_REVERSE "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\
} \
else if((*yada == 'I')) { \
fprintf(stderr,"" ANSI_BLUE "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\
} \
else if((*yada == 'T')) { \
fprintf(stderr,"" ANSI_GREEN "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\
} \
else if((*yada == 'W')) { \
fprintf(stderr,"" ANSI_CYAN "" ANSI_BOLD "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\
} \
else if((*yada == 'O')) { \
fprintf(stderr,"" ANSI_BLUE "" ANSI_REVERSE "RTS_" SEV ": " __FILE__ " [line %d]: " STRING "" ANSI_RESET "\n" , __LINE__ , ##ARGS) ;\
} \
} while(0) \

#ifndef RTS_ENABLE_LOG

#define RTS_ASSERT(expr) assert(expr)
#define LOG(SEV,STRING,ARGS...)
#define rtsLogUnix_v(str, ...)
#define rtsLogAddCmd(x)


// the following become noops...
Expand All @@ -136,7 +109,7 @@ void rtsLogAddJmlFile (char *fname);
#define rtsLogLevelInt(x)
#define rtsLogOutput(x)

#else /* RTS_DISABLE_LOG */
#else /* RTS_ENABLE_LOG */


#ifdef __GNUC__
Expand Down Expand Up @@ -270,12 +243,12 @@ INLINE_HACK void rtsLogLevel(const char *level)



#endif
#endif /* RTS_LOG_COLORED */

#endif
#endif /* __vxworks */


#endif /* RTS_DISABLE_LOG */
#endif /* RTS_ENABLE_LOG */

#ifdef __cplusplus
}
Expand Down
2 changes: 2 additions & 0 deletions StRoot/RTS/src/DAQ_FCS/fcs_data_c.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ u_int fcs_data_c::run_type ;

// for ZS
float fcs_data_c::n_sigma ;
float fcs_data_c::n_sigma_hcal ;
float fcs_data_c::n_sigma_epd ;
short fcs_data_c::n_pre ;
short fcs_data_c::n_post ;
Expand Down Expand Up @@ -267,6 +268,7 @@ int fcs_data_c::zs_start(u_short *buff)
float sigma ;

if(hdr_det==2) sigma = n_sigma_epd ;
else if(hdr_det==1) sigma = n_sigma_hcal ;
else sigma = n_sigma ;

// trigger channels are special so figure this out
Expand Down
2 changes: 2 additions & 0 deletions StRoot/RTS/src/DAQ_FCS/fcs_data_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class fcs_data_c {
run_number = 0 ;

n_sigma = 4.0 ;
n_sigma_hcal = 4.0 ;
n_sigma_epd = 4.0 ;
n_pre = 8 ;
n_post = 8 ;
Expand Down Expand Up @@ -235,6 +236,7 @@ class fcs_data_c {
// for ZS
static float n_sigma ;
static float n_sigma_epd ;
static float n_sigma_hcal ;
static short n_pre ;
static short n_post ;
static short n_cou ;
Expand Down
9 changes: 6 additions & 3 deletions StRoot/RTS/src/DAQ_ITPC/daq_itpc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ daq_itpc::daq_itpc(daqReader *rts_caller)

it23 = 0 ; // assume we won't use it
online = 0 ;
mode = 0 ;

// it23 = new itpc23 ;
// it23->no_cld = 1 ;
// it23->log_level = 2 ;

memset(fcf,0,sizeof(fcf)) ;
fcf_det_type = 1 ; // ITPC
Expand Down Expand Up @@ -535,6 +533,7 @@ daq_dta *daq_itpc::handle_sampa(int sec, int rdo, int in_adc)
it23->run_type = 3 ; // NO CLUSTER FINDER PLEASE
it23->no_cld = 1 ;
it23->log_level = 0 ;
it23->mode = mode ;
}
it23->data_c = &sampa_c ;

Expand All @@ -559,6 +558,10 @@ daq_dta *daq_itpc::handle_sampa(int sec, int rdo, int in_adc)
//LOG(WARN,"S%02d:%d: rdo_fmt %d -- scan will fail",s,r,rdo_fmt) ;
it23->set_rdo(s,r) ;
ret = it23->rdo_scan((char *)dta,words) ;

if((it23->err || ret) && mode) {
LOG(ERR,"S%02d:%d: rdo_scan 0x%X, err 0x%X, words %d",s,r,ret,it23->err,words) ;
}
}
else {
ret = it->rdo_scan_top(dta,words) ;
Expand Down
1 change: 1 addition & 0 deletions StRoot/RTS/src/DAQ_ITPC/daq_itpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class daq_itpc : public daq_det {
static int no_sw16 ;

int online ;
int mode ;
int rdo_fmt ;
} ;

Expand Down
12 changes: 6 additions & 6 deletions StRoot/RTS/src/DAQ_ITPC/itpcFCF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ int itpc_fcf_c::do_blobs_stage2(int row)

int b_ix = blob_ix[ix] ;

LOG(TERR," using bix %d %d",ix,b_ix) ;
//LOG(TERR," using bix %d %d",ix,b_ix) ;
if(b_ix != ix) {
LOG(WARN,"Can't be: %d %d, RP %d:%d",b_ix,ix,row,p) ;
}
Expand Down Expand Up @@ -1347,7 +1347,7 @@ int itpc_fcf_c::do_blobs_stage2(int row)



#if 1
#if 0
LOG(TERR,"Blobs OK %d/%d in row %d",blob_ok,blob_cou,row) ;

for(int i=0;i<blob_cou;i++) {
Expand Down Expand Up @@ -1975,25 +1975,25 @@ int itpc_fcf_c::do_row_check(int row)
}

for(int i=1;i<blob_cou;i++) {
LOG(TERR,"blob_ix[%d] = %d",i,blob_ix[i]) ;
LOG(DBG,"blob_ix[%d] = %d",i,blob_ix[i]) ;

}

for(int i=1;i<blob_cou;i++) {
if(blob[i].cou) {
LOG(TERR," Blob %d: %d",i,blob[i].cou) ;
LOG(DBG," Blob %d: %d",i,blob[i].cou) ;
max_ix++ ;
}
}

for(int i=1;i<max_ix;i++) {
if(blob[i].merges) {
LOG(TERR,"blob %d: merged %d",i,blob[i].merges) ;
LOG(DBG,"blob %d: merged %d",i,blob[i].merges) ;
}
}


LOG(TERR,"Final blob count %d/%d",max_ix,blob_cou) ;
LOG(DBG,"Final blob count %d/%d",max_ix,blob_cou) ;

return 0 ;

Expand Down
14 changes: 14 additions & 0 deletions StRoot/RTS/src/DAQ_STGC/stgc_data_c.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,18 @@ int stgc_data_c::event_0001()

feb_id = dd>>29 ;

#if 0
if(rdo1==2) {
switch(feb_id) {
case 1 :
case 3 :
case 5 :
LOG(WARN,"%d: FEB %d\n",rdo1,feb_id) ;
break ;
}
}
#endif

datum_ix++ ;


Expand Down Expand Up @@ -732,6 +744,8 @@ int stgc_data_c::event()
}
else {

// printf("%d: ROD %d, FEB %d\n",rdo1,rod_id,feb_id) ;

vmm.feb_vmm = ((feb_id-1)<<2)|(vmm_id-4) ;
vmm.ch = channel ;
vmm.adc = pdo ;
Expand Down
Loading

0 comments on commit b573b1d

Please sign in to comment.