Skip to content

Commit

Permalink
third commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh bhatt committed Feb 11, 2024
1 parent a96d314 commit 8083787
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions Geometry/HGCalCommonData/src/HGCalCellOffset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -682,23 +682,26 @@ HGCalCellOffset::HGCalCellOffset(
if (k == 0) {
double totalArea = 11 * sqrt3_ * std::pow(cellY_[k], 2) / 6;
double cutArea1 = (5 * cellY_[k] * guardRingOffset_) / (2 * sqrt3_);
double cutArea2 = (5 * cellY_[k] * guardRingOffset_) / (2 * sqrt3_) - std::pow(guardRingOffset_, 2)/(2 * sqrt3_);
double cutArea2 =
(5 * cellY_[k] * guardRingOffset_) / (2 * sqrt3_) - std::pow(guardRingOffset_, 2) / (2 * sqrt3_);

double x1 = -cellY_[k] / (4 * sqrt3_);
double y1 = cellY_[k] - 0.5 * guardRingOffset_;
double x2_0 =((1.041 * cellY_[k] * cellY_[k]) - (cellY_[k] * 0.416 * guardRingOffset_) +
(std::pow(guardRingOffset_, 2) / 18.0))/((5.0 * cellY_[k]/(2.0 * sqrt3_)) - (guardRingOffset_/(2.0 * sqrt3_)));
double x2_0 = ((1.041 * cellY_[k] * cellY_[k]) - (cellY_[k] * 0.416 * guardRingOffset_) +
(std::pow(guardRingOffset_, 2) / 18.0)) /
((5.0 * cellY_[k] / (2.0 * sqrt3_)) - (guardRingOffset_ / (2.0 * sqrt3_)));
double y2_0 =
((5.0 * cellY_[k] * guardRingOffset_/(4.0 * sqrt3_)) - std::pow(guardRingOffset_, 2)/(6 * sqrt3_)) /
((5.0 * cellY_[k]/(2.0 * sqrt3_)) - (guardRingOffset_ / (2.0 * sqrt3_)));
((5.0 * cellY_[k] * guardRingOffset_ / (4.0 * sqrt3_)) - std::pow(guardRingOffset_, 2) / (6 * sqrt3_)) /
((5.0 * cellY_[k] / (2.0 * sqrt3_)) - (guardRingOffset_ / (2.0 * sqrt3_)));

double x2 = -(0.5 * x2_0) + (sqrt3By2_ * y2_0) + (cellY_[k] * 1.5 * sqrt3By2_);
double y2 = -(0.5 * y2_0) + (sqrt3By2_ * x2_0) - cellY_[k];
double cellArea = totalArea - cutArea1 - cutArea2;
double xMag = ((47.0 * cellY_[k]/ (528.0 * sqrt3_)) * totalArea - (cutArea1 * x1) - (cutArea2 * x2)) /(cellArea);
double yMag =((47.0 * cellY_[k]/ 528.0) * totalArea - (cutArea1 * y1) - (cutArea2 * y2)) /(cellArea);
double xMag =
((47.0 * cellY_[k] / (528.0 * sqrt3_)) * totalArea - (cutArea1 * x1) - (cutArea2 * x2)) / (cellArea);
double yMag = ((47.0 * cellY_[k] / 528.0) * totalArea - (cutArea1 * y1) - (cutArea2 * y2)) / (cellArea);

std::array<double, 6> tempOffsetX = {{(-sqrt3By2_ * xMag - 0.5 * yMag),
std::array<double, 6> tempOffsetX = {{(-sqrt3By2_ * xMag - 0.5 * yMag),
(-sqrt3By2_ * xMag + 0.5 * yMag),
yMag,
(sqrt3By2_ * xMag + 0.5 * yMag),
Expand Down

0 comments on commit 8083787

Please sign in to comment.