Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Geometry/HGCalCommonData/interface/HGCalTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <cmath>
#include <cstdint>
#include <string>
#include <string_view>
#include <vector>

class HGCalTypes {
Expand Down Expand Up @@ -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;
Expand All @@ -163,10 +164,10 @@ class HGCalTypes {
HGCalTypes::CornerCenterYm,
HGCalTypes::CornerCenterXp,
HGCalTypes::CornerCenterXm};
static constexpr std::string layerTypes_[7] = {
static constexpr std::string_view layerTypes_[7] = {
"Center", "CenterB", "CenterYp", "CenterYm", "CenterR", "CenterXp", "CenterXm"};
static constexpr std::string waferType_[4] = {"HD120", "LD200", "LD300", "HD200"};
static constexpr std::string waferTypeX_[27] = {
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"};
Expand Down
6 changes: 3 additions & 3 deletions Geometry/HGCalCommonData/src/HGCalTypes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ int32_t HGCalTypes::layerType(int type) {
return ((type >= 0) && (type < 7)) ? HGCalTypes::layerType_[type] : HGCalTypes::WaferCenter;
}

std::string HGCalTypes::layerTypeX(int32_t type) { return layerTypes_[HGCalTypes::layerType(type)]; }
std::string_view HGCalTypes::layerTypeX(int32_t type) { return layerTypes_[HGCalTypes::layerType(type)]; }

std::string HGCalTypes::waferType(int32_t type) {
std::string_view HGCalTypes::waferType(int32_t type) {
return (((type >= 0) && (type < 4)) ? HGCalTypes::waferType_[type] : "Undefined");
}

std::string HGCalTypes::waferTypeX(int32_t type) {
std::string_view HGCalTypes::waferTypeX(int32_t type) {
return (((type >= 0) && (type < 27)) ? HGCalTypes::waferTypeX_[type] : "UnknownXX");
}