CMS 3D CMS Logo

DDSpecparRegistry.cc
Go to the documentation of this file.
3 #include <algorithm>
4 #include <iterator>
5 #include <regex>
6 
7 using namespace std;
8 using namespace cms;
9 using namespace edm;
10 
11 string_view
12 DDSpecPar::strValue(const char* key) const {
13  auto const& item = spars.find(key);
14  if(item == end(spars))
15  return string();
16  return *begin(item->second);
17 }
18 
19 bool
20 DDSpecPar::hasValue(const char* key) const {
21  if(numpars.find(key) != end(numpars))
22  return true;
23  else
24  return false;
25 }
26 
27 double
28 DDSpecPar::dblValue(const char* key) const {
29  auto const& item = numpars.find(key);
30  if(item == end(numpars))
31  return 0;
32  return *begin(item->second);
33 }
34 
35 void
37  string_view attribute, string_view value) const {
38 
39  bool found(false);
40  for_each(begin(specpars), end(specpars), [&refs, &attribute,
41  &value, &found](const auto& k) {
42  found = false;
43  for_each(begin(k.second.spars), end(k.second.spars), [&](const auto& l) {
44  if(l.first == attribute) {
45  for_each(begin(l.second), end(l.second), [&](const auto& m) {
46  if(m == value)
47  found = true;
48  });
49  }
50  });
51  if(found) {
52  refs.emplace_back(&k.second);
53  }
54  });
55 }
#define end
Definition: vmac.h:39
Definition: value.py:1
int k[5][pyjets_maxn]
Namespace of DDCMS conversion namespace.
std::vector< const DDSpecPar * > DDSpecParRefs
#define begin
Definition: vmac.h:32
HLT enums.