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 
42 
43  // swap function
44  void swap(HcalFrontEndMap& other);
45  // copy-ctor
47  // copy assignment operator
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
HcalFrontEndMap::allRMs
std::vector< int > allRMs() const
Definition: HcalFrontEndMap.cc:92
HcalFrontEndMap::operator=
HcalFrontEndMap & operator=(const HcalFrontEndMap &rhs)
Definition: HcalFrontEndMap.cc:22
HcalFrontEndMap::initialize
void initialize()
Definition: HcalFrontEndMap.cc:114
HcalFrontEndMap::lookupRMIndex
const int lookupRMIndex(DetId fId) const
Definition: HcalFrontEndMap.cc:63
HcalFrontEndMap::sortById
void sortById()
Definition: HcalFrontEndMap.cc:110
HcalFrontEndMap::~HcalFrontEndMap
~HcalFrontEndMap()
Definition: HcalFrontEndMap.cc:16
HcalFrontEndMapAddons::Helper::mPItems
std::set< HcalFrontEndMap::PrecisionItem, LessById > mPItems
Definition: HcalFrontEndMap.h:102
HcalFrontEndMapAddons::Helper::loadObject
bool loadObject(DetId fId, int rm, std::string rbx)
load a new entry
Definition: HcalFrontEndMap.cc:44
HcalFrontEndMapAddons::Helper::Helper
Helper()
Definition: HcalFrontEndMap.cc:42
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
HcalFrontEndMapAddons::LessById::operator()
bool operator()(const HcalFrontEndMap::PrecisionItem &a, const HcalFrontEndMap::PrecisionItem &b) const
Definition: HcalFrontEndMap.h:88
HcalFrontEndMap::PrecisionItem::mRBX
std::string mRBX
Definition: HcalFrontEndMap.h:34
HcalFrontEndMap::PrecisionItem::PrecisionItem
PrecisionItem(uint32_t fId, int fRM, std::string fRBX)
Definition: HcalFrontEndMap.h:31
HcalFrontEndMap::mPItems
std::vector< PrecisionItem > mPItems
Definition: HcalFrontEndMap.h:76
HcalFrontEndMap::PrecisionItem::PrecisionItem
PrecisionItem()
Definition: HcalFrontEndMap.h:27
DetId
Definition: DetId.h:17
HcalFrontEndId.h
HcalFrontEndMap::allRBXs
std::vector< std::string > allRBXs() const
Definition: HcalFrontEndMap.cc:101
HcalFrontEndMap::allDetIds
std::vector< DetId > allDetIds() const
Definition: HcalFrontEndMap.cc:84
HcalFrontEndMap::PrecisionItem::mRM
int mRM
Definition: HcalFrontEndMap.h:33
HcalFrontEndId::maxRmIndex
static const int maxRmIndex
Definition: HcalFrontEndId.h:21
trackingPlots.other
other
Definition: trackingPlots.py:1467
submit.rm
rm
Definition: submit.py:77
HcalFrontEndMap::lookupRBXIndex
const int lookupRBXIndex(DetId fId) const
Definition: HcalFrontEndMap.cc:76
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalFrontEndMapAddons::LessById
Definition: HcalFrontEndMap.h:83
HcalFrontEndMap::lookupRBX
const std::string lookupRBX(DetId fId) const
brief lookup the RBX associated with the given logical id
Definition: HcalFrontEndMap.cc:71
HcalFrontEndMapAddons::LessById::equal
bool equal(const HcalFrontEndMap::PrecisionItem *a, const HcalFrontEndMap::PrecisionItem *b) const
Definition: HcalFrontEndMap.h:91
a
double a
Definition: hdecay.h:119
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
HcalDetId.h
helper
Definition: helper.py:1
HcalFrontEndMap::HcalFrontEndMap
HcalFrontEndMap()
Definition: HcalFrontEndMap.h:39
HcalFrontEndMap::maxRMIndex
const int maxRMIndex() const
Definition: HcalFrontEndMap.h:58
HcalFrontEndMap::mPItemsById
std::vector< const PrecisionItem * > mPItemsById
Definition: HcalFrontEndMap.h:77
Serializable.h
HcalFrontEndMapAddons
Definition: HcalFrontEndMap.h:19
HcalFrontEndMapAddons::LessById::good
bool good(const HcalFrontEndMap::PrecisionItem &a) const
Definition: HcalFrontEndMap.h:94
HcalFrontEndMap::PrecisionItem
Definition: HcalFrontEndMap.h:25
HcalFrontEndMapAddons::Helper
Definition: HcalFrontEndMap.h:96
HcalFrontEndMapAddons::LessById::operator()
bool operator()(const HcalFrontEndMap::PrecisionItem *a, const HcalFrontEndMap::PrecisionItem *b) const
Definition: HcalFrontEndMap.h:85
DetId.h
HcalFrontEndMap::lookupRM
const int lookupRM(DetId fId) const
brief lookup the RM associated with the given logical id
Definition: HcalFrontEndMap.cc:58
HcalFrontEndMap
Definition: HcalFrontEndMap.h:23
hcaldqm::quantity::fRBX
Definition: ValueQuantity.h:62
HcalFrontEndMap::swap
void swap(HcalFrontEndMap &other)
Definition: HcalFrontEndMap.cc:29
HcalFrontEndMap::findById
const PrecisionItem * findById(uint32_t fId) const
Definition: HcalFrontEndMap.cc:37
HcalFrontEndMap::PrecisionItem::mId
uint32_t mId
Definition: HcalFrontEndMap.h:32