22 : mPItems(src.mPItems), mPItemsById(
nullptr) {}
35 std::memory_order_acq_rel),
36 std::memory_order_acq_rel);
46 std::vector<const HcalFrontEndMap::PrecisionItem*>::const_iterator item;
49 auto const& ptr = (*
mPItemsById.load(std::memory_order_acquire));
51 if (item == ptr.end() || (*item)->mId != fId)
61 <<
HcalDetId(fId) <<
" already exists with RM "
62 << item->
mRM <<
" RBX " << item->
mRBX
63 <<
" new values " << rm <<
" and " << rbx
75 return (item ? item->
mRM : 0);
87 return (item ? item->
mRBX :
"");
98 std::vector <DetId>
result;
99 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin ();
100 item !=
mPItems.end (); item++)
101 if (item->mId) result.push_back(
DetId(item->mId));
107 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin ();
108 item !=
mPItems.end (); item++) {
109 if (
std::find(result.begin(),result.end(),item->mRM) == result.end())
110 result.push_back(item->mRM);
116 std::vector <std::string>
result;
117 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin ();
118 item !=
mPItems.end (); item++) {
119 if (
std::find(result.begin(),result.end(),item->mRBX) == result.end())
120 result.push_back(item->mRBX);
126 if (!
mPItemsById.load(std::memory_order_acquire)) {
127 auto ptr =
new std::vector<const PrecisionItem*>;
129 if (
i->mId) (*ptr).push_back(&(*
i));
134 std::vector<const PrecisionItem*>* expect =
nullptr;
135 bool exchanged =
mPItemsById.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
std::vector< std::string > allRBXs() const
std::atomic< std::vector< const PrecisionItem * > * > mPItemsById
HcalFrontEndMap & operator=(const HcalFrontEndMap &rhs)
const int lookupRMIndex(DetId fId) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
uint32_t rawId() const
get the raw id
const int lookupRBXIndex(DetId fId) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< DetId > allDetIds() const
void swap(HcalFrontEndMap &other)
const PrecisionItem * findById(uint32_t fId) const
const int lookupRM(DetId fId) const
brief lookup the RM associated with the given logical id
bool operator()(const HcalDcsMap::Item *a, const HcalDcsMap::Item *b)
bool loadObject(DetId fId, int rm, std::string rbx)
load a new entry
std::vector< int > allRMs() const
const std::string lookupRBX(DetId fId) const
brief lookup the RBX associated with the given logical id
std::vector< PrecisionItem > mPItems