CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloRecHitMetaCollections.h
Go to the documentation of this file.
1 #ifndef RECOCALOTOOLS_METACOLLECTIONS_CALORECHITMETACOLLECTIONS_H
2 #define RECOCALOTOOLS_METACOLLECTIONS_CALORECHITMETACOLLECTIONS_H 1
3 
7 
8 template <class C>
10 public:
12 
14  SimpleCaloRecHitMetaCollection(const C* c) : coll_(*c) { size_=coll_.size(); }
15  virtual const_iterator find(const DetId& id) const {
17  typename C::const_iterator j=coll_.find(id);
18  if (j!=coll_.end()) {
19  int delta=j-coll_.begin();
20  i=const_iterator(this,delta);
21  }
22  return i;
23  }
24  virtual const CaloRecHit* at(const_iterator::offset_type i) const {
25  return &(coll_[i]);
26  }
27 private:
28  const C& coll_;
29 };
30 
35 
36 #endif
dbl * delta
Definition: mlp_gen.cc:36
int i
Definition: DBlmapReader.cc:9
SimpleCaloRecHitMetaCollection< HORecHitCollection > HORecHitMetaCollection
virtual const_iterator find(const DetId &id) const
find by id (default version is very slow unsorted find)
const_iterator end() const
get the ending iterator
int j
Definition: DBlmapReader.cc:9
SimpleCaloRecHitMetaCollection< HBHERecHitCollection > HBHERecHitMetaCollection
Definition: DetId.h:18
SimpleCaloRecHitMetaCollection< EcalRecHitCollection > EcalRecHitMetaCollection
SimpleCaloRecHitMetaCollection< HFRecHitCollection > HFRecHitMetaCollection
CaloRecHitMetaCollectionV::const_iterator const_iterator
virtual const CaloRecHit * at(const_iterator::offset_type i) const
get an item by index