1 #include "DD4hep/DetFactoryHelper.h" 13 int startCopyNo = args.
find(
"StartCopyNo") ? args.
value<
int>(
"StartCopyNo") : 1;
14 int incrCopyNo = args.
find(
"IncrCopyNo") ? args.
value<
int>(
"IncrCopyNo") : 1;
17 vector<double> zvec = args.
value<vector<double> >(
"ZPositions");
18 vector<string> rotMat = args.
value<vector<string> >(
"Rotations");
20 LogDebug(
"TrackerGeom") <<
"debug: Parent " << mother.name() <<
"\tChild " << child.name() <<
" NameSpace " 21 << ns.
name() <<
"\tCopyNo (Start/Increment) " << startCopyNo <<
", " << incrCopyNo
22 <<
"\tNumber " << zvec.size();
23 for (
int i = 0;
i < (
int)(zvec.size());
i++)
24 LogDebug(
"TrackerGeom") <<
"\t[" <<
i <<
"]\tZ = " << zvec[
i] <<
", Rot.Matrix = " << rotMat[
i];
26 for (
int i = 0,
copy = startCopyNo;
i < (
int)(zvec.size());
i++,
copy += incrCopyNo) {
27 Position tran(0, 0, zvec[i]);
30 ? mother.placeVolume(child, copy, Transform3D(ns.
rotation(rotMat[i]), tran))
31 : mother.placeVolume(child, copy, tran);
32 LogDebug(
"TrackerGeom") <<
"test: " << child.name() <<
" number " << copy <<
" positioned in " << mother.name()
33 <<
" at " << tran <<
" with " <<
rot;
dd4hep::Volume volume(const std::string &name, bool exc=true) const
static long algorithm(Detector &, cms::DDParsingContext &ctxt, xml_h e, SensitiveDetector &)
T value(const std::string &name) const
std::string_view name() const
Namespace of DDCMS conversion namespace.
const dd4hep::Rotation3D & rotation(const std::string &name) const
#define DECLARE_DDCMS_DETELEMENT(name, func)
bool find(const std::string &name) const
Check the existence of an argument by name.
std::string parentName() const
Access value of rParent child node.