Skip to content

Commit

Permalink
Take care of Kevin's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda Banerjee committed Apr 2, 2020
1 parent 425804e commit 8087bbb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/interface/HGCalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class HGCalParameters {
static constexpr double k_ScaleFromDD4HepToG4 = 10.0;
static constexpr double k_ScaleToDD4HepFromG4 = 0.1;
static constexpr uint32_t k_CornerSize = 6;
static constexpr double tol = 1.0e-12;

struct hgtrap {
int lay;
Expand Down
8 changes: 4 additions & 4 deletions Geometry/HGCalCommonData/src/HGCalGeomParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ void HGCalGeomParameters::loadGeometryHexagon(const DDFilteredView& _fv,
xx += (HGCalParameters::k_ScaleFromDDD * (p2.X()));
yy += (HGCalParameters::k_ScaleFromDDD * (p2.Y()));
#ifdef EDM_ML_DEBUG
if (std::abs(p2.X()) < 1.0e-12)
if (std::abs(p2.X()) < HGCalParameters::tol)
p2.SetX(0.0);
if (std::abs(p2.Z()) < 1.0e-12)
if (std::abs(p2.Z()) < HGCalParameters::tol)
p2.SetZ(0.0);
edm::LogVerbatim("HGCalGeom") << "Wafer " << wafer << " Type " << type << " Cell " << cellx << " local "
<< xx << ":" << yy << " new " << p1 << ":" << p2;
Expand Down Expand Up @@ -464,9 +464,9 @@ void HGCalGeomParameters::loadGeometryHexagon(const cms::DDCompactView* cpv,
xx += (HGCalParameters::k_ScaleFromDDD * (p2.X()));
yy += (HGCalParameters::k_ScaleFromDDD * (p2.Y()));
#ifdef EDM_ML_DEBUG
if (std::abs(p2.X()) < 1.0e-12)
if (std::abs(p2.X()) < HGCalParameters::tol)
p2.SetX(0.0);
if (std::abs(p2.Z()) < 1.0e-12)
if (std::abs(p2.Z()) < HGCalParameters::tol)
p2.SetZ(0.0);
edm::LogVerbatim("HGCalGeom") << "Wafer " << wafer << " Type " << type << " Cell " << cellx << " local "
<< xx << ":" << yy << " new " << p1 << ":" << p2;
Expand Down
18 changes: 9 additions & 9 deletions Geometry/HGCalCommonData/src/HGCalParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ void HGCalParameters::fillTrForm(const HGCalParameters::hgtrform& mytr) {
trformTranX_.emplace_back(mytr.h3v.x());
trformTranY_.emplace_back(mytr.h3v.y());
trformTranZ_.emplace_back(mytr.h3v.z());
trformRotXX_.emplace_back((std::abs(mytr.hr.xx()) > 1.0e-12) ? mytr.hr.xx() : 0);
trformRotYX_.emplace_back((std::abs(mytr.hr.yx()) > 1.0e-12) ? mytr.hr.yx() : 0);
trformRotZX_.emplace_back((std::abs(mytr.hr.zx()) > 1.0e-12) ? mytr.hr.zx() : 0);
trformRotXY_.emplace_back((std::abs(mytr.hr.xy()) > 1.0e-12) ? mytr.hr.xy() : 0);
trformRotYY_.emplace_back((std::abs(mytr.hr.yy()) > 1.0e-12) ? mytr.hr.yy() : 0);
trformRotZY_.emplace_back((std::abs(mytr.hr.zy()) > 1.0e-12) ? mytr.hr.zy() : 0);
trformRotXZ_.emplace_back((std::abs(mytr.hr.xz()) > 1.0e-12) ? mytr.hr.xz() : 0);
trformRotYZ_.emplace_back((std::abs(mytr.hr.yz()) > 1.0e-12) ? mytr.hr.yz() : 0);
trformRotZZ_.emplace_back((std::abs(mytr.hr.zz()) > 1.0e-12) ? mytr.hr.zz() : 0);
trformRotXX_.emplace_back((std::abs(mytr.hr.xx()) > tol) ? mytr.hr.xx() : 0);
trformRotYX_.emplace_back((std::abs(mytr.hr.yx()) > tol) ? mytr.hr.yx() : 0);
trformRotZX_.emplace_back((std::abs(mytr.hr.zx()) > tol) ? mytr.hr.zx() : 0);
trformRotXY_.emplace_back((std::abs(mytr.hr.xy()) > tol) ? mytr.hr.xy() : 0);
trformRotYY_.emplace_back((std::abs(mytr.hr.yy()) > tol) ? mytr.hr.yy() : 0);
trformRotZY_.emplace_back((std::abs(mytr.hr.zy()) > tol) ? mytr.hr.zy() : 0);
trformRotXZ_.emplace_back((std::abs(mytr.hr.xz()) > tol) ? mytr.hr.xz() : 0);
trformRotYZ_.emplace_back((std::abs(mytr.hr.yz()) > tol) ? mytr.hr.yz() : 0);
trformRotZZ_.emplace_back((std::abs(mytr.hr.zz()) > tol) ? mytr.hr.zz() : 0);
#ifdef EDM_ML_DEBUG
unsigned int k = trformIndex_.size() - 1;
edm::LogVerbatim("HGCalGeom") << "HGCalParameters[" << k << "] Index " << std::hex << trformIndex_[k] << std::dec
Expand Down

0 comments on commit 8087bbb

Please sign in to comment.