File indexing completed on 2024-04-06 12:07:28
0001 #ifndef HashFilter_h
0002 #define HashFilter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "DQM/HcalCommon/interface/HashMapper.h"
0013
0014 #include <unordered_set>
0015 #include <vector>
0016
0017 namespace hcaldqm {
0018 namespace filter {
0019 enum FilterType { fFilter = 0, fPreserver = 1, nFilterType = 2 };
0020
0021 class HashFilter : public mapper::HashMapper {
0022 public:
0023 HashFilter() : _ftype(fFilter) {}
0024
0025 HashFilter(FilterType ftype, hashfunctions::HashType htype);
0026
0027 HashFilter(FilterType, hashfunctions::HashType, std::vector<uint32_t> const &);
0028
0029 HashFilter(HashFilter const &hf);
0030 ~HashFilter() override {}
0031 virtual void initialize(FilterType ftype, hashfunctions::HashType htype, std::vector<uint32_t> const &);
0032 using mapper::HashMapper::initialize;
0033
0034
0035
0036
0037 virtual bool filter(HcalDetId const &) const;
0038 virtual bool filter(HcalElectronicsId const &) const;
0039 virtual bool filter(HcalTrigTowerDetId const &) const;
0040
0041 virtual void print();
0042
0043 protected:
0044 FilterType _ftype;
0045 typedef std::unordered_set<uint32_t> FilterMap;
0046 FilterMap _ids;
0047
0048 virtual bool preserve(uint32_t) const;
0049 virtual bool skip(uint32_t) const;
0050 };
0051 }
0052 }
0053
0054 #endif