4 #include "DD4hep/DetFactoryHelper.h" 12 dd4hep::SensitiveDetector& ) {
16 int n = args.
value<
int>(
"n");
17 int startCopyNo = args.
value<
int>(
"startCopyNo");
18 int incrCopyNo = args.
value<
int>(
"incrCopyNo");
19 double rangeAngle = args.
value<
double>(
"rangeAngle");
20 double startAngle = args.
value<
double>(
"startAngle");
21 double shiftX = args.
value<
double>(
"shiftX");
22 double shiftY = args.
value<
double>(
"shiftY");
23 double zoffset = args.
value<
double>(
"zoffset");
27 childName = ns.
name() + childName;
31 double dphi = rangeAngle /
n;
33 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalAngular: Parameters for positioning::" 34 <<
" n " << n <<
" Start, Range, Delta " <<
convertRadToDeg(startAngle) <<
" " 37 <<
"\tChild " << child.name() <<
" NameSpace " << ns.
name();
39 int copy = startCopyNo;
40 double phix = startAngle;
41 for (
int ii = 0;
ii <
n; ++
ii) {
53 rotation = dd4hep::RotationZ(phix);
56 double xpos = shiftX *
cos(phix) - shiftY *
sin(phix);
57 double ypos = shiftX *
sin(phix) + shiftY *
cos(phix);
58 dd4hep::Position tran(xpos, ypos, zoffset);
59 mother.placeVolume(child, copy, dd4hep::Transform3D(rotation, tran));
61 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalAngular:: " << child.name() <<
" number " << copy <<
" positioned in " dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
std::string_view name() const
Cos< T >::type cos(const T &t)
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
Abs< T >::type abs(const T &t)
constexpr NumType convertCmToMm(NumType centimeters)
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::string parentName() const
Access value of rParent child node.