CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Geometry/CommonDetUnit/interface/GeomDet.h

Go to the documentation of this file.
00001 #ifndef CommonDet_GeomDet_H
00002 #define CommonDet_GeomDet_H
00003 
00012 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
00013 #include "DataFormats/DetId/interface/DetId.h"
00014 
00015 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00016 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00017 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00018 #include "DataFormats/GeometryVector/interface/LocalVector.h"
00019 
00020 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h"
00021 
00022 #include <vector>
00023 
00024 class AlignmentPositionError;
00025 
00026 class GeomDet {
00027 public:
00028   typedef GeomDetEnumerators::SubDetector SubDetector;
00029 
00030   explicit GeomDet(BoundPlane* plane);
00031 
00032   explicit GeomDet(const ReferenceCountingPointer<BoundPlane>& plane);
00033 
00034   virtual ~GeomDet();
00035 
00037   virtual const BoundPlane& surface() const {return *thePlane;}
00038 
00040   virtual const BoundPlane& specificSurface() const {return *thePlane;}
00041   
00043   const Surface::PositionType& position() const {return surface().position();} 
00044   
00046   const Surface::RotationType& rotation() const { return surface().rotation();}
00047 
00049   GlobalPoint toGlobal(const Local2DPoint& lp) const {
00050     return surface().toGlobal( lp);
00051   }
00052   
00054   GlobalPoint toGlobal(const Local3DPoint& lp) const {
00055     return surface().toGlobal( lp);
00056   }
00057 
00059   GlobalVector toGlobal(const LocalVector& lv) const {
00060     return surface().toGlobal( lv);
00061   }
00062   
00064   LocalPoint toLocal(const GlobalPoint& gp) const {
00065     return surface().toLocal( gp);
00066   }
00067   
00069   LocalVector toLocal(const GlobalVector& gv) const {
00070     return surface().toLocal( gv);
00071   } 
00072 
00074   DetId geographicalId() const { return m_detId; }
00075 
00077   virtual SubDetector subDetector() const = 0;  
00078 
00081   virtual AlignmentPositionError* alignmentPositionError() const { return theAlignmentPositionError;}
00082 
00084   virtual std::vector< const GeomDet*> components() const = 0;
00085 
00087   // FIXME: must become pure virtual
00088   virtual const GeomDet* component(DetId id) const {return 0;}
00089 
00090 
00091   protected:
00092 
00093     void setDetId(DetId id) {
00094       m_detId = id;
00095     }
00096 
00097 private:
00098 
00099   ReferenceCountingPointer<BoundPlane>  thePlane;
00100   AlignmentPositionError*               theAlignmentPositionError;
00101   DetId m_detId;
00102 
00103 
00105   friend class DetPositioner;
00106 
00109   void move( const GlobalVector& displacement);
00110 
00113   void rotate( const Surface::RotationType& rotation);
00114 
00118    
00119   void setPosition( const Surface::PositionType& position, 
00120                     const Surface::RotationType& rotation);
00121 
00126   
00127   virtual void setAlignmentPositionError (const AlignmentPositionError& ape); 
00128 
00129 };
00130   
00131 #endif
00132 
00133 
00134 
00135