File indexing completed on 2025-01-30 09:17:56
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include <DDCMS/DDShapes.h>
0020 #include <DD4hep/DD4hepUnits.h>
0021
0022 using namespace dd4hep::cms;
0023 namespace units = dd4hep;
0024
0025
0026
0027 DDBox::DDBox(const std::string& nam, double dx, double dy, double dz) {
0028 m_element = dd4hep::Box(nam, dx, dy, dz).ptr();
0029 }
0030
0031
0032 DDPolycone::DDPolycone(const std::string& nam,
0033 double start_phi, double delta_phi,
0034 const std::vector<double>& z,
0035 const std::vector<double>& rmin,
0036 const std::vector<double>& rmax)
0037 {
0038 dd4hep::Polycone pcone(nam, start_phi, delta_phi);
0039 pcone.addZPlanes(rmin, rmax, z);
0040 m_element = pcone.ptr();
0041 }
0042
0043 double DDPolycone::startPhi() const {
0044 return access()->GetPhi1()*units::deg/units::rad;
0045 }
0046
0047 double DDPolycone::deltaPhi() const {
0048 return access()->GetDphi()*units::deg/units::rad;
0049 }
0050
0051 std::vector<double> DDPolycone::zVec() const {
0052 const auto* p = access();
0053 const double* v = p->GetZ();
0054 return {v, v+p->GetNz()};
0055 }
0056
0057 std::vector<double> DDPolycone::rMinVec() const {
0058 const auto* p = access();
0059 const double* v = p->GetRmin();
0060 return {v, v+p->GetNz()};
0061 }
0062
0063 std::vector<double> DDPolycone::rMaxVec() const {
0064 const auto* p = access();
0065 const double* v = p->GetRmax();
0066 return {v, v+p->GetNz()};
0067 }
0068