35 : mPItems(src.mPItems), mTItems(src.mTItems),
50 std::memory_order_acq_rel);
53 std::memory_order_acq_rel);
63 std::vector<const HcalElectronicsMap::PrecisionItem*>::const_iterator item;
67 auto ptr = (*
mPItemsById.load(std::memory_order_acquire));
69 if (item == ptr.end() || (*item)->mId != fId)
79 if (i!=0 && i->
mElId!=fElId) i=0;
87 if (i!=0 && i->
mElId!=fElId) i=0;
94 std::vector<const HcalElectronicsMap::TriggerItem*>::const_iterator item;
100 if (item == (*mTItemsByTrigId).end() || (*item)->mTrigId != fTrigId)
108 return DetId (item ? item->
mId : 0);
128 if (i!=0 && i->
mId!=0) {
146 std::vector <HcalElectronicsId>
result;
147 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin (); item !=
mPItems.end (); item++)
149 for (std::vector<TriggerItem>::const_iterator item =
mTItems.begin (); item !=
mTItems.end (); item++)
156 std::vector <HcalElectronicsId>
result;
157 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin (); item !=
mPItems.end (); item++)
163 std::vector <HcalElectronicsId>
result;
164 for (std::vector<TriggerItem>::const_iterator item =
mTItems.begin (); item !=
mTItems.end (); item++)
171 std::vector <HcalGenericDetId>
result;
172 std::set <unsigned long> allIds;
173 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin (); item !=
mPItems.end (); item++)
174 if (item->mId) allIds.insert (item->mId);
175 for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++) {
182 std::vector <HcalTrigTowerDetId>
result;
183 std::set <unsigned long> allIds;
184 for (std::vector<TriggerItem>::const_iterator item =
mTItems.begin (); item !=
mTItems.end (); item++)
185 if (item->mTrigId) allIds.insert (item->mTrigId);
186 for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++)
204 edm::LogWarning(
"HCAL") <<
"HcalElectronicsMap::mapEId2tId-> Electronics channel " << fElectronicsId <<
" already mapped to trigger channel "
221 else if (item.
mId != fId.
rawId ()) {
222 edm::LogWarning(
"HCAL") <<
"HcalElectronicsMap::mapEId2tId-> Electronics channel " << fElectronicsId <<
" already mapped to channel "
230 if (!
mPItemsById.load(std::memory_order_acquire)) {
231 auto ptr =
new std::vector<const PrecisionItem*>;
233 if (
i->mElId) (*ptr).push_back(&(*
i));
238 std::vector<const PrecisionItem*>* expect =
nullptr;
239 bool exchanged =
mPItemsById.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
248 auto ptr =
new std::vector<const TriggerItem*>;
250 if (
i->mElId) (*ptr).push_back(&(*
i));
255 std::vector<const TriggerItem*>* expect =
nullptr;
256 bool exchanged =
mTItemsByTrigId.compare_exchange_strong(expect, ptr, std::memory_order_acq_rel);
const TriggerItem * findByTrigId(unsigned long fTrigId) const
const PrecisionItem * findPByElId(unsigned long fElId) const
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
std::vector< PrecisionItem > mPItems
bool operator()(const HcalElectronicsMap::TriggerItem *a, const HcalElectronicsMap::TriggerItem *b)
bool mapEId2tId(HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
void swap(HcalElectronicsMap &other)
uint32_t rawId() const
get the raw id
std::vector< HcalElectronicsId > allElectronicsIdTrigger() const
const PrecisionItem * findById(unsigned long fId) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::atomic< std::vector< const PrecisionItem * > * > mPItemsById
std::vector< TriggerItem > mTItems
std::vector< HcalGenericDetId > allPrecisionId() const
bool mapEId2chId(HcalElectronicsId fElectronicsId, DetId fId)
std::vector< HcalElectronicsId > allElectronicsId() const
bool operator()(const HcalDcsMap::Item *a, const HcalDcsMap::Item *b)
const TriggerItem * findTByElId(unsigned long fElId) const
HcalElectronicsMap & operator=(const HcalElectronicsMap &rhs)
int linearIndex() const
get a fast, compact, unique index for linear lookups (maximum value = 16384)
void sortByTriggerId() const
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
std::vector< HcalTrigTowerDetId > allTriggerId() const
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
std::atomic< std::vector< const TriggerItem * > * > mTItemsByTrigId