Skip to content

Commit

Permalink
Merge branch 'main' into TFG_Export_030224
Browse files Browse the repository at this point in the history
  • Loading branch information
fisyak authored Mar 4, 2024
2 parents 6cf9189 + 2ffb8a4 commit b73315b
Show file tree
Hide file tree
Showing 32 changed files with 517 additions and 404 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
3 changes: 2 additions & 1 deletion StRoot/RTS/src/LOG/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include ../rtsmakefile.def
include ../rtsplus.def


# zap LDLIBS
LDLIBS =

Expand All @@ -28,7 +29,7 @@ rtsLog.o : rtsLog.C

rtsLog: rtsLog.o rtsLogUnix.o
$(CXX) $(CXXFLAGS) rtsLogUnix.o rtsLog.o -o rtsLog

#operDisplay.sh:


Expand Down
2 changes: 1 addition & 1 deletion StRoot/RTS/src/LOG/rtsLog.C
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char *argv[])
use_stdin = 0 ;

rtsLogLevel(DBG) ;
rtsLogOutput(RTS_LOG_NET) ;
//rtsLogOutput(RTS_LOG_NET) ;

memset(logstr,0,sizeof(logstr)) ;

Expand Down
34 changes: 30 additions & 4 deletions StRoot/RTS/src/LOG/rtsLogUnix.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,30 @@ extern "C" {
volatile int tonkoLogLevel = 2 ;






#ifdef RTS_ENABLE_LOG
#warning "DAQ logging is enabled"
#ifdef RTS_LOG_DEFAULT_NET
#warning "DAQ logging defaults to daqman"
#else
#warning "DAQ logging defaults to STDERR"
#endif /* RTS_LOG_DEFAULT_NET */
#else
#warning "DAQ logging is disabled"
#endif /* RTS_ENABLE_LOG */


#ifdef RTS_ENABLE_LOG

#ifdef RTS_LOG_DEFAULT_NET
static int output_flag = RTS_LOG_NET ;
#else
static int output_flag = RTS_LOG_STDERR ;
#endif

static const char *getCmd(void) ;
static int odesc = -1 ;
static int handchange ;
Expand All @@ -42,7 +66,7 @@ static char servER[80] = RTS_LOG_HOST ;
#endif

static int port = RTS_LOG_PORT ;
static int output_flag = RTS_LOG_NET ;

static char cmd[1024] ;

/*
Expand Down Expand Up @@ -113,7 +137,6 @@ void rtsLogAddJmlFile (char *fname)
jml_fname = _g_fname;
}


int rtsLogUnix_v(const char *str, ...)
{
/* common to all threads */
Expand Down Expand Up @@ -328,8 +351,6 @@ int rtsLogUnix_v(const char *str, ...)
return 0 ;
}



static const char *getCmd(void)
{

Expand Down Expand Up @@ -370,6 +391,11 @@ static const char *getCmd(void)
#endif
}


#endif



#ifdef __cplusplus
}
#endif
Expand Down
36 changes: 33 additions & 3 deletions StRoot/RTS/src/rtsmakefile.def
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ifeq ($(HOST_NAME),daqman.starp.bnl.gov)
endif


HOSTDOMAIN = $(shell hostname -d)

# jml... TARGET_CPU_STRING to mean the full string...

# go from "uname" to gcc -mcpu=TARGET_CPU variant
Expand Down Expand Up @@ -373,14 +375,38 @@ DEFINES = -D_REENTRANT ${RTS_DAQMAN_FLAGS} -DRTS_HOST_NAME=\"${HOST_NAME}\" -DTA


# Set strict errors in LINUX
BASEFLAGS = -O3 -Wall -Werror -Wno-error=strict-overflow -Wno-error=maybe-uninitialized -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS}
BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=maybe-uninitialized -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS}


#-O3
ifneq (${TARGET_SYSTEM}, LINUX)
BASEFLAGS = -O3 -Wall -pipe -fverbose-asm ${HOSTFLAGS}
BASEFLAGS = -Wall -pipe -fverbose-asm ${HOSTFLAGS}
endif

ifeq (${HOST_NAME},xvme01.daq.bnl.local)
BASEFLAGS = -O3 -Wall -Werror -Wno-error=strict-overflow -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS}
BASEFLAGS = -O3 -Wall -Wno-error=strict-overflow -Wno-error=unused-label -Wno-error=unused-value -Wno-error=unused-variable -Wno-error=unused-function -Wno-unused-but-set-variable -pipe -fverbose-asm ${HOSTFLAGS}
endif

# if not compiling on one of the standard domains, then
# use the default log destination of std_err
# if compiling on local domain, write to daqman
#
# if compiling somewhere else for writing to daqman these defines
ifeq (${HOSTDOMAIN},starp.bnl.gov)
DEFINES += -DRTS_LOG_DEFAULT_NET
DEFINES += -DRTS_ENABLE_LOG
else ifeq (${HOSTDOMAIN},daq.bnl.local)
DEFINES += -DRTS_LOG_DEFAULT_NET
DEFINES += -DRTS_ENABLE_LOG
else ifeq (${HOSTDOMAIN},daq2.bnl.local)
DEFINES += -DRTS_LOG_DEFAULT_NET
DEFINES += -DRTS_ENABLE_LOG
else ifeq (${HOSTDOMAIN},trg.bnl.local)
DEFINES += -DRTS_LOG_DEFAULT_NET
DEFINES += -DRTS_ENABLE_LOG
else ifeq (${HOSTDOMAIN},l4.bnl.local)
DEFINES += -DRTS_LOG_DEFAULT_NET
DEFINES += -DRTS_ENABLE_LOG
endif

CCFLAGS = ${BASEFLAGS} ${USRCCFLAGS} ${DEFINES} ${INCLUDES}
Expand All @@ -396,6 +422,10 @@ ifeq ($(RTS_PROJECT),PP2PP)
endif
endif





# noticed problems on Linux where the default linker gcc doesn't work well for g++ compiled
# files
LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH)
Expand Down
2 changes: 1 addition & 1 deletion StRoot/StBFChain/BigFullChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ Bfc_st BFC[] = { // standard chains
// Sti/Stv chains
{"Sti" ,"Sti","","StiLib,StiLibs,SCL,StEvent,StDbT,TpcIT,compend,sim_T,tbutil","StiMaker"
, "StEventUtilities,StiUtilities,StiMaker","Sti tracker",kFALSE},
{"StiCA" ,"Sti","","Sti","StiMaker","TPCCATracker,StiCA" ,"StiCA tracker",kFALSE},
{"StiCA" ,"Sti","","Sti","StiMaker","TPCCATracker" ,"StiCA tracker",kFALSE},
{"StiCAPerf","","","","", "TPCCATrackerPerformance", "CA Performance",kFALSE},
{"StiCA" ,"Sti","","Sti,StiLib,StiCALib,StiLibs,SCL,StEvent,StDbT,TpcIT,compend,tbutil","StiMaker"
, "StEventUtilities,libEG,StiUtilities,StiMaker","Sti+CA tracker",kFALSE},
Expand Down
7 changes: 5 additions & 2 deletions StRoot/StEvent/StFcsCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class StFcsCollection : public StObject {
const StSPtrVecFcsPoint& points(unsigned int det) const; // Return the point list
unsigned int numberOfPoints(unsigned int det) const; // Return the number of points

void setDataExist(int v) {mDataExist=v;}
int isDataExist() {return mDataExist;}

int fcsReconstructionFlag() const;
void setFcsReconstructionFlag(int v);

Expand All @@ -64,9 +67,9 @@ class StFcsCollection : public StObject {
StSPtrVecFcsPoint mPoints[kFcsNDet];

Int_t mFcsReconstructionFlag=0; // undefined for now
Int_t mDataExist=0; // if FCS data existed in daq file

ClassDef(StFcsCollection,1)

ClassDef(StFcsCollection,2)
};

inline int StFcsCollection::fcsReconstructionFlag() const {return mFcsReconstructionFlag;}
Expand Down
2 changes: 1 addition & 1 deletion StRoot/StEvent/StFstConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const float kFstrStart[kFstNumRStripsPerWedge]= {5.000, 7.875, 10.750, 13.625, 1
const float kFstrStop[kFstNumRStripsPerWedge] = {7.875, 10.750, 136.25, 16.500, 19.375, 22.250, 25.125, 28.000}; // in cm

//general APV chip constants
const unsigned char kFstNumTimeBins = 3; // 3 time bins for ADC sampling (maximum time bin number)
const unsigned char kFstNumTimeBins = 9; // 9 time bins for ADC sampling (maximum time bin number, 3 or 9)
const unsigned char kFstDefaultTimeBin = 2; // the default time bin number (2nd time bin) for FST raw hits
const int kFstMaxAdc = 4096; // ADC value should be less than 4096 (12 bits ADC)

Expand Down
2 changes: 1 addition & 1 deletion StRoot/StFcsClusterMaker/StFcsClusterMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ float StFcsClusterMaker::isNeighbor(StFcsHit* hit, StFcsCluster* clu){
if(ehp==1) thr=mNeighborDistance_Hcal;
float d = distance(hit,h);
float e = h->energy();
if(d < thr) ne=e;
if(d < thr && e>ne) ne=e;
}
return ne;
}
Expand Down
Loading

0 comments on commit b73315b

Please sign in to comment.