CMS 3D CMS Logo

CaloTowerConstituentsMap.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_CALOTOWERCONSTITUENTSMAP_H
2 #define GEOMETRY_CALOTOPOLOGY_CALOTOWERCONSTITUENTSMAP_H 1
3 
7 #include <vector>
8 #include <map>
9 #include <atomic>
10 
11 class HcalTopology;
12 class CaloTowerTopology;
13 
19 public:
20  CaloTowerConstituentsMap() = delete;
22  CaloTowerConstituentsMap(const HcalTopology* hcaltopo, const CaloTowerTopology* cttopo);
23 
25  CaloTowerDetId towerOf(const DetId& id) const;
26 
28  std::vector<DetId> constituentsOf(const CaloTowerDetId& id) const;
29 
31  void assign(const DetId& cell, const CaloTowerDetId& tower);
32 
34  void sort();
35 
37  void useStandardHB(bool use = true);
39  void useStandardHE(bool use = true);
41  void useStandardHO(bool use = true);
43  void useStandardHF(bool use = true);
45  void useStandardEB(bool use = true);
46 
47 private:
50 
56 
57  struct MapItem {
58  typedef DetId key_type;
59  MapItem(const DetId& acell, const CaloTowerDetId& atower) : cell(acell), tower(atower) {}
62  inline DetId id() const { return cell; }
63  };
64 
66  mutable std::atomic<std::multimap<CaloTowerDetId, DetId>*> m_reverseItems;
67 };
68 
69 #endif
CaloTowerConstituentsMap::useStandardEB
void useStandardEB(bool use=true)
add standard (hardcoded) EB items?
Definition: CaloTowerConstituentsMap.cc:203
CaloTowerConstituentsMap::sort
void sort()
done adding to the association
Definition: CaloTowerConstituentsMap.cc:62
CaloTowerConstituentsMap::constituentsOf
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
Definition: CaloTowerConstituentsMap.cc:69
CaloTowerConstituentsMap::useStandardHB
void useStandardHB(bool use=true)
add standard (hardcoded) HB items?
Definition: CaloTowerConstituentsMap.cc:199
CaloTowerConstituentsMap::assign
void assign(const DetId &cell, const CaloTowerDetId &tower)
set the association between a DetId and a tower
Definition: CaloTowerConstituentsMap.cc:53
CaloTowerConstituentsMap::useStandardHO
void useStandardHO(bool use=true)
add standard (hardcoded) HO items?
Definition: CaloTowerConstituentsMap.cc:201
HcalTopology
Definition: HcalTopology.h:26
CaloTowerConstituentsMap::MapItem::id
DetId id() const
Definition: CaloTowerConstituentsMap.h:62
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
CaloTowerTopology
Definition: CaloTowerTopology.h:13
CaloTowerConstituentsMap::useStandardHE
void useStandardHE(bool use=true)
add standard (hardcoded) HE items?
Definition: CaloTowerConstituentsMap.cc:200
edm::SortedCollection
Definition: SortedCollection.h:49
CaloTowerConstituentsMap::MapItem
Definition: CaloTowerConstituentsMap.h:57
CaloTowerConstituentsMap::m_hcaltopo
const HcalTopology * m_hcaltopo
Definition: CaloTowerConstituentsMap.h:48
CaloTowerConstituentsMap::standardHO_
bool standardHO_
Definition: CaloTowerConstituentsMap.h:54
DetId
Definition: DetId.h:17
CaloTowerConstituentsMap
Definition: CaloTowerConstituentsMap.h:18
CaloTowerConstituentsMap::m_cttopo
const CaloTowerTopology * m_cttopo
Definition: CaloTowerConstituentsMap.h:49
CaloTowerConstituentsMap::MapItem::tower
CaloTowerDetId tower
Definition: CaloTowerConstituentsMap.h:61
CaloTowerConstituentsMap::standardHF_
bool standardHF_
Definition: CaloTowerConstituentsMap.h:53
CaloTowerConstituentsMap::useStandardHF
void useStandardHF(bool use=true)
add standard (hardcoded) HF items?
Definition: CaloTowerConstituentsMap.cc:202
CaloTowerConstituentsMap::standardHB_
bool standardHB_
Definition: CaloTowerConstituentsMap.h:51
CaloTowerConstituentsMap::standardEB_
bool standardEB_
Definition: CaloTowerConstituentsMap.h:55
CaloTowerConstituentsMap::standardHE_
bool standardHE_
Definition: CaloTowerConstituentsMap.h:52
CaloTowerConstituentsMap::MapItem::MapItem
MapItem(const DetId &acell, const CaloTowerDetId &atower)
Definition: CaloTowerConstituentsMap.h:59
CaloTowerDetId.h
CaloTowerConstituentsMap::towerOf
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
Definition: CaloTowerConstituentsMap.cc:26
DetId.h
CaloTowerConstituentsMap::MapItem::cell
DetId cell
Definition: CaloTowerConstituentsMap.h:60
SortedCollection.h
CaloTowerConstituentsMap::m_reverseItems
std::atomic< std::multimap< CaloTowerDetId, DetId > * > m_reverseItems
Definition: CaloTowerConstituentsMap.h:66
CaloTowerConstituentsMap::m_items
edm::SortedCollection< MapItem > m_items
Definition: CaloTowerConstituentsMap.h:65
CaloTowerConstituentsMap::MapItem::key_type
DetId key_type
Definition: CaloTowerConstituentsMap.h:58
CaloTowerConstituentsMap::~CaloTowerConstituentsMap
~CaloTowerConstituentsMap()
Definition: CaloTowerConstituentsMap.cc:12
CaloTowerConstituentsMap::CaloTowerConstituentsMap
CaloTowerConstituentsMap()=delete
CaloTowerDetId
Definition: CaloTowerDetId.h:12