From c4ef429d8b68b8fcbdae4f871161c8c3541826e4 Mon Sep 17 00:00:00 2001 From: Gordon McCann Date: Wed, 8 Jun 2022 15:51:26 -0400 Subject: [PATCH] Switched to build with cmake rather than premake for easier ROOT integration --- CMakeLists.txt | 14 ++++++++++++++ src/Detectors/CMakeLists.txt | 19 +++++++++++++++++++ src/Mask/CMakeLists.txt | 29 +++++++++++++++++++++++++++++ src/Mask/MaskApp.cpp | 4 ++++ src/MaskApp/CMakeLists.txt | 12 ++++++++++++ src/Plotters/ROOT/CMakeLists.txt | 17 +++++++++++++++++ src/Plotters/ROOT/RootPlotter.cpp | 2 ++ 7 files changed, 97 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/Detectors/CMakeLists.txt create mode 100644 src/Mask/CMakeLists.txt create mode 100644 src/MaskApp/CMakeLists.txt create mode 100644 src/Plotters/ROOT/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..060a36e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 3.16) + +project(Mask) + +set(MASK_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin) +set(MASK_LIBRARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib) +set(MASK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) + +set(CMAKE_CXX_STANDARD 17) + +add_subdirectory(src/Mask) +add_subdirectory(src/MaskApp) +add_subdirectory(src/Detectors) +add_subdirectory(src/Plotters/ROOT) \ No newline at end of file diff --git a/src/Detectors/CMakeLists.txt b/src/Detectors/CMakeLists.txt new file mode 100644 index 0000000..46d2b16 --- /dev/null +++ b/src/Detectors/CMakeLists.txt @@ -0,0 +1,19 @@ +add_executable(DetectEff) +target_include_directories(DetectEff PUBLIC ${MASK_INCLUDE_DIR}) + +target_sources(DetectEff PUBLIC + AnasenDeadChannelMap.cpp + AnasenEfficiency.cpp + DetectorEfficiency.cpp + QQQDetector.cpp + SabreDeadChannelMap.cpp + SabreDetector.cpp + SabreEfficiency.cpp + StripDetector.cpp +) + +target_link_libraries(DetectEff + Mask +) + +set_target_properties(DetectEff PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${MASK_BINARY_DIR}) \ No newline at end of file diff --git a/src/Mask/CMakeLists.txt b/src/Mask/CMakeLists.txt new file mode 100644 index 0000000..f808410 --- /dev/null +++ b/src/Mask/CMakeLists.txt @@ -0,0 +1,29 @@ +add_library(Mask STATIC) +target_include_directories(Mask + PUBLIC ${MASK_INCLUDE_DIR} +) + +target_sources(Mask PRIVATE + AngularDistribution.cpp + DecaySystem.cpp + EnergyLoss.cpp + LayeredTarget.cpp + LegendrePoly.cpp + MaskApp.cpp + MaskFile.cpp + MassLookup.cpp + Nucleus.cpp + OneStepSystem.cpp + RandomGenerator.cpp + Reaction.cpp + ReactionSystem.cpp + Rotation.cpp + Stopwatch.cpp + Target.cpp + ThreeStepSystem.cpp + TwoStepSystem.cpp + Vec3.cpp + Vec4.cpp +) + +set_target_properties(Mask PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${MASK_LIBRARY_DIR}) \ No newline at end of file diff --git a/src/Mask/MaskApp.cpp b/src/Mask/MaskApp.cpp index a4365e8..fb7ee7a 100644 --- a/src/Mask/MaskApp.cpp +++ b/src/Mask/MaskApp.cpp @@ -126,6 +126,8 @@ namespace Mask { input>>junk>>par1; switch(m_rxn_type) { + case RxnType::PureDecay : break; + case RxnType::None : break; case RxnType::OneStepRxn : { dynamic_cast(m_sys)->SetReactionThetaType(par1); @@ -152,6 +154,8 @@ namespace Mask { input>>junk>>dfile2; switch(m_rxn_type) { + case RxnType::PureDecay : break; + case RxnType::None : break; case RxnType::OneStepRxn : { DecaySystem* this_sys = dynamic_cast(m_sys); diff --git a/src/MaskApp/CMakeLists.txt b/src/MaskApp/CMakeLists.txt new file mode 100644 index 0000000..9cf35b9 --- /dev/null +++ b/src/MaskApp/CMakeLists.txt @@ -0,0 +1,12 @@ +add_executable(MaskApp) +target_include_directories(MaskApp PUBLIC ${MASK_INCLUDE_DIR}) + +target_sources(MaskApp PUBLIC + main.cpp +) + +target_link_libraries(MaskApp + Mask +) + +set_target_properties(MaskApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${MASK_BINARY_DIR}) \ No newline at end of file diff --git a/src/Plotters/ROOT/CMakeLists.txt b/src/Plotters/ROOT/CMakeLists.txt new file mode 100644 index 0000000..8cf06ff --- /dev/null +++ b/src/Plotters/ROOT/CMakeLists.txt @@ -0,0 +1,17 @@ +find_package(ROOT REQUIRED) +add_executable(RootPlot) +target_include_directories(RootPlot + PUBLIC ${MASK_INCLUDE_DIR} + SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS} +) + +target_sources(RootPlot PUBLIC + RootPlotter.cpp +) + +target_link_libraries(RootPlot + Mask + ${ROOT_LIBRARIES} +) + +set_target_properties(RootPlot PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${MASK_BINARY_DIR}) \ No newline at end of file diff --git a/src/Plotters/ROOT/RootPlotter.cpp b/src/Plotters/ROOT/RootPlotter.cpp index 4458bd5..c1176df 100644 --- a/src/Plotters/ROOT/RootPlotter.cpp +++ b/src/Plotters/ROOT/RootPlotter.cpp @@ -163,6 +163,7 @@ std::vector GetParents(const Mask::MaskFileData& data, Mask::RxnT Mask::Nucleus temp1, temp2, temp3; switch(rxn_type) { + case Mask::RxnType::None : break; case Mask::RxnType::PureDecay : { temp1.SetIsotope(data.Z[0], data.A[0]); @@ -210,6 +211,7 @@ std::vector GetParents(const Mask::MaskFileData& data, Mask::RxnT return parents; } } + return parents; } void SetThetaCM(Mask::Nucleus& daughter, const Mask::Nucleus& parent)