CMS 3D CMS Logo

Functions
DDCompactView.cc File Reference
#include "DetectorDescription/DDCMS/interface/DDCompactView.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <DD4hep/Filter.h>
#include <cmath>
#include <vector>

Go to the source code of this file.

Functions

template<>
std::vector< double > const & cms::DDCompactView::get< std::vector< double > > (const std::string &key) const
 
template<>
std::vector< double > const & cms::DDCompactView::get< std::vector< double > > (const std::string &name, const std::string &key) const
 

Function Documentation

◆ cms::DDCompactView::get< std::vector< double > >() [1/2]

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

Definition at line 34 of file DDCompactView.cc.

References hgcalTestNeighbor_cfi::detector, Exception, and crabWrapper::key.

34  {
35  const auto& vmap = this->detector()->vectors();
36  for (auto const& it : vmap) {
37  if (dd4hep::dd::noNamespace(it.first) == key) {
38  return it.second;
39  }
40  }
41  throw cms::Exception("DDError") << "no vector<double> with name " << key;
42 }

◆ cms::DDCompactView::get< std::vector< double > >() [2/2]

template<>
std::vector<double> const& cms::DDCompactView::get< std::vector< double > > ( const std::string &  name,
const std::string &  key 
) const

Definition at line 45 of file DDCompactView.cc.

References mps_fire::end, Exception, crabWrapper::key, and Skims_PA_cff::name.

46  {
47  const auto& spec = specpars().specPar(name);
48  if (spec != nullptr) {
49  auto const& nitem = spec->numpars.find(key);
50  if (nitem != end(spec->numpars)) {
51  return nitem->second;
52  }
53  }
54  throw cms::Exception("DDError") << "no SpecPar with name " << name << " and vector<double> key " << key;
55 }