CMS 3D CMS Logo

DDsvalues.h
Go to the documentation of this file.
1 #ifndef DD_DDsvalues_type_h
2 #define DD_DDsvalues_type_h
3 
4 #include <algorithm>
5 #include <map>
6 //#include "DetectorDescription/Core/interface/DDAlgoPar.h"
7 #include <ostream>
8 #include <utility>
9 #include <vector>
10 
12 
13 //typedef parS_type svalues_type;
14 
16 
17 // typedef std::map< unsigned int, DDValue> DDsvalues_type;
18 
19 // vin test
20 typedef std::vector< std::pair<unsigned int, DDValue> > DDsvalues_type;
22 
23 //typedef std::map< unsigned int, DDValue*> DDsvalues_type;
24 
26 
27 inline bool operator<(const DDsvalues_Content_type & lh, const DDsvalues_Content_type & rh){
28  return lh.first < rh.first;
29 }
30 
31 inline DDsvalues_type::const_iterator find( DDsvalues_type::const_iterator begin, DDsvalues_type::const_iterator end, unsigned int id) {
32  static const DDValue dummy;
33  DDsvalues_Content_type v(id,dummy);
34  DDsvalues_type::const_iterator it = std::lower_bound(begin,end,v);
35  if (it!=end && (*it).first==id) return it;
36  return end;
37 }
38 
39 inline DDsvalues_type::const_iterator find(DDsvalues_type const & sv, unsigned int id) {
40  return find(sv.begin(),sv.end(),id);
41 }
42 
43 
44 
45 void merge(DDsvalues_type & target, DDsvalues_type const & sv, bool sortit=true );
46 
47 
49 bool DDfetch(const DDsvalues_type *, DDValue &);
50 
52 unsigned int DDfetch(const std::vector<const DDsvalues_type *> & sp,
53  DDValue & toFetch,
54  std::vector<DDValue> & result);
55 /*
56 class DDsvalues_type : public std::map< unsigned int, DDValue>
57 {
58 public:
59  DDValue operator[](const unsigned int& i) const;
60 };
61 */
62 
63 std::ostream & operator<<(std::ostream & , const DDsvalues_type &);
64 std::ostream & operator<<(std::ostream & , const std::vector<const DDsvalues_type*> &);
65 
66 #endif
void merge(DDsvalues_type &target, DDsvalues_type const &sv, bool sortit=true)
Definition: DDsvalues.cc:5
bool int lh
Definition: SIMDVec.h:21
DDsvalues_type::const_iterator find(DDsvalues_type::const_iterator begin, DDsvalues_type::const_iterator end, unsigned int id)
Definition: DDsvalues.h:31
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:81
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
#define end
Definition: vmac.h:39
std::ostream & operator<<(std::ostream &, const DDsvalues_type &)
Definition: DDsvalues.cc:41
#define begin
Definition: vmac.h:32
bool operator<(const DDsvalues_Content_type &lh, const DDsvalues_Content_type &rh)
Definition: DDsvalues.h:27
DDsvalues_type::value_type DDsvalues_Content_type
Definition: DDsvalues.h:21