From 2aa615e8ddab4b002ba3bfcfdc25a670ff70b171 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Sun, 2 May 2021 17:53:17 +0200 Subject: [PATCH 1/2] Remove reference of DDD from plugins/dd4hep/DDEcalEndcapAlgo.cc --- .../interface/DDEcalEndcapTrapX.h | 53 ++++ .../plugins/dd4hep/DDEcalEndcapAlgo.cc | 19 +- .../EcalCommonData/src/DDEcalEndcapTrap.cc | 45 ++- .../EcalCommonData/src/DDEcalEndcapTrapX.cc | 274 ++++++++++++++++++ 4 files changed, 364 insertions(+), 27 deletions(-) create mode 100644 Geometry/EcalCommonData/interface/DDEcalEndcapTrapX.h create mode 100644 Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc diff --git a/Geometry/EcalCommonData/interface/DDEcalEndcapTrapX.h b/Geometry/EcalCommonData/interface/DDEcalEndcapTrapX.h new file mode 100644 index 0000000000000..0f3ba7d035c1a --- /dev/null +++ b/Geometry/EcalCommonData/interface/DDEcalEndcapTrapX.h @@ -0,0 +1,53 @@ +#ifndef Geometry_EcalCommonDatao_DDEcalEndcapTrapX_h +#define Geometry_EcalCommonDatao_DDEcalEndcapTrapX_h + +#include +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DetectorDescription/DDCMS/interface/DDRotationMatrix.h" +#include "DetectorDescription/DDCMS/interface/DDTranslation.h" + +// Define Endcap Supercrystal class + +class DDEcalEndcapTrapX { +public: + DDEcalEndcapTrapX(const int hand, const double front, const double rear, const double length); + DDEcalEndcapTrapX() = delete; + + void rotate(const DDRotationMatrix& rot); + void translate(const DDTranslation& trans); + + void rotateX(const double angle); + void rotateY(const double angle); + void translate(); + void moveto(const DDTranslation& frontCentre, const DDTranslation& rearCentre); + double elevationAngle(const DDTranslation& trans); + double polarAngle(const DDTranslation& trans); + double elevationAngle(); + double polarAngle(); + DDTranslation cornerPos(const int icorner); + void cornerPos(const int icorner, const DDTranslation& cc); + DDTranslation centrePos(); + DDTranslation fcentrePos(); + DDTranslation rcentrePos(); + void calculateCorners(); + void calculateCentres(); + DDRotationMatrix rotation() { return m_rotation; } + void print(); + +private: + DDRotationMatrix m_rotation; + DDTranslation m_translation; + + double m_centre[4]; + double m_fcentre[4]; + double m_rcentre[4]; + double m_corners[25]; + double m_front; + double m_rear; + double m_length; + + int m_hand; + int m_update; +}; + +#endif diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc index e8efe7e37608c..1df77ee052546 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc @@ -4,7 +4,7 @@ #include "DetectorDescription/DDCMS/interface/DDutils.h" #include "DataFormats/Math/interface/angle_units.h" // Header files for endcap supercrystal geometry -#include "Geometry/EcalCommonData/interface/DDEcalEndcapTrap.h" +#include "Geometry/EcalCommonData/interface/DDEcalEndcapTrapX.h" #include #include @@ -12,9 +12,6 @@ using namespace angle_units::operators; -using DDTranslation = ROOT::Math::DisplacementVector3D >; -using DDRotation = ROOT::Math::Rotation3D; - //#define EDM_ML_DEBUG namespace { @@ -77,7 +74,7 @@ namespace { double zFront; }; - const DDRotation& myrot(cms::DDNamespace& ns, const std::string& nam, const DDRotation& r) { + const DDRotationMatrix& myrot(cms::DDNamespace& ns, const std::string& nam, const DDRotationMatrix& r) { ns.addRotation(nam, r); return ns.rotation(ns.prepend(nam)); } @@ -308,10 +305,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const CLHEP::HepRotationZ cutm(ffived); - DDRotation cutRot(5 != iSCType ? DDRotation() + DDRotationMatrix cutRot(5 != iSCType ? DDRotationMatrix() : myrot(ns, "EECry5Rot", - DDRotation(cutm.xx(), + DDRotationMatrix(cutm.xx(), cutm.xy(), cutm.xz(), cutm.yx(), @@ -390,9 +387,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext if (imax > 0) { // Loop over crystals in this row for (int irow(imin); irow <= imax; ++irow) { - // Create crystal as a DDEcalEndcapTrap object and calculate rotation and + // Create crystal as a DDEcalEndcapTrapX object and calculate rotation and // translation required to position it in the SC. - DDEcalEndcapTrap crystal(1, ee.crysFront, ee.crysRear, ee.crysLength); + DDEcalEndcapTrapX crystal(1, ee.crysFront, ee.crysRear, ee.crysLength); crystal.moveto(ee.cryFCtr[icol - 1][irow - 1], ee.cryRCtr[icol - 1][irow - 1]); @@ -434,9 +431,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext } } - // Create SC as a DDEcalEndcapTrap object and calculate rotation and + // Create SC as a DDEcalEndcapTrapX object and calculate rotation and // translation required to position it in the endcap. - DDEcalEndcapTrap scrys(1, ee.sCEFront, ee.sCERear, ee.sCELength); + DDEcalEndcapTrapX scrys(1, ee.sCEFront, ee.sCERear, ee.sCELength); scrys.moveto(ee.scrFCtr[icol - 1][irow - 1], ee.scrRCtr[icol - 1][irow - 1]); scrys.translate(DDTranslation(0., 0., -ee.zOff)); diff --git a/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc b/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc index d8890fe61370f..3d3f1447c0d69 100644 --- a/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc +++ b/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc @@ -7,6 +7,8 @@ #include "CLHEP/Geometry/Transform3D.h" #include "CLHEP/Vector/EulerAngles.h" +//#define EDM_ML_DEBUG + // Implementation of DDEcalEndcapTrap class DDEcalEndcapTrap::DDEcalEndcapTrap(const int hand, const double front, const double rear, const double length) { @@ -87,8 +89,7 @@ void DDEcalEndcapTrap::rotate(const DDTranslation& frontCentre, const DDTranslat // // Rotate supercrystal to bring front and rear face centres to specified points // - edm::LogInfo("EcalGeom") << "DDEcalEndcapTrap::rotate(DDTranslation,DDTranslation) - not yet implemented" - << std::endl; + edm::LogVerbatim("EcalGeom") << "DDEcalEndcapTrap::rotate(DDTranslation,DDTranslation) - not yet implemented"; } void DDEcalEndcapTrap::rotate(const DDRotationMatrix& rot) { @@ -98,12 +99,18 @@ void DDEcalEndcapTrap::rotate(const DDRotationMatrix& rot) { int icorner; DDTranslation cc; - // edm::LogInfo("EcalGeom") << "DDEcalEndcapTrap::rotate - rotation " << rot << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalEndcapTrap::rotate - rotation " << rot; +#endif for (icorner = 1; icorner <= 8; icorner++) { cc = cornerPos(icorner); - // edm::LogInfo("EcalGeom") << " Corner (orig) " << icorner << cc << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << " Corner (orig) " << icorner << cc; +#endif cc = rot * cc; - // edm::LogInfo("EcalGeom") << " Corner (rot) " << icorner << cc << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << " Corner (rot) " << icorner << cc; +#endif cornerPos(icorner, cc); } m_rotation = rot * m_rotation; @@ -111,7 +118,9 @@ void DDEcalEndcapTrap::rotate(const DDRotationMatrix& rot) { } void DDEcalEndcapTrap::translate() { - // edm::LogInfo("EcalGeom") << "DDEcalEndcapTrap::translate() not yet implemented" << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalEndcapTrap::translate() not yet implemented"; +#endif translate(-1. * centrePos()); } @@ -141,16 +150,20 @@ void DDEcalEndcapTrap::moveto(const DDTranslation& frontCentre, const DDTranslat double targetPhi = polarAngle(frontCentre - rearCentre); // Rotate to correct angle (X then Y) - // edm::LogInfo("EcalGeom") << "moveto: frontCentre " << frontCentre << std::endl; - // edm::LogInfo("EcalGeom") << "moveto: rearCentre " << rearCentre << std::endl; - // edm::LogInfo("EcalGeom") << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " << targetTheta-currentTheta << std::endl; - // edm::LogInfo("EcalGeom") << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " << " " << targetPhi-currentPhi << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "moveto: frontCentre " << frontCentre << std::endl + << "moveto: rearCentre " << rearCentre << std::endl + << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " << targetTheta-currentTheta << std::endl + << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " << " " << targetPhi-currentPhi; +#endif rotateX(targetTheta - currentTheta); rotateY(targetPhi - currentPhi); // Translate SC to final position DDTranslation targetCentre = 0.5 * (frontCentre + rearCentre); - // edm::LogInfo("EcalGeom") << "moveto: translation " << targetCentre-centrePos() << std::endl; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "moveto: translation " << targetCentre-centrePos(); +#endif translate(targetCentre - centrePos()); } @@ -274,12 +287,12 @@ void DDEcalEndcapTrap::print() { // // Print SC coordinates for debugging // - edm::LogInfo("EcalGeom") << "Endcap supercrystal" << std::endl; + edm::LogVerbatim("EcalGeom") << "Endcap supercrystal"; for (int ic = 1; ic <= 8; ic++) { DDTranslation cc = cornerPos(ic); - edm::LogInfo("EcalGeom") << "Corner " << ic << " " << cc << std::endl; + edm::LogVerbatim("EcalGeom") << "Corner " << ic << " " << cc; } - edm::LogInfo("EcalGeom") << " Centre " << centrePos() << std::endl; - edm::LogInfo("EcalGeom") << " fCentre " << fcentrePos() << std::endl; - edm::LogInfo("EcalGeom") << " rCentre " << rcentrePos() << std::endl; + edm::LogVerbatim("EcalGeom") << " Centre " << centrePos() << std::endl + << " fCentre " << fcentrePos() << std::endl + << " rCentre " << rcentrePos(); } diff --git a/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc b/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc new file mode 100644 index 0000000000000..5ce0b1803b831 --- /dev/null +++ b/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc @@ -0,0 +1,274 @@ +#include "Geometry/EcalCommonData/interface/DDEcalEndcapTrapX.h" +#include "CLHEP/Geometry/Transform3D.h" + +//#define EDM_ML_DEBUG +// Implementation of DDEcalEndcapTrapX class + +DDEcalEndcapTrapX::DDEcalEndcapTrapX(const int hand, const double front, const double rear, const double length) { + // + // Initialise corners of supercrystal. + + // Start out with bottom surface on (x,z) plane, front face in (x,y) plane. + + double xsign; + + if (hand == 2) { + xsign = -1.; + } else { + xsign = 1.; + } + + m_hand = hand; + m_front = front; + m_rear = rear; + m_length = length; + + int icorner; + icorner = 1; + m_corners[3 * icorner - 3] = xsign * front; + m_corners[3 * icorner - 2] = front; + m_corners[3 * icorner - 1] = 0.; + icorner = 2; + m_corners[3 * icorner - 3] = xsign * front; + m_corners[3 * icorner - 2] = 0.; + m_corners[3 * icorner - 1] = 0.; + icorner = 3; + m_corners[3 * icorner - 3] = 0.; + m_corners[3 * icorner - 2] = 0.; + m_corners[3 * icorner - 1] = 0.; + icorner = 4; + m_corners[3 * icorner - 3] = 0.; + m_corners[3 * icorner - 2] = front; + m_corners[3 * icorner - 1] = 0.; + + icorner = 5; + m_corners[3 * icorner - 3] = xsign * rear; + m_corners[3 * icorner - 2] = rear; + m_corners[3 * icorner - 1] = length; + icorner = 6; + m_corners[3 * icorner - 3] = xsign * rear; + m_corners[3 * icorner - 2] = 0.; + m_corners[3 * icorner - 1] = length; + icorner = 7; + m_corners[3 * icorner - 3] = 0.; + m_corners[3 * icorner - 2] = 0.; + m_corners[3 * icorner - 1] = length; + icorner = 8; + m_corners[3 * icorner - 3] = 0.; + m_corners[3 * icorner - 2] = rear; + m_corners[3 * icorner - 1] = length; + + calculateCentres(); + + // Move centre of SC to (0,0,0) + + translate(); + + // Rotate into standard position (face centres on z axis) + + // this->rotate(); + + calculateCentres(); +} + +void DDEcalEndcapTrapX::rotate(const DDRotationMatrix& rot) { + // + // Rotate supercrystal by specified rotation about (0,0,0) + // + + int icorner; + DDTranslation cc; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalEndcapTrapX::rotate - rotation " << rot; +#endif + for (icorner = 1; icorner <= 8; icorner++) { + cc = cornerPos(icorner); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << " Corner (orig) " << icorner << cc; +#endif + cc = rot * cc; +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << " Corner (rot) " << icorner << cc; +#endif + cornerPos(icorner, cc); + } + m_rotation = rot * m_rotation; + calculateCentres(); +} + +void DDEcalEndcapTrapX::translate() { +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "DDEcalEndcapTrapX::translate() not yet implemented"; +#endif + translate(-1. * centrePos()); +} + +void DDEcalEndcapTrapX::translate(const DDTranslation& trans) { + // + // Translate supercrystal by specified amount + // + + DDTranslation tcorner; + for (int icorner = 1; icorner <= 8; icorner++) { + tcorner = cornerPos(icorner) + trans; + cornerPos(icorner, tcorner); + } + calculateCentres(); + m_translation = trans + m_translation; +} + +void DDEcalEndcapTrapX::moveto(const DDTranslation& frontCentre, const DDTranslation& rearCentre) { + // + // Rotate (about X then about Y) and translate supercrystal to bring axis joining front and rear face centres parallel to line connecting specified points + // + + // Get azimuthal and polar angles of current axis and target axis + double currentTheta = elevationAngle(); + double currentPhi = polarAngle(); + double targetTheta = elevationAngle(frontCentre - rearCentre); + double targetPhi = polarAngle(frontCentre - rearCentre); + + // Rotate to correct angle (X then Y) +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "moveto: frontCentre " << frontCentre << std::endl << "moveto: rearCentre " << rearCentre << std::endl << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " << targetTheta-currentTheta << std::endl << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " << " " << targetPhi-currentPhi << std::endl; +#endif + rotateX(targetTheta - currentTheta); + rotateY(targetPhi - currentPhi); + + // Translate SC to final position + DDTranslation targetCentre = 0.5 * (frontCentre + rearCentre); +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("EcalGeom") << "moveto: translation " << targetCentre-centrePos(); +#endif + translate(targetCentre - centrePos()); +} + +void DDEcalEndcapTrapX::rotateX(const double angle) { + // + // Rotate SC through given angle about X axis + // + + const CLHEP::HepRotation tmp(CLHEP::Hep3Vector(1., 0., 0.), angle); + + rotate(DDRotationMatrix(tmp.xx(), tmp.xy(), tmp.xz(), tmp.yx(), tmp.yy(), tmp.yz(), tmp.zx(), tmp.zy(), tmp.zz())); +} + +void DDEcalEndcapTrapX::rotateY(const double angle) { + // + // Rotate SC through given angle about Y axis + // + const CLHEP::HepRotation tmp(CLHEP::Hep3Vector(0., 1., 0.), angle); + + rotate(DDRotationMatrix(tmp.xx(), tmp.xy(), tmp.xz(), tmp.yx(), tmp.yy(), tmp.yz(), tmp.zx(), tmp.zy(), tmp.zz())); +} + +void DDEcalEndcapTrapX::calculateCentres() { + // + // Calculate crystal centre and front & rear face centres + // + + int ixyz, icorner; + + for (ixyz = 0; ixyz < 3; ixyz++) { + m_centre[ixyz] = 0; + m_fcentre[ixyz] = 0; + m_rcentre[ixyz] = 0; + } + + for (icorner = 1; icorner <= 4; icorner++) { + for (ixyz = 0; ixyz < 3; ixyz++) { + m_centre[ixyz] = m_centre[ixyz] + 0.125 * m_corners[3 * icorner - 3 + ixyz]; + m_fcentre[ixyz] = m_fcentre[ixyz] + 0.25 * m_corners[3 * icorner - 3 + ixyz]; + } + } + for (icorner = 5; icorner <= 8; icorner++) { + for (ixyz = 0; ixyz < 3; ixyz++) { + m_centre[ixyz] = m_centre[ixyz] + 0.125 * m_corners[3 * icorner - 3 + ixyz]; + m_rcentre[ixyz] = m_rcentre[ixyz] + 0.25 * m_corners[3 * icorner - 3 + ixyz]; + } + } +} + +DDTranslation DDEcalEndcapTrapX::cornerPos(const int icorner) { + // + // Return specified corner as a Translation + // + return DDTranslation(m_corners[3 * icorner - 3], m_corners[3 * icorner - 2], m_corners[3 * icorner - 1]); +} + +void DDEcalEndcapTrapX::cornerPos(const int icorner, const DDTranslation& cornerxyz) { + // + // Save position of specified corner. + // + for (int ixyz = 0; ixyz < 3; ixyz++) { + m_corners[3 * icorner - 3 + ixyz] = (0 == ixyz ? cornerxyz.x() : (1 == ixyz ? cornerxyz.y() : cornerxyz.z())); + ; + } +} + +DDTranslation DDEcalEndcapTrapX::centrePos() { + // + // Return SC centre as a Translation + // + return DDTranslation(m_centre[0], m_centre[1], m_centre[2]); +} + +DDTranslation DDEcalEndcapTrapX::fcentrePos() { + // + // Return SC front face centre as a Translation + // + return DDTranslation(m_fcentre[0], m_fcentre[1], m_fcentre[2]); +} + +DDTranslation DDEcalEndcapTrapX::rcentrePos() { + // + // Return SC rear face centre as a Translation + // + return DDTranslation(m_rcentre[0], m_rcentre[1], m_rcentre[2]); +} + +double DDEcalEndcapTrapX::elevationAngle(const DDTranslation& trans) { + // + // Return elevation angle (out of x-z plane) of a given translation (seen as a vector from the origin). + // + double sintheta = trans.y() / trans.r(); + return asin(sintheta); +} + +double DDEcalEndcapTrapX::elevationAngle() { + // + // Return elevation angle (out of x-z plane) of SC in current position. + // + DDTranslation current = fcentrePos() - rcentrePos(); + return elevationAngle(current); +} + +double DDEcalEndcapTrapX::polarAngle(const DDTranslation& trans) { + // + // Return polar angle (from x to z) of a given translation (seen as a vector from the origin). + // + double tanphi = trans.x() / trans.z(); + return atan(tanphi); +} + +double DDEcalEndcapTrapX::polarAngle() { + // + // Return elevation angle (out of x-z plane) of SC in current position. + // + DDTranslation current = fcentrePos() - rcentrePos(); + return polarAngle(current); +} + +void DDEcalEndcapTrapX::print() { + // + // Print SC coordinates for debugging + // + edm::LogVerbatim("EcalGeom") << "Endcap supercrystal"; + for (int ic = 1; ic <= 8; ic++) { + DDTranslation cc = cornerPos(ic); + edm::LogVerbatim("EcalGeom") << "Corner " << ic << " " << cc << std::endl; + } + edm::LogVerbatim("EcalGeom") << " Centre " << centrePos() << std::endl + << " fCentre " << fcentrePos() << std::endl + << " rCentre " << rcentrePos(); +} From 8a39f7b431f002802b0833bb09875d420af350eb Mon Sep 17 00:00:00 2001 From: Sunanda Date: Sun, 2 May 2021 18:06:11 +0200 Subject: [PATCH 2/2] Code check --- .../plugins/dd4hep/DDEcalEndcapAlgo.cc | 22 +++++++++---------- .../EcalCommonData/src/DDEcalEndcapTrap.cc | 14 +++++++----- .../EcalCommonData/src/DDEcalEndcapTrapX.cc | 13 +++++++---- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc index 1df77ee052546..b612ed4406a08 100644 --- a/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc +++ b/Geometry/EcalCommonData/plugins/dd4hep/DDEcalEndcapAlgo.cc @@ -306,17 +306,17 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const CLHEP::HepRotationZ cutm(ffived); DDRotationMatrix cutRot(5 != iSCType ? DDRotationMatrix() - : myrot(ns, - "EECry5Rot", - DDRotationMatrix(cutm.xx(), - cutm.xy(), - cutm.xz(), - cutm.yx(), - cutm.yy(), - cutm.yz(), - cutm.zx(), - cutm.zy(), - cutm.zz()))); + : myrot(ns, + "EECry5Rot", + DDRotationMatrix(cutm.xx(), + cutm.xy(), + cutm.xz(), + cutm.yx(), + cutm.yy(), + cutm.yz(), + cutm.zx(), + cutm.zy(), + cutm.zz()))); dd4hep::Solid eeCutEnv = dd4hep::SubtractionSolid(ee.envName + std::to_string(iSCType), ns.solid(ee.envName + std::to_string(iSCType) + "Tmp"), diff --git a/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc b/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc index 3d3f1447c0d69..6e8b2ba626315 100644 --- a/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc +++ b/Geometry/EcalCommonData/src/DDEcalEndcapTrap.cc @@ -152,9 +152,11 @@ void DDEcalEndcapTrap::moveto(const DDTranslation& frontCentre, const DDTranslat // Rotate to correct angle (X then Y) #ifdef EDM_ML_DEBUG edm::LogVerbatim("EcalGeom") << "moveto: frontCentre " << frontCentre << std::endl - << "moveto: rearCentre " << rearCentre << std::endl - << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " << targetTheta-currentTheta << std::endl - << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " << " " << targetPhi-currentPhi; + << "moveto: rearCentre " << rearCentre << std::endl + << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " + << targetTheta - currentTheta << std::endl + << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " + << " " << targetPhi - currentPhi; #endif rotateX(targetTheta - currentTheta); rotateY(targetPhi - currentPhi); @@ -162,7 +164,7 @@ void DDEcalEndcapTrap::moveto(const DDTranslation& frontCentre, const DDTranslat // Translate SC to final position DDTranslation targetCentre = 0.5 * (frontCentre + rearCentre); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "moveto: translation " << targetCentre-centrePos(); + edm::LogVerbatim("EcalGeom") << "moveto: translation " << targetCentre - centrePos(); #endif translate(targetCentre - centrePos()); } @@ -293,6 +295,6 @@ void DDEcalEndcapTrap::print() { edm::LogVerbatim("EcalGeom") << "Corner " << ic << " " << cc; } edm::LogVerbatim("EcalGeom") << " Centre " << centrePos() << std::endl - << " fCentre " << fcentrePos() << std::endl - << " rCentre " << rcentrePos(); + << " fCentre " << fcentrePos() << std::endl + << " rCentre " << rcentrePos(); } diff --git a/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc b/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc index 5ce0b1803b831..7473b7043d6b7 100644 --- a/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc +++ b/Geometry/EcalCommonData/src/DDEcalEndcapTrapX.cc @@ -130,7 +130,12 @@ void DDEcalEndcapTrapX::moveto(const DDTranslation& frontCentre, const DDTransla // Rotate to correct angle (X then Y) #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "moveto: frontCentre " << frontCentre << std::endl << "moveto: rearCentre " << rearCentre << std::endl << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " << targetTheta-currentTheta << std::endl << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " << " " << targetPhi-currentPhi << std::endl; + edm::LogVerbatim("EcalGeom") << "moveto: frontCentre " << frontCentre << std::endl + << "moveto: rearCentre " << rearCentre << std::endl + << "moveto: X rotation: " << targetTheta << " " << currentTheta << " " + << targetTheta - currentTheta << std::endl + << "moveto: Y rotation: " << targetPhi << " " << currentPhi << " " + << " " << targetPhi - currentPhi << std::endl; #endif rotateX(targetTheta - currentTheta); rotateY(targetPhi - currentPhi); @@ -138,7 +143,7 @@ void DDEcalEndcapTrapX::moveto(const DDTranslation& frontCentre, const DDTransla // Translate SC to final position DDTranslation targetCentre = 0.5 * (frontCentre + rearCentre); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("EcalGeom") << "moveto: translation " << targetCentre-centrePos(); + edm::LogVerbatim("EcalGeom") << "moveto: translation " << targetCentre - centrePos(); #endif translate(targetCentre - centrePos()); } @@ -269,6 +274,6 @@ void DDEcalEndcapTrapX::print() { edm::LogVerbatim("EcalGeom") << "Corner " << ic << " " << cc << std::endl; } edm::LogVerbatim("EcalGeom") << " Centre " << centrePos() << std::endl - << " fCentre " << fcentrePos() << std::endl - << " rCentre " << rcentrePos(); + << " fCentre " << fcentrePos() << std::endl + << " rCentre " << rcentrePos(); }