CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloRecHitMetaCollection.h
Go to the documentation of this file.
1 #ifndef RECOCALOTOOLS_METACOLLECTIONS_CALORECHITMETACOLLECTION_H
2 #define RECOCALOTOOLS_METACOLLECTIONS_CALORECHITMETACOLLECTION_H 1
3 
7 #include <map>
8 
10 
16 public:
18 
19  void add(const HBHERecHitCollection* hbhe);
20  void add(const HORecHitCollection* ho);
21  void add(const HFRecHitCollection* hf);
22  void add(const EcalRecHitCollection* ecal);
23 
24  virtual ~CaloRecHitMetaCollection();
25  virtual const_iterator find(const DetId& id) const;
26  virtual const CaloRecHit* at(const_iterator::offset_type i) const;
27 private:
28  // This map is used for "at", and the key is the global index of the largest item in the list.
29  std::map<int,CaloRecHitMetaCollectionItem*> m_items;
30  std::multimap<int, CaloRecHitMetaCollectionItem*> m_findTool;
31  int findIndex(const DetId& id) const;
32 };
33 
34 #endif
int i
Definition: DBlmapReader.cc:9
std::map< int, CaloRecHitMetaCollectionItem * > m_items
virtual const CaloRecHit * at(const_iterator::offset_type i) const
get an item by index
virtual const_iterator find(const DetId &id) const
find by id (default version is very slow unsorted find)
void add(const HBHERecHitCollection *hbhe)
Definition: DetId.h:18
int findIndex(const DetId &id) const
std::multimap< int, CaloRecHitMetaCollectionItem * > m_findTool
CaloRecHitMetaCollectionV::Iterator const_iterator