File indexing completed on 2024-04-11 23:27:57
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 halfTrunCell = 12;
0038 static constexpr int32_t halfExtCell = 13;
0039 static constexpr int32_t partiaclWaferCellsOffset = 11;
0040
0041 static constexpr int32_t LDPartial0714Cell = 14;
0042 static constexpr int32_t LDPartial0209Cell = 15;
0043 static constexpr int32_t LDPartial0007Cell = 16;
0044 static constexpr int32_t LDPartial0815Cell = 17;
0045 static constexpr int32_t LDPartial1415Cell = 18;
0046 static constexpr int32_t LDPartial1515Cell = 19;
0047
0048 static constexpr int32_t HDPartial0920Cell = 20;
0049 static constexpr int32_t HDPartial1021Cell = 21;
0050
0051 static constexpr int32_t undefinedCell = -1;
0052 static constexpr int32_t centralCell = 0;
0053 static constexpr int32_t bottomLeftEdge = 1;
0054 static constexpr int32_t leftEdge = 2;
0055 static constexpr int32_t topLeftEdge = 3;
0056 static constexpr int32_t topRightEdge = 4;
0057 static constexpr int32_t rightEdge = 5;
0058 static constexpr int32_t bottomRightEdge = 6;
0059 static constexpr int32_t bottomCorner = 11;
0060 static constexpr int32_t bottomLeftCorner = 12;
0061 static constexpr int32_t topLeftCorner = 13;
0062 static constexpr int32_t topCorner = 14;
0063 static constexpr int32_t topRightCorner = 15;
0064 static constexpr int32_t bottomRightCorner = 16;
0065
0066 static constexpr int32_t leftCell = 21;
0067 static constexpr int32_t rightCell = 22;
0068 static constexpr int32_t topCell = 23;
0069 static constexpr int32_t bottomCell = 24;
0070 static constexpr int32_t partiaclCellsPosOffset = 21;
0071
0072 std::pair<double, double> cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0073 std::pair<double, double> cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0074
0075 std::pair<int32_t, int32_t> cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0076
0077 static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient);
0078
0079 static std::pair<int32_t, int32_t> cellOrient(int32_t placementIndex);
0080
0081 static std::pair<int32_t, int32_t> cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex);
0082 static std::pair<int32_t, int32_t> cellType(
0083 int32_t u, int32_t v, int32_t ncell, int32_t placementIndex, int32_t partialType);
0084
0085 private:
0086 const double sqrt3By2_ = (0.5 * std::sqrt(3.0));
0087 int32_t ncell_[2];
0088 double cellX_[2], cellY_[2];
0089 };
0090
0091 #endif