Skip to content

Commit

Permalink
Backport cms-sw#40644 to complete v17 definition of HGCal with differ…
Browse files Browse the repository at this point in the history
…ent lateral sizes of the components inside a silicon module
  • Loading branch information
Sunanda authored and Ming-Yan committed Nov 29, 2023
1 parent d11a112 commit 3a4a7ec
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 238 deletions.
1 change: 0 additions & 1 deletion Geometry/HGCalCommonData/data/hgcal/v17/hgcal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<Constant name="WaferThicknessCoarse2" value="0.30*mm"/>
<Constant name="SensorSeparation" value="0.10*mm"/>
<Constant name="SensorSizeOffset" value="0.87*mm"/>
<Constant name="GuardRingOffset" value="0.90*mm"/>
<Constant name="MouseBite" value="5.00*mm"/>
<Constant name="ModuleThicknessEE" value="9.325*mm"/>
<Constant name="ModuleThicknessHE" value="8.70*mm"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void DDHGCalWaferPartialRotated::execute(DDCompactView& cpv) {
// First the mother
std::string mother = parentName + placementIndexTags_[m] + waferTag_ + tags_[k];
std::vector<std::pair<double, double> > wxy =
HGCalWaferMask::waferXY(partialTypes_[k], placementIndex_[m], waferSize_, 0.0, 0.0, 0.0, (waferMode_ > 0));
HGCalWaferMask::waferXY(partialTypes_[k], placementIndex_[m], 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 Down Expand Up @@ -157,8 +157,7 @@ void DDHGCalWaferPartialRotated::execute(DDCompactView& cpv) {
double zi(-0.5 * thick_), thickTot(0.0);
for (unsigned int l = 0; l < layers_.size(); l++) {
unsigned int i = layers_[l];
wxy = HGCalWaferMask::waferXY(
partialTypes_[k], placementIndex_[m], waferSize_, layerSizeOff_[i], 0.0, 0.0, (waferMode_ > 0));
wxy = HGCalWaferMask::waferXY(partialTypes_[k], placementIndex_[m], waferSize_, layerSizeOff_[i], 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i0 = 0; i0 < (wxy.size() - 1); ++i0) {
xL.emplace_back(wxy[i0].first);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
// First the mother
std::string mother = parentName + placementIndexTags[m] + waferTag + tags[k];
std::vector<std::pair<double, double>> wxy =
HGCalWaferMask::waferXY(partialTypes[k], placementIndex[m], waferSize, 0.0, 0.0, 0.0, (waferMode > 0));
HGCalWaferMask::waferXY(partialTypes[k], placementIndex[m], 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 Down Expand Up @@ -120,8 +120,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
double zi(-0.5 * thick), thickTot(0.0);
for (unsigned int l = 0; l < layers.size(); l++) {
unsigned int i = layers[l];
wxy = HGCalWaferMask::waferXY(
partialTypes[k], placementIndex[m], waferSize, layerSizeOff[i], 0.0, 0.0, (waferMode > 0));
wxy = HGCalWaferMask::waferXY(partialTypes[k], placementIndex[m], waferSize, layerSizeOff[i], 0.0, 0.0);
std::vector<double> xL, yL;
for (unsigned int i0 = 0; i0 < (wxy.size() - 1); ++i0) {
xL.emplace_back(wxy[i0].first);
Expand All @@ -130,7 +129,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferPartialRotated:Layer " << l << ":" << i << " T " << layerThick[i]
<< " Size offset " << layerSizeOff[i] << " Copy " << copyNumber[i]
<< " Partial type " << partialTypes[k];
<< " Partial type " << partialTypes_[k];
#endif
if (copyNumber[i] == 1) {
if (layerType[i] > 0) {
Expand Down
2 changes: 0 additions & 2 deletions Geometry/HGCalCommonData/src/HGCalCell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ HGCalCell::HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse) {
cellX_[k] = waferSize / (3 * ncell_[k]);
cellY_[k] = sqrt3By2_ * cellX_[k];
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom") << "HGCalCell initialized with waferSize " << waferSize << " number of cells " << nFine
<< ":" << nCoarse;
#endif
}

std::pair<double, double> HGCalCell::cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type) {
Expand Down
292 changes: 68 additions & 224 deletions Geometry/HGCalCommonData/src/HGCalWaferMask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1430,13 +1430,8 @@ std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(const int& part,
return xy;
}

std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(const int& part,
const int& place,
const double& waferSize,
const double& offset,
const double& xpos,
const double& ypos,
const bool& v17OrLess) {
std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(
int part, int place, double waferSize, double offset, double xpos, double ypos) {
std::vector<std::pair<double, double> > xy;
// Good for V17 version and uses partial wafer type & placement index
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -1473,156 +1468,53 @@ std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(const int& part,
are chosen in the variable *np*
The points 24-35 are the same as points 12-23 with different offset
*/
double Sin_60 = std::sqrt(3.0) / 2.0;
double Cos_60 = 0.5;
double Tan_60 = Sin_60 / Cos_60;
double delX = 0.5 * waferSize;
double delY = delX / sin_60_;
double dx[60] = {
HGCalTypes::c00 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX,
-HGCalTypes::c10 * delX,
HGCalTypes::c50 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c50 * delX,
-HGCalTypes::c50 * delX,
-HGCalTypes::c10 * delX,
-HGCalTypes::c50 * delX,
c22 * delX,
HGCalTypes::c10 * delX,
c77 * delX,
-c22 * delX,
-HGCalTypes::c10 * delX,
-c77 * delX,
c22 * delX,
-c77 * delX,
-HGCalTypes::c10 * delX,
-c22 * delX,
c77 * delX,
HGCalTypes::c10 * delX,
c22 * delX,
HGCalTypes::c10 * delX,
c77 * delX,
-c22 * delX,
-HGCalTypes::c10 * delX,
-c77 * delX,
c22 * delX,
-c77 * delX,
-HGCalTypes::c10 * delX,
-c22 * delX,
c77 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX,
-HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX,
-HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX,
-HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c10 * delX,
HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX,
-HGCalTypes::c10 * delX,
};
double dy[60] = {
-HGCalTypes::c10 * delY,
-HGCalTypes::c50 * delY,
HGCalTypes::c50 * delY,
HGCalTypes::c10 * delY,
HGCalTypes::c50 * delY,
-HGCalTypes::c50 * delY,
-HGCalTypes::c75 * delY,
HGCalTypes::c00 * delY,
HGCalTypes::c75 * delY,
HGCalTypes::c75 * delY,
HGCalTypes::c00 * delY,
-HGCalTypes::c75 * delY,
-c88 * delY,
-c27 * delY,
c61 * delY,
c88 * delY,
c27 * delY,
-c61 * delY,
c88 * delY,
c61 * delY,
-c27 * delY,
-c88 * delY,
-c61 * delY,
c27 * delY,
-c88 * delY,
-c27 * delY,
c61 * delY,
c88 * delY,
c27 * delY,
-c61 * delY,
c88 * delY,
c61 * delY,
-c27 * delY,
-c88 * delY,
-c61 * delY,
c27 * delY,
-HGCalTypes::c10 * delY,
-HGCalTypes::c50 * delY,
HGCalTypes::c50 * delY,
HGCalTypes::c10 * delY,
HGCalTypes::c50 * delY,
-HGCalTypes::c50 * delY,
-HGCalTypes::c10 * delY,
-HGCalTypes::c50 * delY,
HGCalTypes::c50 * delY,
HGCalTypes::c10 * delY,
HGCalTypes::c50 * delY,
-HGCalTypes::c50 * delY,
-HGCalTypes::c10 * delY,
-HGCalTypes::c50 * delY,
HGCalTypes::c50 * delY,
HGCalTypes::c10 * delY,
HGCalTypes::c50 * delY,
-HGCalTypes::c50 * delY,
-HGCalTypes::c10 * delY,
-HGCalTypes::c50 * delY,
HGCalTypes::c50 * delY,
HGCalTypes::c10 * delY,
HGCalTypes::c50 * delY,
-HGCalTypes::c50 * delY,
};
double delY = delX / Sin_60;
double dx[36] = {HGCalTypes::c00 * delX, HGCalTypes::c10 * delX, HGCalTypes::c10 * delX, HGCalTypes::c00 * delX,
-HGCalTypes::c10 * delX, -HGCalTypes::c10 * delX, HGCalTypes::c50 * delX, HGCalTypes::c10 * delX,
HGCalTypes::c50 * delX, -HGCalTypes::c50 * delX, -HGCalTypes::c10 * delX, -HGCalTypes::c50 * delX,
HGCalTypes::c22 * delX, HGCalTypes::c10 * delX, HGCalTypes::c77 * delX, -HGCalTypes::c22 * delX,
-HGCalTypes::c10 * delX, -HGCalTypes::c77 * delX, HGCalTypes::c22 * delX, -HGCalTypes::c77 * delX,
-HGCalTypes::c10 * delX, -HGCalTypes::c22 * delX, HGCalTypes::c77 * delX, HGCalTypes::c10 * delX,
HGCalTypes::c22 * delX, HGCalTypes::c10 * delX, HGCalTypes::c77 * delX, -HGCalTypes::c22 * delX,
-HGCalTypes::c10 * delX, -HGCalTypes::c77 * delX, HGCalTypes::c22 * delX, -HGCalTypes::c77 * delX,
-HGCalTypes::c10 * delX, -HGCalTypes::c22 * delX, HGCalTypes::c77 * delX, HGCalTypes::c10 * delX};
double dy[36] = {-HGCalTypes::c10 * delY, -HGCalTypes::c50 * delY, HGCalTypes::c50 * delY, HGCalTypes::c10 * delY,
HGCalTypes::c50 * delY, -HGCalTypes::c50 * delY, -HGCalTypes::c75 * delY, HGCalTypes::c00 * delY,
HGCalTypes::c75 * delY, HGCalTypes::c75 * delY, HGCalTypes::c00 * delY, -HGCalTypes::c75 * delY,
-HGCalTypes::c88 * delY, -HGCalTypes::c27 * delY, HGCalTypes::c61 * delY, HGCalTypes::c88 * delY,
HGCalTypes::c27 * delY, -HGCalTypes::c61 * delY, HGCalTypes::c88 * delY, HGCalTypes::c61 * delY,
-HGCalTypes::c27 * delY, -HGCalTypes::c88 * delY, -HGCalTypes::c61 * delY, HGCalTypes::c27 * delY,
-HGCalTypes::c88 * delY, -HGCalTypes::c27 * delY, HGCalTypes::c61 * delY, HGCalTypes::c88 * delY,
HGCalTypes::c27 * delY, -HGCalTypes::c61 * delY, HGCalTypes::c88 * delY, HGCalTypes::c61 * delY,
-HGCalTypes::c27 * delY, -HGCalTypes::c88 * delY, -HGCalTypes::c61 * delY, HGCalTypes::c27 * delY};

double offsetx[60] = {0.0,
double offsetx[36] = {0.0,
-offset,
-offset,
0.0,
offset,
offset,
-offset * cos_60_,
-offset * Cos_60,
-offset,
-offset * cos_60_,
offset * cos_60_,
-offset * Cos_60,
offset * Cos_60,
offset,
offset * cos_60_,
-offset * cos_60_,
offset * Cos_60,
-offset * Cos_60,
-offset,
-offset * cos_60_,
offset * cos_60_,
-offset * Cos_60,
offset * Cos_60,
offset,
offset * cos_60_,
-offset * cos_60_,
offset * cos_60_,
offset * Cos_60,
-offset * Cos_60,
offset * Cos_60,
offset,
offset * cos_60_,
-offset * cos_60_,
offset * Cos_60,
-offset * Cos_60,
-offset,
0.0,
-offset,
Expand All @@ -1635,91 +1527,43 @@ std::vector<std::pair<double, double> > HGCalWaferMask::waferXY(const int& part,
offset,
0.0,
-offset,
-offset,
-offset,
-offset / cos_60_,
-offset,
offset,
offset / cos_60_,
offset,
offset,
-offset,
-offset / cos_60_,
-offset,
offset,
offset / cos_60_,
-offset * cos_60_,
-offset,
-offset * cos_60_,
offset * cos_60_,
offset,
offset * cos_60_,
offset * cos_60_,
-offset * cos_60_,
-offset,
-offset * cos_60_,
offset * cos_60_,
offset};
double offsety[60] = {offset / sin_60_,
offset / tan_60_,
-offset / tan_60_,
-offset / sin_60_,
-offset / tan_60_,
offset / tan_60_,
offset * sin_60_,
-offset};
double offsety[36] = {offset / Sin_60,
offset / Tan_60,
-offset / Tan_60,
-offset / Sin_60,
-offset / Tan_60,
offset / Tan_60,
offset * Sin_60,
0.0,
-offset * sin_60_,
-offset * sin_60_,
-offset * Sin_60,
-offset * Sin_60,
0.0,
offset * sin_60_,
offset * sin_60_,
offset * Sin_60,
offset * Sin_60,
0.0,
-offset * sin_60_,
-offset * sin_60_,
-offset * Sin_60,
-offset * Sin_60,
0.0,
offset * sin_60_,
-offset * sin_60_,
-offset * sin_60_,
offset * Sin_60,
-offset * Sin_60,
-offset * Sin_60,
0.0,
offset * sin_60_,
offset * sin_60_,
offset * Sin_60,
offset * Sin_60,
0.0,
offset / sin_60_,
offset / tan_60_,
-offset / tan_60_,
-offset / sin_60_,
-offset / tan_60_,
offset / tan_60_,
-offset / sin_60_,
-offset / tan_60_,
offset / tan_60_,
offset / sin_60_,
offset / tan_60_,
-offset / tan_60_,
offset * tan_60_,
0,
-offset * tan_60_,
-offset * tan_60_,
0,
offset * tan_60_,
offset * tan_60_,
offset * tan_60_,
0,
-offset * tan_60_,
-offset * tan_60_,
0,
offset * sin_60_,
0,
-offset * sin_60_,
-offset * sin_60_,
0,
offset * sin_60_,
offset * sin_60_,
offset * sin_60_,
0,
-offset * sin_60_,
-offset * sin_60_,
0};
offset / Sin_60,
offset / Tan_60,
-offset / Tan_60,
-offset / Sin_60,
-offset / Tan_60,
offset / Tan_60,
-offset / Sin_60,
-offset / Tan_60,
offset / Tan_60,
offset / Sin_60,
offset / Tan_60,
-offset / Tan_60};

if (part == HGCalTypes::WaferFull) {
int np[7] = {0, 1, 2, 3, 4, 5, 0};
Expand Down
Loading

0 comments on commit 3a4a7ec

Please sign in to comment.