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 
18 public:
20 
21  void add(const HBHERecHitCollection* hbhe);
22  void add(const HORecHitCollection* ho);
23  void add(const HFRecHitCollection* hf);
24  void add(const EcalRecHitCollection* ecal);
25 
26  virtual ~CaloRecHitMetaCollection();
27  virtual const_iterator find(const DetId& id) const;
28  virtual const CaloRecHit* at(const_iterator::offset_type i) const;
29 private:
30  // This map is used for "at", and the key is the global index of the largest item in the list.
31  std::map<int,CaloRecHitMetaCollectionItem*> m_items;
32  std::multimap<int, CaloRecHitMetaCollectionItem*> m_findTool;
33  int findIndex(const DetId& id) const;
34 };
35 
36 #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:20
int findIndex(const DetId &id) const
std::multimap< int, CaloRecHitMetaCollectionItem * > m_findTool
CaloRecHitMetaCollectionV::Iterator const_iterator