35 int createQuarter(
DDCompactView& cpv,
int xQuadrant,
int yQuadrant,
int startCopyNo);
52 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalNoTaperEndcap test: Creating an instance";
62 m_tiltAngle = nArgs[
"tiltAngle"];
63 m_invert =
int(nArgs[
"invert"]);
64 m_rMin =
int(nArgs[
"rMin"]);
65 m_rMax =
int(nArgs[
"rMax"]);
66 m_zoffset = nArgs[
"zoffset"];
67 m_xyoffset = nArgs[
"xyoffset"];
68 m_n =
int(nArgs[
"n"]);
69 m_startCopyNo =
int(nArgs[
"startCopyNo"]);
70 m_incrCopyNo =
int(nArgs[
"incrCopyNo"]);
71 m_childName = sArgs[
"ChildName"];
73 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace <<
"\tParent "
78 int lastCopyNo = m_startCopyNo;
79 lastCopyNo = createQuarter(cpv, 1, 1, lastCopyNo);
80 lastCopyNo = createQuarter(cpv, -1, 1, lastCopyNo);
81 lastCopyNo = createQuarter(cpv, -1, -1, lastCopyNo);
82 createQuarter(cpv, 1, -1, lastCopyNo);
86 int copyNo = startCopyNo;
87 double tiltAngle = m_tiltAngle;
88 double xphi = xQuadrant * tiltAngle;
89 double yphi = yQuadrant * tiltAngle;
90 double theta = 90._deg;
93 double phiZ = 3 *
theta;
94 double offsetZ = m_zoffset;
95 double offsetXY = m_xyoffset;
97 double offsetX = xQuadrant * 0.5 * offsetXY;
98 double offsetY = yQuadrant * 0.5 * offsetXY;
101 int rowmax(0), column(0);
103 while (
std::abs(offsetX) < m_rMax) {
108 while (
std::abs(offsetY) < m_rMax) {
112 double limit1 =
sqrt((offsetX + 0.5 * xQuadrant * offsetXY) * (offsetX + 0.5 * xQuadrant * offsetXY) +
113 (offsetY + 0.5 * yQuadrant * offsetXY) * (offsetY + 0.5 * yQuadrant * offsetXY));
114 double limit2 =
sqrt((offsetX - 0.5 * xQuadrant * offsetXY) * (offsetX - 0.5 * xQuadrant * offsetXY) +
115 (offsetY - 0.5 * yQuadrant * offsetXY) * (offsetY - 0.5 * yQuadrant * offsetXY));
117 if (limit2 > m_rMin && limit1 < m_rMax) {
119 edm::LogVerbatim(
"HGCalGeom") << m_childName <<
" copyNo = " << copyNo <<
" (" << column <<
"," << row
120 <<
"): offsetX,Y = " << offsetX <<
"," << offsetY <<
" limit=" << limit1 <<
":"
121 << limit2 <<
" rMin, rMax = " << m_rMin <<
"," << m_rMax;
128 rotstr += std::to_string(copyNo);
132 std::make_unique<DDRotationMatrix>(
143 copyNo += m_incrCopyNo;
146 edm::LogVerbatim(
"HGCalGeom") <<
" (" << column <<
"," << row <<
"): offsetX,Y = " << offsetX <<
"," << offsetY
147 <<
" is out of limit=" << limit1 <<
":" << limit2 <<
" rMin, rMax = " << m_rMin
152 yphi += yQuadrant * 2. * tiltAngle;
153 offsetY += yQuadrant * offsetXY;
159 xphi += xQuadrant * 2. * tiltAngle;
160 yphi = yQuadrant * tiltAngle;
161 offsetY = yQuadrant * 0.5 * offsetXY;
162 offsetX += xQuadrant * offsetXY;
165 edm::LogVerbatim(
"HGCalGeom") << rowmax <<
" rows and " << column <<
" columns in quadrant " << xQuadrant <<
":"