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  bool debug = false);
39  // Checks partial wafer type and orientation (for V15, V16)
40  static bool goodTypeMode(double xpos,
41  double ypos,
42  double delX,
43  double delY,
44  double rin,
45  double rout,
46  int part,
47  int rotn,
48  bool debug = false);
49  // Gets the corners of the partial wafers from its type, orientation, zside
50  // (Good for V15, V16 geometries)
51  static std::vector<std::pair<double, double> > waferXY(
52  int part, int orient, int zside, double delX, double delY, double xpos, double ypos);
53  // Gets the corners of the partial wafers from its type, placement index
54  // (Good for V17 geometry)
55  static std::vector<std::pair<double, double> > waferXY(
56  int part, int placement, double delX, double delY, double xpos, double ypos);
57 
58 private:
59  static constexpr double sqrt3_ = 1.732050807568877; // std::sqrt(3.0) in double precision
60  static constexpr double sin_60_ = 0.5 * sqrt3_;
61  static constexpr double cos_60_ = 0.5;
62  static constexpr double tan_60_ = sqrt3_;
63 };
64 
65 #endif
static std::vector< std::pair< double, double > > waferXY(int part, int orient, int zside, double delX, double delY, double xpos, double ypos)
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 bool goodTypeMode(double xpos, double ypos, double delX, double delY, double rin, double rout, int part, int rotn, bool debug=false)
static constexpr double tan_60_
#define debug
Definition: HDRShower.cc:19
#define N
Definition: blowfish.cc:9
part
Definition: HCALResponse.h:20
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, bool debug=false)
static constexpr double cos_60_
HGCalWaferMask()=default
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)