Skip to content

Commit

Permalink
second commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lokesh bhatt committed Feb 11, 2024
1 parent edbf106 commit a96d314
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
18 changes: 9 additions & 9 deletions Geometry/HGCalCommonData/src/HGCalCell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,30 +650,30 @@ std::pair<int32_t, int32_t> HGCalCell::cellType(
if (((u == 15 && v == 11) || (u == 7 && v == 7)) &&
((partialType == HGCalTypes::WaferLDLeft) || (partialType == HGCalTypes::WaferLDRight))) {
cellt = HGCalCell::halfExtCell;
if ((partialType == HGCalTypes::WaferLDLeft)) {
if (partialType == HGCalTypes::WaferLDLeft) {
cellx = HGCalCell::leftCell;
} else {
cellx = HGCalCell::rightCell;
}
} else if ((u == 7 && v == 11) &&
((partialType == HGCalTypes::WaferLDFive) || (partialType == HGCalTypes::WaferLDThree))) {
cellt = HGCalCell::halfExtCell;
if ((partialType == HGCalTypes::WaferLDFive)) {
if (partialType == HGCalTypes::WaferLDFive) {
cellx = HGCalCell::leftCell;
} else {
cellx = HGCalCell::rightCell;
}
} else if (2 * v - u == 7) {
cellt = HGCalCell::halfCell;
if ((partialType == HGCalTypes::WaferLDLeft)) {
if (partialType == HGCalTypes::WaferLDLeft) {
cellx = HGCalCell::leftCell;
} else if ((partialType == HGCalTypes::WaferLDRight)) {
} else if (partialType == HGCalTypes::WaferLDRight) {
cellx = HGCalCell::rightCell;
}
} else if (2 * v - u == 15) {
if ((partialType == HGCalTypes::WaferLDFive)) {
if (partialType == HGCalTypes::WaferLDFive) {
cellx = HGCalCell::leftCell;
} else if ((partialType == HGCalTypes::WaferLDThree)) {
} else if (partialType == HGCalTypes::WaferLDThree) {
cellx = HGCalCell::rightCell;
}
cellt = HGCalCell::halfCell;
Expand Down Expand Up @@ -720,14 +720,14 @@ std::pair<int32_t, int32_t> HGCalCell::cellType(
}
} else if (2 * v - u == 4) {
cellt = HGCalCell::halfCell;
if ((partialType == HGCalTypes::WaferHDLeft)) {
if (partialType == HGCalTypes::WaferHDLeft) {
cellx = HGCalCell::leftCell;
}
} else if (2 * v - u == 18) {
cellt = HGCalCell::halfCell;
if ((partialType == HGCalTypes::WaferHDFive)) {
if (partialType == HGCalTypes::WaferHDFive) {
cellx = HGCalCell::leftCell;
} else if ((partialType == HGCalTypes::WaferHDRight)) {
} else if (partialType == HGCalTypes::WaferHDRight) {
cellx = HGCalCell::rightCell;
}
}
Expand Down
42 changes: 30 additions & 12 deletions Geometry/HGCalCommonData/src/HGCalCellOffset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,36 @@ HGCalCellOffset::HGCalCellOffset(
}
} else if (j == (HGCalCell::HDPartial1021Cell)) {
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 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 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_)));

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);

std::array<double, 6> tempOffsetX = {{(-sqrt3By2_ * xMag - 0.5 * yMag),
(-sqrt3By2_ * xMag + 0.5 * yMag),
yMag,
(sqrt3By2_ * xMag + 0.5 * yMag),
(sqrt3By2_ * xMag - 0.5 * yMag),
-yMag}};
std::array<double, 6> tempOffsetY = {{(0.5 * xMag - sqrt3By2_ * yMag),
(-sqrt3By2_ * yMag - 0.5 * xMag),
-xMag,
(-0.5 * xMag + sqrt3By2_ * yMag),
(0.5 * xMag + sqrt3By2_ * yMag),
xMag}};
for (int i = 0; i < 6; ++i) {
offsetPartialX[k][j - HGCalCell::partiaclWaferCellsOffset][i] = 0.0;
offsetPartialY[k][j - HGCalCell::partiaclWaferCellsOffset][i] = 0.0;
Expand Down Expand Up @@ -726,10 +756,6 @@ std::pair<double, double> HGCalCellOffset::cellOffsetUV2XY1(int32_t u, int32_t v
x_off = -1 * x_off;
}
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalCellOffset in wafer with placement index " << placementIndex << " type "
<< type << " for cell u " << u << " v " << v << " Offset x:y " << x_off << ":" << y_off;
#endif
return std::make_pair(x_off, y_off);
}

Expand Down Expand Up @@ -785,10 +811,6 @@ std::pair<double, double> HGCalCellOffset::cellOffsetUV2XY1(
x_off = placementIndex < HGCalCell::cellPlacementExtra ? x_off : -x_off;
}
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalCellOffset in wafer with placement index " << placementIndex << " type "
<< type << " for cell u " << u << " v " << v << " Offset x:y " << x_off << ":" << y_off;
#endif
return std::make_pair(x_off, y_off);
}

Expand All @@ -799,9 +821,5 @@ double HGCalCellOffset::cellAreaUV(int32_t u, int32_t v, int32_t placementIndex,
std::pair<int, int> cell = hgcalcell_->cellType(u, v, ncell_[type], placementIndex);
int cellType = cell.second;
area = reco ? cellArea[type][cellType] : HGCalParameters::k_ScaleToDDD2 * cellArea[type][cellType];
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalCellOffset in wafer with placement index " << placementIndex << " type "
<< type << " for cell u " << u << " v " << v << " Area " << area;
#endif
return area;
}

0 comments on commit a96d314

Please sign in to comment.