CMS 3D CMS Logo

List of all members | Public Member Functions
DDI::Trap Class Reference

#include <Trap.h>

Inheritance diagram for DDI::Trap:
DDI::Solid

Public Member Functions

void stream (std::ostream &) const override
 
 Trap (double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
 
double volume () const override
 
- Public Member Functions inherited from DDI::Solid
const std::vector< double > & parameters () const
 
void setParameters (std::vector< double > const &p)
 
DDSolidShape shape () const
 
 Solid ()
 
 Solid (DDSolidShape shape)
 
virtual ~Solid ()
 

Additional Inherited Members

- Protected Attributes inherited from DDI::Solid
std::vector< double > p_
 
DDSolidShape shape_
 

Detailed Description

Definition at line 9 of file Trap.h.

Constructor & Destructor Documentation

DDI::Trap::Trap ( double  pDz,
double  pTheta,
double  pPhi,
double  pDy1,
double  pDx1,
double  pDx2,
double  pAlp1,
double  pDy2,
double  pDx3,
double  pDx4,
double  pAlp2 
)

Definition at line 13 of file Trap.cc.

References ddtrap, and DDI::Solid::p_.

21 {
22  p_.emplace_back(pDz); // ......... 0
23  p_.emplace_back(pTheta); // .. 1
24  p_.emplace_back(pPhi); // ....... 2
25  p_.emplace_back(pDy1); // ........ 3
26  p_.emplace_back(pDx1); // ........ 4
27  p_.emplace_back(pDx2); // ........ 5
28  p_.emplace_back(pAlp1); // ....... 6
29  p_.emplace_back(pDy2); // ........ 7
30  p_.emplace_back(pDx3); // ......... 8
31  p_.emplace_back(pDx4); // ........ 9
32  p_.emplace_back(pAlp2);
33 }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32

Member Function Documentation

void DDI::Trap::stream ( std::ostream &  os) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 36 of file Trap.cc.

References DDI::Solid::p_.

37 {
38  os << " dz=" << p_[0]/cm
39  << " theta=" << p_[1]/deg
40  << " phi=" << p_[2]/deg
41  << " dy1=" << p_[3]/cm
42  << " dx1=" << p_[4]/cm
43  << " dx2=" << p_[5]/cm
44  << " alpha1=" << p_[6]/deg
45  << " dy2=" << p_[7]/cm
46  << " dx3=" << p_[8]/cm
47  << " dx4=" << p_[9]/cm
48  << " alpha2=" << p_[10]/deg;
49 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::Trap::volume ( void  ) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 51 of file Trap.cc.

References PVValHelper::dz, and DDI::Solid::p_.

52 {
53  double volume = 0;
54 
55  double dz = p_[0]*2.;
56  double dy1 = p_[3]*2.;
57  double dx1 = p_[4]*2.;
58  double dx2 = p_[5]*2.;
59  double dy2 = p_[7]*2.;
60  double dx3 = p_[8]*2.;
61  double dx4 = p_[9]*2.;
62 
63  volume = ((dx1 + dx2 + dx3 + dx4)*(dy1 + dy2) +
64  (dx4 + dx3 - dx2 - dx1)*(dy2 - dy1)/3)*dz*0.125;
65 
66  return volume;
67 }
double volume() const override
Definition: Trap.cc:51
std::vector< double > p_
Definition: Solid.h:32