From 2a301fb8b05aa9010f66e8b623a107978e10246d Mon Sep 17 00:00:00 2001 From: YiHui Liu Date: Mon, 25 Nov 2024 14:08:43 +0800 Subject: [PATCH] Fix: cmake bluet_base path; Feat: timestamp projection --- .gitignore | 1 + CMakeLists.txt | 25 ++++++++++++------------- src/BluetAnalyzer.cc | 11 ++++++----- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 54b75a2..abd170d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ cfg # Data data +*.root # build build/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index a0a0224..38f112f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,10 @@ include_directories($ENV{GARFIELD_INSTALL}/include/Garfield) include(${Geant4_USE_FILE}) include_directories(${PROJECT_SOURCE_DIR}/include) # Include bluet file -set(bluet_base "/home/liuyihui/bluet/") -include_directories(${bluet_base}/sources/config/include) -include_directories(${bluet_base}/sources/modules/include) -include_directories(${bluet_base}/sources/runner/include) -include_directories(${bluet_base}/utils/include) +include_directories($ENV{bluet_base}/sources/config/include) +include_directories($ENV{bluet_base}/sources/modules/include) +include_directories($ENV{bluet_base}/sources/runner/include) +include_directories($ENV{bluet_base}/utils/include) include_directories($ENV{GARFIELD_INSTALL}/include/Garfield) # Locate sources and headers for this project @@ -42,14 +41,14 @@ file(GLOB analyzer ${PROJECT_SOURCE_DIR}/include/* ${PROJECT_SOURCE_DIR}/src/*) add_library(SO_${PROJECT_NAME} SHARED ${analyzer} # Bluet - ${bluet_base}/sources/config/include/BluetDataModel.hh - ${bluet_base}/utils/include/pugixml.hpp - ${bluet_base}/utils/src/pugixml.cpp - ${bluet_base}/utils/include/xmlparse.hh - ${bluet_base}/utils/src/xmlparse.cc - ${bluet_base}/utils/include/stringhandle.hh - ${bluet_base}/utils/src/stringhandle.cc - ${bluet_base}/utils/include/clipp.h + $ENV{bluet_base}/sources/config/include/BluetDataModel.hh + $ENV{bluet_base}/utils/include/pugixml.hpp + $ENV{bluet_base}/utils/src/pugixml.cpp + $ENV{bluet_base}/utils/include/xmlparse.hh + $ENV{bluet_base}/utils/src/xmlparse.cc + $ENV{bluet_base}/utils/include/stringhandle.hh + $ENV{bluet_base}/utils/src/stringhandle.cc + $ENV{bluet_base}/utils/include/clipp.h ) target_link_libraries(SO_${PROJECT_NAME} PUBLIC diff --git a/src/BluetAnalyzer.cc b/src/BluetAnalyzer.cc index 09405cc..3cdafa6 100644 --- a/src/BluetAnalyzer.cc +++ b/src/BluetAnalyzer.cc @@ -1010,12 +1010,13 @@ void BluetAnalyzer::saveHistograms(TString filename) { hbeamr->Write(); hrinte->Write(); htofE->Write(); - htof->Write(); htofr0->Write(); htofr1->Write(); hpull->Write(); hratio->Write(); hLengthE->Write(); + (TH1F *)(hLengthE->ProjectionX())->Write(); + (TH1F *)(hLengthE->ProjectionY())->Write(); htcath->Write(); htpad->Write(); hv0->Write(); @@ -1025,17 +1026,17 @@ void BluetAnalyzer::saveHistograms(TString filename) { hdeltacos1->Write(); hdeltacos2->Write(); hts->Write(); + (TH1F *)(hts->ProjectionX())->Write(); + (TH1F *)(hts->ProjectionY())->Write(); htn->Write(); hamp->Write(); + (TH1F *)(hamp->ProjectionX())->Write(); + (TH1F *)(hamp->ProjectionY())->Write(); han->Write(); hta->Write(); htt->Write(); hte->Write(); hec->Write(); - (TH1F *)(hamp->ProjectionX())->Write(); - (TH1F *)(hamp->ProjectionY())->Write(); - (TH1F *)(hLengthE->ProjectionX())->Write(); - (TH1F *)(hLengthE->ProjectionY())->Write(); fout->Close(); }