CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Geometry/CommonDetUnit/src/GeomDet.cc

Go to the documentation of this file.
00001 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00002 #include "Geometry/CommonDetUnit/interface/ModifiedSurfaceGenerator.h"
00003 #include "DataFormats/TrackingRecHit/interface/AlignmentPositionError.h"
00004 
00005 GeomDet::GeomDet( Plane* plane):
00006   thePlane(plane), theAlignmentPositionError(0), theLocalAlignmentError(InvalidError()), m_index(-1) {}
00007 
00008 GeomDet::GeomDet( const ReferenceCountingPointer<Plane>& plane) :
00009   thePlane(plane), theAlignmentPositionError(0), theLocalAlignmentError(InvalidError()), m_index(-1) {}
00010 
00011 GeomDet::~GeomDet() {delete theAlignmentPositionError;}
00012 
00013 void GeomDet::move( const GlobalVector& displacement)
00014 {
00015   //
00016   // Should recreate the surface like the set* methods ?
00017   //
00018   thePlane->move(displacement);
00019 }
00020 
00021 void GeomDet::rotate( const Surface::RotationType& rotation)
00022 {
00023   //
00024   // Should recreate the surface like the set* methods ?
00025   //
00026   thePlane->rotate(rotation);
00027 }
00028 
00029 void GeomDet::setPosition( const Surface::PositionType& position, 
00030                            const Surface::RotationType& rotation)
00031 {
00032   thePlane = ModifiedSurfaceGenerator<Plane>(thePlane).atNewPosition(position,
00033                                                                           rotation);
00034 }
00035 
00036 #include "DataFormats/GeometryCommonDetAlgo/interface/ErrorFrameTransformer.h"
00037 bool GeomDet::setAlignmentPositionError (const AlignmentPositionError& ape) 
00038 {
00039   if (!theAlignmentPositionError) {
00040     if (ape.valid()) theAlignmentPositionError = new AlignmentPositionError(ape);
00041   } 
00042   else *theAlignmentPositionError = ape;
00043 
00044   theLocalAlignmentError = ape.valid() ?
00045     ErrorFrameTransformer().transform( ape.globalError(),
00046                                        surface()
00047                                        ) :
00048     InvalidError();
00049   return ape.valid();
00050 }