Skip to content

Commit

Permalink
Update DDHGCalWaferPartialRotated.cc files
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Feb 6, 2023
1 parent 5b72109 commit a36dc8f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
11 changes: 3 additions & 8 deletions Geometry/HGCalCommonData/plugins/DDHGCalWaferPartialRotated.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ void DDHGCalWaferPartialRotated::execute(DDCompactView& cpv) {
#endif

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
Expand All @@ -130,7 +127,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], r, R, 0.0, 0.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 @@ -158,9 +155,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];
double r2 = 0.5 * (waferSize_ - layerSizeOff_[i]);
double R2 = r2 / sqrt3;
wxy = HGCalWaferMask::waferXY(partialTypes_[k], placementIndex_[m], r2, R2, 0.0, 0.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 @@ -169,7 +164,7 @@ void DDHGCalWaferPartialRotated::execute(DDCompactView& cpv) {
#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] << " r " << r2 << ":" << r;
<< " Partial type " << partialTypes_[k];
#endif
DDRotation rot;
if (copyNumber[i] == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
edm::LogVerbatim("HGCalGeom") << "==>> Executing DDHGCalWaferPartialRotated...";
#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) {
for (unsigned int m = 0; m < placementIndex.size(); ++m) {
// 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], r, R, 0.0, 0.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 @@ -122,9 +119,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];
double r2 = 0.5 * (waferSize - layerSizeOff[i]);
double R2 = r2 / sqrt3;
wxy = HGCalWaferMask::waferXY(partialTypes[k], placementIndex[m], r2, R2, 0.0, 0.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 @@ -133,7 +128,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] << " r " << r2 << ":" << r;
<< " Partial type " << partialTypes_[k];
#endif
if (copyNumber[i] == 1) {
if (layerType[i] > 0) {
Expand Down
4 changes: 2 additions & 2 deletions Geometry/HGCalCommonData/test/python/g4OverlapCheck_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Way to use this:
# cmsRun g4OverlapCheck_cfg.py type=V17 tol=0.01
#
# Options for type V16, V17, Wafer, WaferFR
# Options for type V16, V17, Wafer, WaferFR, WaferPR
# tol 1.0, 0.1, 0.01, 0.0
#
###############################################################################
Expand All @@ -17,7 +17,7 @@
"V17",
VarParsing.VarParsing.multiplicity.singleton,
VarParsing.VarParsing.varType.string,
"type of operations: V16, V17, Wafer, WaferFR")
"type of operations: V16, V17, Wafer, WaferFR, WaferPR")
options.register('tol',
0.01,
VarParsing.VarParsing.multiplicity.singleton,
Expand Down

0 comments on commit a36dc8f

Please sign in to comment.