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 
17 public:
18  HGCalWaferMask() = default;
19 
20  // Decides if the cell is present or not from # oc corners (for V14)
21  static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners);
22  // Decides if the cell is present or not from # oc corners (for V15, V16)
23  static bool goodCell(int u, int v, int N, int type, int rotn);
24  // Decides if the cell is present or not (for v17)
25  static bool goodCell(int u, int v, int waferType);
26  // Converts rotation index (as otained from flat file) depending on
27  // zside and type (for V15, V16)
28  static int getRotation(int zside, int type, int rotn);
29  // Get partial wafer type and orientation (for V15, V16)
30  static std::pair<int, int> getTypeMode(const double& xpos,
31  const double& ypos,
32  const double& delX,
33  const double& delY,
34  const double& rin,
35  const double& rout,
36  const int& waferType,
37  const int& mode,
38  const bool& v17,
39  const bool& debug = false);
40  // Checks partial wafer type and orientation (for V15, V16)
41  static bool goodTypeMode(const double& xpos,
42  const double& ypos,
43  const double& delX,
44  const double& delY,
45  const double& rin,
46  const double& rout,
47  const int& part,
48  const int& rotn,
49  const bool& v17,
50  const bool& debug = false);
51  // Gets the corners of the partial wafers from its type, orientation, zside
52  // (Good for V15, V16 geometries)
53  static std::vector<std::pair<double, double> > waferXY(const int& part,
54  const int& orient,
55  const int& zside,
56  const double& waferSize,
57  const double& offset,
58  const double& xpos,
59  const double& ypos,
60  const bool& v17);
61  // Gets the corners of the partial wafers from its type, placement index
62  // (Good for V17 geometry)
63  static std::vector<std::pair<double, double> > waferXY(const int& part,
64  const int& placement,
65  const double& wafersize,
66  const double& offset,
67  const double& xpos,
68  const double& ypos,
69  const bool& v17);
70 
71 private:
72  static constexpr double sqrt3_ = 1.732050807568877; // std::sqrt(3.0) in double precision
73  static constexpr double sin_60_ = 0.5 * sqrt3_;
74  static constexpr double cos_60_ = 0.5;
75  static constexpr double tan_60_ = sqrt3_;
76 };
77 
78 #endif
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 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 bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)