7 #include "DD4hep/DetFactoryHelper.h" 8 #include "DD4hep/Printout.h" 19 dd4hep::SensitiveDetector& ) {
28 std::vector<double> bladeZShift;
38 startCopyNo = args.
find(
"StartCopyNo") ? args.
value<
int>(
"StartCopyNo") : 0;
39 nBlades = args.
value<
int>(
"NumberOfBlades");
40 bladeAngle = args.
value<
double>(
"BladeAngle");
41 bladeTilt = -1. * args.
value<
double>(
"BladeTilt");
42 zPlane = args.
value<
double>(
"BladeCommonZ");
43 anchorR = args.
value<
double>(
"AnchorRadius");
45 bladeZShift = args.
value<std::vector<double> >(
"BladeZShift");
53 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo debug: Parent " << mother.name() <<
"\tChild " << child.name()
54 <<
" NameSpace " << ns.
name() <<
"\tRot Name " << rotName <<
"\tCopyNo (Start/Total) " 55 << startCopyNo <<
", " << nBlades <<
"\tAngles " <<
convertRadToDeg(bladeAngle)
56 <<
", " <<
convertRadToDeg(bladeTilt) <<
"\tZshifts " << zPlane <<
"\tAnchor Radius " 59 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
60 edm::LogVerbatim(
"TrackerGeom") <<
"DDPixFwdDiskAlgo: Blade " << iBlade <<
" flag " << flagString[iBlade]
61 <<
" zshift " << bladeZShift[iBlade];
64 double deltaPhi = 360.0_deg / (double)nBlades;
65 int copyNo = startCopyNo;
68 for (
int iBlade = 0; iBlade < nBlades; ++iBlade) {
69 if (flagString[iBlade] == flagSelector[0]) {
70 double phi = (iBlade + 0.5) *
deltaPhi;
71 double phiy = atan2(
cos(phi), -
sin(phi));
72 double thety = acos(
sin(bladeTilt));
73 double phix = atan2(
cos(bladeAngle) *
sin(phi) +
cos(phi) *
sin(bladeTilt) *
sin(bladeAngle),
74 cos(phi) *
cos(bladeAngle) -
sin(phi) *
sin(bladeTilt) *
sin(bladeAngle));
75 double thetx = acos(-
cos(bladeTilt) *
sin(bladeAngle));
76 double phiz = atan2(
sin(phi) *
sin(bladeAngle) -
cos(phi) *
cos(bladeAngle) *
sin(bladeTilt),
77 cos(phi) *
sin(bladeAngle) +
cos(bladeAngle) *
sin(phi) *
sin(bladeTilt));
78 double thetz = acos(
cos(bladeTilt) *
cos(bladeAngle));
82 double xpos = -anchorR *
sin(phi);
83 double ypos = anchorR *
cos(phi);
84 double zpos = zPlane + bladeZShift[iBlade % nBlades];
86 dd4hep::Position tran(xpos, ypos, zpos);
87 pv = mother.placeVolume(child, copyNo, dd4hep::Transform3D(rot, tran));
dd4hep::Volume volume(const std::string &name, bool exc=true) const
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
std::string_view name() const
static constexpr long s_executed
dd4hep::PlacedVolume PlacedVolume
Cos< T >::type cos(const T &t)
#define DECLARE_DDCMS_DETELEMENT(name, func)
bool find(const std::string &name) const
Check the existence of an argument by name.
std::string parentName() const
Access value of rParent child node.