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-hgx336C Try to introduce the guard rings for both full and partial wafers of HGCal (will be a part of V18) #41048

Merged
merged 4 commits into from
Mar 23, 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
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<Parameter name="SensorSizeOffset" value="[hfnose:SensorSizeOffset]"/>
<Parameter name="GuardRingOffset" value="[hfnose:GuardRingOffset]"/>
<Parameter name="MouseBite" value="[hfnose:MouseBite]"/>
<Parameter name="UseOffset" value="0"/>
<Parameter name="NumberOfCellsFine" value="[hfnose:NumberOfCellsFine]"/>
<Parameter name="NumberOfCellsCoarse" value="[hfnose:NumberOfCellsCoarse]"/>
</SpecPar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<Parameter name="SensorSizeOffset" value="[hfnose:SensorSizeOffset]"/>
<Parameter name="GuardRingOffset" value="[hfnose:GuardRingOffset]"/>
<Parameter name="MouseBite" value="[hfnose:MouseBite]"/>
<Parameter name="UseOffset" value="0"/>
<Parameter name="NumberOfCellsFine" value="[hfnose:NumberOfCellsFine]"/>
<Parameter name="NumberOfCellsCoarse" value="[hfnose:NumberOfCellsCoarse]"/>
</SpecPar>
Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/data/hgcalCons/v16/hgcalCons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
<Parameter name="SensorSizeOffset" value="[hgcal:SensorSizeOffset]"/>
<Parameter name="GuardRingOffset" value="[hgcal:GuardRingOffset]"/>
<Parameter name="MouseBite" value="[hgcal:MouseBite]"/>
<Parameter name="UseOffset" value="0"/>
<Parameter name="NumberOfCellsFine" value="[hgcal:NumberOfCellsFine]"/>
<Parameter name="NumberOfCellsCoarse" value="[hgcal:NumberOfCellsCoarse]"/>
</SpecPar>
Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/data/hgcalCons/v17/hgcalCons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<Parameter name="SensorSizeOffset" value="[hgcal:SensorSizeOffset]"/>
<Parameter name="GuardRingOffset" value="[hgcal:GuardRingOffset]"/>
<Parameter name="MouseBite" value="[hgcal:MouseBite]"/>
<Parameter name="UseOffset" value="0"/>
<Parameter name="NumberOfCellsFine" value="[hgcal:NumberOfCellsFine]"/>
<Parameter name="NumberOfCellsCoarse" value="[hgcal:NumberOfCellsCoarse]"/>
</SpecPar>
Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/data/hgcalCons/v17n/hgcalCons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
<Parameter name="SensorSizeOffset" value="[hgcal:SensorSizeOffset]"/>
<Parameter name="GuardRingOffset" value="[hgcal:GuardRingOffset]"/>
<Parameter name="MouseBite" value="[hgcal:MouseBite]"/>
<Parameter name="UseOffset" value="0"/>
<Parameter name="NumberOfCellsFine" value="[hgcal:NumberOfCellsFine]"/>
<Parameter name="NumberOfCellsCoarse" value="[hgcal:NumberOfCellsCoarse]"/>
</SpecPar>
Expand Down
3 changes: 3 additions & 0 deletions Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ class HGCalDDDConstants {
return ((mode_ == HGCalGeometryMode::Hexagon8File) || (mode_ == HGCalGeometryMode::Hexagon8Module) ||
(mode_ == HGCalGeometryMode::Hexagon8Cassette));
}
inline bool waferHexagon8Module() const {
return ((mode_ == HGCalGeometryMode::Hexagon8Module) || (mode_ == HGCalGeometryMode::Hexagon8Cassette));
}
bool waferInLayer(int wafer, int lay, bool reco) const;
bool waferFullInLayer(int wafer, int lay, bool reco) const;
inline int waferCount(const int type) const { return ((type == 0) ? waferMax_[2] : waferMax_[3]); }
Expand Down
1 change: 1 addition & 0 deletions Geometry/HGCalCommonData/interface/HGCalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class HGCalParameters {
double sensorSizeOffset_;
double guardRingOffset_;
double mouseBite_;
int useOffset_;
int waferUVMax_;
std::vector<int> waferUVMaxLayer_;
bool defineFull_;
Expand Down
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
13 changes: 8 additions & 5 deletions Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "Geometry/HGCalCommonData/interface/HGCalGeometryMode.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"

//#define EDM_ML_DEBUG
#define EDM_ML_DEBUG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this get re-commented out?

using namespace geant_units::operators;

bool HGCalParametersFromDD::build(const DDCompactView* cpv,
Expand Down Expand Up @@ -116,6 +116,7 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv,
php.sensorSizeOffset_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("SensorSizeOffset", sv2);
php.guardRingOffset_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("GuardRingOffset", sv2);
php.mouseBite_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MouseBite", sv2);
php.useOffset_ = static_cast<int>(getDDDValue("UseOffset", sv2));
php.waferR_ = HGCalParameters::k_ScaleToDDD * php.waferSize_ * tan30deg_;
php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
Expand All @@ -126,7 +127,7 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv,
<< php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
<< ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":"
<< php.sensorSizeOffset_ << ":" << php.guardRingOffset_ << ":" << php.mouseBite_
<< ":" << php.waferR_;
<< ":" << php.useOffset_ << ":" << php.waferR_;
#endif
for (int k = 0; k < 2; ++k)
getCellPosition(php, k);
Expand Down Expand Up @@ -193,7 +194,7 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv,
php.minTileSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MinimumTileSize", sv);
php.waferSize_ = php.waferR_ = 0;
php.sensorSeparation_ = php.mouseBite_ = 0;
php.sensorSizeOffset_ = php.guardRingOffset_ = 0;
php.sensorSizeOffset_ = php.guardRingOffset_ = php.useOffset_ = 0;
php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
php.waferZSide_ = static_cast<int>(getDDDValue("WaferZside", sv));
if ((php.mode_ == HGCalGeometryMode::TrapezoidModule) || (php.mode_ == HGCalGeometryMode::TrapezoidCassette))
Expand Down Expand Up @@ -343,6 +344,8 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
php.guardRingOffset_ = HGCalParameters::k_ScaleFromDD4hep * tempD[0];
tempD = fv.get<std::vector<double> >(namet, "MouseBite");
php.mouseBite_ = HGCalParameters::k_ScaleFromDD4hep * tempD[0];
tempD = fv.get<std::vector<double> >(namet, "UseOffset");
php.useOffset_ = static_cast<int>(tempD[0]);
php.waferR_ = HGCalParameters::k_ScaleToDDD * php.waferSize_ * tan30deg_;
php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
Expand All @@ -353,7 +356,7 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
<< php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
<< ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":"
<< php.sensorSizeOffset_ << ":" << php.guardRingOffset_ << ":" << php.mouseBite_
<< ":" << php.waferR_;
<< ":" << php.useOffset_ << ":" << php.waferR_;
#endif
for (int k = 0; k < 2; ++k)
getCellPosition(php, k);
Expand Down Expand Up @@ -427,7 +430,7 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
php.minTileSize_ = HGCalParameters::k_ScaleFromDD4hep * tempD[0];
php.waferSize_ = php.waferR_ = 0;
php.sensorSeparation_ = php.mouseBite_ = 0;
php.sensorSizeOffset_ = php.guardRingOffset_ = 0;
php.sensorSizeOffset_ = php.guardRingOffset_ = php.useOffset_ = 0;
tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
php.waferMaskMode_ = static_cast<int>(tempD[0]);
tempD = fv.get<std::vector<double> >(name, "WaferZside");
Expand Down
Loading