1 #include "DD4hep/DetFactoryHelper.h"
9 using namespace cms_units::operators;
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;
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];
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;
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)
std::unordered_map< std::string, dd4hep::Rotation3D > rotations
T value(const std::string &name) const
Geom::Theta< T > theta() const
std::string to_string(const V &value)
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)
static std::string nsName(const std::string &)
Cos< T >::type cos(const T &t)
std::string prepend(const std::string &) const
const dd4hep::Rotation3D & rotation(const std::string &name) const
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.