5 #include "DD4hep/DetFactoryHelper.h" 13 dd4hep::SensitiveDetector& ) {
19 double cellDx = args.
value<
double>(
"CellDx");
20 double cellDy = args.
value<
double>(
"CellDy");
21 double cellDz = args.
value<
double>(
"CellDz");
22 double startY = args.
value<
double>(
"StartY");
23 std::vector<std::string> childName = args.
value<std::vector<std::string> >(
"Child");
24 std::vector<int>
number = args.
value<std::vector<int> >(
"Number");
25 std::vector<int>
size = args.
value<std::vector<int> >(
"Size");
26 std::vector<int>
type = args.
value<std::vector<int> >(
"Type");
28 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: Cell material " << cellMat <<
"\tCell Size " 31 << childName[0] <<
", " << childName[1] <<
"\n " 32 <<
" Cell positioning done for " << number.size() <<
" times";
33 for (
unsigned int i = 0;
i < number.size(); ++
i)
34 edm::LogVerbatim(
"HCalGeom") <<
"\t" <<
i <<
" Number of children " << size[
i] <<
" occurence " << number[
i]
35 <<
" first child index " << type[
i];
44 for (
unsigned int i = 0;
i < number.size();
i++) {
45 double dx = cellDx * size[
i];
47 for (
int j = 0;
j < number[
i];
j++) {
50 dd4hep::Solid solid = dd4hep::Box(ns.
prepend(name),
dx, cellDy, cellDz);
52 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: " << solid.name() <<
" Box made of " << cellMat <<
" of Size " 58 parent.placeVolume(glog, box, dd4hep::Position(0.0, ypos, 0.0));
60 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: " << solid.name() <<
" number " << box <<
" positioned in " 61 << parent.name() <<
" at (0.0, " <<
convertCmToMm(ypos) <<
", 0.0) with no rotation";
64 double xpos = -dx + cellDx;
67 for (
int k = 0;
k < size[
i]; ++
k) {
68 glog.placeVolume(ns.
volume(childName[indx]),
k + 1, dd4hep::Position(xpos, 0.0, 0.0));
70 edm::LogVerbatim(
"HCalGeom") <<
"DDHCalForwardAlgo: " << childName[indx] <<
" number " <<
k + 1
71 <<
" positioned in " << glog.name() <<
" at (" <<
convertCmToMm(xpos)
72 <<
", 0,0, 0.0) with no rotation";
79 edm::LogVerbatim(
"HCalGeom") <<
"<<== End of DDHCalForwardAlgo construction";
dd4hep::Volume volume(const std::string &name, bool exc=true) const
T value(const std::string &name) const
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
std::string_view name() const
dd4hep::Material material(const std::string &name) const
std::string prepend(const std::string &) const
constexpr NumType convertCmToMm(NumType centimeters)
#define DECLARE_DDCMS_DETELEMENT(name, func)
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = ':'
std::string parentName() const
Access value of rParent child node.