diff --git a/DetectorDescription/DDCMS/plugins/DDCutTubsFromPoints.cc b/DetectorDescription/DDCMS/plugins/DDCutTubsFromPoints.cc index 7f7f2a3f15607..78e28bdfb31fb 100644 --- a/DetectorDescription/DDCMS/plugins/DDCutTubsFromPoints.cc +++ b/DetectorDescription/DDCMS/plugins/DDCutTubsFromPoints.cc @@ -40,6 +40,9 @@ static long algorithm(dd4hep::Detector& /* description */, for (unsigned i = 0; i < phis.size(); i++) { Section s = {phis[i], z_ls[i], z_ts[i]}; + + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: Sections :" << phis[i] << " , " << z_ls[i] << " , " + << z_ts[i]; sections.emplace_back(s); } @@ -49,8 +52,9 @@ static long algorithm(dd4hep::Detector& /* description */, // non-zero phi distance. Sections with zero phi distance can be used to // create sharp jumps. - LogDebug("TrackerGeom") << "DDCutTubsFromPoints debug: Parent " << args.parentName() << "\tSolid " << solidOutput - << " NameSpace " << ns.name() << "\tnumber of sections " << sections.size(); + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints debug: Parent " << args.parentName() << "\tSolid " + << solidOutput << " NameSpace " << ns.name() << "\tnumber of sections " + << sections.size(); // radius for plane calculations // We use r_max here, since P3 later has a Z that is always more inside @@ -107,6 +111,16 @@ static long algorithm(dd4hep::Detector& /* description */, double P3_z_l = (P1_z_l + P2_z_l) / 2; double P3_z_t = (P1_z_t + P2_z_t) / 2; + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: P1 l: " << segname << P1_x_l << " , " << P1_y_l << " , " + << P1_z_l; + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: P1 t: " << segname << P1_x_t << " , " << P1_y_t << " , " + << P1_z_t; + + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: P2 l: " << segname << P2_x_l << " , " << P2_y_l << " , " + << P2_z_l; + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: P2 t: " << segname << P2_x_t << " , " << P2_y_t << " , " + << P2_z_t; + // we only have one dz to position both planes. The anchor is implicitly // between the P3's, we have to use an offset later to make the segments // line up correctly. @@ -123,6 +137,8 @@ static long algorithm(dd4hep::Detector& /* description */, double n_y_l = (D1_z_l * P2_x_l) - (P1_x_l * D2_z_l); double n_z_l = (P1_x_l * P2_y_l) - (P1_y_l * P2_x_l); + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: l_Pos (" << n_x_l << "," << n_y_l << "," << n_z_l << ")"; + // ... normalized. // flip the sign here (but not for t) since root wants it like that. double norm = -sqrt(n_x_l * n_x_l + n_y_l * n_y_l + n_z_l * n_z_l); @@ -130,6 +146,8 @@ static long algorithm(dd4hep::Detector& /* description */, n_y_l /= norm; n_z_l /= norm; + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: l_norm " << norm; + // same game for the t side. double D1_z_t = P1_z_t - P3_z_t; double D2_z_t = P2_z_t - P3_z_t; @@ -138,7 +156,12 @@ static long algorithm(dd4hep::Detector& /* description */, double n_y_t = (D1_z_t * P2_x_t) - (P1_x_t * D2_z_t); double n_z_t = (P1_x_t * P2_y_t) - (P1_y_t * P2_x_t); + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: t_Pos (" << n_x_t << "," << n_y_t << "," << n_z_t << ")"; + norm = sqrt(n_x_t * n_x_t + n_y_t * n_y_t + n_z_t * n_z_t); + + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: t_norm " << norm; + n_x_t /= norm; n_y_t /= norm; n_z_t /= norm; @@ -148,6 +171,10 @@ static long algorithm(dd4hep::Detector& /* description */, auto seg = dd4hep::CutTube(r_min, r_max, dz, phi1, dphi, n_x_l, n_y_l, n_z_l, n_x_t, n_y_t, n_z_t); + edm::LogVerbatim("TrackerGeom") << "DDCutTubsFromPoints: CutTube(" << r_min << "," << r_max << "," << dz << "," + << phi1 << "," << dphi << "," << n_x_l << "," << n_y_l << "," << n_z_l << "," + << n_x_t << "," << n_y_t << "," << n_z_t << ")"; + segments.emplace_back(seg); offsets.emplace_back(offset); } diff --git a/DetectorDescription/DDCMS/plugins/DDDefinitions2Objects.cc b/DetectorDescription/DDCMS/plugins/DDDefinitions2Objects.cc index 51fe52822f222..de9b7c8a5bb32 100644 --- a/DetectorDescription/DDCMS/plugins/DDDefinitions2Objects.cc +++ b/DetectorDescription/DDCMS/plugins/DDDefinitions2Objects.cc @@ -12,7 +12,7 @@ #include "XML/Utilities.h" #include "FWCore/ParameterSet/interface/FileInPath.h" #include "FWCore/Utilities/interface/thread_safety_macros.h" -#include "DataFormats/Math/interface/GeantUnits.h" +#include "DataFormats/Math/interface/CMSUnits.h" #include "DetectorDescription/DDCMS/interface/DDAlgoArguments.h" #include "DetectorDescription/DDCMS/interface/DDNamespace.h" #include "DetectorDescription/DDCMS/interface/DDParsingContext.h" @@ -32,7 +32,7 @@ using namespace std; using namespace dd4hep; using namespace cms; -using namespace geant_units::operators; +using namespace cms_units::operators; namespace dd4hep { @@ -1640,7 +1640,7 @@ namespace { for_each_token(cbegin(str), cend(str), cbegin(delims), cend(delims), [&output](auto first, auto second) { if (first != second) { - output.emplace_back(stod(string(first, second))); + output.emplace_back(dd4hep::_toDouble(string(first, second))); } }); return output; diff --git a/DetectorDescription/DDCMS/plugins/DDTrackerAngular.cc b/DetectorDescription/DDCMS/plugins/DDTrackerAngular.cc index 78616636bb745..af7656d1326ed 100644 --- a/DetectorDescription/DDCMS/plugins/DDTrackerAngular.cc +++ b/DetectorDescription/DDCMS/plugins/DDTrackerAngular.cc @@ -30,12 +30,12 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, delta = rangeAngle / double(n - 1); } - LogDebug("TrackerGeom") << "debug: Parameters for positioning:: n " << n << " Start, Range, Delta " - << convertRadToDeg(startAngle) << " " << convertRadToDeg(rangeAngle) << " " - << convertRadToDeg(delta) << " Radius " << radius << " Centre " << center[0] << ", " - << center[1] << ", " << center[2]; - LogDebug("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " - << ns.name(); + edm::LogVerbatim("TrackerGeom") << "debug: Parameters for positioning:: n " << n << " Start, Range, Delta " + << convertRadToDeg(startAngle) << " " << convertRadToDeg(rangeAngle) << " " + << convertRadToDeg(delta) << " Radius " << radius << " Centre " << center[0] << ", " + << center[1] << ", " << center[2]; + edm::LogVerbatim("TrackerGeom") << "debug: Parent " << mother.name() << "\tChild " << child.name() << " NameSpace " + << ns.name(); double theta = 90._deg; int copy = startCopyNo; @@ -52,9 +52,9 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, if (irot != ctxt.rotations.end()) { rotation = ns.rotation(ns.prepend(rotstr)); } else { - LogDebug("TrackerGeom") << "Creating a new " - << "rotation: " << rotstr << "\t90., " << convertRadToDeg(phix) << ", 90.," - << convertRadToDeg(phiy) << ", 0, 0"; + edm::LogVerbatim("TrackerGeom") << "Creating a new " + << "rotation: " << rotstr << "\t90., " << convertRadToDeg(phix) << ", 90.," + << convertRadToDeg(phiy) << ", 0, 0"; RotationZYX rot; rotation = makeRotation3D(theta, phix, theta, phiy, 0., 0.); } @@ -65,8 +65,8 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, double zpos = center[2]; Position tran(xpos, ypos, zpos); mother.placeVolume(child, copy, Transform3D(rotation, tran)); - LogDebug("TrackerGeom") << "test " << child.name() << " number " << copy << " positioned in " << mother.name() - << " at " << tran << " with " << rotation; + edm::LogVerbatim("TrackerGeom") << "test " << child.name() << " number " << copy << " positioned in " + << mother.name() << " at " << tran << " with " << rotation; copy += incrCopyNo; phi += delta; }