1 #include "DD4hep/DetFactoryHelper.h" 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];
69 <<
" positioned in " << mother.name() <<
" at " << tran <<
" with " <<
rotation;
Log< level::Info, true > LogVerbatim
const dd4hep::Rotation3D & rotation(const std::string &name) const
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
std::unordered_map< std::string, dd4hep::Rotation3D > rotations
DDRotationMatrix makeRotation3D(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
static std::string to_string(const XMLCh *ch)
#define DECLARE_DDCMS_DETELEMENT(name, func)
static std::string nsName(const std::string &)
std::string_view name() const
Cos< T >::type cos(const T &t)
static long algorithm(Detector &, cms::DDParsingContext &ctxt, xml_h e)
Namespace of DDCMS conversion namespace.
Geom::Theta< T > theta() const
dd4hep::Volume volume(const std::string &name, bool exc=true) const
std::string prepend(const std::string &) const