@@ -449,6 +449,11 @@ namespace {
449449 return ns.rotation (ns.prepend (nam));
450450 }
451451
452+ const Rotation3D& myrot (cms::DDNamespace& ns, const string& nam, const Rotation3D& r) {
453+ ns.addRotation (nam, r);
454+ return ns.rotation (ns.prepend (nam));
455+ }
456+
452457 Solid mytrap (const std::string& nam, const EcalTrapezoidParameters& t) {
453458#ifdef EDM_ML_DEBUG
454459 edm::LogVerbatim (" EBGeom" ) << nam << " Trap " << convertRadToDeg (t.theta ()) << " :" << convertRadToDeg (t.phi ())
@@ -1169,10 +1174,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
11691174 const double yy (radius * sin (phi));
11701175 const double xx (radius * cos (phi));
11711176 ++ptmCopy;
1172- xilyLog.placeVolume (
1173- ilyPTMLog,
1174- ptmCopy,
1175- Transform3D (RotationZ (phi), Position (xx, yy, ily.vecIlyPTMZ [ilyPTM] - ilyLengthHalf)));
1177+ xilyLog.placeVolume (ilyPTMLog,
1178+ ptmCopy,
1179+ Transform3D (myrot (ns,
1180+ std::string (ilyPTMLog.name ()) + " _rot" + std::to_string (ptmCopy),
1181+ Rotation3D (RotationZ (phi))),
1182+ Position (xx, yy, ily.vecIlyPTMZ [ilyPTM] - ilyLengthHalf)));
11761183#ifdef EDM_ML_DEBUG
11771184 edm::LogVerbatim (" EBGeomX" )
11781185 << ilyPTMLog.name () << " :" << ptmCopy << " positioned in " << xilyLog.name () << " at ("
@@ -1189,10 +1196,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
11891196 const double yy (radius * sin (phi));
11901197 const double xx (radius * cos (phi));
11911198 ++fanOutCopy;
1192- xilyLog.placeVolume (ilyFanOutLog,
1193- fanOutCopy,
1194- Transform3D (RotationZ (phi) * RotationY (180 ._deg ),
1195- Position (xx, yy, ily.vecIlyFanOutZ [ilyFO] - ilyLengthHalf)));
1199+ xilyLog.placeVolume (
1200+ ilyFanOutLog,
1201+ fanOutCopy,
1202+ Transform3D (myrot (ns,
1203+ std::string (ilyFanOutLog.name ()) + " _rot" + std::to_string (fanOutCopy),
1204+ RotationZ (phi) * RotationY (180 ._deg )),
1205+ Position (xx, yy, ily.vecIlyFanOutZ [ilyFO] - ilyLengthHalf)));
11961206#ifdef EDM_ML_DEBUG
11971207 edm::LogVerbatim (" EBGeomX" )
11981208 << ilyFanOutLog.name () << " :" << fanOutCopy << " positioned in " << xilyLog.name () << " at ("
@@ -1207,10 +1217,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
12071217 const double yy (radius * sin (phi));
12081218 const double xx (radius * cos (phi));
12091219 ++femCopy;
1210- xilyLog.placeVolume (
1211- ilyFEMLog,
1212- femCopy,
1213- Transform3D (RotationZ (phi), Position (xx, yy, ily.vecIlyFEMZ [ilyFEM] - ilyLengthHalf)));
1220+ xilyLog.placeVolume (ilyFEMLog,
1221+ femCopy,
1222+ Transform3D (myrot (ns,
1223+ std::string (ilyFEMLog.name ()) + " _rot" + std::to_string (femCopy),
1224+ Rotation3D (RotationZ (phi))),
1225+ Position (xx, yy, ily.vecIlyFEMZ [ilyFEM] - ilyLengthHalf)));
12141226#ifdef EDM_ML_DEBUG
12151227 edm::LogVerbatim (" EBGeomX" )
12161228 << ilyFEMLog.name () << " :" << femCopy << " positioned in " << xilyLog.name () << " at ("
@@ -1242,8 +1254,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
12421254 xilyLog.placeVolume (
12431255 ilyPipeLog[type],
12441256 copyNum[type],
1245- Transform3D (Rotation3D (ROOT::Math::AxisAngle (ROOT::Math::AxisAngle::XYZVector (xx, yy, 0 ), 90 ._deg )),
1246- Position (xx, yy, zz)));
1257+ Transform3D (
1258+ myrot (ns,
1259+ std::string (ilyPipeLog[type].name ()) + " _rot" + std::to_string (ly),
1260+ Rotation3D (ROOT::Math::AxisAngle (ROOT::Math::AxisAngle::XYZVector (xx, yy, 0 ), 90 ._deg ))),
1261+ Position (xx, yy, zz)));
12471262#ifdef EDM_ML_DEBUG
12481263 edm::LogVerbatim (" EBGeomX" ) << ilyPipeLog[type].name () << " :" << copyNum[type] << " positioned in "
12491264 << xilyLog.name () << " at (" << cms::convert2mm (xx) << " ,"
@@ -1390,7 +1405,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
13901405
13911406 Solid fawSolid = SubtractionSolid (fawSolid1,
13921407 fawCutBox,
1393- Transform3D (myrot (ns, fawCutName + " R " , fawCutForm.getRotation ()),
1408+ Transform3D (myrot (ns, fawCutName + " _rot " , fawCutForm.getRotation ()),
13941409 Position (fawCutForm.getTranslation ().x (),
13951410 fawCutForm.getTranslation ().y (),
13961411 fawCutForm.getTranslation ().z ())));
@@ -1413,7 +1428,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
14131428 ns.assembly (alvWedge.hawRName ),
14141429 copyOne,
14151430 Transform3D (
1416- myrot (ns, alvWedge.hawRName + " R " , hawRform.getRotation ()),
1431+ myrot (ns, alvWedge.hawRName + " _rot " , hawRform.getRotation ()),
14171432 Position (hawRform.getTranslation ().x (), hawRform.getTranslation ().y (), hawRform.getTranslation ().z ())));
14181433#ifdef EDM_ML_DEBUG
14191434 edm::LogVerbatim (" EBGeomX" ) << ns.assembly (alvWedge.hawRName ).name () << " :" << copyOne << " positioned in "
@@ -1426,7 +1441,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
14261441 ns.assembly (alvWedge.hawRName ),
14271442 copyTwo,
14281443 Transform3D (
1429- Rotation3D (1 ., 0 ., 0 ., 0 ., 1 ., 0 ., 0 ., 0 ., -1 .) * RotationY (M_PI), // rotate about Y after refl thru Z
1444+ myrot (
1445+ ns,
1446+ alvWedge.hawRName + " R2" ,
1447+ Rotation3D (1 ., 0 ., 0 ., 0 ., 1 ., 0 ., 0 ., 0 ., -1 .) * RotationY (M_PI)), // rotate about Y after refl thru Z
14301448 Position (-hawRform.getTranslation ().x (), -hawRform.getTranslation ().y (), -hawRform.getTranslation ().z ())));
14311449#ifdef EDM_ML_DEBUG
14321450 edm::LogVerbatim (" EBGeomX" ) << ns.assembly (alvWedge.hawRName ).name () << " :" << copyTwo << " positioned in "
@@ -1489,7 +1507,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
14891507 ns.assembly (alvWedge.hawRName )
14901508 .placeVolume (gridLog,
14911509 copyOne,
1492- Transform3D (myrot (ns, grid.name + " R " , gridForm.getRotation ()),
1510+ Transform3D (myrot (ns, grid.name + " _rot " , gridForm.getRotation ()),
14931511 Position (gridForm.getTranslation ().x (),
14941512 gridForm.getTranslation ().y (),
14951513 gridForm.getTranslation ().z ())));
@@ -1559,7 +1577,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext
15591577 );
15601578
15611579 const string cryDDName (cry.name + sType );
1562- Solid crySolid = mytrap (cry. name , trapCry);
1580+ Solid crySolid = mytrap (cryDDName , trapCry);
15631581 Volume cryLog = Volume (cryDDName, crySolid, ns.material (cry.mat ));
15641582
15651583 // ++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++
0 commit comments