Skip to content
Closed
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
16 changes: 6 additions & 10 deletions Geometry/HGCalCommonData/interface/HGCalTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <array>
#include <cmath>
#include <cstdint>
#include <string>
#include <vector>

class HGCalTypes {
Expand All @@ -20,12 +19,12 @@ class HGCalTypes {

static constexpr int32_t UnknownPosition = -1;
static constexpr int32_t WaferCenter = 0;
static constexpr int32_t WaferCenterB = 1;
static constexpr int32_t CornerCenterYp = 2;
static constexpr int32_t CornerCenterYm = 3;
static constexpr int32_t WaferCenterR = 4;
static constexpr int32_t CornerCenterXp = 5;
static constexpr int32_t CornerCenterXm = 6;
static constexpr int32_t CornerCenterYp = 1;
static constexpr int32_t CornerCenterYm = 2;
static constexpr int32_t CornerCenterXp = 3;
static constexpr int32_t CornerCenterXm = 4;
static constexpr int32_t WaferCenterB = 5;
static constexpr int32_t WaferCenterR = 6;

static constexpr int32_t WaferTypeUndefined = -1;
static constexpr int32_t WaferHD120 = 0;
Expand Down Expand Up @@ -140,9 +139,6 @@ 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);

private:
static constexpr int32_t facu_ = 1;
Expand Down
33 changes: 6 additions & 27 deletions Geometry/HGCalCommonData/src/HGCalTypes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,10 @@ int32_t HGCalTypes::getUnpackedCellType6(int id) { return (id / faccell6_); }
int32_t HGCalTypes::getUnpackedCell6(int id) { return (id % faccell6_); }

int32_t HGCalTypes::layerType(int type) {
static const int32_t layerTypeX[7] = {HGCalTypes::WaferCenter,
HGCalTypes::WaferCenterB,
HGCalTypes::WaferCenterR,
HGCalTypes::CornerCenterYp,
HGCalTypes::CornerCenterYm,
HGCalTypes::CornerCenterXp,
HGCalTypes::CornerCenterXm};
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 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 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");
static constexpr int32_t types[5] = {HGCalTypes::WaferCenter,
HGCalTypes::WaferCenterB,
HGCalTypes::CornerCenterYp,
HGCalTypes::CornerCenterYm,
HGCalTypes::WaferCenterR};
return ((type >= 0 && type < 5) ? types[type] : HGCalTypes::WaferCenter);
}