From acc4ab3f25767010ddbc76bdac7b4283e566d866 Mon Sep 17 00:00:00 2001 From: akritkbehera Date: Tue, 13 Jan 2026 10:14:02 +0100 Subject: [PATCH 1/3] Fix constexpr std::string error --- .../HGCalCommonData/interface/HGCalTypes.h | 21 ++++++++++++++++--- Geometry/HGCalCommonData/src/HGCalTypes.cc | 19 +++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Geometry/HGCalCommonData/interface/HGCalTypes.h b/Geometry/HGCalCommonData/interface/HGCalTypes.h index a6ec2d9148347..134def7736a5c 100644 --- a/Geometry/HGCalCommonData/interface/HGCalTypes.h +++ b/Geometry/HGCalCommonData/interface/HGCalTypes.h @@ -5,6 +5,7 @@ #include #include #include +#include #include class HGCalTypes { @@ -140,9 +141,9 @@ class HGCalTypes { // LD vs HD and Fullvs Partial wafer static constexpr bool waferHD(int32_t type) { return ((type == WaferHD120) || (type == WaferHD200)); } static constexpr bool waferFull(int32_t type) { return (type == WaferFull); } - static std::string layerTypeX(int32_t type); - static std::string waferType(int32_t type); - static std::string waferTypeX(int32_t type); + static std::string_view layerTypeX(int32_t type); + static std::string_view waferType(int32_t type); + static std::string_view waferTypeX(int32_t type); private: static constexpr int32_t facu_ = 1; @@ -156,6 +157,20 @@ class HGCalTypes { static constexpr int32_t faccell_ = 100; static constexpr int32_t faccelltype_ = 10000; static constexpr int32_t faccell6_ = 1000; + static constexpr int32_t layerType_[7] = {HGCalTypes::WaferCenter, + HGCalTypes::WaferCenterB, + HGCalTypes::WaferCenterR, + HGCalTypes::CornerCenterYp, + HGCalTypes::CornerCenterYm, + HGCalTypes::CornerCenterXp, + HGCalTypes::CornerCenterXm}; + static constexpr std::string_view layerTypes_[7] = { + "Center", "CenterB", "CenterYp", "CenterYm", "CenterR", "CenterXp", "CenterXm"}; + static constexpr std::string_view waferType_[4] = {"HD120", "LD200", "LD300", "HD200"}; + static constexpr std::string_view waferTypeX_[27] = { + "Full", "Five", "ChopTwo", "ChopTwoM", "Half", "Semi", "Semi2", "Three", "Half2", + "Five2", "Unknown10", "LDTop", "LDBottom", "LDLeft", "LDRight", "LDFive", "LDThree", "Unknown17", + "Unknown18", "Unknown19", "Unknown20", "HDTop", "HDBottom", "HDLeft", "HDRight", "HDFive", "Out"}; }; #endif diff --git a/Geometry/HGCalCommonData/src/HGCalTypes.cc b/Geometry/HGCalCommonData/src/HGCalTypes.cc index d19036f9b7a69..3d65abfbd5ce0 100644 --- a/Geometry/HGCalCommonData/src/HGCalTypes.cc +++ b/Geometry/HGCalCommonData/src/HGCalTypes.cc @@ -50,21 +50,12 @@ int32_t HGCalTypes::layerType(int type) { return ((type >= 0) && (type < 7)) ? layerTypeX[type] : HGCalTypes::WaferCenter; } -std::string HGCalTypes::layerTypeX(int32_t type) { - static const std::string layerTypes[7] = { - "Center", "CenterB", "CenterYp", "CenterYm", "CenterR", "CenterXp", "CenterXm"}; - return layerTypes[layerType(type)]; -} +std::string_view HGCalTypes::layerTypeX(int32_t type) { return layerTypes_[HGCalTypes::layerType(type)]; } -std::string HGCalTypes::waferType(int32_t type) { - static const std::string waferType[4] = {"HD120", "LD200", "LD300", "HD200"}; - return (((type >= 0) && (type < 4)) ? waferType[type] : "Undefined"); +std::string_view HGCalTypes::waferType(int32_t type) { + return (((type >= 0) && (type < 4)) ? HGCalTypes::waferType_[type] : "Undefined"); } -std::string HGCalTypes::waferTypeX(int32_t type) { - static const std::string waferTypeX[27] = { - "Full", "Five", "ChopTwo", "ChopTwoM", "Half", "Semi", "Semi2", "Three", "Half2", - "Five2", "Unknown10", "LDTop", "LDBottom", "LDLeft", "LDRight", "LDFive", "LDThree", "Unknown17", - "Unknown18", "Unknown19", "Unknown20", "HDTop", "HDBottom", "HDLeft", "HDRight", "HDFive", "Out"}; - return (((type >= 0) && (type < 27)) ? waferTypeX[type] : "UnknownXX"); +std::string_view HGCalTypes::waferTypeX(int32_t type) { + return (((type >= 0) && (type < 27)) ? HGCalTypes::waferTypeX_[type] : "UnknownXX"); } From d15ab5b3591b7ffc78951978b863c681ab2ca065 Mon Sep 17 00:00:00 2001 From: Akrit Kumar Behera <84931167+akritkbehera@users.noreply.github.com> Date: Tue, 13 Jan 2026 12:37:25 +0100 Subject: [PATCH 2/3] Add new dependencies to BuildFile.xml --- BigProducts/Simulation/BuildFile.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BigProducts/Simulation/BuildFile.xml b/BigProducts/Simulation/BuildFile.xml index fef5a4b1bc75b..b8375e3c31caf 100644 --- a/BigProducts/Simulation/BuildFile.xml +++ b/BigProducts/Simulation/BuildFile.xml @@ -1,3 +1,5 @@ + + From 1576a6d2b4177eece1395efb60478c7f7ce0bbb2 Mon Sep 17 00:00:00 2001 From: Akrit Kumar Behera <84931167+akritkbehera@users.noreply.github.com> Date: Tue, 13 Jan 2026 13:36:12 +0100 Subject: [PATCH 3/3] Revert Removed unused dependencies from BuildFile.xml. --- BigProducts/Simulation/BuildFile.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/BigProducts/Simulation/BuildFile.xml b/BigProducts/Simulation/BuildFile.xml index b8375e3c31caf..fef5a4b1bc75b 100644 --- a/BigProducts/Simulation/BuildFile.xml +++ b/BigProducts/Simulation/BuildFile.xml @@ -1,5 +1,3 @@ - -