CMS 3D CMS Logo

HGCalWaferMask.h
Go to the documentation of this file.
1 #ifndef HGCalCommonData_HGCalWaferMask_h
2 #define HGCalCommonData_HGCalWaferMask_h
3 
13 #include <cmath>
14 #include <vector>
15 #include <array>
16 
18 public:
19  HGCalWaferMask() = default;
20 
21  // Decides if the cell is present or not from # oc corners (for V14)
22  static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners);
23  // Decides if the cell is present or not from # oc corners (for V15, V16)
24  static bool goodCell(int u, int v, int N, int type, int rotn);
25  // Decides if the cell is present or not (for v17)
26  static bool goodCell(int u, int v, int waferType);
27  // Converts rotation index (as otained from flat file) depending on
28  // zside and type (for V15, V16)
29  static int getRotation(int zside, int type, int rotn);
30  // Get partial wafer type and orientation (for V15, V16)
31  static std::pair<int, int> getTypeMode(const double& xpos,
32  const double& ypos,
33  const double& delX,
34  const double& delY,
35  const double& rin,
36  const double& rout,
37  const int& waferType,
38  const int& mode,
39  const bool& v17,
40  const bool& debug = false);
41  // Checks partial wafer type and orientation (for V15, V16)
42  static bool goodTypeMode(const double& xpos,
43  const double& ypos,
44  const double& delX,
45  const double& delY,
46  const double& rin,
47  const double& rout,
48  const int& part,
49  const int& rotn,
50  const bool& v17,
51  const bool& debug = false);
52  // Gets the corners of the partial wafers from its type, orientation, zside
53  // (Good for V15, V16 geometries)
54  static std::vector<std::pair<double, double> > waferXY(const int& part,
55  const int& orient,
56  const int& zside,
57  const double& waferSize,
58  const double& offset,
59  const double& xpos,
60  const double& ypos,
61  const bool& v17);
62  // Gets the corners of the partial wafers from its type, placement index
63  // (Good for V17 geometry)
64  static std::vector<std::pair<double, double> > waferXY(const int& part,
65  const int& placement,
66  const double& wafersize,
67  const double& offset,
68  const double& xpos,
69  const double& ypos,
70  const bool& v17);
71 
72  static std::array<double, 4> maskCut(
73  const int& part, const int& place, const double& waferSize, const double& offset, const bool& v17OrLess);
74 
75 private:
76  static constexpr double sqrt3_ = 1.732050807568877; // std::sqrt(3.0) in double precision
77  static constexpr double sin_60_ = 0.5 * sqrt3_;
78  static constexpr double cos_60_ = 0.5;
79  static constexpr double tan_60_ = sqrt3_;
80  static constexpr std::array<double, 12> tan_1 = {
81  {-sqrt3_, sqrt3_, 0.0, -sqrt3_, sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0}};
82  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}};
83  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}};
84  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}};
85 };
86 
87 #endif
static constexpr std::array< double, 12 > sign_2
static constexpr std::array< double, 12 > cos_1
static bool goodCell(int u, int v, int N, int type, int rotn)
static constexpr double sqrt3_
int zside(DetId const &)
static int getRotation(int zside, int type, int rotn)
static constexpr double sin_60_
static std::vector< std::pair< double, double > > waferXY(const int &part, const int &orient, const int &zside, const double &waferSize, const double &offset, const double &xpos, const double &ypos, const bool &v17)
static constexpr double tan_60_
static std::pair< int, int > getTypeMode(const double &xpos, const double &ypos, const double &delX, const double &delY, const double &rin, const double &rout, const int &waferType, const int &mode, const bool &v17, const bool &debug=false)
static std::array< double, 4 > maskCut(const int &part, const int &place, const double &waferSize, const double &offset, const bool &v17OrLess)
static constexpr std::array< double, 12 > sign_1
static bool goodTypeMode(const double &xpos, const double &ypos, const double &delX, const double &delY, const double &rin, const double &rout, const int &part, const int &rotn, const bool &v17, const bool &debug=false)
#define debug
Definition: HDRShower.cc:19
#define N
Definition: blowfish.cc:9
part
Definition: HCALResponse.h:20
static constexpr double cos_60_
HGCalWaferMask()=default
static constexpr std::array< double, 12 > tan_1
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)