Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:25

0001 #ifndef DDI_Box_h
0002 #define DDI_Box_h
0003 
0004 #include <iosfwd>
0005 #include <vector>
0006 
0007 #include "DetectorDescription/Core/interface/DDSolidShapes.h"
0008 #include "Solid.h"
0009 
0010 namespace DDI {
0011 
0012   class Box : public Solid {
0013   public:
0014     Box(double xHalf, double yHalf, double zHalf) : Solid(DDSolidShape::ddbox) {
0015       p_.emplace_back(xHalf);
0016       p_.emplace_back(yHalf);
0017       p_.emplace_back(zHalf);
0018     }
0019     ~Box() override {}
0020 
0021     double volume() const override { return 8. * p_[0] * p_[1] * p_[2]; }
0022     void stream(std::ostream& os) const override;
0023   };
0024 
0025 }  // namespace DDI
0026 #endif  // DDI_Box_h