18 <<
"DDHGCalNoTaperEndcap test: Creating an instance";
28 m_tiltAngle = nArgs[
"tiltAngle"];
29 m_invert =
int(nArgs[
"invert"]);
30 m_rMin =
int(nArgs[
"rMin"]);
31 m_rMax =
int(nArgs[
"rMax"]);
32 m_zoffset = nArgs[
"zoffset"];
33 m_xyoffset = nArgs[
"xyoffset"];
34 m_n =
int(nArgs[
"n"]);
35 m_startCopyNo =
int(nArgs[
"startCopyNo"]);
36 m_incrCopyNo =
int(nArgs[
"incrCopyNo"]);
37 m_childName = sArgs[
"ChildName"];
40 <<
"DDHGCalNoTaperEndcap: NameSpace " << m_idNameSpace <<
"\tParent " 45 int lastCopyNo = m_startCopyNo;
46 lastCopyNo = createQuarter(cpv, 1, 1, lastCopyNo);
47 lastCopyNo = createQuarter(cpv, -1, 1, lastCopyNo);
48 lastCopyNo = createQuarter(cpv, -1, -1, lastCopyNo);
49 createQuarter(cpv, 1, -1, lastCopyNo);
53 int yQuadrant,
int startCopyNo) {
54 int copyNo = startCopyNo;
55 double tiltAngle = m_tiltAngle;
56 double xphi = xQuadrant * tiltAngle;
57 double yphi = yQuadrant * tiltAngle;
58 double theta = 90._deg;
61 double phiZ = 3 *
theta;
62 double offsetZ = m_zoffset;
63 double offsetXY = m_xyoffset;
65 double offsetX = xQuadrant * 0.5 * offsetXY;
66 double offsetY = yQuadrant * 0.5 * offsetXY;
69 int rowmax(0), column(0);
80 double limit1 =
sqrt((offsetX + 0.5 * xQuadrant * offsetXY) *
81 (offsetX + 0.5 * xQuadrant * offsetXY) +
82 (offsetY + 0.5 * yQuadrant * offsetXY) *
83 (offsetY + 0.5 * yQuadrant * offsetXY));
84 double limit2 =
sqrt((offsetX - 0.5 * xQuadrant * offsetXY) *
85 (offsetX - 0.5 * xQuadrant * offsetXY) +
86 (offsetY - 0.5 * yQuadrant * offsetXY) *
87 (offsetY - 0.5 * yQuadrant * offsetXY));
89 if (limit2 > m_rMin && limit1 < m_rMax) {
92 << m_childName <<
" copyNo = " << copyNo <<
" (" << column
93 <<
"," << row <<
"): offsetX,Y = " << offsetX <<
"," 94 << offsetY <<
" limit=" << limit1 <<
":" << limit2
95 <<
" rMin, rMax = " << m_rMin <<
"," << m_rMax;
102 rotstr += std::to_string(copyNo);
106 DDName(rotstr, m_idNameSpace),
107 std::make_unique<DDRotationMatrix>(
111 90._deg, xphi, 0.0))));
116 <<
"Module " << copyNo <<
": location = " << tran <<
" Rotation " 120 cpv.
position(
DDName(m_childName), parentName, copyNo, tran, rotation);
122 copyNo += m_incrCopyNo;
126 <<
" (" << column <<
"," << row <<
"): offsetX,Y = " << offsetX
127 <<
"," << offsetY <<
" is out of limit=" << limit1 <<
":" << limit2
128 <<
" rMin, rMax = " << m_rMin <<
"," << m_rMax;
132 yphi += yQuadrant * 2. * tiltAngle;
133 offsetY += yQuadrant * offsetXY;
136 if (row > rowmax) rowmax = row;
138 xphi += xQuadrant * 2. * tiltAngle;
139 yphi = yQuadrant * tiltAngle;
140 offsetY = yQuadrant * 0.5 * offsetXY;
141 offsetX += xQuadrant * offsetXY;
145 << rowmax <<
" rows and " << column <<
" columns in quadrant " 146 << xQuadrant <<
":" << yQuadrant;
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.
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
int createQuarter(DDCompactView &cpv, int xQuadrant, int yQuadrant, int startCopyNo)