5 #include "DD4hep/DetFactoryHelper.h"
8 using namespace angle_units::operators;
14 int n = args.
value<
int>(
"n");
15 int startCopyNo = args.
value<
int>(
"startCopyNo");
16 int incrCopyNo = args.
value<
int>(
"incrCopyNo");
17 double rangeAngle = args.
value<
double>(
"rangeAngle");
18 double startAngle = args.
value<
double>(
"startAngle");
19 double shiftX = args.
value<
double>(
"shiftX");
20 double shiftY = args.
value<
double>(
"shiftY");
21 double zoffset = args.
value<
double>(
"zoffset");
24 childName = ns.
prepend(childName);
28 double dphi = rangeAngle /
n;
30 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalAngular: Parameters for positioning::"
31 <<
" n " << n <<
" Start, Range, Delta " <<
convertRadToDeg(startAngle) <<
" "
34 << mother.name() <<
"\tChild " << child.name() <<
" NameSpace " << ns.
name();
36 int copy = startCopyNo;
37 double phix = startAngle;
38 for (
int ii = 0;
ii <
n; ++
ii) {
50 rotation = dd4hep::RotationZ(phix);
53 double xpos = shiftX *
cos(phix) - shiftY *
sin(phix);
54 double ypos = shiftX *
sin(phix) + shiftY *
cos(phix);
56 mother.placeVolume(child, copy, dd4hep::Transform3D(rotation, tran));
58 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalAngular:: " << child.name() <<
" number " << copy <<
" positioned in "
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
constexpr NumType convert2mm(NumType length)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
std::string_view name() const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
std::string prepend(const std::string &) const
std::string parentName() const
Access value of rParent child node.