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-hgx193 PhUpdate HGCal geometry for the support structure #26564

Merged
merged 1 commit into from May 1, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions Geometry/HGCalCommonData/data/hgcalEE/v10/hgcalEE.xml
Expand Up @@ -46,20 +46,20 @@
0, 1, 2, 3, 4, 3, 2, 1, 7, 8, 9, 10, 11, 10, 11, 10, 12, 10, 13, 14, 13, 10, 12, 10, 11, 10, 11, 10, 9, 8, 7, 0, 15
</Vector>
<Vector name="LayerSense" type="numeric" nEntries="448">
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2
</Vector>
<Numeric name="FirstLayer" value="1"/>
<Numeric name="AbsorberMode" value="0"/>
Expand Down
10 changes: 5 additions & 5 deletions Geometry/HGCalCommonData/data/hgcalHEmix/v10/hgcalHEmix.xml
Expand Up @@ -35,11 +35,11 @@
1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5,
1, 2, 3, 4, 5, 1, 2, 3, 4, 5</Vector>
<Vector name="LayerSense" type="numeric" nEntries="70">
-1, 0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0,
-1, 0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0,
-1, 0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0,
-1, 0, 0, 1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0,
-1, 0, 0, 1, 0, -1, 0, 0, 1, 0</Vector>
-1, 0, -1, 1, -2, -1, 0, -1, 1, -2, -1, 0, -1, 1, -2,
-1, 0, -1, 1, -2, -1, 0, -1, 1, -2, -1, 0, -1, 1, -2,
-1, 0, -1, 1, -2, -1, 0, -1, 1, -2, -1, 0, -1, 1, -2,
-1, 0, -1, 1, -2, -1, 0, -1, 1, -2, -1, 0, -1, 1, -2,
-1, 0, -1, 1, -2, -1, 0, -1, 1, -2</Vector>
<Numeric name="FirstLayer" value="[hgcal:FirstMixedLayer]"/>
<Numeric name="AbsorberMode" value="1"/>
<Vector name="TopMaterialNames" type="string" nEntries="6">
Expand Down
16 changes: 8 additions & 8 deletions Geometry/HGCalCommonData/data/hgcalHEsil/v10/hgcalHEsil.xml
Expand Up @@ -36,14 +36,14 @@
1, 2, 3, 4, 5, 6, 8, 7, 8, 9, 8, 10, 11,
1, 2, 3, 4, 5, 6, 8, 7, 8, 9, 8, 10, 11 </Vector>
<Vector name="LayerSense" type="numeric" nEntries="104">
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
-1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0</Vector>
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2,
-1, 0, -2, 0, 0, 0, 0, 1, 0, 0, 0, 0, -2</Vector>
<Numeric name="FirstLayer" value="1"/>
<Numeric name="AbsorberMode" value="1"/>
<Numeric name="zMinBlock" value="[hgcal:zHGCalHEsil1]"/>
Expand Down
11 changes: 11 additions & 0 deletions Geometry/HGCalCommonData/interface/HGCalGeomTools.h
Expand Up @@ -8,12 +8,23 @@ class HGCalGeomTools {
public:
HGCalGeomTools() {}
~HGCalGeomTools() {}
static void radius(double zf, double zb,
std::vector<double> const& zFront1,
std::vector<double> const& rFront1,
std::vector<double> const& slope1,
std::vector<double> const& zFront2,
std::vector<double> const& rFront2,
std::vector<double> const& slope2, int flag,
std::vector<double>& zz, std::vector<double>& rin,
std::vector<double>& rout);
static double radius(double z, std::vector<double> const& zFront,
std::vector<double> const& rFront,
std::vector<double> const& slope);
static double radius(double z, int layer0, int layerf,
std::vector<double> const& zFront,
std::vector<double> const& rFront);
static double slope(double z, std::vector<double> const& zFront,
std::vector<double> const& slope);
static std::pair<double, double> zradius(double z1, double z2,
std::vector<double> const& zFront,
std::vector<double> const& rFront);
Expand Down
42 changes: 15 additions & 27 deletions Geometry/HGCalCommonData/plugins/DDHGCalEEAlgo.cc
Expand Up @@ -15,7 +15,6 @@
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"

//#define EDM_ML_DEBUG
using namespace geant_units;
using namespace geant_units::operators;

DDHGCalEEAlgo::DDHGCalEEAlgo() {
Expand Down Expand Up @@ -102,7 +101,7 @@ void DDHGCalEEAlgo::initialize(const DDNumericArguments& nArgs,
waferSize_ = nArgs["waferSize"];
waferSepar_ = nArgs["SensorSeparation"];
sectors_ = (int)(nArgs["Sectors"]);
alpha_ = piRadians / sectors_;
alpha_ = (1._pi) / sectors_;
cosAlpha_ = cos(alpha_);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom")
Expand Down Expand Up @@ -184,8 +183,6 @@ void DDHGCalEEAlgo::constructLayers(const DDLogicalPart& module,
int copy = copyNumber_[ii];
double hthick = 0.5 * thick_[ii];
double rinB = HGCalGeomTools::radius(zo, zFrontB_, rMinFront_, slopeB_);
std::pair<double, double> zr =
HGCalGeomTools::zradius(zz, zz + thick_[ii], zFrontT_, rMaxFront_);
zz += hthick;
thickTot += thick_[ii];

Expand All @@ -201,32 +198,23 @@ void DDHGCalEEAlgo::constructLayers(const DDLogicalPart& module,
DDMaterial matter(matName);
DDLogicalPart glog;
if (layerSense_[ly] < 1) {
int nsec =
(layerSense_[ly] == 0 || absorbMode_ == 0 || zr.first < 0) ? 2 : 3;
std::vector<double> pgonZ(nsec), pgonRin(nsec), pgonRout(nsec);
std::vector<double> pgonZ, pgonRin, pgonRout;
if (layerSense_[ly] == 0 || absorbMode_ == 0) {
double rmax = routF * cosAlpha_ - tol;
pgonZ[0] = -hthick;
pgonZ[1] = hthick;
pgonRin[0] = rinB;
pgonRin[1] = rinB;
pgonRout[0] = rmax;
pgonRout[1] = rmax;
pgonZ.emplace_back(-hthick);
pgonZ.emplace_back(hthick);
pgonRin.emplace_back(rinB);
pgonRin.emplace_back(rinB);
pgonRout.emplace_back(rmax);
pgonRout.emplace_back(rmax);
} else {
for (int isec = 0; isec < nsec; ++isec) {
double zs =
((isec == 0) ? (zz - hthick)
: (isec == nsec - 1) ? (zz + hthick) : zr.first);
double rm =
(((isec == 0) || (isec == nsec - 1))
? HGCalGeomTools::radius(zs, zFrontT_, rMaxFront_, slopeT_)
: zr.second) *
cosAlpha_ -
tol;
pgonZ[isec] = zs - zz;
pgonRin[isec] = rinB;
pgonRout[isec] = rm;
}
HGCalGeomTools::radius(zz-hthick, zz+hthick, zFrontB_, rMinFront_,
slopeB_, zFrontT_, rMaxFront_, slopeT_,
-layerSense_[ly], pgonZ, pgonRin, pgonRout);
for (unsigned int isec=0; isec < pgonZ.size(); ++isec) {
pgonZ[isec] -= zz;
pgonRout[isec] = pgonRout[isec]*cosAlpha_ - tol;
}
}
DDSolid solid =
DDSolidFactory::polyhedra(DDName(name, nameSpace_), sectors_,
Expand Down
44 changes: 16 additions & 28 deletions Geometry/HGCalCommonData/plugins/DDHGCalHEAlgo.cc
Expand Up @@ -13,9 +13,8 @@
#include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalParameters.h"

using namespace geant_units;
using namespace geant_units::operators;
//#define EDM_ML_DEBUG
using namespace geant_units::operators;

DDHGCalHEAlgo::DDHGCalHEAlgo() {
#ifdef EDM_ML_DEBUG
Expand Down Expand Up @@ -146,7 +145,7 @@ void DDHGCalHEAlgo::initialize(const DDNumericArguments& nArgs,
waferSize_ = nArgs["waferSize"];
waferSepar_ = nArgs["SensorSeparation"];
sectors_ = (int)(nArgs["Sectors"]);
alpha_ = piRadians / sectors_;
alpha_ = (1._pi) / sectors_;
cosAlpha_ = cos(alpha_);
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HGCalGeom")
Expand Down Expand Up @@ -228,8 +227,6 @@ void DDHGCalHEAlgo::constructLayers(const DDLogicalPart& module,
int copy = copyNumber_[ii];
double hthick = 0.5 * thick_[ii];
double rinB = HGCalGeomTools::radius(zo, zFrontB_, rMinFront_, slopeB_);
std::pair<double, double> zr =
HGCalGeomTools::zradius(zz, zz + thick_[ii], zFrontT_, rMaxFront_);
zz += hthick;
thickTot += thick_[ii];

Expand All @@ -245,36 +242,27 @@ void DDHGCalHEAlgo::constructLayers(const DDLogicalPart& module,
DDMaterial matter(matName);
DDLogicalPart glog;
if (layerSense_[ly] < 1) {
int nsec =
(layerSense_[ly] == 0 || absorbMode_ == 0 || zr.first < 0) ? 2 : 3;
std::vector<double> pgonZ(nsec), pgonRin(nsec), pgonRout(nsec);
std::vector<double> pgonZ, pgonRin, pgonRout;
if (layerSense_[ly] == 0 || absorbMode_ == 0) {
double rmax =
(std::min(routF, HGCalGeomTools::radius(zz + hthick, zFrontT_,
rMaxFront_, slopeT_)) *
cosAlpha_) -
tol;
pgonZ[0] = -hthick;
pgonZ[1] = hthick;
pgonRin[0] = rinB;
pgonRin[1] = rinB;
pgonRout[0] = rmax;
pgonRout[1] = rmax;
pgonZ.emplace_back(-hthick);
pgonZ.emplace_back(hthick);
pgonRin.emplace_back(rinB);
pgonRin.emplace_back(rinB);
pgonRout.emplace_back(rmax);
pgonRout.emplace_back(rmax);
} else {
for (int isec = 0; isec < nsec; ++isec) {
double zs =
((isec == 0) ? (zz - hthick)
: (isec == nsec - 1) ? (zz + hthick) : zr.first);
double rm =
(((isec == 0) || (isec == nsec - 1))
? HGCalGeomTools::radius(zs, zFrontT_, rMaxFront_, slopeT_)
: zr.second) *
cosAlpha_ -
tol;
pgonZ[isec] = zs - zz;
pgonRin[isec] = rinB;
pgonRout[isec] = rm;
}
HGCalGeomTools::radius(zz-hthick, zz+hthick, zFrontB_, rMinFront_,
slopeB_, zFrontT_, rMaxFront_, slopeT_,
-layerSense_[ly], pgonZ, pgonRin, pgonRout);
for (unsigned int isec=0; isec < pgonZ.size(); ++isec) {
pgonZ[isec] -= zz;
pgonRout[isec] = pgonRout[isec]*cosAlpha_ - tol;
}
}
DDSolid solid =
DDSolidFactory::polyhedra(DDName(name, nameSpace_), sectors_,
Expand Down