Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:30

0001 #ifndef Geom_BoundDisk_H
0002 #define Geom_BoundDisk_H
0003 
0004 #include "DataFormats/GeometrySurface/interface/Plane.h"
0005 #include "DataFormats/GeometrySurface/interface/SimpleDiskBounds.h"
0006 
0007 /** \class BoundDisk
0008  *
0009  *  A BoundDisk is a special BoundPlane that is additionally limited by an
0010  *  inner and outer radius. 
0011  * 
0012  *  \warning Surfaces are reference counted, so only ReferenceCountingPointer
0013  *  should be used to point to them. For this reason, they should be 
0014  *  using the static build() method. 
0015  *  (The normal constructor will become private in the future).
0016  *
0017  */
0018 
0019 class Disk final : public Plane {
0020 public:
0021   /*
0022   template<typename... Args>
0023     Disk(Args&& ... args) :
0024     Plane(std::forward<Args>(args)...){}
0025   */
0026 
0027   Disk(const PositionType& pos, const RotationType& rot, SimpleDiskBounds* bounds) : Plane(pos, rot, bounds) {}
0028 
0029   Disk(const PositionType& pos, const RotationType& rot, SimpleDiskBounds const& bounds)
0030       : Plane(pos, rot, bounds.clone()) {}
0031 
0032   typedef ReferenceCountingPointer<Disk> DiskPointer;
0033   typedef ConstReferenceCountingPointer<Disk> ConstDiskPointer;
0034   typedef ReferenceCountingPointer<Disk> BoundDiskPointer;
0035   typedef ConstReferenceCountingPointer<Disk> ConstBoundDiskPointer;
0036 
0037   template <typename... Args>
0038   static DiskPointer build(Args&&... args) {
0039     return DiskPointer(new Disk(std::forward<Args>(args)...));
0040   }
0041 
0042   ~Disk() override {}
0043 
0044   // -- DEPRECATED CONSTRUCTORS
0045 
0046   // -- Extension of the Surface interface for disk
0047 
0048   /// The inner radius of the disk
0049   float innerRadius() const { return static_cast<const SimpleDiskBounds&>(bounds()).innerRadius(); }
0050 
0051   /// The outer radius of the disk
0052   float outerRadius() const { return static_cast<const SimpleDiskBounds&>(bounds()).outerRadius(); }
0053 };
0054 using BoundDisk = Disk;
0055 
0056 #endif  // Geom_BoundDisk_H