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>(
141 cpv.
position(
DDName(m_childName), parentName, copyNo, tran, rotation);
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 <<
":" static AlgebraicMatrix initialize()
DDHGCalNoTaperEndcap(void)
Geom::Theta< T > theta() const
DDName is used to identify DDD entities uniquely.
static std::string & ns()
Compact representation of the geometrical detector hierarchy.
std::string m_idNameSpace
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Represents a uniquely identifyable rotation matrix.
~DDHGCalNoTaperEndcap(void) override
Abs< T >::type abs(const T &t)
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string ©no, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
void execute(DDCompactView &cpv) override
#define DEFINE_EDM_PLUGIN(factory, type, name)
int createQuarter(DDCompactView &cpv, int xQuadrant, int yQuadrant, int startCopyNo)
ROOT::Math::Rotation3D DDRotation