CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 #ifndef CommonDet_GeomDet_H
00002 #define CommonDet_GeomDet_H
00003 
00010 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
00011 #include "DataFormats/DetId/interface/DetId.h"
00012 
00013 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00014 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00015 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00016 #include "DataFormats/GeometryVector/interface/LocalVector.h"
00017 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00018 #include "Geometry/CommonDetUnit/interface/GeomDetEnumerators.h"
00019 
00020 #include <vector>
00021 
00022 class AlignmentPositionError;
00023 
00024 class GeomDet {
00025 public:
00026   typedef GeomDetEnumerators::SubDetector SubDetector;
00027 
00028   explicit GeomDet(BoundPlane* plane);
00029 
00030   explicit GeomDet(const ReferenceCountingPointer<BoundPlane>& plane);
00031 
00032   virtual ~GeomDet();
00033 
00035   const BoundPlane& surface() const {return *thePlane;}
00036 
00038   const BoundPlane& specificSurface() const {return *thePlane;}
00039   
00041   const Surface::PositionType& position() const {return surface().position();} 
00042   
00044   const Surface::RotationType& rotation() const { return surface().rotation();}
00045 
00047   GlobalPoint toGlobal(const Local2DPoint& lp) const {
00048     return surface().toGlobal( lp);
00049   }
00050   
00052   GlobalPoint toGlobal(const Local3DPoint& lp) const {
00053     return surface().toGlobal( lp);
00054   }
00055 
00057   GlobalVector toGlobal(const LocalVector& lv) const {
00058     return surface().toGlobal( lv);
00059   }
00060   
00062   LocalPoint toLocal(const GlobalPoint& gp) const {
00063     return surface().toLocal( gp);
00064   }
00065   
00067   LocalVector toLocal(const GlobalVector& gv) const {
00068     return surface().toLocal( gv);
00069   } 
00070 
00072   DetId geographicalId() const { return m_detId; }
00073 
00075   virtual SubDetector subDetector() const = 0;  
00076 
00078   LocalError const & localAlignmentError() const { return theLocalAlignmentError;}
00079 
00081   virtual std::vector< const GeomDet*> components() const = 0;
00082 
00084   // FIXME: must become pure virtual
00085   virtual const GeomDet* component(DetId /*id*/) const {return 0;}
00086 
00088   AlignmentPositionError* alignmentPositionError() const { return theAlignmentPositionError;}
00089 
00090 
00091   // specific unix index in a given subdetector (such as Tracker)
00092   int index() const { return m_index;}
00093   void setIndex(int i) { m_index=i;}
00094 
00095   protected:
00096 
00097     void setDetId(DetId id) {
00098       m_detId = id;
00099     }
00100 
00101 private:
00102 
00103   ReferenceCountingPointer<BoundPlane>  thePlane;
00104   AlignmentPositionError*               theAlignmentPositionError;
00105   LocalError                            theLocalAlignmentError;
00106   DetId m_detId;
00107   int m_index;
00108 
00110   friend class DetPositioner;
00111 
00114   void move( const GlobalVector& displacement);
00115 
00118   void rotate( const Surface::RotationType& rotation);
00119 
00123    
00124   void setPosition( const Surface::PositionType& position, 
00125                     const Surface::RotationType& rotation);
00126 
00129   
00130   bool setAlignmentPositionError (const AlignmentPositionError& ape); 
00131 
00132 };
00133   
00134 #endif
00135 
00136 
00137 
00138