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");
39 bladeTilt = -1. *
args.value<
double>(
"BladeTilt");
40 zPlane =
args.value<
double>(
"BladeCommonZ");
41 anchorR =
args.value<
double>(
"AnchorRadius");
43 bladeZShift =
args.value<std::vector<double> >(
"BladeZShift");
51 edm::LogVerbatim(
"PixelGeom") <<
"DDPixFwdDiskAlgo debug: Parent " << mother.name() <<
"\tChild " <<
child.name()
52 <<
" NameSpace " << ns.
name() <<
"\tRot Name " <<
rotName <<
"\tCopyNo (Start/Total) "
53 << startCopyNo <<
", " << nBlades <<
"\tAngles " <<
convertRadToDeg(bladeAngle) <<
", "
54 <<
convertRadToDeg(bladeTilt) <<
"\tZshifts " << zPlane <<
"\tAnchor Radius "
57 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
58 edm::LogVerbatim(
"PixelGeom") <<
"DDPixFwdDiskAlgo: Blade " << iBlade <<
" flag " << flagString[iBlade]
59 <<
" zshift " << bladeZShift[iBlade];
62 double deltaPhi = 360.0_deg / (double)nBlades;
63 int copyNo = startCopyNo;
66 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
67 if (flagString[iBlade] == flagSelector[0]) {
68 double phi = (iBlade + 0.5) *
deltaPhi;
69 double phiy = atan2(
cos(phi), -
sin(phi));
70 double thety = acos(
sin(bladeTilt));
71 double phix = atan2(
cos(bladeAngle) *
sin(phi) +
cos(phi) *
sin(bladeTilt) *
sin(bladeAngle),
72 cos(phi) *
cos(bladeAngle) -
sin(phi) *
sin(bladeTilt) *
sin(bladeAngle));
73 double thetx = acos(-
cos(bladeTilt) *
sin(bladeAngle));
74 double phiz = atan2(
sin(phi) *
sin(bladeAngle) -
cos(phi) *
cos(bladeAngle) *
sin(bladeTilt),
75 cos(phi) *
sin(bladeAngle) +
cos(bladeAngle) *
sin(phi) *
sin(bladeTilt));
76 double thetz = acos(
cos(bladeTilt) *
cos(bladeAngle));
80 double xpos = -anchorR *
sin(phi);
81 double ypos = anchorR *
cos(phi);
82 double zpos = zPlane + bladeZShift[iBlade % nBlades];
85 pv = mother.placeVolume(
child, copyNo, dd4hep::Transform3D(
rot, tran));