File indexing completed on 2023-03-17 10:51:16
0001 #ifndef DataFormats_RPCDigi_RPCAMCLinkCounters_icc
0002 #define DataFormats_RPCDigi_RPCAMCLinkCounters_icc
0003
0004 #include "DataFormats/RPCDigi/interface/RPCAMCLinkCounters.h"
0005
0006 inline void RPCAMCLinkCounters::add(unsigned int event, RPCAMCLink const& link, unsigned int count) {
0007 type_link_count_[std::pair<unsigned int, std::uint32_t>(event, link.getId())] += count;
0008 }
0009
0010 inline void RPCAMCLinkCounters::reset() { type_link_count_.clear(); }
0011
0012 inline void RPCAMCLinkCounters::reset(unsigned int event) {
0013 map_type::iterator first(type_link_count_.lower_bound(std::pair<unsigned int, std::uint32_t>(event, 0)));
0014 if (first != type_link_count_.end()) {
0015 map_type::iterator last(type_link_count_.upper_bound(std::pair<unsigned int, std::uint32_t>(event, 0xffffffff)));
0016 type_link_count_.erase(first, last);
0017 }
0018 }
0019
0020 inline void RPCAMCLinkCounters::reset(unsigned int event, RPCAMCLink const& link) {
0021 map_type::iterator pos(type_link_count_.find(std::pair<unsigned int, std::uint32_t>(event, link.getId())));
0022 if (pos != type_link_count_.end()) {
0023 type_link_count_.erase(pos);
0024 }
0025 }
0026
0027 inline RPCAMCLinkCounters::map_type const& RPCAMCLinkCounters::getCounters() const { return type_link_count_; }
0028
0029 #endif