4 #include "DD4hep/DetFactoryHelper.h"
12 int numberX = args.
value<
int>(
"NumberX");
13 int numberY = args.
value<
int>(
"NumberY");
14 double deltaX = args.
value<
double>(
"DeltaX");
15 double deltaY = args.
value<
double>(
"DeltaY");
16 std::vector<double> centre = args.
value<std::vector<double> >(
"Center");
18 std::vector<std::string> childName = args.
value<std::vector<std::string> >(
"Child");
21 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalLinearXY: Parent " << parent.name() <<
" \twith " << childName.size()
24 for (
auto const&
child : childName) {
28 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalLinearXY: Number along X/Y " << numberX <<
"/" << numberY
33 double xoff = centre[0] - (numberX - 1) * 0.5 * deltaX;
34 double yoff = centre[1] - (numberY - 1) * 0.5 * deltaY;
35 unsigned int copy = 0;
36 for (
int i = 0;
i < numberX; ++
i) {
37 for (
int j = 0;
j < numberY; ++
j) {
38 unsigned int k = (childName.size() == 1) ? 0 : copy;
40 if (k < childName.size() && (childName[
k] !=
" " && childName[
k] !=
"Null")) {
43 parent.placeVolume(ns.
volume(child),
copy, tran);
45 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalLinearXY: " << child <<
" number " << copy <<
" positioned in "
48 <<
") with no rotation";
52 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalLinearXY: no child placed for [" << copy <<
"]";
Log< level::Info, true > LogVerbatim
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convert2mm(NumType length)
T value(const std::string &name) const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
std::string parentName() const
Access value of rParent child node.