25 delete mItemsById.load();
26 delete mItemsByDcsId.load();
42 other.mItemsByDcsId.exchange(
43 mItemsByDcsId.exchange(other.mItemsByDcsId.load(std::memory_order_acquire), std::memory_order_acq_rel),
44 std::memory_order_acq_rel);
45 other.mItemsById.exchange(
46 mItemsById.exchange(other.mItemsById.load(std::memory_order_acquire), std::memory_order_acq_rel),
47 std::memory_order_acq_rel);
76 _iter.
fIter = (*mItemsById.load(std::memory_order_acquire)).
begin();
83 _iter.
fIter = (*mItemsByDcsId.load(std::memory_order_acquire)).
begin();
90 _iter.
fIter = (*mItemsById.load(std::memory_order_acquire)).
end();
97 _iter.
fIter = (*mItemsByDcsId.load(std::memory_order_acquire)).
end();
123 return (*fIter)->mDcsId;
127 return (*fIter)->mId;
133 std::vector<const HcalDcsMap::Item*>::const_iterator item;
134 std::vector<const HcalDcsMap::Item *>
result;
139 auto ptr = (*mItemsById.load(std::memory_order_acquire));
140 item = std::lower_bound (ptr.begin(), ptr.end(), &
target, lessById);
141 if (item == ptr.end() || (*item)->mId != fId){
146 if(item != ptr.end() && !lessById(&target, *item)){
147 result.push_back( *item );
156 std::vector<const HcalDcsMap::Item*>::const_iterator item;
157 std::vector<const HcalDcsMap::Item *>
result;
162 auto ptr = (*mItemsByDcsId.load(std::memory_order_acquire));
163 item = std::lower_bound (ptr.begin(), ptr.end(), &
target, lessByDcsId);
164 if (item == ptr.end() || (*item)->mDcsId != fDcsId) {
169 if(item != ptr.end() && !lessByDcsId(&target, *item)){
170 result.push_back( *item );
186 const std::vector<const Item *> items =
findByDcsId (fDcsId_notype.rawId ());
187 std::vector<HcalDetId> _ids;
188 for (std::vector<const Item *>::const_iterator item = items.begin();
191 _ids.push_back(
DetId(*item ? (*item)->mId : 0) );
197 const std::vector<const Item *> items =
findById (fId.
rawId ());
198 std::vector<HcalDcsDetId> _ids;
199 for (std::vector<const Item *>::const_iterator item = items.begin();
216 std::vector <HcalDcsDetId>
result;
217 for (std::vector<Item>::const_iterator item =
mItems.begin (); item !=
mItems.end (); item++)
218 if (item->mDcsId) result.push_back(
HcalDcsDetId(item->mDcsId));
224 std::vector <HcalGenericDetId>
result;
225 std::set <unsigned long> allIds;
226 for (std::vector<Item>::const_iterator item =
mItems.begin (); item !=
mItems.end (); item++)
227 if (item->mId) allIds.insert (item->mId);
228 for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++) {
244 const std::vector<const Item *> items =
findByDcsId(fDcsId_notype);
245 for (std::vector<const Item *>::const_iterator item = items.begin();
248 if ((*item)->mId == fId){
249 edm::LogWarning(
"HCAL") <<
"HcalDcsMap::mapGeomId2DcsId-> Geom channel " << fId
250 <<
" already mapped to DCS channel " << fDcsId_notype;
254 Item _item(fId, fDcsId_notype);
256 delete mItemsById.load();
257 mItemsById =
nullptr;
258 delete mItemsByDcsId.load();
259 mItemsByDcsId =
nullptr;
265 if (!mItemsById.load(std::memory_order_acquire)) {
266 auto ptr =
new std::vector<const Item*>;
268 if (
i->mDcsId) ptr->push_back(&(*
i));
273 std::vector<const Item*>* expect =
nullptr;
274 bool exchanged = mItemsById.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
282 if (!mItemsByDcsId.load(std::memory_order_acquire)) {
283 auto ptr =
new std::vector<const Item*>;
285 if (
i->mDcsId) ptr->push_back(&(*
i));
290 std::vector<const Item*>* expect =
nullptr;
291 bool exchanged = mItemsByDcsId.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
std::vector< const Item * >::const_iterator fIter
bool mapGeomId2DcsId(HcalDetId fId, HcalDcsDetId fDcsId)
std::vector< HcalDcsDetId > allHcalDcsDetId() const
const_iterator operator++()
void swap(HcalDcsMap &other)
uint32_t rawId() const
get the raw id
const_iterator endById(void) const
const_iterator beginById(void) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
bool operator()(const HcalDcsMap::Item *a, const HcalDcsMap::Item *b)
const std::vector< HcalDetId > lookup(HcalDcsDetId fId) const
HcalDetId getHcalDetId(void)
const std::vector< const Item * > findByDcsId(unsigned long fDcsId) const
HcalDcsMap & operator=(const HcalDcsMap &rhs)
HcalDcsDetId getHcalDcsDetId(void)
const std::vector< const Item * > findById(unsigned long fId) const
HcalOtherSubdetector subdet() const
get the category
std::vector< HcalGenericDetId > allHcalDetId() const
bool operator()(const HcalDcsMap::Item *a, const HcalDcsMap::Item *b)
bool operator!=(const const_iterator &other)
const_iterator endByDcsId(void) const
std::vector< Item > mItems
const_iterator beginByDcsId(void) const