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")) {
48 <<
") with no rotation";
Log< level::Info, true > LogVerbatim
constexpr NumType convert2mm(NumType length)
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e)
dd4hep::Volume volume(const std::string &name, bool exc=true) const