CMS 3D CMS Logo

DDsvalues.h
Go to the documentation of this file.
1 #ifndef DETECTOR_DESCRIPTION_CORE_DDSVALUES_H
2 #define DETECTOR_DESCRIPTION_CORE_DDSVALUES_H
3 
4 #include <algorithm>
5 #include <map>
6 #include <ostream>
7 #include <utility>
8 #include <vector>
9 
11 
12 using DDsvalues_type = std::vector<std::pair<unsigned int, DDValue> >;
14 
16  return lh.first < rh.first;
17 }
18 
19 inline DDsvalues_type::const_iterator find(DDsvalues_type::const_iterator begin,
20  DDsvalues_type::const_iterator end,
21  unsigned int id) {
22  static const DDValue dummy;
24  DDsvalues_type::const_iterator it = std::lower_bound(begin, end, v);
25  if (it != end && (*it).first == id)
26  return it;
27  return end;
28 }
29 
30 inline DDsvalues_type::const_iterator find(DDsvalues_type const &sv, unsigned int id) {
31  return find(sv.begin(), sv.end(), id);
32 }
33 
34 void merge(DDsvalues_type &target, DDsvalues_type const &sv, bool sortit = true);
35 
37 bool DDfetch(const DDsvalues_type *, DDValue &);
38 
40 unsigned int DDfetch(const std::vector<const DDsvalues_type *> &sp, DDValue &toFetch, std::vector<DDValue> &result);
41 
42 std::ostream &operator<<(std::ostream &, const DDsvalues_type &);
43 std::ostream &operator<<(std::ostream &, const std::vector<const DDsvalues_type *> &);
44 
45 #endif
void merge(DDsvalues_type &target, DDsvalues_type const &sv, bool sortit=true)
Definition: DDsvalues.cc:5
DDsvalues_type::value_type DDsvalues_Content_type
Definition: DDsvalues.h:13
bool int lh
Definition: SIMDVec.h:27
DDsvalues_type::const_iterator find(DDsvalues_type::const_iterator begin, DDsvalues_type::const_iterator end, unsigned int id)
Definition: DDsvalues.h:19
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
std::ostream & operator<<(std::ostream &, const DDsvalues_type &)
Definition: DDsvalues.cc:42
bool operator<(const DDsvalues_Content_type &lh, const DDsvalues_Content_type &rh)
Definition: DDsvalues.h:15