Skip to content

Commit 2a00279

Browse files
author
Sunanda
committed
Code check
1 parent c0ae74f commit 2a00279

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

Geometry/HGCalCommonData/plugins/DDHGCalPassive.cc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,16 @@ void DDHGCalPassive::execute(DDCompactView& cpv) {
155155
int nsec = 2 * parts_ + 2;
156156
std::vector<double> xM(nsec, 0), yM(nsec, 0);
157157
for (int n = 0; n <= parts_; ++n) {
158-
double phi0 = phi1 + n * dphi0;
159-
if (n == 0) {
160-
xM[0] = rinB * cos(phi0); yM[0] = rinB * sin(phi0);
161-
} else {
162-
xM[nsec - n] = rinB * cos(phi0); yM[nsec - n] = rinB * sin(phi0);
163-
}
164-
xM[n + 1] = routF * cos(phi0); yM[n + 1] = routF * sin(phi0);
158+
double phi0 = phi1 + n * dphi0;
159+
if (n == 0) {
160+
xM[0] = rinB * cos(phi0);
161+
yM[0] = rinB * sin(phi0);
162+
} else {
163+
xM[nsec - n] = rinB * cos(phi0);
164+
yM[nsec - n] = rinB * sin(phi0);
165+
}
166+
xM[n + 1] = routF * cos(phi0);
167+
yM[n + 1] = routF * sin(phi0);
165168
}
166169
std::vector<double> zw = {-0.5 * thick_, 0.5 * thick_};
167170
std::vector<double> zx(2, 0), zy(2, 0), scale(2, 1.0);
@@ -174,7 +177,8 @@ void DDHGCalPassive::execute(DDCompactView& cpv) {
174177
edm::LogVerbatim("HGCalGeom") << "DDHGCalPassive: " << solid.name() << " extruded polygon made of " << matName
175178
<< " z|x|y|s (0) " << zw[0] << ":" << zx[0] << ":" << zy[0] << ":" << scale[0]
176179
<< " z|x|y|s (1) " << zw[1] << ":" << zx[1] << ":" << zy[1] << ":" << scale[1]
177-
<< " and " << xM.size() << " edges with " << parts_ << " parts between " << convertRadToDeg(phi1) << " and " << convertRadToDeg(phi2);
180+
<< " and " << xM.size() << " edges with " << parts_ << " parts between "
181+
<< convertRadToDeg(phi1) << " and " << convertRadToDeg(phi2);
178182
for (unsigned int kk = 0; kk < xM.size(); ++kk)
179183
edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << xM[kk] << ":" << yM[kk];
180184
#endif

Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalPassive.cc

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ struct HGCalPassive {
3939
int parts = args.value<int>("Parts"); // number of parts in units of 30 degree
4040
if (parts < 0)
4141
parts = 1;
42-
double phi0 = args.value<double>("PhiStart"); // Start phi of the first cassette
43-
double dphi = (2._pi) / tagSector.size(); // delta phi of the cassette
42+
double phi0 = args.value<double>("PhiStart"); // Start phi of the first cassette
43+
double dphi = (2._pi) / tagSector.size(); // delta phi of the cassette
4444
#ifdef EDM_ML_DEBUG
4545
edm::LogVerbatim("HGCalGeom") << "DDHGCalPassive: " << tagLayer.size() << " Modules with base name " << parentName
4646
<< " made of " << material << " T " << thick << " Sectors " << tagSector.size()
@@ -105,31 +105,35 @@ struct HGCalPassive {
105105
for (unsigned int k = 0; k < tagSector.size(); ++k) {
106106
std::string parentName = args.parentName() + tagLayer[j] + tagSector[k];
107107
double phi1 = phi0 + k * dphi;
108-
double dphi0 = dphi / parts;
109-
// First the mother
110-
int nsec = 2 * parts + 2;
111-
std::vector<double> xM(nsec, 0), yM(nsec, 0);
112-
for (int n = 0; n <= parts; ++n) {
113-
double phi0 = phi1 + n * dphi0;
114-
if (n == 0) {
115-
xM[0] = rinB * cos(phi0); yM[0] = rinB * sin(phi0);
116-
} else {
117-
xM[nsec - n] = rinB * cos(phi0); yM[nsec - n] = rinB * sin(phi0);
118-
}
119-
xM[n + 1] = routF * cos(phi0); yM[n + 1] = routF * sin(phi0);
120-
}
108+
double dphi0 = dphi / parts;
109+
// First the mother
110+
int nsec = 2 * parts + 2;
111+
std::vector<double> xM(nsec, 0), yM(nsec, 0);
112+
for (int n = 0; n <= parts; ++n) {
113+
double phi0 = phi1 + n * dphi0;
114+
if (n == 0) {
115+
xM[0] = rinB * cos(phi0);
116+
yM[0] = rinB * sin(phi0);
117+
} else {
118+
xM[nsec - n] = rinB * cos(phi0);
119+
yM[nsec - n] = rinB * sin(phi0);
120+
}
121+
xM[n + 1] = routF * cos(phi0);
122+
yM[n + 1] = routF * sin(phi0);
123+
}
121124
std::vector<double> zw = {-0.5 * thick, 0.5 * thick};
122125
std::vector<double> zx(2, 0), zy(2, 0), scale(2, 1.0);
123126
dd4hep::Solid solid = dd4hep::ExtrudedPolygon(xM, yM, zw, zx, zy, scale);
124127
ns.addSolidNS(ns.prepend(parentName), solid);
125128
dd4hep::Material matter = ns.material(material);
126129
dd4hep::Volume glogM = dd4hep::Volume(solid.name(), solid, matter);
127130
#ifdef EDM_ML_DEBUG
128-
double phi2 = phi1 + dphi;
131+
double phi2 = phi1 + dphi;
129132
edm::LogVerbatim("HGCalGeom") << "DDHGCalPassive: " << solid.name() << " extruded polygon made of "
130133
<< matter.name() << " z|x|y|s (0) " << zw[0] << ":" << zx[0] << ":" << zy[0]
131134
<< ":" << scale[0] << " z|x|y|s (1) " << zw[1] << ":" << zx[1] << ":" << zy[1]
132-
<< ":" << scale[1] << " and " << xM.size() << " edges with " << parts << " parts between " << convertRadToDeg(phi1) << " and " << convertRadToDeg(phi2);
135+
<< ":" << scale[1] << " and " << xM.size() << " edges with " << parts
136+
<< " parts between " << convertRadToDeg(phi1) << " and " << convertRadToDeg(phi2);
133137
for (unsigned int kk = 0; kk < xM.size(); ++kk)
134138
edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << xM[kk] << ":" << yM[kk];
135139
#endif

0 commit comments

Comments
 (0)