From 60c956028057c7e0aa406b938e3e419493c8e59b Mon Sep 17 00:00:00 2001 From: Carl Vuosalo Date: Thu, 10 Jun 2021 23:14:21 +0200 Subject: [PATCH 1/5] Bug fixes from geometry validation --- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 56 ++++++++++++------- .../data/PhaseI/v2/pixfwdInnerDiskZminus.xml | 8 +-- .../data/PhaseI/v2/pixfwdInnerDiskZplus.xml | 8 +-- .../data/PhaseI/v2/pixfwdOuterDiskZminus.xml | 8 +-- .../data/PhaseI/v2/pixfwdOuterDiskZplus.xml | 8 +-- .../plugins/dd4hep/DDTECModuleAlgo.cc | 2 + .../plugins/dd4hep/DDTIBLayerAlgo.cc | 4 +- 7 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 321673184ae79..acc4d825141fc 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -449,6 +449,11 @@ namespace { return ns.rotation(ns.prepend(nam)); } + const Rotation3D& myrot(cms::DDNamespace& ns, const string& nam, const Rotation3D& r) { + ns.addRotation(nam, r); + return ns.rotation(ns.prepend(nam)); + } + Solid mytrap(const std::string& nam, const EcalTrapezoidParameters& t) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeom") << nam << " Trap " << convertRadToDeg(t.theta()) << ":" << convertRadToDeg(t.phi()) @@ -1169,10 +1174,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++ptmCopy; - xilyLog.placeVolume( - ilyPTMLog, - ptmCopy, - Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); + xilyLog.placeVolume(ilyPTMLog, + ptmCopy, + Transform3D(myrot(ns, + std::string(ilyPTMLog.name()) + "_rot" + std::to_string(ptmCopy), + Rotation3D(RotationZ(phi))), + Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name() << " at (" @@ -1189,10 +1196,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++fanOutCopy; - xilyLog.placeVolume(ilyFanOutLog, - fanOutCopy, - Transform3D(RotationZ(phi) * RotationY(180._deg), - Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); + xilyLog.placeVolume( + ilyFanOutLog, + fanOutCopy, + Transform3D(myrot(ns, + std::string(ilyFanOutLog.name()) + "_rot" + std::to_string(fanOutCopy), + RotationZ(phi) * RotationY(180._deg)), + Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name() << " at (" @@ -1207,10 +1217,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++femCopy; - xilyLog.placeVolume( - ilyFEMLog, - femCopy, - Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); + xilyLog.placeVolume(ilyFEMLog, + femCopy, + Transform3D(myrot(ns, + std::string(ilyFEMLog.name()) + "_rot" + std::to_string(femCopy), + Rotation3D(RotationZ(phi))), + Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name() << " at (" @@ -1242,8 +1254,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume( ilyPipeLog[type], copyNum[type], - Transform3D(Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg)), - Position(xx, yy, zz))); + Transform3D( + myrot(ns, + std::string(ilyPipeLog[type].name()) + "_rot" + std::to_string(ly), + Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg))), + Position(xx, yy, zz))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name() << " at (" << cms::convert2mm(xx) << "," @@ -1390,7 +1405,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid fawSolid = SubtractionSolid(fawSolid1, fawCutBox, - Transform3D(myrot(ns, fawCutName + "R", fawCutForm.getRotation()), + Transform3D(myrot(ns, fawCutName + "_rot", fawCutForm.getRotation()), Position(fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()))); @@ -1413,7 +1428,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyOne, Transform3D( - myrot(ns, alvWedge.hawRName + "R", hawRform.getRotation()), + myrot(ns, alvWedge.hawRName + "_rot", hawRform.getRotation()), Position(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyOne << " positioned in " @@ -1426,7 +1441,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyTwo, Transform3D( - Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI), // rotate about Y after refl thru Z + myrot( + ns, + alvWedge.hawRName + "R2", + Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI)), // rotate about Y after refl thru Z Position(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyTwo << " positioned in " @@ -1489,7 +1507,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName) .placeVolume(gridLog, copyOne, - Transform3D(myrot(ns, grid.name + "R", gridForm.getRotation()), + Transform3D(myrot(ns, grid.name + "_rot", gridForm.getRotation()), Position(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()))); @@ -1559,7 +1577,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ); const string cryDDName(cry.name + sType); - Solid crySolid = mytrap(cry.name, trapCry); + Solid crySolid = mytrap(cryDDName, trapCry); Volume cryLog = Volume(cryDDName, crySolid, ns.material(cry.mat)); //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++ diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml index 2ae56d29e0696..070c811e2e706 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml index e744d68704f63..d6e671bc51252 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml index 49ebab585fb14..d2b2664bf4f72 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml index 6777aefaeb8aa..624a61bb081e3 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc index 2623aae568e80..fd13d7af97b08 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc @@ -409,6 +409,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dy = 0.5 * pitchThick; dz = 0.5 * pitchHeight; solid = Box(dx, dy, dz); + name += "Box"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Box made of " << pitchMat << " of dimensions " << dx << ", " << dy << ", " << dz; @@ -419,6 +420,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl2 = 0.5 * pitchHeight - 0.5 * dz * sin(detTilt); thet = atan((bl1 - bl2) / (2. * dz)); solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); + name += "Trap"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << pitchMat << " of dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", " diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc index 2aa79f129ec9e..77eb4d493534c 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc @@ -252,7 +252,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex double dz = 0.5 * layerL - 2. * fillerDz; double _rmi = std::min(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); double _rma = std::max(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); - solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, width)); + solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, 0.5 * width)); LogDebug("TIBGeom") << solid.name() << " Tubs made of " << ribMat << " from " << -0.5 * convertRadToDeg(width) << " to " << 0.5 * convertRadToDeg(width) << " with Rin " << rin + 0.5 * dd4hep::mm << " Rout " << rout - 0.5 * dd4hep::mm << " ZHalf " << dz; @@ -490,7 +490,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex break; } - solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, 2. * pillarDPhi)); + solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, pillarDPhi)); Volume Pillar = ns.addVolumeNS(Volume(name, solid, ns.material(pillarMaterial))); LogDebug("TIBGeom") << solid.name() << " Tubs made of " << pillarMaterial << " from " << -pillarDPhi << " to " << pillarDPhi << " with Rin " << pillarRin << " Rout " << pillarRout << " ZHalf " << pillarDz; From 2e36ed0b7c30e31b912a5d223d277eff68337072 Mon Sep 17 00:00:00 2001 From: Carl Vuosalo Date: Thu, 10 Jun 2021 23:16:38 +0200 Subject: [PATCH 2/5] Revert "Bug fixes from geometry validation" This reverts commit 60c956028057c7e0aa406b938e3e419493c8e59b. --- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 56 +++++++------------ .../data/PhaseI/v2/pixfwdInnerDiskZminus.xml | 8 +-- .../data/PhaseI/v2/pixfwdInnerDiskZplus.xml | 8 +-- .../data/PhaseI/v2/pixfwdOuterDiskZminus.xml | 8 +-- .../data/PhaseI/v2/pixfwdOuterDiskZplus.xml | 8 +-- .../plugins/dd4hep/DDTECModuleAlgo.cc | 2 - .../plugins/dd4hep/DDTIBLayerAlgo.cc | 4 +- 7 files changed, 37 insertions(+), 57 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index acc4d825141fc..321673184ae79 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -449,11 +449,6 @@ namespace { return ns.rotation(ns.prepend(nam)); } - const Rotation3D& myrot(cms::DDNamespace& ns, const string& nam, const Rotation3D& r) { - ns.addRotation(nam, r); - return ns.rotation(ns.prepend(nam)); - } - Solid mytrap(const std::string& nam, const EcalTrapezoidParameters& t) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeom") << nam << " Trap " << convertRadToDeg(t.theta()) << ":" << convertRadToDeg(t.phi()) @@ -1174,12 +1169,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++ptmCopy; - xilyLog.placeVolume(ilyPTMLog, - ptmCopy, - Transform3D(myrot(ns, - std::string(ilyPTMLog.name()) + "_rot" + std::to_string(ptmCopy), - Rotation3D(RotationZ(phi))), - Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); + xilyLog.placeVolume( + ilyPTMLog, + ptmCopy, + Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name() << " at (" @@ -1196,13 +1189,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++fanOutCopy; - xilyLog.placeVolume( - ilyFanOutLog, - fanOutCopy, - Transform3D(myrot(ns, - std::string(ilyFanOutLog.name()) + "_rot" + std::to_string(fanOutCopy), - RotationZ(phi) * RotationY(180._deg)), - Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); + xilyLog.placeVolume(ilyFanOutLog, + fanOutCopy, + Transform3D(RotationZ(phi) * RotationY(180._deg), + Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name() << " at (" @@ -1217,12 +1207,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++femCopy; - xilyLog.placeVolume(ilyFEMLog, - femCopy, - Transform3D(myrot(ns, - std::string(ilyFEMLog.name()) + "_rot" + std::to_string(femCopy), - Rotation3D(RotationZ(phi))), - Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); + xilyLog.placeVolume( + ilyFEMLog, + femCopy, + Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name() << " at (" @@ -1254,11 +1242,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume( ilyPipeLog[type], copyNum[type], - Transform3D( - myrot(ns, - std::string(ilyPipeLog[type].name()) + "_rot" + std::to_string(ly), - Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg))), - Position(xx, yy, zz))); + Transform3D(Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg)), + Position(xx, yy, zz))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name() << " at (" << cms::convert2mm(xx) << "," @@ -1405,7 +1390,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid fawSolid = SubtractionSolid(fawSolid1, fawCutBox, - Transform3D(myrot(ns, fawCutName + "_rot", fawCutForm.getRotation()), + Transform3D(myrot(ns, fawCutName + "R", fawCutForm.getRotation()), Position(fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()))); @@ -1428,7 +1413,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyOne, Transform3D( - myrot(ns, alvWedge.hawRName + "_rot", hawRform.getRotation()), + myrot(ns, alvWedge.hawRName + "R", hawRform.getRotation()), Position(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyOne << " positioned in " @@ -1441,10 +1426,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyTwo, Transform3D( - myrot( - ns, - alvWedge.hawRName + "R2", - Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI)), // rotate about Y after refl thru Z + Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI), // rotate about Y after refl thru Z Position(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyTwo << " positioned in " @@ -1507,7 +1489,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName) .placeVolume(gridLog, copyOne, - Transform3D(myrot(ns, grid.name + "_rot", gridForm.getRotation()), + Transform3D(myrot(ns, grid.name + "R", gridForm.getRotation()), Position(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()))); @@ -1577,7 +1559,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ); const string cryDDName(cry.name + sType); - Solid crySolid = mytrap(cryDDName, trapCry); + Solid crySolid = mytrap(cry.name, trapCry); Volume cryLog = Volume(cryDDName, crySolid, ns.material(cry.mat)); //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++ diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml index 070c811e2e706..2ae56d29e0696 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml index d6e671bc51252..e744d68704f63 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml index d2b2664bf4f72..49ebab585fb14 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml index 624a61bb081e3..6777aefaeb8aa 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc index fd13d7af97b08..2623aae568e80 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc @@ -409,7 +409,6 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dy = 0.5 * pitchThick; dz = 0.5 * pitchHeight; solid = Box(dx, dy, dz); - name += "Box"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Box made of " << pitchMat << " of dimensions " << dx << ", " << dy << ", " << dz; @@ -420,7 +419,6 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl2 = 0.5 * pitchHeight - 0.5 * dz * sin(detTilt); thet = atan((bl1 - bl2) / (2. * dz)); solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - name += "Trap"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << pitchMat << " of dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", " diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc index 77eb4d493534c..2aa79f129ec9e 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc @@ -252,7 +252,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex double dz = 0.5 * layerL - 2. * fillerDz; double _rmi = std::min(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); double _rma = std::max(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); - solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, 0.5 * width)); + solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, width)); LogDebug("TIBGeom") << solid.name() << " Tubs made of " << ribMat << " from " << -0.5 * convertRadToDeg(width) << " to " << 0.5 * convertRadToDeg(width) << " with Rin " << rin + 0.5 * dd4hep::mm << " Rout " << rout - 0.5 * dd4hep::mm << " ZHalf " << dz; @@ -490,7 +490,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex break; } - solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, pillarDPhi)); + solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, 2. * pillarDPhi)); Volume Pillar = ns.addVolumeNS(Volume(name, solid, ns.material(pillarMaterial))); LogDebug("TIBGeom") << solid.name() << " Tubs made of " << pillarMaterial << " from " << -pillarDPhi << " to " << pillarDPhi << " with Rin " << pillarRin << " Rout " << pillarRout << " ZHalf " << pillarDz; From 821e3d471093a9cffcd786a9b07a6d5322bd030d Mon Sep 17 00:00:00 2001 From: Carl Vuosalo Date: Thu, 10 Jun 2021 23:37:00 +0200 Subject: [PATCH 3/5] Bug fixes from geometry validation --- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 56 ++++++++++++------- .../data/PhaseI/v2/pixfwdInnerDiskZminus.xml | 8 +-- .../data/PhaseI/v2/pixfwdInnerDiskZplus.xml | 8 +-- .../data/PhaseI/v2/pixfwdOuterDiskZminus.xml | 8 +-- .../data/PhaseI/v2/pixfwdOuterDiskZplus.xml | 8 +-- .../plugins/dd4hep/DDTECModuleAlgo.cc | 2 + .../plugins/dd4hep/DDTIBLayerAlgo.cc | 4 +- 7 files changed, 57 insertions(+), 37 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index 321673184ae79..acc4d825141fc 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -449,6 +449,11 @@ namespace { return ns.rotation(ns.prepend(nam)); } + const Rotation3D& myrot(cms::DDNamespace& ns, const string& nam, const Rotation3D& r) { + ns.addRotation(nam, r); + return ns.rotation(ns.prepend(nam)); + } + Solid mytrap(const std::string& nam, const EcalTrapezoidParameters& t) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeom") << nam << " Trap " << convertRadToDeg(t.theta()) << ":" << convertRadToDeg(t.phi()) @@ -1169,10 +1174,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++ptmCopy; - xilyLog.placeVolume( - ilyPTMLog, - ptmCopy, - Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); + xilyLog.placeVolume(ilyPTMLog, + ptmCopy, + Transform3D(myrot(ns, + std::string(ilyPTMLog.name()) + "_rot" + std::to_string(ptmCopy), + Rotation3D(RotationZ(phi))), + Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name() << " at (" @@ -1189,10 +1196,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++fanOutCopy; - xilyLog.placeVolume(ilyFanOutLog, - fanOutCopy, - Transform3D(RotationZ(phi) * RotationY(180._deg), - Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); + xilyLog.placeVolume( + ilyFanOutLog, + fanOutCopy, + Transform3D(myrot(ns, + std::string(ilyFanOutLog.name()) + "_rot" + std::to_string(fanOutCopy), + RotationZ(phi) * RotationY(180._deg)), + Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name() << " at (" @@ -1207,10 +1217,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++femCopy; - xilyLog.placeVolume( - ilyFEMLog, - femCopy, - Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); + xilyLog.placeVolume(ilyFEMLog, + femCopy, + Transform3D(myrot(ns, + std::string(ilyFEMLog.name()) + "_rot" + std::to_string(femCopy), + Rotation3D(RotationZ(phi))), + Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name() << " at (" @@ -1242,8 +1254,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume( ilyPipeLog[type], copyNum[type], - Transform3D(Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg)), - Position(xx, yy, zz))); + Transform3D( + myrot(ns, + std::string(ilyPipeLog[type].name()) + "_rot" + std::to_string(ly), + Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg))), + Position(xx, yy, zz))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name() << " at (" << cms::convert2mm(xx) << "," @@ -1390,7 +1405,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid fawSolid = SubtractionSolid(fawSolid1, fawCutBox, - Transform3D(myrot(ns, fawCutName + "R", fawCutForm.getRotation()), + Transform3D(myrot(ns, fawCutName + "_rot", fawCutForm.getRotation()), Position(fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()))); @@ -1413,7 +1428,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyOne, Transform3D( - myrot(ns, alvWedge.hawRName + "R", hawRform.getRotation()), + myrot(ns, alvWedge.hawRName + "_rot", hawRform.getRotation()), Position(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyOne << " positioned in " @@ -1426,7 +1441,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyTwo, Transform3D( - Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI), // rotate about Y after refl thru Z + myrot( + ns, + alvWedge.hawRName + "R2", + Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI)), // rotate about Y after refl thru Z Position(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyTwo << " positioned in " @@ -1489,7 +1507,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName) .placeVolume(gridLog, copyOne, - Transform3D(myrot(ns, grid.name + "R", gridForm.getRotation()), + Transform3D(myrot(ns, grid.name + "_rot", gridForm.getRotation()), Position(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()))); @@ -1559,7 +1577,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ); const string cryDDName(cry.name + sType); - Solid crySolid = mytrap(cry.name, trapCry); + Solid crySolid = mytrap(cryDDName, trapCry); Volume cryLog = Volume(cryDDName, crySolid, ns.material(cry.mat)); //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++ diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml index 2ae56d29e0696..137f5f9625d7f 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml index e744d68704f63..701bcb78e352b 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml index 49ebab585fb14..a66348e6a68af 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml index 6777aefaeb8aa..d9669d347219a 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc index 2623aae568e80..fd13d7af97b08 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc @@ -409,6 +409,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dy = 0.5 * pitchThick; dz = 0.5 * pitchHeight; solid = Box(dx, dy, dz); + name += "Box"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Box made of " << pitchMat << " of dimensions " << dx << ", " << dy << ", " << dz; @@ -419,6 +420,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl2 = 0.5 * pitchHeight - 0.5 * dz * sin(detTilt); thet = atan((bl1 - bl2) / (2. * dz)); solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); + name += "Trap"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << pitchMat << " of dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", " diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc index 2aa79f129ec9e..77eb4d493534c 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTIBLayerAlgo.cc @@ -252,7 +252,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex double dz = 0.5 * layerL - 2. * fillerDz; double _rmi = std::min(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); double _rma = std::max(rin + 0.5 * dd4hep::mm, rout - 0.5 * dd4hep::mm); - solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, width)); + solid = ns.addSolidNS(name, Tube(_rmi, _rma, dz, -0.5 * width, 0.5 * width)); LogDebug("TIBGeom") << solid.name() << " Tubs made of " << ribMat << " from " << -0.5 * convertRadToDeg(width) << " to " << 0.5 * convertRadToDeg(width) << " with Rin " << rin + 0.5 * dd4hep::mm << " Rout " << rout - 0.5 * dd4hep::mm << " ZHalf " << dz; @@ -490,7 +490,7 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& contex break; } - solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, 2. * pillarDPhi)); + solid = ns.addSolidNS(name, Tube(pillarRin, pillarRout, pillarDz, -pillarDPhi, pillarDPhi)); Volume Pillar = ns.addVolumeNS(Volume(name, solid, ns.material(pillarMaterial))); LogDebug("TIBGeom") << solid.name() << " Tubs made of " << pillarMaterial << " from " << -pillarDPhi << " to " << pillarDPhi << " with Rin " << pillarRin << " Rout " << pillarRout << " ZHalf " << pillarDz; From d2b14d520e0a647bd3cecdd0ca6893a61628a2df Mon Sep 17 00:00:00 2001 From: Carl Vuosalo Date: Sat, 12 Jun 2021 01:20:34 +0200 Subject: [PATCH 4/5] Removed unnecessary rotation naming --- .../plugins/dd4hep/DDEcalBarrelNewAlgo.cc | 54 +++++++------------ 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc index acc4d825141fc..3c32b0115fca2 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalBarrelNewAlgo.cc @@ -449,11 +449,6 @@ namespace { return ns.rotation(ns.prepend(nam)); } - const Rotation3D& myrot(cms::DDNamespace& ns, const string& nam, const Rotation3D& r) { - ns.addRotation(nam, r); - return ns.rotation(ns.prepend(nam)); - } - Solid mytrap(const std::string& nam, const EcalTrapezoidParameters& t) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeom") << nam << " Trap " << convertRadToDeg(t.theta()) << ":" << convertRadToDeg(t.phi()) @@ -1174,12 +1169,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++ptmCopy; - xilyLog.placeVolume(ilyPTMLog, - ptmCopy, - Transform3D(myrot(ns, - std::string(ilyPTMLog.name()) + "_rot" + std::to_string(ptmCopy), - Rotation3D(RotationZ(phi))), - Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); + xilyLog.placeVolume( + ilyPTMLog, + ptmCopy, + Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyPTMZ[ilyPTM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name() << " at (" @@ -1196,13 +1189,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++fanOutCopy; - xilyLog.placeVolume( - ilyFanOutLog, - fanOutCopy, - Transform3D(myrot(ns, - std::string(ilyFanOutLog.name()) + "_rot" + std::to_string(fanOutCopy), - RotationZ(phi) * RotationY(180._deg)), - Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); + xilyLog.placeVolume(ilyFanOutLog, + fanOutCopy, + Transform3D(RotationZ(phi) * RotationY(180._deg), + Position(xx, yy, ily.vecIlyFanOutZ[ilyFO] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name() << " at (" @@ -1217,12 +1207,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const double yy(radius * sin(phi)); const double xx(radius * cos(phi)); ++femCopy; - xilyLog.placeVolume(ilyFEMLog, - femCopy, - Transform3D(myrot(ns, - std::string(ilyFEMLog.name()) + "_rot" + std::to_string(femCopy), - Rotation3D(RotationZ(phi))), - Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); + xilyLog.placeVolume( + ilyFEMLog, + femCopy, + Transform3D(RotationZ(phi), Position(xx, yy, ily.vecIlyFEMZ[ilyFEM] - ilyLengthHalf))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name() << " at (" @@ -1254,11 +1242,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext xilyLog.placeVolume( ilyPipeLog[type], copyNum[type], - Transform3D( - myrot(ns, - std::string(ilyPipeLog[type].name()) + "_rot" + std::to_string(ly), - Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg))), - Position(xx, yy, zz))); + Transform3D(Rotation3D(ROOT::Math::AxisAngle(ROOT::Math::AxisAngle::XYZVector(xx, yy, 0), 90._deg)), + Position(xx, yy, zz))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in " << xilyLog.name() << " at (" << cms::convert2mm(xx) << "," @@ -1405,7 +1390,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext Solid fawSolid = SubtractionSolid(fawSolid1, fawCutBox, - Transform3D(myrot(ns, fawCutName + "_rot", fawCutForm.getRotation()), + Transform3D(myrot(ns, fawCutName + "R", fawCutForm.getRotation()), Position(fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()))); @@ -1428,7 +1413,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyOne, Transform3D( - myrot(ns, alvWedge.hawRName + "_rot", hawRform.getRotation()), + myrot(ns, alvWedge.hawRName + "R", hawRform.getRotation()), Position(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyOne << " positioned in " @@ -1441,10 +1426,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName), copyTwo, Transform3D( - myrot( - ns, - alvWedge.hawRName + "R2", - Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI)), // rotate about Y after refl thru Z + Rotation3D(1., 0., 0., 0., 1., 0., 0., 0., -1.) * RotationY(M_PI), // rotate about Y after refl thru Z Position(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()))); #ifdef EDM_ML_DEBUG edm::LogVerbatim("EBGeomX") << ns.assembly(alvWedge.hawRName).name() << ":" << copyTwo << " positioned in " @@ -1507,7 +1489,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.assembly(alvWedge.hawRName) .placeVolume(gridLog, copyOne, - Transform3D(myrot(ns, grid.name + "_rot", gridForm.getRotation()), + Transform3D(myrot(ns, grid.name + "R", gridForm.getRotation()), Position(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()))); From a5b80a17156c5bf5e5e3d80e9aee99378e5808c9 Mon Sep 17 00:00:00 2001 From: Carl Vuosalo Date: Sat, 12 Jun 2021 05:10:49 +0200 Subject: [PATCH 5/5] Remove files with only name changes --- .../data/PhaseI/v2/pixfwdInnerDiskZminus.xml | 8 ++++---- .../data/PhaseI/v2/pixfwdInnerDiskZplus.xml | 8 ++++---- .../data/PhaseI/v2/pixfwdOuterDiskZminus.xml | 8 ++++---- .../data/PhaseI/v2/pixfwdOuterDiskZplus.xml | 8 ++++---- .../TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc | 2 -- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml index 137f5f9625d7f..2ae56d29e0696 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZminus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml index 701bcb78e352b..e744d68704f63 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdInnerDiskZplus.xml @@ -11,7 +11,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -33,7 +33,7 @@ - + @@ -44,7 +44,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml index a66348e6a68af..49ebab585fb14 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZminus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml index d9669d347219a..6777aefaeb8aa 100644 --- a/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml +++ b/Geometry/TrackerCommonData/data/PhaseI/v2/pixfwdOuterDiskZplus.xml @@ -20,7 +20,7 @@ --> - + @@ -31,7 +31,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -53,7 +53,7 @@ - + diff --git a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc index fd13d7af97b08..2623aae568e80 100644 --- a/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc +++ b/Geometry/TrackerCommonData/plugins/dd4hep/DDTECModuleAlgo.cc @@ -409,7 +409,6 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, dy = 0.5 * pitchThick; dz = 0.5 * pitchHeight; solid = Box(dx, dy, dz); - name += "Box"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Box made of " << pitchMat << " of dimensions " << dx << ", " << dy << ", " << dz; @@ -420,7 +419,6 @@ static long algorithm(Detector& /* description */, cms::DDParsingContext& ctxt, bl2 = 0.5 * pitchHeight - 0.5 * dz * sin(detTilt); thet = atan((bl1 - bl2) / (2. * dz)); solid = Trap(dz, thet, 0, h1, bl1, bl1, 0, h1, bl2, bl2, 0); - name += "Trap"; ns.addSolidNS(name, solid); edm::LogVerbatim("TECGeom") << "Solid:\t" << name << " " << solid.name() << " Trap made of " << pitchMat << " of dimensions " << dz << ", " << convertRadToDeg(thet) << ", 0, " << h1 << ", "