From 03d88eb2479f70922099b117fd7db9b064246e49 Mon Sep 17 00:00:00 2001 From: kmtsui Date: Wed, 2 Oct 2024 15:30:18 +0900 Subject: [PATCH] Update to compile with WCSim v1.12.16 --- README.md | 8 ++------ app/application/Makefile | 4 ++-- app/utilities/WCRootData/Makefile | 4 ++-- app/utilities/WCRootData/src/WCRootData.cc | 10 ++++++++-- cpp/include/TrueHit.h | 3 +++ envMDT.sh | 15 ++++++--------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 5615489..efe0e6b 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,7 @@ The library provides C++ classes that manage three tasks: Simple runtime procedures. First set up your ROOT and WCSIM: ``` source your_thisroot.sh -export WCSIMDIR=your_WCSIM_installation -``` -If `libWCSimRoot.so` is not directly under `WCSIMDIR`, export to `WCSIMROOTDIR`. -``` -export WCSIMROOTDIR=your_libWCSimRoot.so_installation +source your_this_wcsim.sh # or just export WCSIM_BUILD_DIR ``` Then set up the MDT environment. ``` @@ -32,7 +28,7 @@ cd $MDTROOT/app/utilities/WCRootData; make clean; make all cd $MDTROOT/app/application; make clean; make all cd $MDTROOT # edit variables properly in run_test_mdt4wcte.sh -bash run_test_mdt4iwcd.sh +bash run_test_mdt4wcte.sh ``` ## IWCD usage diff --git a/app/application/Makefile b/app/application/Makefile index 478474d..f5b4d51 100644 --- a/app/application/Makefile +++ b/app/application/Makefile @@ -2,12 +2,12 @@ CXX=g++ LD=g++ CXXFLAGS += -Wall -std=c++11 -g $(shell root-config --cflags)\ - -I$(WCSIMDIR)/include\ + -I$(WCSIM_BUILD_DIR)/include/WCSim\ -I${MDTROOT}/cpp/include\ -I${WCRDROOT}/include LDFLAGS += $(shell root-config --ldflags) $(shell root-config --libs) -lTreePlayer\ - -L$(WCSIMROOTDIR) -lWCSimRoot\ + -L$(WCSIM_BUILD_DIR)/lib -lWCSimRoot\ -L${MDTROOT}/cpp -lMDT\ -L${WCRDROOT} -lWCRData diff --git a/app/utilities/WCRootData/Makefile b/app/utilities/WCRootData/Makefile index ad090a8..6a9aa2e 100644 --- a/app/utilities/WCRootData/Makefile +++ b/app/utilities/WCRootData/Makefile @@ -1,9 +1,9 @@ CXX=g++ LD=g++ -CXXFLAGS += -Wall -O2 -std=c++11 -g -fPIC -I./include $(shell root-config --cflags) -I$(WCSIMDIR)/include -I${MDTROOT}/cpp/include +CXXFLAGS += -Wall -O2 -std=c++11 -g -fPIC -I./include $(shell root-config --cflags) -I$(WCSIM_BUILD_DIR)/include/WCSim -I${MDTROOT}/cpp/include #LDFLAGS += -shared $(shell root-config --ldflags) $(shell root-config --libs) -lTreePlayer -lMinuit2 -L$(WCSIMDIR) -lWCSimRoot -L${MDTROOT}/cpp -lMDT -LDFLAGS += -shared $(shell root-config --ldflags) $(shell root-config --libs) -L$(WCSIMROOTDIR) -lWCSimRoot -L${MDTROOT}/cpp -lMDT +LDFLAGS += -shared $(shell root-config --ldflags) $(shell root-config --libs) -L$(WCSIM_BUILD_DIR)/lib -lWCSimRoot -L${MDTROOT}/cpp -lMDT TARGET=libWCRData.so diff --git a/app/utilities/WCRootData/src/WCRootData.cc b/app/utilities/WCRootData/src/WCRootData.cc index 8a17224..2179e13 100644 --- a/app/utilities/WCRootData/src/WCRootData.cc +++ b/app/utilities/WCRootData/src/WCRootData.cc @@ -91,6 +91,7 @@ void WCRootData::AddTrueHitsToMDT(HitTubeCollection *hc, PMTResponse *pr, float th->SetStartTime(aHitTime->GetPhotonStartTime()+intTime); for(int k=0; k<3; k++){ th->SetStartPosition(k, aHitTime->GetPhotonStartPos(k)); } + th->SetCreatorProcess((int)(aHitTime->GetPhotonCreatorProcess())); if( !pr->ApplyDE(th) ){ continue; } (&(*hc)[tubeID])->AddRawPE(th); @@ -207,6 +208,7 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID std::vector photonEndPos; std::vector photonStartDir; std::vector photonEndDir; + std::vector photonCreatorProcess; for(hc->Begin(); !hc->IsEnd(); hc->Next()) { // Get tube ID @@ -227,6 +229,7 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID photonEndPos.push_back(TVector3(PEs[iPE]->GetPosition(0),PEs[iPE]->GetPosition(1),PEs[iPE]->GetPosition(2))); photonStartDir.push_back(TVector3(PEs[iPE]->GetStartDirection(0),PEs[iPE]->GetStartDirection(1),PEs[iPE]->GetStartDirection(2))); photonEndDir.push_back(TVector3(PEs[iPE]->GetDirection(0),PEs[iPE]->GetDirection(1),PEs[iPE]->GetDirection(2))); + photonCreatorProcess.push_back((ProcessType_t)(PEs[iPE]->GetCreatorProcess())); } anEvent->AddCherenkovHit(tubeID, @@ -238,7 +241,8 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID photonStartPos, photonEndPos, photonStartDir, - photonEndDir); + photonEndDir, + photonCreatorProcess); truetime.clear(); primaryParentID.clear(); @@ -247,6 +251,7 @@ void WCRootData::AddDigiHits(HitTubeCollection *hc, TriggerInfo *ti, int eventID photonEndPos.clear(); photonStartDir.clear(); photonEndDir.clear(); + photonCreatorProcess.clear(); } const int nTriggers = ti->GetNumOfTrigger(); for(int iTrig=0; iTrigGetParenttype(); Int_t id = aTrack->GetId(); Int_t idPrnt = aTrack->GetParentId(); - + ProcessType_t creatorProcess = aTrack->GetCreatorProcess(); Double_t dir[3]; Double_t pdir[3]; @@ -393,6 +398,7 @@ void WCRootData::AddTracks(const WCSimRootTrigger *aEvtIn, float offset_time, in stop, start, parenttype, + creatorProcess, time, id, idPrnt, diff --git a/cpp/include/TrueHit.h b/cpp/include/TrueHit.h index 988fa0c..7e72509 100644 --- a/cpp/include/TrueHit.h +++ b/cpp/include/TrueHit.h @@ -15,6 +15,7 @@ class TrueHit float GetStartPosition(int i) const { return fStartPosition[i]; } float GetStartDirection(int i) const { return fStartDirection[i]; } int GetPosBin(int i) const { return fBin[i]; } + int GetCreatorProcess() const { return fCreatorProcess; } void SetPosition(int i, float f) { fPosition[i] = f; } void SetDirection(int i, float f) { fDirection[i] = f; } @@ -22,6 +23,7 @@ class TrueHit void SetStartPosition(int i, float f) { fStartPosition[i] = f; } void SetStartDirection(int i, float f) { fStartDirection[i] = f; } void SetPosBin(int i, int b){ fBin[i] = b; } + void SetCreatorProcess(int i){ fCreatorProcess = i; } private: double fTime; @@ -32,4 +34,5 @@ class TrueHit float fStartDirection[3]; // Photon track initial direction int fParentId; int fBin[3]; + int fCreatorProcess; }; diff --git a/envMDT.sh b/envMDT.sh index a60a2a8..d7a5ceb 100644 --- a/envMDT.sh +++ b/envMDT.sh @@ -27,7 +27,7 @@ if [ -n "${MDTROOT}" ] ; then drop_from_path "$LD_LIBRARY_PATH" "${old_mdtroot}/cpp" LD_LIBRARY_PATH=$newpath - drop_from_path "$LD_LIBRARY_PATH" "${WCSIMROOTDIR}" + drop_from_path "$LD_LIBRARY_PATH" "${WCSIM_BUILD_DIR}/lib" LD_LIBRARY_PATH=$newpath drop_from_path "$LD_LIBRARY_PATH" "${WCRDROOT}" @@ -59,18 +59,15 @@ else fi #--- WCSim -if [[ -z "${WCSIMDIR}" ]]; then - echo "WCSIMDIR not set. Exit!" +if [[ -z "${WCSIM_BUILD_DIR}" ]]; then + echo "WCSIM_BUILD_DIR not set. Exit!" return else - echo "Using WCSIM installed in $WCSIMDIR" + echo "Using WCSIM installed in $WCSIM_BUILD_DIR" #export LD_LIBRARY_PATH=${WCSIMDIR}:$LD_LIBRARY_PATH - if [[ -z "${WCSIMROOTDIR}" ]]; then - WCSIMROOTDIR=$WCSIMDIR - fi - echo "Using libWCSimRoot.so installed in $WCSIMROOTDIR" - export LD_LIBRARY_PATH=${WCSIMROOTDIR}:$LD_LIBRARY_PATH + echo "Using libWCSimRoot.so installed in $WCSIM_BUILD_DIR/lib" + export LD_LIBRARY_PATH=${WCSIM_BUILD_DIR}/lib:$LD_LIBRARY_PATH fi #--- MDT's utility