5 #include "DD4hep/DetFactoryHelper.h"
8 using namespace geant_units::operators;
14 double rr = args.
value<
double>(
"radius");
15 double dphi = args.
value<
double>(
"deltaPhi");
17 edm::LogVerbatim(
"ForwardGeom") <<
"DDBHMAngular debug: Parameters for positioning-- " << units
18 <<
" copies at radius " <<
convertMmToCm(rr) <<
" cm with delta(phi) "
26 edm::LogVerbatim(
"ForwardGeom") <<
"DDBHMAngular debug: Parent " << parent.name() <<
"\tChild " << child.name()
27 <<
"\tRotation matrix " << rotMat;
30 dd4hep::Rotation3D
rot;
31 if (rotstr !=
"NULL") {
34 static const int startpos = 16;
35 static const double fac1 = 0.5;
36 static const double fac2 = 1.5;
38 double driverX(0), driverY(0), driverZ(0);
40 driverX = rr *
cos((
jj + fac1) * dphi);
41 driverY =
sqrt(rr * rr - driverX * driverX);
42 }
else if (
jj == startpos) {
43 driverX = rr *
cos((startpos - fac1) * dphi);
44 driverY = -
sqrt(rr * rr - driverX * driverX);
45 }
else if (
jj == startpos + 1) {
46 driverX = rr *
cos((startpos - fac2) * dphi);
47 driverY = -
sqrt(rr * rr - driverX * driverX);
48 }
else if (
jj == startpos + 2) {
49 driverX = rr *
cos(fac1 * dphi);
50 driverY = -
sqrt(rr * rr - driverX * driverX);
51 }
else if (
jj == startpos + 3) {
52 driverX = rr *
cos(fac2 * dphi);
53 driverY = -
sqrt(rr * rr - driverX * driverX);
57 parent.placeVolume(child,
jj + 1, dd4hep::Transform3D(rot, tran));
59 edm::LogVerbatim(
"ForwardGeom") <<
"DDBHMAngular test: " << child.name() <<
" number " <<
jj + 1
60 <<
" positioned in " << parent.name() <<
" at " << tran <<
" with " << rotMat
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
T value(const std::string &name) const
#define DECLARE_DDCMS_DETELEMENT(name, func)
Cos< T >::type cos(const T &t)
std::string prepend(const std::string &) const
constexpr NumType convertMmToCm(NumType millimeters)
const dd4hep::Rotation3D & rotation(const std::string &name) const
TString units(TString variable, Char_t axis)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::string parentName() const
Access value of rParent child node.