Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:36

0001 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
0002 
0003 #include "Alignment/CommonAlignment/interface/AlignableSurface.h"
0004 
0005 using namespace align;
0006 
0007 AlignableSurface::AlignableSurface(const BoundPlane& surface)
0008     : GloballyPositioned<Scalar>(surface.position(), surface.rotation()),
0009       theWidth(surface.bounds().width()),
0010       theLength(surface.bounds().length()) {}
0011 
0012 AlignableSurface::AlignableSurface(const PositionType& pos, const RotationType& rot)
0013     : GloballyPositioned<Scalar>(pos, rot), theWidth(Scalar()), theLength(Scalar()) {}
0014 
0015 GlobalPoints AlignableSurface::toGlobal(const LocalPoints& localPoints) const {
0016   GlobalPoints globalPoints;
0017 
0018   unsigned int nPoint = localPoints.size();
0019 
0020   globalPoints.reserve(nPoint);
0021 
0022   for (unsigned int j = 0; j < nPoint; ++j) {
0023     globalPoints.push_back(toGlobal(localPoints[j]));
0024   }
0025 
0026   return globalPoints;
0027 }
0028 
0029 RotationType AlignableSurface::toGlobal(const RotationType& rot) const {
0030   return rotation().multiplyInverse(rot * rotation());
0031 }
0032 
0033 EulerAngles AlignableSurface::toGlobal(const EulerAngles& angles) const { return toAngles(toGlobal(toMatrix(angles))); }
0034 
0035 RotationType AlignableSurface::toLocal(const RotationType& rot) const {
0036   return rotation() * rot * rotation().transposed();
0037 }
0038 
0039 EulerAngles AlignableSurface::toLocal(const EulerAngles& angles) const { return toAngles(toLocal(toMatrix(angles))); }