34 int createQuarter(
DDCompactView& cpv,
int xQuadrant,
int yQuadrant,
int startCopyNo);
51 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalNoTaperEndcap test: Creating an instance";
59 m_tiltAngle = nArgs[
"tiltAngle"];
60 m_invert =
int(nArgs[
"invert"]);
61 m_rMin =
int(nArgs[
"rMin"]);
62 m_rMax =
int(nArgs[
"rMax"]);
63 m_zoffset = nArgs[
"zoffset"];
64 m_xyoffset = nArgs[
"xyoffset"];
65 m_n =
int(nArgs[
"n"]);
66 m_startCopyNo =
int(nArgs[
"startCopyNo"]);
67 m_incrCopyNo =
int(nArgs[
"incrCopyNo"]);
68 m_childName = sArgs[
"ChildName"];
70 edm::LogVerbatim(
"HGCalGeom") <<
"Tilt Angle " << m_tiltAngle <<
" Invert " << m_invert <<
" R " << m_rMin <<
":"
71 << m_rMax <<
" Offset " << m_zoffset <<
":" << m_xyoffset <<
" N " << m_n <<
" Copy "
72 << m_startCopyNo <<
":" << m_incrCopyNo <<
" Child " << m_childName;
77 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace <<
"\tParent "
83 int lastCopyNo = m_startCopyNo;
87 lastCopyNo = createQuarter(cpv, 1, 1, lastCopyNo);
91 lastCopyNo = createQuarter(cpv, -1, 1, lastCopyNo);
95 lastCopyNo = createQuarter(cpv, -1, -1, lastCopyNo);
99 createQuarter(cpv, 1, -1, lastCopyNo);
103 int copyNo = startCopyNo;
104 double tiltAngle = m_tiltAngle;
105 double xphi = xQuadrant * tiltAngle;
106 double yphi = yQuadrant * tiltAngle;
107 double theta = 90._deg;
110 double phiZ = 3 *
theta;
111 double offsetZ = m_zoffset;
112 double offsetXY = m_xyoffset;
114 double offsetX = xQuadrant * 0.5 * offsetXY;
115 double offsetY = yQuadrant * 0.5 * offsetXY;
118 int rowmax(0), column(0);
120 while (
std::abs(offsetX) < m_rMax) {
125 while (
std::abs(offsetY) < m_rMax) {
129 double limit1 =
sqrt((offsetX + 0.5 * xQuadrant * offsetXY) * (offsetX + 0.5 * xQuadrant * offsetXY) +
130 (offsetY + 0.5 * yQuadrant * offsetXY) * (offsetY + 0.5 * yQuadrant * offsetXY));
131 double limit2 =
sqrt((offsetX - 0.5 * xQuadrant * offsetXY) * (offsetX - 0.5 * xQuadrant * offsetXY) +
132 (offsetY - 0.5 * yQuadrant * offsetXY) * (offsetY - 0.5 * yQuadrant * offsetXY));
134 if (limit2 > m_rMin && limit1 < m_rMax) {
136 edm::LogVerbatim(
"HGCalGeom") << m_childName <<
" copyNo = " << copyNo <<
" (" << column <<
"," << row
137 <<
"): offsetX,Y = " << offsetX <<
"," << offsetY <<
" limit=" << limit1 <<
":"
138 << limit2 <<
" rMin, rMax = " << m_rMin <<
"," << m_rMax;
145 rotstr += std::to_string(copyNo);
149 std::make_unique<DDRotationMatrix>(
161 copyNo += m_incrCopyNo;
164 edm::LogVerbatim(
"HGCalGeom") <<
" (" << column <<
"," << row <<
"): offsetX,Y = " << offsetX <<
"," << offsetY
165 <<
" is out of limit=" << limit1 <<
":" << limit2 <<
" rMin, rMax = " << m_rMin
170 yphi += yQuadrant * 2. * tiltAngle;
171 offsetY += yQuadrant * offsetXY;
177 xphi += xQuadrant * 2. * tiltAngle;
178 yphi = yQuadrant * tiltAngle;
179 offsetY = yQuadrant * 0.5 * offsetXY;
180 offsetX += xQuadrant * offsetXY;
183 edm::LogVerbatim(
"HGCalGeom") << rowmax <<
" rows and " << column <<
" columns in quadrant " << xQuadrant <<
":"