2 #include "DD4hep/DetFactoryHelper.h" 13 dd4hep::SensitiveDetector& ) {
18 auto const& m_tiltAngle = args.
value<
double>(
"tiltAngle");
19 auto const& m_rMin = args.
value<
double>(
"rMin");
20 auto const& m_rMax = args.
value<
double>(
"rMax");
21 auto const& m_zoffset = args.
value<
double>(
"zoffset");
22 auto const& m_xyoffset = args.
value<
double>(
"xyoffset");
23 auto const& m_startCopyNo = args.
value<
int>(
"startCopyNo");
24 auto const& m_incrCopyNo = args.
value<
int>(
"incrCopyNo");
29 edm::LogVerbatim(
"HGCalGeom") <<
"DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace <<
"\tParent " 38 const int ix[4] = {1, -1, -1, 1};
39 const int iy[4] = {1, 1, -1, -1};
40 int copyNo = m_startCopyNo;
41 for (
int i = 0;
i < 4; ++
i) {
42 int xQuadrant = ix[
i];
43 int yQuadrant = iy[
i];
44 double tiltAngle = m_tiltAngle;
45 double xphi = xQuadrant * tiltAngle;
46 double yphi = yQuadrant * tiltAngle;
47 double theta = 90._deg;
50 double phiZ = 3 *
theta;
51 double offsetZ = m_zoffset;
52 double offsetXY = m_xyoffset;
53 double offsetX = xQuadrant * 0.5 * offsetXY;
54 double offsetY = yQuadrant * 0.5 * offsetXY;
57 int rowmax(0), column(0);
68 double limit1 =
sqrt((offsetX + 0.5 * xQuadrant * offsetXY) * (offsetX + 0.5 * xQuadrant * offsetXY) +
69 (offsetY + 0.5 * yQuadrant * offsetXY) * (offsetY + 0.5 * yQuadrant * offsetXY));
70 double limit2 =
sqrt((offsetX - 0.5 * xQuadrant * offsetXY) * (offsetX - 0.5 * xQuadrant * offsetXY) +
71 (offsetY - 0.5 * yQuadrant * offsetXY) * (offsetY - 0.5 * yQuadrant * offsetXY));
73 if (limit2 > m_rMin && limit1 < m_rMax) {
75 edm::LogVerbatim(
"HGCalGeom") << m_childName <<
" copyNo = " << copyNo <<
" (" << column <<
"," << row
76 <<
"): offsetX,Y = " << offsetX <<
"," << offsetY <<
" limit=" << limit1 <<
":" 77 << limit2 <<
" rMin, rMax = " << m_rMin <<
"," << m_rMax;
83 dd4hep::Position tran(offsetX, offsetY, offsetZ);
87 parent.placeVolume(ns.
volume(name), copyNo, dd4hep::Transform3D(rotation, tran));
89 copyNo += m_incrCopyNo;
92 edm::LogVerbatim(
"HGCalGeom") <<
" (" << column <<
"," << row <<
"): offsetX,Y = " << offsetX <<
"," 93 << offsetY <<
" is out of limit=" << limit1 <<
":" << limit2
94 <<
" rMin, rMax = " << m_rMin <<
"," << m_rMax;
97 yphi += yQuadrant * 2. * tiltAngle;
98 offsetY += yQuadrant * offsetXY;
104 xphi += xQuadrant * 2. * tiltAngle;
105 yphi = yQuadrant * tiltAngle;
106 offsetY = yQuadrant * 0.5 * offsetXY;
107 offsetX += xQuadrant * offsetXY;
110 edm::LogVerbatim(
"HGCalGeom") << rowmax <<
" rows and " << column <<
" columns in quadrant " << xQuadrant <<
":" dd4hep::Volume volume(const std::string &name, bool exc=true) const
T value(const std::string &name) const
Geom::Theta< T > theta() const
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
std::string_view name() const
Abs< T >::type abs(const T &t)
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::string parentName() const
Access value of rParent child node.