From bcb132d1a116bb9b25f68028b2630a08c46fe2bc Mon Sep 17 00:00:00 2001 From: Vratislav Chudoba Date: Thu, 7 Mar 2024 12:04:58 +0300 Subject: [PATCH] Compilation of AculData.so by cmake added. Script to test AculData.so library added. --- AculData/CMakeLists.txt | 26 ++++++++++++++++++++++++++ CMakeLists.txt | 1 + README | 12 ++++++++++-- TELoss/CMakeLists.txt | 7 +++++-- macros/parforcal.par | 21 +++++++++++++++++++++ macros/rootlogon.C | 7 +++++++ macros/testOfAculData.cxx | 16 ++++++++++++++++ 7 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 AculData/CMakeLists.txt create mode 100644 macros/parforcal.par create mode 100644 macros/testOfAculData.cxx diff --git a/AculData/CMakeLists.txt b/AculData/CMakeLists.txt new file mode 100644 index 0000000..3cf53b2 --- /dev/null +++ b/AculData/CMakeLists.txt @@ -0,0 +1,26 @@ +############################################################################ +# CMakeLists.txt file for building AculData package +############################################################################ + +ROOT_STANDARD_LIBRARY_PACKAGE(AculData + HEADERS + AculCalibCsI.h + AculCalibration.h + # ConfigDictionary.h + # ReturnCodes.h + # AculDataLinkDef.h + SOURCES + AculCalibCsI.cpp + AculCalibration.cpp + # ConfigDictionary.cpp +# DICTIONARY_OPTIONS +# -writeEmptyRootPCM +# DEPENDENCIES +# MathCore +# Matrix +# RIO + LINKDEF + AculDataLinkDef.h +) + +ROOT_ADD_TEST_SUBDIRECTORY(test) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 12a3f32..2fbc3f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,7 @@ message(STATUS "ROOT include directories: ${ROOT_INCLUDE_DIRS}") # Add the TELoss directory add_subdirectory(TELoss) +add_subdirectory(AculData) # Add the "TELoss" directory to the include path # include_directories(TELoss) diff --git a/README b/README index 5cfa9ef..9e04925 100755 --- a/README +++ b/README @@ -10,7 +10,7 @@ I. Use with GNU make 3) add the install folder to LD_LIBRARY_PATH -II. Use with cmake (TELoss.so build only in this commit) +II. Use with cmake 1) mkdir build @@ -18,4 +18,12 @@ II. Use with cmake (TELoss.so build only in this commit) 3) cmake .. -4) make \ No newline at end of file +4) make + +III. Test of compiled libraries + +1) cd macros + +2) rootlogon.C script will automatically load compiled libraries libTELoss.so and libAculData.so, then + root -l testOfAculData.cxx + root -l testOfTELoss.cxx \ No newline at end of file diff --git a/TELoss/CMakeLists.txt b/TELoss/CMakeLists.txt index dae8f49..c48b777 100644 --- a/TELoss/CMakeLists.txt +++ b/TELoss/CMakeLists.txt @@ -23,8 +23,11 @@ set(FORTRAN_SOURCES ) # Generate dictionary for TELoss class -ROOT_GENERATE_DICTIONARY(G__TELoss ${CMAKE_CURRENT_SOURCE_DIR}/TELoss.h -LINKDEF ${CMAKE_CURRENT_SOURCE_DIR}/TELossLinkDef.h) +ROOT_GENERATE_DICTIONARY( + G__TELoss + ${CMAKE_CURRENT_SOURCE_DIR}/TELoss.h + LINKDEF + ${CMAKE_CURRENT_SOURCE_DIR}/TELossLinkDef.h) #working # ROOT_GENERATE_DICTIONARY(G__TELoss ${CMAKE_CURRENT_SOURCE_DIR}/TELoss/TELoss.h diff --git a/macros/parforcal.par b/macros/parforcal.par new file mode 100644 index 0000000..34fcb5a --- /dev/null +++ b/macros/parforcal.par @@ -0,0 +1,21 @@ +//226Ra +//relative units are normalized to 1 + +4 noPeaks //number of peaks// число пиков, по которым происходит калибровка +4.751 E1 //in MeV including dead layer of alpha source//энергии альфа источника +5.459 E2 //in MeV// +5.972 E3 //in MeV// +7.661 E4 //in MeV// +2.3 deadLayer +0 lowersubaddress +15 uppersubaddress +ANS block +AnalysisxTree treename +400 lowerChannel //in channels//каналы, +2000 upperChannel //in channels//каналы +0.5 lowerPeakHight //in relative units; minimal range of the peak// +0.5 upperPeakHight //in relative units; minimal range of the peak// +0.1 peakPositionTolerance //in relative units; for check of the peaks positions in channels// +2 fitFunctionLineWidth //integer 1 - 10; graphics// +20 minFitSigma //minimal sigma of the peaks to be fitted// +0.3 fitHightThreshold //in relative units; the minimal height of the treated peak// diff --git a/macros/rootlogon.C b/macros/rootlogon.C index c93c330..efd6007 100644 --- a/macros/rootlogon.C +++ b/macros/rootlogon.C @@ -1,9 +1,16 @@ { TString pathToTELoss = "../build/TELoss/libTELoss.so"; + TString pathToAculData = "../build/AculData/libAculData.so"; + //libTELoss.so loading Int_t teloss = gSystem->Load(pathToTELoss); if (teloss==0) Info("rootlogon.C", "Library %s was successfully loaded.", pathToTELoss.Data()); else Error("rootlogon.C", "Some error with %s loading", pathToTELoss.Data()); + + //libAculData.so loading + Int_t aculdata = gSystem->Load(pathToAculData); + if (aculdata==0) Info("rootlogon.C", "Library %s was successfully loaded.", pathToAculData.Data()); + else Error("rootlogon.C", "Some error with %s loading", pathToAculData.Data()); } \ No newline at end of file diff --git a/macros/testOfAculData.cxx b/macros/testOfAculData.cxx new file mode 100644 index 0000000..3236fd8 --- /dev/null +++ b/macros/testOfAculData.cxx @@ -0,0 +1,16 @@ +#include "../AculData/AculCalibration.h" + +void testOfAculData() +{ + // gSystem->Load("/home/aculina/AculUt/libAculData.so"); + // gSystem->Load("/home/aculina/AculUt/libTELoss.so"); + + AculCalibration cal; + + cal.SetParFileName("./parforcal.par"); + cal.Init(); //takes parameters from .par + cal.PrintInputParameters(); + + cal.PrintCalibrationParameters(); + +} -- 2.18.1