From b532491dcf24e29c4aadd59a99ec416a0725df59 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Mon, 30 Jun 2025 10:17:39 +0200 Subject: [PATCH 1/2] move unnecessary statics to .cxx --- Framework/Core/include/Framework/BasicOps.h | 58 -------------------- Framework/Core/src/Expressions.cxx | 61 ++++++++++++++++++++- 2 files changed, 60 insertions(+), 59 deletions(-) diff --git a/Framework/Core/include/Framework/BasicOps.h b/Framework/Core/include/Framework/BasicOps.h index 06880de275b9e..0927b557c86bc 100644 --- a/Framework/Core/include/Framework/BasicOps.h +++ b/Framework/Core/include/Framework/BasicOps.h @@ -10,9 +10,6 @@ // or submit itself to any jurisdiction. #ifndef O2_FRAMEWORK_BASICOPS_H_ #define O2_FRAMEWORK_BASICOPS_H_ -#include -#include -#include "CommonConstants/MathConstants.h" namespace o2::framework { @@ -49,61 +46,6 @@ enum BasicOp : unsigned int { BitwiseNot, Conditional // 3-ar functions }; - -static constexpr std::array mapping{ - "&&", - "||", - "+", - "-", - "/", - "*", - "&", - "|", - "^", - "<", - "<=", - ">", - ">=", - "==", - "!=", - "natan2", - "npow", - "nsqrt", - "nexp", - "nlog", - "nlog10", - "nsin", - "ncos", - "ntan", - "nasin", - "nacos", - "natan", - "nabs", - "nround", - "nbitwise_not", - "ifnode"}; - -static constexpr std::array mathConstants{ - "Almost0", - "Epsilon", - "Almost1", - "VeryBig", - "PI", - "TwoPI", - "PIHalf", - "PIThird", - "PIQuarter"}; - -static constexpr std::array mathConstantsValues{ - o2::constants::math::Almost0, - o2::constants::math::Epsilon, - o2::constants::math::Almost1, - o2::constants::math::VeryBig, - o2::constants::math::PI, - o2::constants::math::TwoPI, - o2::constants::math::PIHalf, - o2::constants::math::PIThird, - o2::constants::math::PIQuarter}; } // namespace o2::framework #endif // O2_FRAMEWORK_BASICOPS_H_ diff --git a/Framework/Core/src/Expressions.cxx b/Framework/Core/src/Expressions.cxx index 3e52d49dfa4bb..6ed423cec4a70 100644 --- a/Framework/Core/src/Expressions.cxx +++ b/Framework/Core/src/Expressions.cxx @@ -19,6 +19,7 @@ #include #include #include +#include "CommonConstants/MathConstants.h" using namespace o2::framework; @@ -29,9 +30,67 @@ void unknownParameterUsed(const char* name) runtime_error_f("Unknown parameter used in expression: %s", name); } +/// a map between BasicOp and tokens in string expressions +constexpr std::array mapping{ + "&&", + "||", + "+", + "-", + "/", + "*", + "&", + "|", + "^", + "<", + "<=", + ">", + ">=", + "==", + "!=", + "natan2", + "npow", + "nsqrt", + "nexp", + "nlog", + "nlog10", + "nsin", + "ncos", + "ntan", + "nasin", + "nacos", + "natan", + "nabs", + "nround", + "nbitwise_not", + "ifnode"}; + +/// math constants to recognize in string expressions +constexpr std::array mathConstants{ + "Almost0", + "Epsilon", + "Almost1", + "VeryBig", + "PI", + "TwoPI", + "PIHalf", + "PIThird", + "PIQuarter"}; + +/// values of math constants to substiture +constexpr std::array mathConstantsValues{ + o2::constants::math::Almost0, + o2::constants::math::Epsilon, + o2::constants::math::Almost1, + o2::constants::math::VeryBig, + o2::constants::math::PI, + o2::constants::math::TwoPI, + o2::constants::math::PIHalf, + o2::constants::math::PIThird, + o2::constants::math::PIQuarter}; + /// a map between BasicOp and gandiva node definitions /// note that logical 'and' and 'or' are created separately -static constexpr std::array basicOperationsMap = { +constexpr std::array basicOperationsMap = { "and", "or", "add", From 73624634a253ced15e0c0b9ea03069aa4918bcc2 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 30 Jun 2025 08:18:16 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- Framework/Core/src/Expressions.cxx | 98 +++++++++++++++--------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/Framework/Core/src/Expressions.cxx b/Framework/Core/src/Expressions.cxx index 6ed423cec4a70..cc6d9f99fb25d 100644 --- a/Framework/Core/src/Expressions.cxx +++ b/Framework/Core/src/Expressions.cxx @@ -32,61 +32,61 @@ void unknownParameterUsed(const char* name) /// a map between BasicOp and tokens in string expressions constexpr std::array mapping{ - "&&", - "||", - "+", - "-", - "/", - "*", - "&", - "|", - "^", - "<", - "<=", - ">", - ">=", - "==", - "!=", - "natan2", - "npow", - "nsqrt", - "nexp", - "nlog", - "nlog10", - "nsin", - "ncos", - "ntan", - "nasin", - "nacos", - "natan", - "nabs", - "nround", - "nbitwise_not", - "ifnode"}; + "&&", + "||", + "+", + "-", + "/", + "*", + "&", + "|", + "^", + "<", + "<=", + ">", + ">=", + "==", + "!=", + "natan2", + "npow", + "nsqrt", + "nexp", + "nlog", + "nlog10", + "nsin", + "ncos", + "ntan", + "nasin", + "nacos", + "natan", + "nabs", + "nround", + "nbitwise_not", + "ifnode"}; /// math constants to recognize in string expressions constexpr std::array mathConstants{ - "Almost0", - "Epsilon", - "Almost1", - "VeryBig", - "PI", - "TwoPI", - "PIHalf", - "PIThird", - "PIQuarter"}; + "Almost0", + "Epsilon", + "Almost1", + "VeryBig", + "PI", + "TwoPI", + "PIHalf", + "PIThird", + "PIQuarter"}; /// values of math constants to substiture constexpr std::array mathConstantsValues{ - o2::constants::math::Almost0, - o2::constants::math::Epsilon, - o2::constants::math::Almost1, - o2::constants::math::VeryBig, - o2::constants::math::PI, - o2::constants::math::TwoPI, - o2::constants::math::PIHalf, - o2::constants::math::PIThird, - o2::constants::math::PIQuarter}; + o2::constants::math::Almost0, + o2::constants::math::Epsilon, + o2::constants::math::Almost1, + o2::constants::math::VeryBig, + o2::constants::math::PI, + o2::constants::math::TwoPI, + o2::constants::math::PIHalf, + o2::constants::math::PIThird, + o2::constants::math::PIQuarter}; /// a map between BasicOp and gandiva node definitions /// note that logical 'and' and 'or' are created separately