/
DDSpecParRegistry.h
41 lines (32 loc) · 1.3 KB
/
DDSpecParRegistry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef DETECTOR_DESCRIPTION_DD_SPECPAR_REGISTRY_H
#define DETECTOR_DESCRIPTION_DD_SPECPAR_REGISTRY_H
#include <string>
#include <string_view>
#include "tbb/concurrent_unordered_map.h"
#include "tbb/concurrent_vector.h"
namespace cms {
using DDPaths = tbb::concurrent_vector<std::string>;
using DDPartSelectionMap = tbb::concurrent_unordered_map<std::string, tbb::concurrent_vector<std::string>>;
using DDVectorsMap = tbb::concurrent_unordered_map<std::string, tbb::concurrent_vector<double>>;
struct DDSpecPar {
std::string_view strValue(const std::string&) const;
bool hasValue(const std::string& key) const;
double dblValue(const std::string&) const;
template <typename T>
T value(const std::string&) const;
DDPaths paths;
DDPartSelectionMap spars;
DDVectorsMap numpars;
};
using DDSpecParMap = tbb::concurrent_unordered_map<std::string, DDSpecPar>;
using DDSpecParRefs = std::vector<const DDSpecPar*>;
struct DDSpecParRegistry {
void filter(DDSpecParRefs&, std::string_view, std::string_view) const;
void filter(DDSpecParRefs&, std::string_view) const;
std::vector<std::string_view> names() const;
bool hasSpecPar(std::string_view) const;
const DDSpecPar* specPar(std::string_view) const;
DDSpecParMap specpars;
};
} // namespace cms
#endif