File indexing completed on 2025-01-18 03:42:03
0001 #ifndef Geometry_HGCalCommonData_HGCalCell_h
0002 #define Geometry_HGCalCommonData_HGCalCell_h
0003
0004 #include <cmath>
0005 #include <cstdint>
0006
0007 class HGCalCell {
0008 public:
0009 HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse);
0010
0011 static constexpr int32_t cellPlacementIndex0 = 0;
0012 static constexpr int32_t cellPlacementIndex1 = 1;
0013 static constexpr int32_t cellPlacementIndex2 = 2;
0014 static constexpr int32_t cellPlacementIndex3 = 3;
0015 static constexpr int32_t cellPlacementIndex4 = 4;
0016 static constexpr int32_t cellPlacementIndex5 = 5;
0017 static constexpr int32_t cellPlacementIndex6 = 6;
0018 static constexpr int32_t cellPlacementIndex7 = 7;
0019 static constexpr int32_t cellPlacementIndex8 = 8;
0020 static constexpr int32_t cellPlacementIndex9 = 9;
0021 static constexpr int32_t cellPlacementIndex10 = 10;
0022 static constexpr int32_t cellPlacementIndex11 = 11;
0023
0024 static constexpr int32_t cellPlacementExtra = 6;
0025 static constexpr int32_t cellPlacementOld = 7;
0026 static constexpr int32_t cellPlacementTotal = 12;
0027
0028 static constexpr int32_t fullCell = 0;
0029 static constexpr int32_t cornerCell = 1;
0030 static constexpr int32_t truncatedCell = 2;
0031 static constexpr int32_t extendedCell = 3;
0032 static constexpr int32_t truncatedMBCell = 4;
0033 static constexpr int32_t extendedMBCell = 5;
0034 static constexpr int32_t fullWaferCellsCount = 6;
0035
0036 static constexpr int32_t halfCell = 11;
0037 static constexpr int32_t extHalfTrunCell = 12;
0038 static constexpr int32_t extHalfExtCell = 13;
0039 static constexpr int32_t extTrunCellCenCut = 14;
0040 static constexpr int32_t extExtCellCenCut = 15;
0041 static constexpr int32_t extTrunCellEdgeCut = 16;
0042 static constexpr int32_t extExtCellEdgeCut = 17;
0043 static constexpr int32_t fullCellEdgeCut = 18;
0044 static constexpr int32_t fullCellCenCut = 19;
0045 static constexpr int32_t intExtCell = 20;
0046 static constexpr int32_t intTrunCell = 21;
0047 static constexpr int32_t intHalfExtCell = 22;
0048 static constexpr int32_t intHalfTrunCell = 23;
0049 static constexpr int32_t intExtCellCenCut = 24;
0050 static constexpr int32_t intTrunCellCenCut = 25;
0051 static constexpr int32_t intExtCellEdgeCut = 26;
0052 static constexpr int32_t intTrunCellEdgeCut = 27;
0053 static constexpr int32_t partiaclWaferCellsOffset = 11;
0054
0055 static constexpr int32_t LDPartial0714Cell = 28;
0056 static constexpr int32_t LDPartial0209Cell = 29;
0057 static constexpr int32_t LDPartial0007Cell = 30;
0058 static constexpr int32_t LDPartial0815Cell = 31;
0059 static constexpr int32_t LDPartial1415Cell = 32;
0060 static constexpr int32_t LDPartial1515Cell = 33;
0061
0062 static constexpr int32_t HDPartial0920Cell = 34;
0063 static constexpr int32_t HDPartial1021Cell = 35;
0064
0065 static constexpr int32_t undefinedCell = -1;
0066 static constexpr int32_t centralCell = 0;
0067 static constexpr int32_t bottomLeftEdge = 1;
0068 static constexpr int32_t leftEdge = 2;
0069 static constexpr int32_t topLeftEdge = 3;
0070 static constexpr int32_t topRightEdge = 4;
0071 static constexpr int32_t rightEdge = 5;
0072 static constexpr int32_t bottomRightEdge = 6;
0073 static constexpr int32_t bottomCorner = 11;
0074 static constexpr int32_t bottomLeftCorner = 12;
0075 static constexpr int32_t topLeftCorner = 13;
0076 static constexpr int32_t topCorner = 14;
0077 static constexpr int32_t topRightCorner = 15;
0078 static constexpr int32_t bottomRightCorner = 16;
0079
0080 static constexpr int32_t leftCell = 21;
0081 static constexpr int32_t rightCell = 22;
0082 static constexpr int32_t topCell = 23;
0083 static constexpr int32_t bottomCell = 24;
0084 static constexpr int32_t partiaclCellsPosOffset = 21;
0085
0086 std::pair<double, double> cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0087 std::pair<double, double> cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0088
0089 std::pair<int32_t, int32_t> cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0090
0091 static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient);
0092
0093 static std::pair<int32_t, int32_t> cellOrient(int32_t placementIndex);
0094
0095 static std::pair<int32_t, int32_t> cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex);
0096 static std::pair<int32_t, int32_t> cellType(
0097 int32_t u, int32_t v, int32_t ncell, int32_t placementIndex, int32_t partialType);
0098
0099 private:
0100 const double sqrt3By2_ = (0.5 * std::sqrt(3.0));
0101 int32_t ncell_[2];
0102 double cellX_[2], cellY_[2];
0103 };
0104
0105 #endif