CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/DataFormats/GeometrySurface/interface/BoundSurface.h

Go to the documentation of this file.
00001 #ifndef Geom_BoundSurface_H
00002 #define Geom_BoundSurface_H
00003 
00014 #include <memory>
00015 #include "DataFormats/GeometrySurface/interface/Surface.h"
00016 #include "DataFormats/GeometrySurface/interface/Bounds.h"
00017 #include "DataFormats/GeometrySurface/interface/BoundSpan.h"
00018 
00019 class BoundSurface : public virtual Surface {
00020 public:
00021 
00022   BoundSurface( const PositionType& pos, 
00023                 const RotationType& rot, 
00024                 const Bounds* bounds) :
00025     Surface(   pos, rot ),
00026     m_phiSpan( 0., 0.),
00027     m_zSpan(   0., 0.),
00028     m_rSpan(   0., 0.),
00029     theBounds( bounds->clone() )
00030   { 
00031     computeSpan();
00032   }
00033 
00034   BoundSurface( const PositionType& pos, 
00035                 const RotationType& rot, 
00036                 const Bounds& bounds) :
00037     Surface(   pos, rot),
00038     m_phiSpan( 0., 0.),
00039     m_zSpan(   0., 0.),
00040     m_rSpan(   0., 0.),
00041     theBounds( bounds.clone()) 
00042   { 
00043     computeSpan();
00044   }
00045 
00046   BoundSurface( const PositionType& pos, 
00047                 const RotationType& rot, 
00048                 const Bounds* bounds, 
00049                 MediumProperties* mp) :
00050     Surface(   pos, rot, mp),  
00051     m_phiSpan( 0., 0.),
00052     m_zSpan(   0., 0.),
00053     m_rSpan(   0., 0.),
00054     theBounds( bounds->clone()) 
00055   { 
00056     computeSpan();
00057   }
00058 
00059   BoundSurface( const PositionType& pos, 
00060                 const RotationType& rot, 
00061                 const Bounds& bounds, 
00062                 MediumProperties* mp) :
00063     Surface(   pos, rot, mp),  
00064     m_phiSpan( 0., 0.),
00065     m_zSpan(   0., 0.),
00066     m_rSpan(   0., 0.),
00067     theBounds( bounds.clone()) 
00068   {
00069     computeSpan();
00070   }
00071 
00072   BoundSurface( const BoundSurface& iToCopy) :
00073     Surface(   iToCopy ), 
00074     m_phiSpan( iToCopy.m_phiSpan ),
00075     m_zSpan(   iToCopy.m_zSpan ),
00076     m_rSpan(   iToCopy.m_rSpan ),
00077     theBounds( iToCopy.theBounds->clone() ) 
00078   {}
00079 
00080   const BoundSurface& operator=( const BoundSurface& iRHS ) {
00081     Surface::operator=( iRHS );
00082     m_phiSpan = iRHS.m_phiSpan;
00083     m_zSpan   = iRHS.m_zSpan;
00084     m_rSpan   = iRHS.m_rSpan;
00085     theBounds.reset( iRHS.theBounds->clone() );
00086     return *this;
00087   }
00088 
00089   const Bounds& bounds() const { return *theBounds; }
00090 
00091   std::pair<float,float> const & phiSpan() const { return m_phiSpan; }
00092   std::pair<float,float> const & zSpan()   const { return m_zSpan; }
00093   std::pair<float,float> const & rSpan()   const { return m_rSpan; }
00094 
00095 protected:
00096   friend void boundSpan::computeSpan(BoundSurface& plane);
00097   void computeSpan();
00098 
00099 private:
00100 
00101   std::pair<float,float> m_phiSpan;
00102   std::pair<float,float> m_zSpan;
00103   std::pair<float,float> m_rSpan;
00104   
00105   std::auto_ptr<Bounds> theBounds;
00106 };
00107 
00108 #endif // Geom_BoundSurface_H