CMS 3D CMS Logo

ESCondObjectContainer.h
Go to the documentation of this file.
1 #ifndef ES_COND_OBJECT_CONTAINER_HH
2 #define ES_COND_OBJECT_CONTAINER_HH
3 
5 
9 
10 template < typename T >
12  public:
13  typedef T Item;
14  typedef Item value_type;
16  typedef typename std::vector<Item> Items;
17  typedef typename std::vector<Item>::const_iterator const_iterator;
18  typedef typename std::vector<Item>::iterator iterator;
19 
22 
23  inline
24  const Items & preshowerItems() const { return es_.items(); };
25 
26  inline
27  const Item & preshower( size_t hashedIndex ) const {
28  return es_.item(hashedIndex);
29  }
30 
31  inline
32  void insert( std::pair<uint32_t, Item> const &a ) {
33  if (DetId(a.first).subdetId() == EcalPreshower) {
34  es_.insert(a);
35  }
36  }
37 
38  inline
39  const_iterator find( uint32_t rawId ) const {
40  return es_.find(rawId);
41  }
42 
43  inline
44  const_iterator begin() const {
45  return es_.begin();
46  }
47 
48  inline
49  const_iterator end() const {
50  return es_.end();
51  }
52 
53  inline
54  void setValue(const uint32_t id, const Item &item) {
55  (*this)[id] = item;
56  }
57 
58  inline
59  const self & getMap() const {
60  return *this;
61  }
62 
63  inline
64  size_t size() const {
65  return es_.size() ;
66  }
67  // add coherent operator++, not needed now -- FIXME
68 
69  inline
70  Item & operator[]( uint32_t rawId ) {
71  return es_[rawId];
72  }
73 
74  inline
75  Item const & operator[]( uint32_t rawId ) const {
76  return es_[rawId];
77  }
78 
79  private:
81 
83 };
84 
86 #endif
const_iterator begin() const
Definition: EcalContainer.h:85
ESCondObjectContainer< float > ESFloatCondObjectContainer
const Item & item(size_t hashid) const
Definition: EcalContainer.h:36
std::vector< Item > Items
const Items & items() const
Definition: EcalContainer.h:40
const_iterator end() const
Definition: EcalContainer.h:89
const_iterator end() const
const self & getMap() const
EcalContainer< ESDetId, Item > es_
Item & operator[](uint32_t rawId)
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:42
const_iterator find(uint32_t rawId) const
Definition: EcalContainer.h:79
void insert(std::pair< uint32_t, Item > const &a)
void setValue(const uint32_t id, const Item &item)
const_iterator find(uint32_t rawId) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:38
const Item & preshower(size_t hashedIndex) const
Definition: DetId.h:18
#define COND_SERIALIZABLE
Definition: Serializable.h:38
std::vector< Item >::const_iterator const_iterator
void insert(std::pair< uint32_t, Item > const &a)
Definition: EcalContainer.h:32
std::vector< Item >::iterator iterator
double a
Definition: hdecay.h:121
const_iterator begin() const
size_t size() const
Definition: EcalContainer.h:93
Item const & operator[](uint32_t rawId) const
long double T
const Items & preshowerItems() const