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 <set>
7 #include <vector>
8 #include <algorithm>
9 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
10 #include <atomic>
11 #endif
12 
16 #include <cstdint>
17 
18 //forward declaration
20  class Helper;
21 }
22 
24 public:
25  class PrecisionItem {
26  public:
28  mId = mRM = 0;
29  mRBX = "";
30  }
31  PrecisionItem(uint32_t fId, int fRM, std::string fRBX) : mId(fId), mRM(fRM), mRBX(fRBX) {}
32  uint32_t mId;
33  int mRM;
35 
37  };
38 
41  ~HcalFrontEndMap();
42 
43  // swap function
44  void swap(HcalFrontEndMap& other);
45  // copy-ctor
47  // copy assignment operator
48  HcalFrontEndMap& operator=(const HcalFrontEndMap& rhs);
49  // move constructor
50 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
52 #endif
53 
55  //return Null item if no such mapping
56  const int lookupRM(DetId fId) const;
57  const int lookupRMIndex(DetId fId) const;
58  const int maxRMIndex() const { return HcalFrontEndId::maxRmIndex; }
59 
61  //return Null item if no such mapping
62  const std::string lookupRBX(DetId fId) const;
63  const int lookupRBXIndex(DetId fId) const;
64 
65  std::vector<DetId> allDetIds() const;
66  std::vector<int> allRMs() const;
67  std::vector<std::string> allRBXs() const;
68 
69  const PrecisionItem* findById(uint32_t fId) const;
70 
71  // sorting
72  void sortById();
73  void initialize();
74 
75 protected:
76  std::vector<PrecisionItem> mPItems;
77  std::vector<const PrecisionItem*> mPItemsById COND_TRANSIENT;
78 
80 };
81 
82 namespace HcalFrontEndMapAddons {
83  class LessById {
84  public:
86  return a->mId < b->mId;
87  }
89  return a.mId < b.mId;
90  }
92  return a->mId == b->mId;
93  }
94  bool good(const HcalFrontEndMap::PrecisionItem& a) const { return a.mId; }
95  };
96  class Helper {
97  public:
98  Helper();
100  bool loadObject(DetId fId, int rm, std::string rbx);
101 
102  std::set<HcalFrontEndMap::PrecisionItem, LessById> mPItems;
103  };
104 } // namespace HcalFrontEndMapAddons
105 
106 #endif
static AlgebraicMatrix initialize()
bool equal(const HcalFrontEndMap::PrecisionItem *a, const HcalFrontEndMap::PrecisionItem *b) const
Definition: helper.py:1
PrecisionItem(uint32_t fId, int fRM, std::string fRBX)
std::set< HcalFrontEndMap::PrecisionItem, LessById > mPItems
bool operator()(const HcalFrontEndMap::PrecisionItem &a, const HcalFrontEndMap::PrecisionItem &b) const
void swap(Association< C > &lhs, Association< C > &rhs)
Definition: Association.h:117
bool operator()(const HcalFrontEndMap::PrecisionItem *a, const HcalFrontEndMap::PrecisionItem *b) const
bool good(const HcalFrontEndMap::PrecisionItem &a) const
static const int maxRmIndex
Definition: DetId.h:17
#define COND_TRANSIENT
Definition: Serializable.h:62
double b
Definition: hdecay.h:118
#define COND_SERIALIZABLE
Definition: Serializable.h:38
double a
Definition: hdecay.h:119
rm
Definition: submit.py:77
const int maxRMIndex() const
std::vector< PrecisionItem > mPItems