Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:17:56

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 //
0014 // DDCMS is a detector description convention developed by the CMS experiment.
0015 //
0016 //==========================================================================
0017 
0018 // Framework include files
0019 #include <DDCMS/DDShapes.h>
0020 #include <DD4hep/DD4hepUnits.h>
0021 
0022 using namespace dd4hep::cms;
0023 namespace units = dd4hep;
0024 
0025 
0026 /// Optional: special constructor with object creation
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 /// Optional: special constructor with object creation
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