File indexing completed on 2024-06-04 04:35:02
0001 #ifndef HGCalCommonData_HGCalWaferMask_h
0002 #define HGCalCommonData_HGCalWaferMask_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <cmath>
0014 #include <vector>
0015 #include <array>
0016
0017 class HGCalWaferMask {
0018 public:
0019 HGCalWaferMask() = default;
0020
0021
0022 static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners);
0023
0024 static bool goodCell(int u, int v, int N, int type, int rotn);
0025
0026 static bool goodCell(int u, int v, int waferType);
0027
0028
0029 static int getRotation(int zside, int type, int rotn);
0030
0031 static std::pair<int, int> getTypeMode(const double& xpos,
0032 const double& ypos,
0033 const double& delX,
0034 const double& delY,
0035 const double& rin,
0036 const double& rout,
0037 const int& waferType,
0038 const int& mode,
0039 const bool& v17,
0040 const bool& debug = false);
0041
0042 static bool goodTypeMode(const double& xpos,
0043 const double& ypos,
0044 const double& delX,
0045 const double& delY,
0046 const double& rin,
0047 const double& rout,
0048 const int& part,
0049 const int& rotn,
0050 const bool& v17,
0051 const bool& debug = false);
0052
0053
0054 static std::vector<std::pair<double, double> > waferXY(const int& part,
0055 const int& orient,
0056 const int& zside,
0057 const double& waferSize,
0058 const double& offset,
0059 const double& xpos,
0060 const double& ypos,
0061 const bool& v17);
0062
0063
0064 static std::vector<std::pair<double, double> > waferXY(const int& part,
0065 const int& placement,
0066 const double& wafersize,
0067 const double& offset,
0068 const double& xpos,
0069 const double& ypos,
0070 const bool& v17);
0071
0072 static std::array<double, 4> maskCut(
0073 const int& part, const int& place, const double& waferSize, const double& offset, const bool& v17OrLess);
0074
0075 private:
0076 static constexpr double sqrt3_ = 1.732050807568877;
0077 static constexpr double sin_60_ = 0.5 * sqrt3_;
0078 static constexpr double cos_60_ = 0.5;
0079 static constexpr double tan_60_ = sqrt3_;
0080 static constexpr std::array<double, 12> tan_1 = {
0081 {-sqrt3_, sqrt3_, 0.0, -sqrt3_, sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0}};
0082 static constexpr std::array<double, 12> cos_1 = {{0.5, -0.5, -1.0, -0.5, 0.5, 1.0, 0.5, -0.5, -1.0, -0.5, 0.5, 1.0}};
0083 static constexpr std::array<double, 12> sign_1 = {{1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0}};
0084 static constexpr std::array<double, 12> sign_2 = {{1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0}};
0085 };
0086
0087 #endif