Skip to content

Commit

Permalink
Update from akio
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbrice committed Feb 9, 2024
2 parents 8f24db3 + 4f2d19e commit d188093
Show file tree
Hide file tree
Showing 27 changed files with 129 additions and 89 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
24 changes: 21 additions & 3 deletions StRoot/StPicoDstMaker/StPicoDstMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#include "StEmcRawMaker/StBemcTables.h"

#include "StFmsDbMaker/StFmsDbMaker.h"
#include "StFcsDbMaker/StFcsDb.h"

#include "tables/St_mtdModuleToQTmap_Table.h"
#include "tables/St_mtdQTSlewingCorr_Table.h"
Expand Down Expand Up @@ -2546,6 +2547,11 @@ void StPicoDstMaker::fillFwdTracks() {

//_________________
void StPicoDstMaker::fillFcsClusters() {
StFcsDb* fcsDb = static_cast<StFcsDb*>(GetDataSet("fcsDb"));
if( !fcsDb ) {
LOG_ERROR << "Cannot get StFcsDb object" << endm;
return;
}
StMuFcsCollection * muFcs = mMuDst->muFcsCollection();
if ( !muFcs ) {
LOG_ERROR << "Cannot get Fcs Collection from MuDst" << endm;
Expand All @@ -2568,13 +2574,22 @@ void StPicoDstMaker::fillFcsClusters() {
picoFcsCluster.setTheta(muCluster->theta());
picoFcsCluster.setChi2Ndf1Photon(muCluster->chi2Ndf1Photon());
picoFcsCluster.setChi2Ndf2Photon(muCluster->chi2Ndf2Photon());
picoFcsCluster.setFourMomentum(muCluster->fourMomentum());
double zVertex=picoDst()->event()->primaryVertex().z();
StThreeVectorD xyz=fcsDb->getStarXYZ(muCluster->detectorId(), muCluster->x(), muCluster->y());
StLorentzVectorD lv = fcsDb->getLorentzVector(xyz, muCluster->energy(), zVertex);
picoFcsCluster.setFourMomentum(lv.px(),lv.py(),lv.pz(),lv.e());
new((*(mPicoArrays[StPicoArrays::FcsCluster]))[counter]) StPicoFcsCluster(picoFcsCluster);
}
LOG_INFO << "StPicoDstMaker::fillFcsClusters filled " << mPicoArrays[StPicoArrays::FcsCluster]->GetEntries() << endm;
}//fillFcsClusters

//_________________
void StPicoDstMaker::fillFcsHits() {
StFcsDb* fcsDb = static_cast<StFcsDb*>(GetDataSet("fcsDb"));
if( !fcsDb ) {
LOG_ERROR << "Cannot get StFcsDb object" << endm;
return;
}
StMuFcsCollection * muFcs = mMuDst->muFcsCollection();
if ( !muFcs ) {
LOG_ERROR << "Cannot get Fcs Collection from MuDst" << endm;
Expand All @@ -2588,10 +2603,13 @@ void StPicoDstMaker::fillFcsHits() {
picoFcsHit.setIndex(counter);
picoFcsHit.setDetectorId(muHit->detectorId());
picoFcsHit.setId(muHit->id());
// picoFcsHit.setFourMomentum(muHit->fourMomentum());
picoFcsHit.setFourMomentum( TLorentzVector(0, 0, 0, muHit->energy()) );
double zVertex=picoDst()->event()->primaryVertex().z();
StThreeVectorD xyz = fcsDb->getStarXYZ(muHit->detectorId(), muHit->id());
StLorentzVectorD lv = fcsDb->getLorentzVector(xyz, muHit->energy(), zVertex);
picoFcsHit.setFourMomentum(lv.px(),lv.py(),lv.pz(),lv.e());
new((*(mPicoArrays[StPicoArrays::FcsHit]))[counter]) StPicoFcsHit(picoFcsHit);
}
LOG_INFO << "StPicoDstMaker::fillFcsHits filled " << mPicoArrays[StPicoArrays::FcsHit]->GetEntries() << endm;
}//fillFcsHit

#if !defined (__TFG__VERSION__)
Expand Down
6 changes: 3 additions & 3 deletions StRoot/StPicoEvent/StPicoFcsCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ class StPicoFcsCluster : public TObject {
unsigned short detectorId() const { return mDetectorId; }
int category() const { return mCategory; }
int nTowers() const { return mNTowers; }
float energy() const { return mFourMomentumT; }
float energy() const { return mFourMomentumT; } // Energy
float x() const { return mX; } // Mean x ("center of gravity") in local grid coordinate (1st moment).
float y() const { return mY; } // Mean y ("center of gravity") in local grid coordinate (1st moment).
float sigmaMax() const { return mSigmaMax; } // Maximum 2nd moment (along major axis).
float sigmaMin() const { return mSigmaMin; } // Minimum 2nd moment.
float theta() const { return mTheta; } // Angle in x-y plane that defines the direction of least-2nd-sigma
float chi2Ndf1Photon() const { return mChi2Ndf1Photon; } // chi^2/ndf for 1-photon fit to the cluster.
float chi2Ndf2Photon() const { return mChi2Ndf2Photon; } // chi^2/ndf for 2-photon fit to the cluster.
const TLorentzVector& fourMomentum() const { return TLorentzVector( mFourMomentumX, mFourMomentumY, mFourMomentumZ, mFourMomentumT ); } // Cluster four-momentum (px, py, pz, E)
const TLorentzVector fourMomentum() const { return TLorentzVector( mFourMomentumX, mFourMomentumY, mFourMomentumZ, mFourMomentumT ); } // Cluster four-momentum (px, py, pz, E)

void setId(int cluid) { mId = (UShort_t)cluid; }
void setDetectorId(unsigned short detector) { mDetectorId=(UShort_t)detector; }
Expand All @@ -53,8 +53,8 @@ class StPicoFcsCluster : public TObject {
void setTheta(float theta) { mTheta = theta; }
void setChi2Ndf1Photon(float chi2ndfph1) { mChi2Ndf1Photon = chi2ndfph1; }
void setChi2Ndf2Photon(float chi2ndfph2) { mChi2Ndf2Photon = chi2ndfph2;}
void setFourMomentum(float px, float py, float pz, float e) { mFourMomentumX = px; mFourMomentumY = py; mFourMomentumZ = pz; mFourMomentumT = e; }
void setFourMomentum(TLorentzVector p4) { mFourMomentumX = p4.X(); mFourMomentumY = p4.Y(); mFourMomentumZ = p4.Z(); mFourMomentumT = p4.T(); }


protected:
UShort_t mId=0; // Eventwise cluster ID
Expand Down
5 changes: 3 additions & 2 deletions StRoot/StPicoEvent/StPicoFcsHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ class StPicoFcsHit : public TObject {
Int_t index() const { return mId; } // Return unique Index of the hit
unsigned short detectorId() const { return mDetectorId; }
Int_t id() const { return mId; } // Id of the hit winthin detectorId
float energy() const { return mFourMomentumT; }
const TLorentzVector& fourMomentum() const { return TLorentzVector( mFourMomentumX, mFourMomentumY, mFourMomentumZ, mFourMomentumT ); } // Hit four-momentum (px, py, pz, E)
float energy() const { return mFourMomentumT; } // Energy
const TLorentzVector fourMomentum() const { return TLorentzVector( mFourMomentumX, mFourMomentumY, mFourMomentumZ, mFourMomentumT ); } // Hit four-momentum (px, py, pz, E)

void setIndex(int index) { mIndex = (UShort_t)index; }
void setDetectorId(unsigned short detector) { mDetectorId=(UShort_t)detector; }
void setId(int id) { mIndex = (UShort_t)id; }
void setFourMomentum(float px, float py, float pz, float e) { mFourMomentumX = px; mFourMomentumY = py; mFourMomentumZ = pz; mFourMomentumT = e; }
void setFourMomentum(TLorentzVector p4) { mFourMomentumX = p4.X(); mFourMomentumY = p4.Y(); mFourMomentumZ = p4.Z(); mFourMomentumT = p4.T(); }

protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,3 @@ StiDebug::Count("Reused_Pct",reUsed, pct);
}
mEnded = 3; return 0;
}
//________________________________________________________________________________
StiCATpcSeedFinder* StiCALoader::New() { return new StiCATpcSeedFinder;}
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,4 @@ class StiCATpcSeedFinder: public StiTrackFinder
std::vector<Seed_t> *mSeeds;
};

class StiCALoader {
public:
static StiCATpcSeedFinder* New();
#if 0
ClassDef(StiCALoader,0)
#endif
};

#endif
File renamed without changes.
File renamed without changes.
7 changes: 2 additions & 5 deletions StRoot/Sti/StiDefaultToolkit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@
#include "Sti/StiDefaultTrackFilter.h"
#include "Sti/StiDetectorGroup.h"
#include "Sti/StiDetectorGroups.h"
#include "Sti/StiCATpcSeedFinder.h"
#include "StDetectorDbMaker/StiHitErrorCalculator.h"
#include "StiTpc/StiTpcHitLoader.h"
#include "StiSvt/StiSvtHitLoader.h"
Expand Down Expand Up @@ -639,11 +640,7 @@ StiTrackFinder * StiDefaultToolkit::getTrackSeedFinderKNN()
//______________________________________________________________________________
StiTrackFinder * StiDefaultToolkit::getTrackSeedFinderCA()
{
gSystem->Load("TPCCATracker");
gSystem->Load("StiCA");
auto *mySeed = (StiTrackFinder*)gROOT->ProcessLineFast("StiCALoader::New()");
assert(mySeed);
return mySeed;
return new StiCATpcSeedFinder();
}

//______________________________________________________________________________
Expand Down
Loading

0 comments on commit d188093

Please sign in to comment.