CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h

Go to the documentation of this file.
00001 #ifndef GEOMETRY_CALOTOPOLOGY_CALOTOWERCONSTITUENTSMAP_H
00002 #define GEOMETRY_CALOTOPOLOGY_CALOTOWERCONSTITUENTSMAP_H 1
00003 
00004 #include "DataFormats/DetId/interface/DetId.h"
00005 #include "DataFormats/CaloTowers/interface/CaloTowerDetId.h"
00006 #include "DataFormats/Common/interface/SortedCollection.h"
00007 #include <vector>
00008 #include <map>
00009 
00016 class CaloTowerConstituentsMap {
00017 public:
00018   CaloTowerConstituentsMap();
00019 
00021   CaloTowerDetId towerOf(const DetId& id) const;
00022 
00024   std::vector<DetId> constituentsOf(const CaloTowerDetId& id) const;
00025 
00027   void assign(const DetId& cell, const CaloTowerDetId& tower);
00028 
00030   void sort();
00031 
00033   void useStandardHB(bool use=true);
00035   void useStandardHE(bool use=true);
00037   void useStandardHO(bool use=true);
00039   void useStandardHF(bool use=true);
00041   void useStandardEB(bool use=true);
00042 
00043 private:
00044   bool standardHB_;
00045   bool standardHE_;
00046   bool standardHF_;
00047   bool standardHO_;
00048   bool standardEB_;
00049 
00050   struct MapItem {
00051     typedef DetId key_type;
00052     MapItem(const DetId& acell, const CaloTowerDetId& atower) : cell(acell),tower(atower) { }
00053     DetId cell;
00054     CaloTowerDetId tower;
00055     inline DetId id() const { return cell; }
00056   };
00057 
00058   edm::SortedCollection<MapItem> m_items;
00059   mutable std::multimap<CaloTowerDetId,DetId> m_reverseItems;
00060 };
00061 
00062 #endif