Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase2-336G Backport the bugfixes to HGCal geometries of versions V16 (#41208) and V17 (#41294) to CMSSW version 13_0_X #41296

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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