CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
DDExtrudedPolygon Class Reference

#include <DDSolid.h>

Inheritance diagram for DDExtrudedPolygon:
DDPolySolid DDSolid DDBase< DDName, std::unique_ptr< DDI::Solid > >

Public Member Functions

 DDExtrudedPolygon (const DDSolid &s)
 
 DDExtrudedPolygon (void)=delete
 
std::vector< double > xVec (void) const
 
std::vector< double > yVec (void) const
 
std::vector< double > zscaleVec (void) const
 
std::vector< double > zVec (void) const
 
std::vector< double > zxVec (void) const
 
std::vector< double > zyVec (void) const
 
- Public Member Functions inherited from DDPolySolid
 DDPolySolid (const DDSolid &s)
 
 DDPolySolid (void)=delete
 
- Public Member Functions inherited from DDSolid
 DDSolid (void)
 Uninitialilzed solid reference-object; for further details on reference-objects see documentation of DDLogicalPart. More...
 
 DDSolid (const DDName &name)
 Creates a reference-object to a solid named name. More...
 
const std::vector< double > & parameters (void) const
 Give the parameters of the solid. More...
 
DDSolidShape shape (void) const
 The type of the solid. More...
 
double volume (void) const
 Returns the volume of the given solid (does not work with boolean soids !) More...
 
- Public Member Functions inherited from DDBase< DDName, std::unique_ptr< DDI::Solid > >
void create (const DDName &name, std::unique_ptr< DDI::Solid > vals)
 
void create (const DDName &name)
 
 DDBase ()
 
const DDNameddname () const
 
def_type isDefined () const
 
bool isValid () const
 true, if the wrapped pointer is valid More...
 
const DDNamename () const
 
 operator bool () const
 
bool operator< (const DDBase &b) const
 
bool operator== (const DDBase &b) const
 
bool operator> (const DDBase &b) const
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep () const
 
DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep ()
 
std::string toString () const
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference val () const
 
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference val ()
 
virtual ~DDBase ()
 

Private Member Functions

auto xyPointsSize (void) const -> std::size_t
 
auto zSectionsSize (void) const -> std::size_t
 

Additional Inherited Members

- Public Types inherited from DDBase< DDName, std::unique_ptr< DDI::Solid > >
using def_type = std::pair< const DDName *, bool >
 
using StoreT = DDI::Singleton< DDI::Store< DDName, std::unique_ptr< DDI::Solid > > >
 
- Static Public Member Functions inherited from DDBase< DDName, std::unique_ptr< DDI::Solid > >
static auto begin ()
 
static auto end ()
 
- Protected Member Functions inherited from DDPolySolid
virtual std::vector< double > getVec (const size_t &which, const size_t &offset=0, const size_t &nVecs=1) const
 note defaults please. More...
 

Detailed Description

Definition at line 249 of file DDSolid.h.

Constructor & Destructor Documentation

◆ DDExtrudedPolygon() [1/2]

DDExtrudedPolygon::DDExtrudedPolygon ( const DDSolid s)

Definition at line 349 of file DDSolid.cc.

References ddextrudedpolygon, Exception, alignCSCRings::s, and AlCaHLTBitMon_QueryRunRegistry::string.

349  : DDPolySolid(s) {
350  if (s.shape() != DDSolidShape::ddextrudedpolygon) {
351  std::string ex = "Solid [" + s.name().ns() + ":" + s.name().name() + "] is not a DDExtrudedPolygon.\n";
352  ex = ex + "Use a different solid interface!";
353  throw cms::Exception("DDException") << ex;
354  }
355 }
DDPolySolid(void)=delete

◆ DDExtrudedPolygon() [2/2]

DDExtrudedPolygon::DDExtrudedPolygon ( void  )
delete

Member Function Documentation

◆ xVec()

std::vector< double > DDExtrudedPolygon::xVec ( void  ) const

Definition at line 378 of file DDSolid.cc.

References DDBase< DDName, std::unique_ptr< DDI::Solid > >::rep(), and xyPointsSize().

Referenced by TGeoMgrFromDdd::createShape(), HGCalTBGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometryHexagon(), and DDCoreToDDXMLOutput::solid().

378  {
379  return std::vector<double>(rep().parameters().begin() + 1, rep().parameters().begin() + 1 + xyPointsSize());
380 }
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:357
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64

◆ xyPointsSize()

auto DDExtrudedPolygon::xyPointsSize ( void  ) const -> std::size_t
private

Definition at line 357 of file DDSolid.cc.

References cuy::rep, and findQualityFiles::size.

Referenced by xVec(), and yVec().

357  {
358  // Compute the size of the X and Y coordinate vectors
359  // which define the vertices of the outlined polygon
360  // defined in clock-wise order
361 
362  return (rep().parameters().size() - 4 * zSectionsSize()) * 0.5;
363 }
size
Write out results.
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:365

◆ yVec()

std::vector< double > DDExtrudedPolygon::yVec ( void  ) const

Definition at line 382 of file DDSolid.cc.

References DDBase< DDName, std::unique_ptr< DDI::Solid > >::rep(), and xyPointsSize().

Referenced by TGeoMgrFromDdd::createShape(), and DDCoreToDDXMLOutput::solid().

382  {
383  return std::vector<double>(rep().parameters().begin() + 1 + xyPointsSize(),
384  rep().parameters().begin() + 1 + 2 * xyPointsSize());
385 }
auto xyPointsSize(void) const -> std::size_t
Definition: DDSolid.cc:357
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64

◆ zscaleVec()

std::vector< double > DDExtrudedPolygon::zscaleVec ( void  ) const

Definition at line 402 of file DDSolid.cc.

References DDBase< DDName, std::unique_ptr< DDI::Solid > >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), and DDCoreToDDXMLOutput::solid().

402  {
403  return std::vector<double>(rep().parameters().end() - zSectionsSize(), rep().parameters().end());
404 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:365

◆ zSectionsSize()

auto DDExtrudedPolygon::zSectionsSize ( void  ) const -> std::size_t
private

Definition at line 365 of file DDSolid.cc.

References cuy::rep.

Referenced by zscaleVec(), zVec(), zxVec(), and zyVec().

365  {
366  // The first parameters element stores a size of the four equal size vectors
367  // which form the ExtrudedPolygon shape Z sections:
368  //
369  // * first: Z coordinate of the XY polygone plane,
370  // * second and third: x and y offset of the polygone in the XY plane,
371  // * fourth: the polygone scale in each XY plane
372  //
373  // The Z sections defined by the z position in an increasing order.
374 
375  return rep().parameters()[0];
376 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64

◆ zVec()

std::vector< double > DDExtrudedPolygon::zVec ( void  ) const

Definition at line 387 of file DDSolid.cc.

References DDBase< DDName, std::unique_ptr< DDI::Solid > >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), HGCalTBGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometryHexagon(), and DDCoreToDDXMLOutput::solid().

387  {
388  return std::vector<double>(rep().parameters().end() - 4 * zSectionsSize(),
389  rep().parameters().end() - 3 * zSectionsSize());
390 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:365

◆ zxVec()

std::vector< double > DDExtrudedPolygon::zxVec ( void  ) const

Definition at line 392 of file DDSolid.cc.

References DDBase< DDName, std::unique_ptr< DDI::Solid > >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), and DDCoreToDDXMLOutput::solid().

392  {
393  return std::vector<double>(rep().parameters().end() - 3 * zSectionsSize(),
394  rep().parameters().end() - 2 * zSectionsSize());
395 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:365

◆ zyVec()

std::vector< double > DDExtrudedPolygon::zyVec ( void  ) const

Definition at line 397 of file DDSolid.cc.

References DDBase< DDName, std::unique_ptr< DDI::Solid > >::rep(), and zSectionsSize().

Referenced by TGeoMgrFromDdd::createShape(), and DDCoreToDDXMLOutput::solid().

397  {
398  return std::vector<double>(rep().parameters().end() - 2 * zSectionsSize(),
399  rep().parameters().end() - zSectionsSize());
400 }
const DDI::rep_traits< DDName, std::unique_ptr< DDI::Solid > >::reference rep() const
Definition: DDBase.h:64
auto zSectionsSize(void) const -> std::size_t
Definition: DDSolid.cc:365