From 50bad7807b0e509bb5d7352c35774d250d1e83aa Mon Sep 17 00:00:00 2001 From: Jaesung Kim Date: Mon, 12 Jan 2026 21:13:59 +0000 Subject: [PATCH 1/2] Define GENIE_VERSION_CODE in CMake; Use to check AR25 availability --- cmake/Templates/nusystematicsConfig.cmake.in | 8 ++++++++ .../systproviders/GENIEReWeightEngineConfig.cc | 8 +++++++- .../systproviders/GENIEReWeightParamConfig.cc | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cmake/Templates/nusystematicsConfig.cmake.in b/cmake/Templates/nusystematicsConfig.cmake.in index 45b4a1f..da2c3a6 100644 --- a/cmake/Templates/nusystematicsConfig.cmake.in +++ b/cmake/Templates/nusystematicsConfig.cmake.in @@ -15,6 +15,14 @@ if(EXISTS "${CMakeModules_CMAKE_DIR}/FindGENIE3.cmake") endif() find_package(GENIE3 REQUIRED) +# Parsing GENIE version +string(REPLACE "." ";" VERSION_LIST ${GENIE_VERSION}) +list(GET VERSION_LIST 0 MAJOR) +list(GET VERSION_LIST 1 MINOR) +list(GET VERSION_LIST 2 PATCH) +math(EXPR GENIE_VERSION_CODE "${MAJOR} * 10000 + ${MINOR} * 100 + ${PATCH}") + + find_package(Eigen3 3.4.0 REQUIRED) set(nusystematics_FOUND TRUE) diff --git a/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc b/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc index 2434e11..c152509 100644 --- a/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc +++ b/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc @@ -6,7 +6,12 @@ #include "RwCalculators/GReWeightFGM.h" #include "RwCalculators/GReWeightFZone.h" #include "RwCalculators/GReWeightINuke.h" + +#if GENIE_VERSION_CODE >= 30602 #include "RwCalculators/GReWeightINukeExtra.h" +#include "RwCalculators/GReWeightINukeKinematics.h" +#endif + #include "RwCalculators/GReWeightNonResonanceBkg.h" #include "RwCalculators/GReWeightNuXSecCCQE.h" #include "RwCalculators/GReWeightNuXSecCCQEaxial.h" @@ -19,7 +24,6 @@ #include "RwCalculators/GReWeightNuXSecNCRES.h" #include "RwCalculators/GReWeightResonanceDecay.h" #include "RwCalculators/GReWeightDeltaradAngle.h" -#include "RwCalculators/GReWeightINukeKinematics.h" #include @@ -473,6 +477,7 @@ ConfigureFSIWeightEngine(systtools::SystMetaData const &FSImd, kINukeTwkDial_FrAbs_N, kINukeTwkDial_FrPiProd_N}, "INuke_N", []() { return new GReWeightINuke; }, UseFullHERG, param_map); +#if GENIE_VERSION_CODE >= 30602 AddResponseAndDependentDials( FSImd, "FSI_N_EDepVariationResponse", {kINukeTwkDial_G4_N, kINukeTwkDial_INCL_N, @@ -489,6 +494,7 @@ ConfigureFSIWeightEngine(systtools::SystMetaData const &FSImd, {kINukeKinematicsTwkDial_NP_N, kINukeKinematicsTwkDial_PP_N, kINukeKinematicsFixPiPro, kINukeKinematicsPiProBias, kINukeKinematicsPiProBiaswFix}, "FrKin", []() { return new GReWeightINukeKinematics; }, UseFullHERG, param_map); +#endif return param_map; } diff --git a/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc b/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc index 8c1297a..c204cdf 100644 --- a/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc +++ b/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc @@ -425,6 +425,7 @@ SystMetaData ConfigureFSIParameterHeaders(fhicl::ParameterSet const &cfg, firstParamId += FSI_N_md.size(); ExtendSystMetaData(FSImd, std::move(FSI_N_md)); +#if GENIE_VERSION_CODE >= 30602 SystMetaData FSI_N_EDep_md = ConfigureSetOfDependentParameters( cfg, firstParamId, tool_options, "FSI_N_EDep_VariationResponse", {kINukeTwkDial_G4_N, kINukeTwkDial_INCL_N, @@ -442,6 +443,7 @@ SystMetaData ConfigureFSIParameterHeaders(fhicl::ParameterSet const &cfg, {kINukeKinematicsTwkDial_NP_N, kINukeKinematicsTwkDial_PP_N, kINukeKinematicsFixPiPro, kINukeKinematicsPiProBias, kINukeKinematicsPiProBiaswFix}); ExtendSystMetaData(FSImd, std::move(FSI_Kinematics)); +#endif return FSImd; } From 938ae7e84f7cba41402b40e54401b25409926d8e Mon Sep 17 00:00:00 2001 From: Jaesung Kim Date: Mon, 12 Jan 2026 22:10:24 +0000 Subject: [PATCH 2/2] Check GENIE versions for the AR25 FSI dials; the criteria is set to >=3.08.00 but need to be updated once they became available. The purpose for now is to simply turn them off --- .../systproviders/GENIEReWeightEngineConfig.cc | 9 +++++++-- .../systproviders/GENIEReWeightParamConfig.cc | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc b/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc index c152509..6629706 100644 --- a/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc +++ b/src/nusystematics/systproviders/GENIEReWeightEngineConfig.cc @@ -7,7 +7,12 @@ #include "RwCalculators/GReWeightFZone.h" #include "RwCalculators/GReWeightINuke.h" -#if GENIE_VERSION_CODE >= 30602 +// TODO These modules are not yet merged into tagged Reweight +// https://github.com/GENIE-MC/Reweight/pull/44 +// https://github.com/GENIE-MC/Reweight/pull/45 +// Assuming these are activated for GENIE>=3.08.00 for now (01/12/2026), +// but need to be updated +#if GENIE_VERSION_CODE >= 30800 #include "RwCalculators/GReWeightINukeExtra.h" #include "RwCalculators/GReWeightINukeKinematics.h" #endif @@ -477,7 +482,7 @@ ConfigureFSIWeightEngine(systtools::SystMetaData const &FSImd, kINukeTwkDial_FrAbs_N, kINukeTwkDial_FrPiProd_N}, "INuke_N", []() { return new GReWeightINuke; }, UseFullHERG, param_map); -#if GENIE_VERSION_CODE >= 30602 +#if GENIE_VERSION_CODE >= 30800 AddResponseAndDependentDials( FSImd, "FSI_N_EDepVariationResponse", {kINukeTwkDial_G4_N, kINukeTwkDial_INCL_N, diff --git a/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc b/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc index c204cdf..ef7ab8b 100644 --- a/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc +++ b/src/nusystematics/systproviders/GENIEReWeightParamConfig.cc @@ -425,7 +425,7 @@ SystMetaData ConfigureFSIParameterHeaders(fhicl::ParameterSet const &cfg, firstParamId += FSI_N_md.size(); ExtendSystMetaData(FSImd, std::move(FSI_N_md)); -#if GENIE_VERSION_CODE >= 30602 +#if GENIE_VERSION_CODE >= 30800 SystMetaData FSI_N_EDep_md = ConfigureSetOfDependentParameters( cfg, firstParamId, tool_options, "FSI_N_EDep_VariationResponse", {kINukeTwkDial_G4_N, kINukeTwkDial_INCL_N,