1 #include "DD4hep/DetFactoryHelper.h"
9 using namespace cms_units::operators;
16 string iccName = args.
value<
string>(
"ICCName");
18 double startAngle = args.
value<
double>(
"StartAngle");
19 double rModule = args.
value<
double>(
"ModuleR");
20 vector<double> zModule = args.
value<vector<double> >(
"ModuleZ");
21 double rICC = args.
value<
double>(
"ICCR");
22 double sICC = args.
value<
double>(
"ICCShift");
23 vector<double> zICC = args.
value<vector<double> >(
"ICCZ");
25 edm::LogVerbatim(
"TIDGeom") <<
"Parent " << mother.name() <<
"\tModule " << moduleName[0] <<
", " << moduleName[1]
26 <<
"\tICC " << iccName <<
"\tNameSpace " << ns.
name();
28 <<
" StartAngle " <<
convertRadToDeg(startAngle) <<
" Copy Numbers " << number
29 <<
" Modules at R " << rModule <<
" Z " << zModule[0] <<
", " << zModule[1]
30 <<
" ICCs at R " << rICC <<
" Z " << zICC[0] <<
", " << zICC[1];
31 double theta = 90._deg;
33 double dphi = 2_pi /
number;
41 double phiz = startAngle +
i * dphi;
42 double xpos = rModule *
cos(phiz);
43 double ypos = rModule *
sin(phiz);
44 double zpos, thetay, phix;
47 phix = phiz + 90._deg;
52 phix = phiz - 90._deg;
59 phix = phix - 180._deg;
60 thetay = thetay + 180._deg;
65 mother.placeVolume(module,
i + 1, Transform3D(rotation, trmod));
66 edm::LogVerbatim(
"TIDGeom") << module.name() <<
" number " <<
i + 1 <<
" positioned in " << mother.name() <<
" at "
71 xpos = rICC *
cos(phiz) + sICC *
sin(phiz);
72 ypos = rICC *
sin(phiz) - sICC *
cos(phiz);
75 xpos = rICC *
cos(phiz) - sICC *
sin(phiz);
76 ypos = rICC *
sin(phiz) + sICC *
cos(phiz);
80 mother.placeVolume(icc,
i + 1, Transform3D(rotation, tricc));
81 edm::LogVerbatim(
"TIDGeom") << icc.name() <<
" number " <<
i + 1 <<
" positioned in " << mother.name() <<
" at "
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
Geom::Theta< T > theta() const
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
std::string_view name() const
#define DECLARE_DDCMS_DETELEMENT(name, func)
Cos< T >::type cos(const T &t)
std::string parentName() const
Access value of rParent child node.