1 #include "DD4hep/DetFactoryHelper.h" 2 #include "DD4hep/Printout.h" 17 int startCopyNo = args.
find(
"StartCopyNo") ? args.
value<
int>(
"StartCopyNo") : 1;
18 double rPosition = args.
value<
double>(
"RPosition");
19 vector<double> phiPosition = args.
value<vector<double> >(
"PhiPosition");
20 vector<string> coolInsert = args.
value<vector<string> >(
"CoolInsert");
23 LogDebug(
"TECGeom") <<
"DDTECCoolAlgo debug: Parent " << mother.name() <<
" NameSpace " << ns.
name()
24 <<
" at radial Position " << rPosition;
25 if (phiPosition.size() == coolInsert.size()) {
26 for (
int i = 0;
i < (
int)(phiPosition.size());
i++) {
27 LogDebug(
"TECGeom") <<
"DDTECCoolAlgo debug: Insert[" <<
i <<
"]: " << coolInsert.at(
i) <<
" at Phi " 31 LogDebug(
"TECGeom") <<
"DDTECCoolAlgo ERROR: Number of inserts does not match the numer of PhiPositions!";
34 int copyNo = startCopyNo;
36 for (
int i = 0;
i < (
int)(coolInsert.size());
i++) {
39 double xpos = rPosition *
cos(phiPosition.at(
i));
40 double ypos = -rPosition *
sin(phiPosition.at(
i));
42 Position tran(xpos, ypos, 0.0);
43 mother.placeVolume(child, copyNo, tran);
44 LogDebug(
"TECGeom") <<
"DDTECCoolAlgo test " << child.name() <<
"[" << copyNo <<
"] positioned in " << mother.name()
45 <<
" at " << tran <<
" phi " <<
convertRadToDeg(phiPosition.at(
i)) <<
" r " << rPosition;
48 LogDebug(
"TECGeom") <<
"DDTECCoolAlgo Finished....";
dd4hep::Volume volume(const std::string &name, bool exc=true) const
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
T value(const std::string &name) const
std::string_view name() const
std::string realName(const std::string &) const
Cos< T >::type cos(const T &t)
Namespace of DDCMS conversion namespace.
static long algorithm(Detector &, cms::DDParsingContext &ctxt, xml_h e, SensitiveDetector &)
#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.