29 std::vector<double> bladeZShift;
39 startCopyNo =
args.find(
"StartCopyNo") ?
args.value<
int>(
"StartCopyNo") : 0;
40 nBlades =
args.value<
int>(
"NumberOfBlades");
41 bladeAngle =
args.value<
double>(
"BladeAngle");
42 bladeTilt =
args.value<
double>(
"BladeTilt");
43 zPlane =
args.value<
double>(
"BladeCommonZ");
44 anchorR =
args.value<
double>(
"AnchorRadius");
46 bladeZShift =
args.value<std::vector<double> >(
"BladeZShift");
53 childName = ns.name() + childName;
57 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo debug: Parent " << mother.name() <<
"\tChild " << child.name()
58 <<
" NameSpace " << ns.name() <<
"\tRot Name " << rotName <<
"\tCopyNo (Start/Total) " 59 << startCopyNo <<
", " << nBlades <<
"\tAngles " <<
convertRadToDeg(bladeAngle)
60 <<
", " <<
convertRadToDeg(bladeTilt) <<
"\tZshifts " << zPlane <<
"\tAnchor Radius " 63 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
64 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo: Blade " << iBlade <<
" flag " << flagString[iBlade]
65 <<
" zshift " << bladeZShift[iBlade];
68 double deltaPhi = 360.0_deg / (double)nBlades;
69 int copyNo = startCopyNo;
72 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
73 if (flagString[iBlade] == flagSelector[0]) {
74 std::string rotstr = rotName[0] + std::to_string(
double(copyNo));
76 double phix = atan2(
sin(phi) *
cos(bladeAngle),
cos(phi) *
cos(bladeAngle));
77 double thetx = acos(-
sin(bladeAngle));
78 double phiy = atan2((
cos(phi) *
cos(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
sin(bladeTilt)),
79 (-
sin(phi) *
cos(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
sin(bladeTilt)));
81 double thety = acos(
cos(bladeAngle) *
sin(bladeTilt));
82 double phiz = atan2((-
cos(phi) *
sin(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
cos(bladeTilt)),
83 (
sin(phi) *
sin(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
cos(bladeTilt)));
85 double thetz = acos(
cos(bladeAngle) *
cos(bladeTilt));
87 auto rot = dd4hep::Rotation3D();
89 auto irot = ctxt.
rotations.find(ns.prepend(rotstr));
100 <<
cos(phi) *
cos(bladeAngle) <<
", " 101 << (-
sin(phi) *
cos(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
sin(bladeTilt))
103 << (
sin(phi) *
sin(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
cos(bladeTilt))
104 <<
", " <<
sin(phi) *
cos(bladeAngle) <<
", " 105 << (
cos(phi) *
cos(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
sin(bladeTilt))
107 << (-
cos(phi) *
sin(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
cos(bladeTilt))
108 <<
", " << -
sin(bladeAngle) <<
", " <<
cos(bladeAngle) *
sin(bladeTilt) <<
", " 109 <<
cos(bladeAngle) *
cos(bladeTilt);
112 double xpos = anchorR * (-
sin(phi) *
cos(bladeTilt) +
cos(phi) *
sin(bladeAngle) *
sin(bladeTilt));
113 double ypos = anchorR * (
cos(phi) *
cos(bladeTilt) +
sin(phi) *
sin(bladeAngle) *
sin(bladeTilt));
114 double zpos = anchorR * (
cos(bladeAngle) *
sin(bladeTilt)) + zPlane + bladeZShift[iBlade];
116 dd4hep::Position tran(xpos, ypos, zpos);
117 pv = mother.placeVolume(child, copyNo, dd4hep::Transform3D(
rot, tran));
118 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo test: " << pv.name() <<
": " << childName <<
" number " 119 << copyNo <<
" positioned in " << mother.name() <<
" at " << tran <<
" with "
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
static constexpr long s_executed
dd4hep::PlacedVolume PlacedVolume
Cos< T >::type cos(const T &t)
tbb::concurrent_unordered_map< std::string, dd4hep::Rotation3D > rotations