23 namespace castor_impl {
40 : mPItems(src.mPItems), mTItems(src.mTItems),
64 std::vector<const CastorElectronicsMap::PrecisionItem*>::const_iterator item;
69 if (item == (*mPItemsById).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 CastorElectronicsMap::TriggerItem*>::const_iterator item;
99 if (item == (*mTItemsByTrigId).end() || (*item)->mTrigId != fTrigId)
107 return DetId (item ? item->
mId : 0);
127 if (i!=0 && i->
mId!=0) {
145 std::vector <CastorElectronicsId>
result;
146 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin (); item !=
mPItems.end (); item++)
148 for (std::vector<TriggerItem>::const_iterator item =
mTItems.begin (); item !=
mTItems.end (); item++)
155 std::vector <CastorElectronicsId>
result;
156 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin (); item !=
mPItems.end (); item++)
162 std::vector <CastorElectronicsId>
result;
163 for (std::vector<TriggerItem>::const_iterator item =
mTItems.begin (); item !=
mTItems.end (); item++)
170 std::vector <HcalGenericDetId>
result;
171 std::set <unsigned long> allIds;
172 for (std::vector<PrecisionItem>::const_iterator item =
mPItems.begin (); item !=
mPItems.end (); item++)
173 if (item->mId) allIds.insert (item->mId);
174 for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++) {
181 std::vector <HcalTrigTowerDetId>
result;
182 std::set <unsigned long> allIds;
183 for (std::vector<TriggerItem>::const_iterator item =
mTItems.begin (); item !=
mTItems.end (); item++)
184 if (item->mTrigId) allIds.insert (item->mTrigId);
185 for (std::set <unsigned long>::const_iterator channel = allIds.begin (); channel != allIds.end (); channel++)
197 edm::LogWarning(
"CASTOR") <<
"CastorElectronicsMap::mapEId2tId-> Electronics channel " << fElectronicsId <<
" already mapped to trigger channel "
211 else if (item.
mId != fId.
rawId ()) {
212 edm::LogWarning(
"CASTOR") <<
"CastorElectronicsMap::mapEId2tId-> Electronics channel " << fElectronicsId <<
" already mapped to channel "
221 auto ptr =
new std::vector<const PrecisionItem*>;
223 if (
i->mElId) (*ptr).push_back(&(*
i));
227 std::vector<const PrecisionItem*>* expect =
nullptr;
228 bool exchanged =
mPItemsById.compare_exchange_strong(expect, ptr);
237 auto ptr =
new std::vector<const TriggerItem*>;
239 if (
i->mElId) (*ptr).push_back(&(*
i));
244 std::vector<const TriggerItem*>* expect =
nullptr;
std::vector< PrecisionItem > mPItems
const DetId lookupTrigger(CastorElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
std::vector< CastorElectronicsId > allElectronicsIdTrigger() const
std::vector< CastorElectronicsId > allElectronicsIdPrecision() const
bool operator()(const CastorElectronicsMap::PrecisionItem *a, const CastorElectronicsMap::PrecisionItem *b)
void swap(CastorElectronicsMap &other)
std::atomic< std::vector< const PrecisionItem * > * > mPItemsById
bool mapEId2tId(CastorElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
uint32_t rawId() const
get the raw id
const PrecisionItem * findById(unsigned long fId) const
const DetId lookup(CastorElectronicsId fId) const
lookup the logical detid associated with the given electronics id
const TriggerItem * findTByElId(unsigned long fElId) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< HcalTrigTowerDetId > allTriggerId() const
const PrecisionItem * findPByElId(unsigned long fElId) const
const TriggerItem * findByTrigId(unsigned long fTrigId) const
std::vector< HcalGenericDetId > allPrecisionId() const
bool operator()(const CastorElectronicsMap::TriggerItem *a, const CastorElectronicsMap::TriggerItem *b)
void sortByTriggerId() const
std::vector< CastorElectronicsId > allElectronicsId() const
std::atomic< std::vector< const TriggerItem * > * > mTItemsByTrigId
std::vector< TriggerItem > mTItems
CastorElectronicsMap & operator=(const CastorElectronicsMap &rhs)
bool mapEId2chId(CastorElectronicsId fElectronicsId, DetId fId)
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...