CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Alignment/CommonAlignment/src/AlignableSurface.cc

Go to the documentation of this file.
00001 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
00002 
00003 #include "Alignment/CommonAlignment/interface/AlignableSurface.h"
00004 
00005 using namespace align;
00006 
00007 AlignableSurface::AlignableSurface(const BoundPlane& surface):
00008   GloballyPositioned<Scalar>( surface.position(), surface.rotation() ),
00009   theWidth( surface.bounds().width() ),
00010   theLength( surface.bounds().length() )
00011 {
00012 }
00013 
00014 AlignableSurface::AlignableSurface(const PositionType& pos,
00015                                    const RotationType& rot):
00016   GloballyPositioned<Scalar>(pos, rot),
00017   theWidth( Scalar() ),
00018   theLength( Scalar() )
00019 {
00020 }
00021 
00022 GlobalPoints AlignableSurface::toGlobal(const LocalPoints& localPoints) const
00023 {
00024   GlobalPoints globalPoints;
00025 
00026   unsigned int nPoint = localPoints.size();
00027 
00028   globalPoints.reserve(nPoint);
00029 
00030   for (unsigned int j = 0; j < nPoint; ++j)
00031   {
00032     globalPoints.push_back( toGlobal(localPoints[j]) );
00033   }
00034 
00035   return globalPoints;
00036 }
00037 
00038 RotationType AlignableSurface::toGlobal(const RotationType& rot) const
00039 {
00040   return rotation().multiplyInverse( rot * rotation() );
00041 }
00042 
00043 EulerAngles AlignableSurface::toGlobal(const EulerAngles& angles) const
00044 {
00045   return toAngles( toGlobal( toMatrix(angles) ) );
00046 }
00047 
00048 RotationType AlignableSurface::toLocal(const RotationType& rot) const
00049 {
00050   return rotation() *  rot * rotation().transposed();
00051 }
00052 
00053 EulerAngles AlignableSurface::toLocal(const EulerAngles& angles) const
00054 {
00055   return toAngles( toLocal( toMatrix(angles) ) );
00056 }