2 #include "DD4hep/DetFactoryHelper.h" 16 auto const& m_tiltAngle =
args.value<
double>(
"tiltAngle");
17 auto const& m_rMin =
args.value<
double>(
"rMin");
18 auto const& m_rMax =
args.value<
double>(
"rMax");
19 auto const& m_zoffset =
args.value<
double>(
"zoffset");
20 auto const& m_xyoffset =
args.value<
double>(
"xyoffset");
21 auto const& m_startCopyNo =
args.value<
int>(
"startCopyNo");
22 auto const& m_incrCopyNo =
args.value<
int>(
"incrCopyNo");
27 <<
cms::convert2mm(m_xyoffset) <<
" Copy " << m_startCopyNo <<
":" << m_incrCopyNo
28 <<
" Child " << m_childName;
30 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalNoTaperEndcap: NameSpace " << ns.
name() <<
"\tParent " <<
args.parentName();
36 const int ix[4] = {1, -1, -1, 1};
37 const int iy[4] = {1, 1, -1, -1};
38 int copyNo = m_startCopyNo;
39 for (
int i = 0;
i < 4; ++
i) {
40 int xQuadrant = ix[
i];
41 int yQuadrant = iy[
i];
43 edm::LogVerbatim(
"HGCalGeom") <<
"Create quarter " << xQuadrant <<
":" << yQuadrant;
45 double tiltAngle = m_tiltAngle;
46 double xphi = xQuadrant * tiltAngle;
47 double yphi = yQuadrant * tiltAngle;
48 double theta = 90._deg;
51 double phiZ = 3 *
theta;
52 double offsetZ = m_zoffset;
53 double offsetXY = m_xyoffset;
54 double offsetX = xQuadrant * 0.5 * offsetXY;
55 double offsetY = yQuadrant * 0.5 * offsetXY;
58 int rowmax(0), column(0);
69 double limit1 =
sqrt((offsetX + 0.5 * xQuadrant * offsetXY) * (offsetX + 0.5 * xQuadrant * offsetXY) +
70 (offsetY + 0.5 * yQuadrant * offsetXY) * (offsetY + 0.5 * yQuadrant * offsetXY));
71 double limit2 =
sqrt((offsetX - 0.5 * xQuadrant * offsetXY) * (offsetX - 0.5 * xQuadrant * offsetXY) +
72 (offsetY - 0.5 * yQuadrant * offsetXY) * (offsetY - 0.5 * yQuadrant * offsetXY));
74 if (limit2 > m_rMin && limit1 < m_rMax) {
76 edm::LogVerbatim(
"HGCalGeom") << m_childName <<
" copyNo = " << copyNo <<
" (" << column <<
"," << row
94 copyNo += m_incrCopyNo;
104 yphi += yQuadrant * 2. * tiltAngle;
105 offsetY += yQuadrant * offsetXY;
111 xphi += xQuadrant * 2. * tiltAngle;
112 yphi = yQuadrant * tiltAngle;
113 offsetY = yQuadrant * 0.5 * offsetXY;
114 offsetX += xQuadrant * offsetXY;
117 edm::LogVerbatim(
"HGCalGeom") << rowmax <<
" rows and " << column <<
" columns in quadrant " << xQuadrant <<
":" Log< level::Info, true > LogVerbatim
constexpr NumType convert2mm(NumType length)
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
std::string_view name() const
Abs< T >::type abs(const T &t)
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e)
Geom::Theta< T > theta() const
dd4hep::Volume volume(const std::string &name, bool exc=true) const
std::string prepend(const std::string &) const