Skip to content

Commit

Permalink
Take comments from Andrea
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Feb 17, 2023
1 parent 1441b6a commit 492fd68
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 46 deletions.
6 changes: 6 additions & 0 deletions Geometry/HGCalCommonData/interface/HGCalWaferMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class HGCalWaferMask {
// (Good for V17 geometry)
static std::vector<std::pair<double, double> > waferXY(
int part, int placement, double delX, double delY, double xpos, double ypos);

private:
static constexpr double sqrt3_ = 1.732050807568877; // std::sqrt(3.0) in double precision
static constexpr double sin_60_ = 0.5 * sqrt3_;
static constexpr double cos_60_ = 0.5;
static constexpr double tan_60_ = sqrt3_;
};

#endif
89 changes: 43 additions & 46 deletions Geometry/HGCalCommonData/src/HGCalWaferMask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1279,11 +1279,8 @@ std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(
are chosen in the variable *np*
The points 24-35 are the same as points 12-23 with different offset
*/
const double Sin_60 = std::sqrt(3.0) / 2.0;
const double Cos_60 = 0.5;
const double Tan_60 = Sin_60 / Cos_60;
double delX = 0.5 * waferSize;
double delY = delX / Sin_60;
double delY = delX / sin_60_;
double dx[36] = {HGCalTypes::c00 * delX, HGCalTypes::c10 * delX, HGCalTypes::c10 * delX, HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX, -HGCalTypes::c10 * delX, HGCalTypes::c50 * delX, HGCalTypes::c10 * delX,
HGCalTypes::c50 * delX, -HGCalTypes::c50 * delX, -HGCalTypes::c10 * delX, -HGCalTypes::c50 * delX,
Expand All @@ -1309,23 +1306,23 @@ std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(
0.0,
offset,
offset,
-offset * Cos_60,
-offset * cos_60_,
-offset,
-offset * Cos_60,
offset * Cos_60,
-offset * cos_60_,
offset * cos_60_,
offset,
offset * Cos_60,
-offset * Cos_60,
offset * cos_60_,
-offset * cos_60_,
-offset,
-offset * Cos_60,
offset * Cos_60,
-offset * cos_60_,
offset * cos_60_,
offset,
offset * Cos_60,
-offset * Cos_60,
offset * Cos_60,
offset * cos_60_,
-offset * cos_60_,
offset * cos_60_,
offset,
offset * Cos_60,
-offset * Cos_60,
offset * cos_60_,
-offset * cos_60_,
-offset,
0.0,
-offset,
Expand All @@ -1339,42 +1336,42 @@ std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(
0.0,
-offset,
-offset};
double offsety[36] = {offset / Sin_60,
offset / Tan_60,
-offset / Tan_60,
-offset / Sin_60,
-offset / Tan_60,
offset / Tan_60,
offset * Sin_60,
double offsety[36] = {offset / sin_60_,
offset / tan_60_,
-offset / tan_60_,
-offset / sin_60_,
-offset / tan_60_,
offset / tan_60_,
offset * sin_60_,
0.0,
-offset * Sin_60,
-offset * Sin_60,
-offset * sin_60_,
-offset * sin_60_,
0.0,
offset * Sin_60,
offset * Sin_60,
offset * sin_60_,
offset * sin_60_,
0.0,
-offset * Sin_60,
-offset * Sin_60,
-offset * sin_60_,
-offset * sin_60_,
0.0,
offset * Sin_60,
-offset * Sin_60,
-offset * Sin_60,
offset * sin_60_,
-offset * sin_60_,
-offset * sin_60_,
0.0,
offset * Sin_60,
offset * Sin_60,
offset * sin_60_,
offset * sin_60_,
0.0,
offset / Sin_60,
offset / Tan_60,
-offset / Tan_60,
-offset / Sin_60,
-offset / Tan_60,
offset / Tan_60,
-offset / Sin_60,
-offset / Tan_60,
offset / Tan_60,
offset / Sin_60,
offset / Tan_60,
-offset / Tan_60};
offset / sin_60_,
offset / tan_60_,
-offset / tan_60_,
-offset / sin_60_,
-offset / tan_60_,
offset / tan_60_,
-offset / sin_60_,
-offset / tan_60_,
offset / tan_60_,
offset / sin_60_,
offset / tan_60_,
-offset / tan_60_};

if (part == HGCalTypes::WaferFull) {
int np[7] = {0, 1, 2, 3, 4, 5, 0};
Expand Down

0 comments on commit 492fd68

Please sign in to comment.