6 #include "DD4hep/DetFactoryHelper.h"
9 using namespace angle_units::operators;
17 double cellDx = args.
value<
double>(
"CellDx");
18 double cellDy = args.
value<
double>(
"CellDy");
19 double cellDz = args.
value<
double>(
"CellDz");
20 double startY = args.
value<
double>(
"StartY");
21 std::vector<std::string> childName = args.
value<std::vector<std::string> >(
"Child");
22 std::vector<int>
number = args.
value<std::vector<int> >(
"Number");
23 std::vector<int>
size = args.
value<std::vector<int> >(
"Size");
24 std::vector<int>
type = args.
value<std::vector<int> >(
"Type");
26 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: Cell material " << cellMat <<
"\tCell Size "
29 << childName[0] <<
", " << childName[1]
30 <<
"\n Cell positioning done for " << number.size() <<
" times";
31 for (
unsigned int i = 0;
i < number.size(); ++
i)
32 edm::LogVerbatim(
"HCalGeom") <<
"\t" <<
i <<
" Number of children " << size[
i] <<
" occurence " << number[
i]
33 <<
" first child index " << type[
i];
38 dd4hep::Material matter = ns.
material(cellMat);
42 for (
unsigned int i = 0;
i < number.size();
i++) {
43 double dx = cellDx * size[
i];
45 for (
int j = 0;
j < number[
i];
j++) {
48 dd4hep::Solid solid = dd4hep::Box(ns.
prepend(name),
dx, cellDy, cellDz);
50 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: " << solid.name() <<
" Box made of " << cellMat <<
" of Size "
58 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: " << solid.name() <<
" number " << box <<
" positioned in "
60 <<
", 0.0) with no rotation";
63 double xpos = -dx + cellDx;
66 for (
int k = 0;
k < size[
i]; ++
k) {
69 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: " << childName[indx] <<
" number " << (
k + 1)
71 <<
", 0,0, 0.0) with no rotation";
78 edm::LogVerbatim(
"HCalGeom") <<
"<<== End of DDHCalForwardAlgo construction";
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
std::string to_string(const V &value)
std::string_view name() const
#define DECLARE_DDCMS_DETELEMENT(name, func)
static constexpr long s_executed
dd4hep::Material material(const std::string &name) const
std::string prepend(const std::string &) const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
tuple size
Write out results.
std::string parentName() const
Access value of rParent child node.