15 int n =
args.value<
int>(
"N");
16 int startCopyNo =
args.find(
"StartCopyNo") ?
args.value<
int>(
"StartCopyNo") : 1;
17 int incrCopyNo =
args.find(
"IncrCopyNo") ?
args.value<
int>(
"IncrCopyNo") : 1;
18 double rangeAngle =
args.value<
double>(
"RangeAngle");
19 double startAngle =
args.value<
double>(
"StartAngle");
21 vector<double> center =
args.value<vector<double> >(
"Center");
27 if (fabs(rangeAngle - 360.0_deg) < 0.001_deg) {
28 delta = rangeAngle / double(n);
30 delta = rangeAngle / double(n - 1);
33 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerAngular debug: Parameters for positioning:: n " << n
36 << radius <<
" Centre " << center[0] <<
", " << center[1] <<
", " << center[2];
37 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerAngular debug: Parent " << mother.name() <<
"\tChild " << child.name()
38 <<
" NameSpace " << ns.name();
40 double theta = 90._deg;
41 int copy = startCopyNo;
42 double phi = startAngle;
43 for (
int i = 0;
i <
n;
i++) {
45 double phiy = phix + 90._deg;
50 string rotstr = ns.nsName(child.name()) + std::to_string(phideg * 10.);
51 auto irot = ctxt.
rotations.find(ns.prepend(rotstr));
53 rotation = ns.rotation(ns.prepend(rotstr));
56 <<
"rotation: " << rotstr <<
"\t90., " <<
convertRadToDeg(phix) <<
", 90.," 63 double xpos = radius *
cos(phi) + center[0];
64 double ypos = radius *
sin(phi) + center[1];
65 double zpos = center[2];
66 Position tran(xpos, ypos, zpos);
67 mother.placeVolume(child, copy, Transform3D(rotation, tran));
68 edm::LogVerbatim(
"TrackerGeom") <<
"DDTrackerAngular test " << child.name() <<
" number " << copy
69 <<
" positioned in " << mother.name() <<
" at " << tran <<
" with " <<
rotation;
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
dd4hep::Rotation3D makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
Cos< T >::type cos(const T &t)
tbb::concurrent_unordered_map< std::string, dd4hep::Rotation3D > rotations