Skip to content

Commit

Permalink
Backport the bugfixes to HGCal geometries of versions V16 (cms-sw#41208
Browse files Browse the repository at this point in the history
…) and V17 (cms-sw#41294) to CMSSW version 13_0_X
  • Loading branch information
Sunanda committed Apr 6, 2023
1 parent a897f09 commit 4f4b391
Show file tree
Hide file tree
Showing 4 changed files with 286 additions and 109 deletions.
4 changes: 2 additions & 2 deletions Geometry/HGCalCommonData/interface/HGCalWaferMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ class HGCalWaferMask {
// Gets the corners of the partial wafers from its type, orientation, zside
// (Good for V15, V16 geometries)
static std::vector<std::pair<double, double> > waferXY(
int part, int orient, int zside, double delX, double delY, double xpos, double ypos);
int part, int orient, int zside, double waferSize, double offset, double xpos, double ypos);
// Gets the corners of the partial wafers from its type, placement index
// (Good for V17 geometry)
static std::vector<std::pair<double, double> > waferXY(
int part, int placement, double delX, double delY, double xpos, double ypos);
int part, int placement, double wafersize, double offset, double xpos, double ypos);

private:
static constexpr double sqrt3_ = 1.732050807568877; // std::sqrt(3.0) in double precision
Expand Down
7 changes: 2 additions & 5 deletions Geometry/HGCalCommonData/plugins/DDHGCalWaferP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,14 @@ void DDHGCalWaferP::initialize(const DDNumericArguments& nArgs,

void DDHGCalWaferP::execute(DDCompactView& cpv) {
static constexpr double tol = 0.00001;
static const double sqrt3 = std::sqrt(3.0);
double r = 0.5 * waferSize_;
double R = 2.0 * r / sqrt3;
std::string parentName = parent().name().name();

// Loop over all types
for (unsigned int k = 0; k < tags_.size(); ++k) {
// First the mother
std::string mother = parentName + tags_[k];
std::vector<std::pair<double, double> > wxy =
HGCalWaferMask::waferXY(partialTypes_[k], orientations_[k], 1, r, R, 0.0, 0.0);
HGCalWaferMask::waferXY(partialTypes_[k], orientations_[k], 1, waferSize_, 0.0, 0.0, 0.0);
std::vector<double> xM, yM;
for (unsigned int i = 0; i < (wxy.size() - 1); ++i) {
xM.emplace_back(wxy[i].first);
Expand All @@ -139,7 +136,7 @@ void DDHGCalWaferP::execute(DDCompactView& cpv) {
#endif

// Then the layers
wxy = HGCalWaferMask::waferXY(partialTypes_[k], orientations_[k], 1, r, R, 0.0, 0.0);
wxy = HGCalWaferMask::waferXY(partialTypes_[k], orientations_[k], 1, waferSize_, 0.0, 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i = 0; i < (wxy.size() - 1); ++i) {
xL.emplace_back(wxy[i].first);
Expand Down
7 changes: 2 additions & 5 deletions Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
#endif

static constexpr double tol = 0.00001 * dd4hep::mm;
static const double sqrt3 = std::sqrt(3.0);
double r = 0.5 * waferSize;
double R = 2.0 * r / sqrt3;

// Loop over all types
for (unsigned int k = 0; k < tags.size(); ++k) {
// First the mother
std::string mother = parentName + tags[k];
std::vector<std::pair<double, double>> wxy =
HGCalWaferMask::waferXY(partialTypes[k], orientations[k], 1, r, R, 0.0, 0.0);
HGCalWaferMask::waferXY(partialTypes[k], orientations[k], 1, waferSize, 0.0, 0.0, 0.0);
std::vector<double> xM, yM;
for (unsigned int i = 0; i < (wxy.size() - 1); ++i) {
xM.emplace_back(wxy[i].first);
Expand All @@ -106,7 +103,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext

// Then the layers
dd4hep::Rotation3D rotation;
wxy = HGCalWaferMask::waferXY(partialTypes[k], orientations[k], 1, r, R, 0.0, 0.0);
wxy = HGCalWaferMask::waferXY(partialTypes[k], orientations[k], 1, waferSize, 0.0, 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i = 0; i < (wxy.size() - 1); ++i) {
xL.emplace_back(wxy[i].first);
Expand Down
Loading

0 comments on commit 4f4b391

Please sign in to comment.