CMS 3D CMS Logo

TrackerDetToDTCELinkCablingMap.h
Go to the documentation of this file.
1 #ifndef CondFormats_Phase2TrackerDTC_TrackerDetToDTCELinkCablingMap_h
2 #define CondFormats_Phase2TrackerDTC_TrackerDetToDTCELinkCablingMap_h
3 
4 // -*- C++ -*-
5 //
6 // Package: CondFormats/Phase2TrackerDTC
7 // Class: TrackerDetToDTCELinkCablingMap
8 //
16 //
17 // Original Author: Luigi Calligaris, SPRACE, Sao Paulo, BR
18 // Created : Wed, 27 Feb 2019 21:41:13 GMT
19 //
20 //
21 
22 #include <vector>
23 #include <unordered_map>
24 #include <cstdint>
25 
28 
30 public:
33 
35  std::unordered_map<DTCELinkId, uint32_t>::const_iterator dtcELinkIdToDetId(DTCELinkId const&) const;
36 
38  std::pair<std::unordered_multimap<uint32_t, DTCELinkId>::const_iterator,
39  std::unordered_multimap<uint32_t, DTCELinkId>::const_iterator>
40  detIdToDTCELinkId(uint32_t const) const;
41 
43  bool knowsDTCELinkId(DTCELinkId const&) const;
44 
46  bool knowsDetId(uint32_t) const;
47 
48  // IMPORTANT: The following information is not stored, to preserve space in memory.
49  // As these vectors are generated each time the functions are called, you are encouraged to
50  // either cache the results or avoid calling them in hot loops.
51  // NOTE: This vectors are unsorted
52 
54  std::vector<DTCELinkId> getKnownDTCELinkIds() const;
55 
57  std::vector<uint32_t> getKnownDetIds() const;
58 
60  void insert(DTCELinkId const&, uint32_t const);
61 
63  void clear();
64 
65 private:
66  std::unordered_multimap<uint32_t, DTCELinkId> cablingMapDetIdToDTCELinkId_;
67  std::unordered_map<DTCELinkId, uint32_t> cablingMapDTCELinkIdToDetId_;
68 
70 };
71 
72 #endif // end CondFormats_Phase2TrackerDTC_TrackerDetToDTCELinkCablingMap_h
TrackerDetToDTCELinkCablingMap
Definition: TrackerDetToDTCELinkCablingMap.h:29
TrackerDetToDTCELinkCablingMap::cablingMapDetIdToDTCELinkId_
std::unordered_multimap< uint32_t, DTCELinkId > cablingMapDetIdToDTCELinkId_
Definition: TrackerDetToDTCELinkCablingMap.h:66
TrackerDetToDTCELinkCablingMap::knowsDTCELinkId
bool knowsDTCELinkId(DTCELinkId const &) const
Returns true if the cabling map has a record corresponding to a detector identified by the given raw ...
Definition: TrackerDetToDTCELinkCablingMap.cc:40
DTCELinkId
Definition: DTCELinkId.h:28
TrackerDetToDTCELinkCablingMap::cablingMapDTCELinkIdToDetId_
std::unordered_map< DTCELinkId, uint32_t > cablingMapDTCELinkIdToDetId_
Definition: TrackerDetToDTCELinkCablingMap.h:67
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
TrackerDetToDTCELinkCablingMap::insert
void insert(DTCELinkId const &, uint32_t const)
Inserts in the cabling map a record corresponding to the connection of an eLink identified by the giv...
Definition: TrackerDetToDTCELinkCablingMap.cc:85
TrackerDetToDTCELinkCablingMap::getKnownDTCELinkIds
std::vector< DTCELinkId > getKnownDTCELinkIds() const
Returns a vector containing all elink DTCELinkId nown to the map.
Definition: TrackerDetToDTCELinkCablingMap.cc:48
TrackerDetToDTCELinkCablingMap::detIdToDTCELinkId
std::pair< std::unordered_multimap< uint32_t, DTCELinkId >::const_iterator, std::unordered_multimap< uint32_t, DTCELinkId >::const_iterator > detIdToDTCELinkId(uint32_t const) const
Resolves one or more DTCELinkId of eLinks which are connected to the detector identified by the given...
Definition: TrackerDetToDTCELinkCablingMap.cc:27
TrackerDetToDTCELinkCablingMap::~TrackerDetToDTCELinkCablingMap
virtual ~TrackerDetToDTCELinkCablingMap()
Definition: TrackerDetToDTCELinkCablingMap.cc:10
TrackerDetToDTCELinkCablingMap::getKnownDetIds
std::vector< uint32_t > getKnownDetIds() const
Returns a vector containing all detector DetId known to the map.
Definition: TrackerDetToDTCELinkCablingMap.cc:60
TrackerDetToDTCELinkCablingMap::dtcELinkIdToDetId
std::unordered_map< DTCELinkId, uint32_t >::const_iterator dtcELinkIdToDetId(DTCELinkId const &) const
Resolves the raw DetId of the detector connected to the eLink identified by a DTCELinkId.
Definition: TrackerDetToDTCELinkCablingMap.cc:12
Serializable.h
TrackerDetToDTCELinkCablingMap::clear
void clear()
Clears the map.
Definition: TrackerDetToDTCELinkCablingMap.cc:90
TrackerDetToDTCELinkCablingMap::knowsDetId
bool knowsDetId(uint32_t) const
Returns true if the cabling map has a record corresponding to an eLink identified by the given DTCELi...
Definition: TrackerDetToDTCELinkCablingMap.cc:44
DTCELinkId.h
TrackerDetToDTCELinkCablingMap::TrackerDetToDTCELinkCablingMap
TrackerDetToDTCELinkCablingMap()
Definition: TrackerDetToDTCELinkCablingMap.cc:8