CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::DDCompactView Class Reference

#include <DDCompactView.h>

Public Member Functions

 DDCompactView (const cms::DDDetector &det)
 
const cms::DDDetectordetector () const
 
template<typename T >
std::vector< TgetVector (const std::string &) const
 
template<>
std::vector< int > getVector (const std::string &key) const
 
template<>
std::vector< double > getVector (const std::string &key) const
 
DDSpecParRegistry const & specpars () const
 

Private Attributes

const cms::DDDetectorm_det
 

Detailed Description

Definition at line 29 of file DDCompactView.h.

Constructor & Destructor Documentation

◆ DDCompactView()

cms::DDCompactView::DDCompactView ( const cms::DDDetector det)
inline

Definition at line 31 of file DDCompactView.h.

31 : m_det(det) {}

Member Function Documentation

◆ detector()

const cms::DDDetector* cms::DDCompactView::detector ( ) const
inline

◆ getVector() [1/3]

template<typename T >
std::vector<T> cms::DDCompactView::getVector ( const std::string &  ) const

◆ getVector() [2/3]

template<>
std::vector<int> cms::DDCompactView::getVector ( const std::string &  key) const

Definition at line 7 of file DDCompactView.cc.

7  {
8  const cms::DDVectorsMap& vmap = this->detector()->vectors();
9  std::vector<int> result;
10  for (auto const& it : vmap) {
11  if (cms::dd::noNamespace(it.first) == key) {
12  for (const auto& i : it.second) {
13  result.emplace_back(std::round(i));
14  }
15  break;
16  }
17  }
18  return result;
19 }

References detector(), mps_fire::i, crabWrapper::key, cms::dd::noNamespace(), mps_fire::result, and cms::DDDetector::vectors().

◆ getVector() [3/3]

template<>
std::vector<double> cms::DDCompactView::getVector ( const std::string &  key) const

Definition at line 22 of file DDCompactView.cc.

22  {
23  const cms::DDVectorsMap& vmap = this->detector()->vectors();
24  std::vector<double> result;
25 
26  for (auto const& it : vmap) {
27  if (cms::dd::noNamespace(it.first) == key) {
28  for (const auto& i : it.second) {
29  result.emplace_back(i);
30  }
31  break;
32  }
33  }
34  return result;
35 }

References hgcalTestNeighbor_cfi::detector, mps_fire::i, crabWrapper::key, cms::dd::noNamespace(), and mps_fire::result.

◆ specpars()

DDSpecParRegistry const& cms::DDCompactView::specpars ( ) const
inline

Member Data Documentation

◆ m_det

const cms::DDDetector& cms::DDCompactView::m_det
private

Definition at line 38 of file DDCompactView.h.

Referenced by detector(), and specpars().

mps_fire.i
i
Definition: mps_fire.py:355
cms::DDDetector::specpars
DDSpecParRegistry const & specpars() const
Definition: DDDetector.h:26
cms::DDVectorsMap
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double > > DDVectorsMap
Definition: DDNamespace.h:14
cms::DDCompactView::m_det
const cms::DDDetector & m_det
Definition: DDCompactView.h:38
cms::dd::noNamespace
std::string_view noNamespace(std::string_view)
Definition: Filter.cc:63
mps_fire.result
result
Definition: mps_fire.py:303
crabWrapper.key
key
Definition: crabWrapper.py:19
cms::DDDetector::vectors
DDVectorsMap const & vectors() const
Definition: DDDetector.h:22
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32