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