7 #include "DD4hep/DetFactoryHelper.h"
8 #include "DD4hep/Printout.h"
25 std::vector<double> bladeZShift;
35 startCopyNo =
args.find(
"StartCopyNo") ?
args.value<
int>(
"StartCopyNo") : 0;
36 nBlades =
args.value<
int>(
"NumberOfBlades");
37 bladeAngle =
args.value<
double>(
"BladeAngle");
38 bladeTilt = -1. *
args.value<
double>(
"BladeTilt");
39 zPlane =
args.value<
double>(
"BladeCommonZ");
40 anchorR =
args.value<
double>(
"AnchorRadius");
42 bladeZShift =
args.value<std::vector<double> >(
"BladeZShift");
50 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo debug: Parent " << mother.name() <<
"\tChild " <<
child.name()
51 <<
" NameSpace " << ns.
name() <<
"\tRot Name " << rotName <<
"\tCopyNo (Start/Total) "
52 << startCopyNo <<
", " << nBlades <<
"\tAngles " <<
convertRadToDeg(bladeAngle)
53 <<
", " <<
convertRadToDeg(bladeTilt) <<
"\tZshifts " << zPlane <<
"\tAnchor Radius "
56 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
57 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo: Blade " << iBlade <<
" flag " << flagString[iBlade]
58 <<
" zshift " << bladeZShift[iBlade];
61 double deltaPhi = 360.0_deg / (double)nBlades;
62 int copyNo = startCopyNo;
65 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
66 if (flagString[iBlade] == flagSelector[0]) {
67 double phi = (iBlade + 0.5) *
deltaPhi;
68 double phiy = atan2(
cos(phi), -
sin(phi));
69 double thety = acos(
sin(bladeTilt));
70 double phix = atan2(
cos(bladeAngle) *
sin(phi) +
cos(phi) *
sin(bladeTilt) *
sin(bladeAngle),
71 cos(phi) *
cos(bladeAngle) -
sin(phi) *
sin(bladeTilt) *
sin(bladeAngle));
72 double thetx = acos(-
cos(bladeTilt) *
sin(bladeAngle));
73 double phiz = atan2(
sin(phi) *
sin(bladeAngle) -
cos(phi) *
cos(bladeAngle) *
sin(bladeTilt),
74 cos(phi) *
sin(bladeAngle) +
cos(bladeAngle) *
sin(phi) *
sin(bladeTilt));
75 double thetz = acos(
cos(bladeTilt) *
cos(bladeAngle));
79 double xpos = -anchorR *
sin(phi);
80 double ypos = anchorR *
cos(phi);
81 double zpos = zPlane + bladeZShift[iBlade % nBlades];
84 pv = mother.placeVolume(
child, copyNo, dd4hep::Transform3D(
rot, tran));