CMS 3D CMS Logo

HcalFrontEndMap.h
Go to the documentation of this file.
1 #ifndef HcalFrontEndMap_h
2 #define HcalFrontEndMap_h
3 
5 
6 #include <vector>
7 #include <algorithm>
8 #include <boost/cstdint.hpp>
9 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
10 #include <atomic>
11 #endif
12 
16 //
18 public:
21 
22  // swap function
23  void swap(HcalFrontEndMap& other);
24  // copy-ctor
26  // copy assignment operator
28  // move constructor
29 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
31 #endif
32 
34  bool loadObject(DetId fId, int rm, std::string rbx);
35 
37  //return Null item if no such mapping
38  const int lookupRM(DetId fId) const;
39  const int lookupRMIndex(DetId fId) const;
40  const int maxRMIndex() const {return HcalFrontEndId::maxRmIndex;}
41 
43  //return Null item if no such mapping
44  const std::string lookupRBX(DetId fId) const;
45  const int lookupRBXIndex(DetId fId) const;
46 
47  std::vector <DetId> allDetIds() const;
48  std::vector <int> allRMs() const;
49  std::vector <std::string> allRBXs() const;
50 
51  // sorting
52  void sortById () const;
53  void sort() {}
54 
55  class PrecisionItem {
56  public:
57  PrecisionItem () {mId = mRM = 0; mRBX = "";}
58  PrecisionItem (uint32_t fId, int fRM, std::string fRBX)
59  : mId (fId), mRM (fRM), mRBX (fRBX) {}
60  uint32_t mId;
61  int mRM;
63 
65  };
66 protected:
67  const PrecisionItem* findById (uint32_t fId) const;
68 
69  std::vector<PrecisionItem> mPItems;
70 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
71  mutable std::atomic<std::vector<const PrecisionItem*>*> mPItemsById COND_TRANSIENT;
72 #else
73  mutable std::vector<const PrecisionItem*>* mPItemsById COND_TRANSIENT;
74 #endif
75 
77 };
78 
79 #endif
std::vector< std::string > allRBXs() const
std::atomic< std::vector< const PrecisionItem * > * > mPItemsById
PrecisionItem(uint32_t fId, int fRM, std::string fRBX)
HcalFrontEndMap & operator=(const HcalFrontEndMap &rhs)
const int lookupRMIndex(DetId fId) const
const int lookupRBXIndex(DetId fId) const
std::vector< DetId > allDetIds() const
static const int maxRmIndex
void swap(HcalFrontEndMap &other)
const PrecisionItem * findById(uint32_t fId) const
Definition: DetId.h:18
#define COND_TRANSIENT
Definition: Serializable.h:61
const int lookupRM(DetId fId) const
brief lookup the RM associated with the given logical id
void sortById() const
#define COND_SERIALIZABLE
Definition: Serializable.h:38
bool loadObject(DetId fId, int rm, std::string rbx)
load a new entry
std::vector< int > allRMs() const
rm
Definition: submit.py:76
const int maxRMIndex() const
const std::string lookupRBX(DetId fId) const
brief lookup the RBX associated with the given logical id
std::vector< PrecisionItem > mPItems