CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDsvalues.h
Go to the documentation of this file.
1 #ifndef DD_DDsvalues_type_h
2 #define DD_DDsvalues_type_h
3 
4 //#include "DetectorDescription/Core/interface/DDAlgoPar.h"
5 #include <ostream>
6 #include <map>
7 #include <vector>
8 #include <algorithm>
9 
11 
12 //typedef parS_type svalues_type;
13 
15 
16 // typedef std::map< unsigned int, DDValue> DDsvalues_type;
17 
18 // vin test
19 typedef std::vector< std::pair<unsigned int, DDValue> > DDsvalues_type;
21 
22 //typedef std::map< unsigned int, DDValue*> DDsvalues_type;
23 
25 
26 inline bool operator<(const DDsvalues_Content_type & lh, const DDsvalues_Content_type & rh){
27  return lh.first < rh.first;
28 }
29 
30 inline DDsvalues_type::const_iterator find( DDsvalues_type::const_iterator begin, DDsvalues_type::const_iterator end, unsigned int id) {
31  static const DDValue dummy;
32  DDsvalues_Content_type v(id,dummy);
33  DDsvalues_type::const_iterator it = std::lower_bound(begin,end,v);
34  if (it!=end && (*it).first==id) return it;
35  return end;
36 }
37 
38 inline DDsvalues_type::const_iterator find(DDsvalues_type const & sv, unsigned int id) {
39  return find(sv.begin(),sv.end(),id);
40 }
41 
42 
43 
44 void merge(DDsvalues_type & target, DDsvalues_type const & sv, bool sortit=true );
45 
46 
48 bool DDfetch(const DDsvalues_type *, DDValue &);
49 
51 unsigned int DDfetch(const std::vector<const DDsvalues_type *> & sp,
52  DDValue & toFetch,
53  std::vector<DDValue> & result);
54 /*
55 class DDsvalues_type : public std::map< unsigned int, DDValue>
56 {
57 public:
58  DDValue operator[](const unsigned int& i) const;
59 };
60 */
61 
62 std::ostream & operator<<(std::ostream & , const DDsvalues_type &);
63 std::ostream & operator<<(std::ostream & , const std::vector<const DDsvalues_type*> &);
64 
65 #endif
bool int lh
Definition: SIMDVec.h:21
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:80
tuple result
Definition: mps_fire.py:95
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
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:19
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
Definition: sp.h:21
DDsvalues_type::value_type DDsvalues_Content_type
Definition: DDsvalues.h:20