CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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 
00010 class HcalTopology;
00011 
00018 class CaloTowerConstituentsMap {
00019 public:
00020   CaloTowerConstituentsMap(const HcalTopology * topology);
00021 
00023   CaloTowerDetId towerOf(const DetId& id) const;
00024 
00026   std::vector<DetId> constituentsOf(const CaloTowerDetId& id) const;
00027 
00029   void assign(const DetId& cell, const CaloTowerDetId& tower);
00030 
00032   void sort();
00033 
00035   void useStandardHB(bool use=true);
00037   void useStandardHE(bool use=true);
00039   void useStandardHO(bool use=true);
00041   void useStandardHF(bool use=true);
00043   void useStandardEB(bool use=true);
00044 
00045 private:
00046   const HcalTopology * m_topology;
00047     
00048   bool standardHB_;
00049   bool standardHE_;
00050   bool standardHF_;
00051   bool standardHO_;
00052   bool standardEB_;
00053 
00054   struct MapItem {
00055     typedef DetId key_type;
00056     MapItem(const DetId& acell, const CaloTowerDetId& atower) : cell(acell),tower(atower) { }
00057     DetId cell;
00058     CaloTowerDetId tower;
00059     inline DetId id() const { return cell; }
00060   };
00061 
00062   edm::SortedCollection<MapItem> m_items;
00063   mutable std::multimap<CaloTowerDetId,DetId> m_reverseItems;
00064 };
00065 
00066 #endif