CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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;
23  DDsvalues_Content_type v(id, 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
uint16_t *__restrict__ id
DDsvalues_type::value_type DDsvalues_Content_type
Definition: DDsvalues.h:13
bool int lh
Definition: SIMDVec.h:20
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
tuple result
Definition: mps_fire.py:311
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
bool operator<(DTCELinkId const &lhs, DTCELinkId const &rhs)
Definition: DTCELinkId.h:70
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
string end
Definition: dataset.py:937