CMS 3D CMS Logo

HashMapper.h
Go to the documentation of this file.
1 #ifndef HashMapper_h
2 #define HashMapper_h
3 
14 
15 namespace hcaldqm {
16  namespace mapper {
17  class HashMapper : public Mapper {
18  public:
19  // constructors/destructors
22  ~HashMapper() override {}
23 
24  // initialize
25  virtual void initialize(hashfunctions::HashType htype) { _htype = htype; }
26 
27  // get hash
28  using Mapper::getHash;
29  uint32_t getHash(HcalDetId const &did) const override { return hashfunctions::hash_did[_htype](did); }
30  uint32_t getHash(HcalElectronicsId const &eid) const override {
32  }
33  uint32_t getHash(HcalTrigTowerDetId const &tid) const override {
35  }
36  uint32_t getHash(HcalTrigTowerDetId const &tid, HcalElectronicsId const &eid) const override {
38  }
39 
40  // get name of the hashed element
41  using Mapper::getName;
42  std::string getName(HcalDetId const &did) const override { return hashfunctions::name_did[_htype](did); }
43  std::string getName(HcalElectronicsId const &eid) const override {
45  }
46  std::string getName(HcalTrigTowerDetId const &tid) const override {
48  }
49  std::string getName(HcalTrigTowerDetId const &tid, HcalElectronicsId const &eid) const override {
51  }
52 
53  // get the Hash Type Name
55  virtual hashfunctions::HashType getHashType() const { return _htype; }
56 
57  // determine the type of the hash
58  virtual bool isDHash() const { return _htype < hashfunctions::nHashType_did ? true : false; }
59  virtual bool isEHash() const {
61  }
62  virtual bool isTHash() const {
64  }
65  virtual bool isMixHash() const {
67  }
68 
69  // get the Linear Hash Type
70  virtual int getLinearHashType(hashfunctions::HashType htype) const {
71  int l = 0;
72  if (htype < hashfunctions::nHashType_did)
73  l = htype;
74  else if (htype < hashfunctions::nHashType_eid)
75  l = htype - 1;
76  else if (htype < hashfunctions::nHashType_tid)
77  l = htype - 2;
78  else
79  l = htype - 3;
80  return l;
81  }
82 
83  protected:
85  };
86  } // namespace mapper
87 } // namespace hcaldqm
88 
89 #endif
hcaldqm::mapper::HashMapper::getLinearHashType
virtual int getLinearHashType(hashfunctions::HashType htype) const
Definition: HashMapper.h:70
hcaldqm::mapper::Mapper
Definition: Mapper.h:21
hcaldqm::mapper::Mapper::getHash
virtual uint32_t getHash(HcalDetId const &) const
Definition: Mapper.h:26
hcaldqm::hashfunctions::nHashType_did
Definition: HashFunctions.h:144
hcaldqm::mapper::HashMapper::getHash
uint32_t getHash(HcalDetId const &did) const override
Definition: HashMapper.h:29
hcaldqm::mapper::HashMapper::isDHash
virtual bool isDHash() const
Definition: HashMapper.h:58
hcaldqm::hashfunctions::HashType
HashType
Definition: HashFunctions.h:131
hcaldqm::mapper::HashMapper::~HashMapper
~HashMapper() override
Definition: HashMapper.h:22
hcaldqm
Definition: Constants.h:8
hcaldqm::mapper::HashMapper::_htype
hashfunctions::HashType _htype
Definition: HashMapper.h:84
hcaldqm::hashfunctions::hash_names
const std::string hash_names[nhashes]
Definition: HashFunctions.h:230
hcaldqm::hashfunctions::hash_eid
const hash_function_eid hash_eid[nHashType_eid - nHashType_did - 1]
Definition: HashFunctions.h:188
hcaldqm::mapper::HashMapper::getName
std::string getName(HcalDetId const &did) const override
Definition: HashMapper.h:42
hcaldqm::mapper::HashMapper::initialize
virtual void initialize(hashfunctions::HashType htype)
Definition: HashMapper.h:25
hcaldqm::mapper::HashMapper
Definition: HashMapper.h:17
hcaldqm::mapper::HashMapper::HashMapper
HashMapper()
Definition: HashMapper.h:20
hcaldqm::mapper::HashMapper::isTHash
virtual bool isTHash() const
Definition: HashMapper.h:62
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
hcaldqm::mapper::HashMapper::getName
std::string getName(HcalTrigTowerDetId const &tid) const override
Definition: HashMapper.h:46
hcaldqm::hashfunctions::hash_did
const hash_function_did hash_did[nHashType_did]
Definition: HashFunctions.h:176
hcaldqm::mapper::HashMapper::getName
std::string getName(HcalElectronicsId const &eid) const override
Definition: HashMapper.h:43
hcaldqm::hashfunctions::nHashType_tid
Definition: HashFunctions.h:163
funct::true
true
Definition: Factorize.h:173
hcaldqm::mapper::HashMapper::getName
std::string getName(HcalTrigTowerDetId const &tid, HcalElectronicsId const &eid) const override
Definition: HashMapper.h:49
hcaldqm::hashfunctions::name_tid
const name_function_tid name_tid[nHashType_tid - nHashType_eid - 1]
Definition: HashFunctions.h:225
hcaldqm::hashfunctions::hash_tid
const hash_function_tid hash_tid[nHashType_tid - nHashType_eid - 1]
Definition: HashFunctions.h:199
HcalDetId
Definition: HcalDetId.h:12
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
hcaldqm::mapper::HashMapper::isMixHash
virtual bool isMixHash() const
Definition: HashMapper.h:65
hcaldqm::mapper::Mapper::getName
virtual std::string getName(HcalDetId const &) const
Definition: Mapper.h:31
hcaldqm::mapper::HashMapper::getHashType
virtual hashfunctions::HashType getHashType() const
Definition: HashMapper.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
HashFunctions.h
hcaldqm::hashfunctions::nHashType_mixid
Definition: HashFunctions.h:165
hcaldqm::hashfunctions::nHashType_eid
Definition: HashFunctions.h:156
hcaldqm::hashfunctions::hash_mixid
const hash_function_mixid hash_mixid[nHashType_mixid - nHashType_tid - 1]
Definition: HashFunctions.h:201
hcaldqm::mapper::HashMapper::getHashTypeName
virtual std::string getHashTypeName() const
Definition: HashMapper.h:54
hcaldqm::mapper::HashMapper::getHash
uint32_t getHash(HcalElectronicsId const &eid) const override
Definition: HashMapper.h:30
Mapper.h
hcaldqm::hashfunctions::name_did
const name_function_did name_did[nHashType_did]
Definition: HashFunctions.h:202
hcaldqm::mapper::HashMapper::HashMapper
HashMapper(hashfunctions::HashType htype)
Definition: HashMapper.h:21
hcaldqm::hashfunctions::name_mixid
const name_function_mixid name_mixid[nHashType_mixid - nHashType_tid - 1]
Definition: HashFunctions.h:227
hcaldqm::mapper::HashMapper::getHash
uint32_t getHash(HcalTrigTowerDetId const &tid, HcalElectronicsId const &eid) const override
Definition: HashMapper.h:36
hcaldqm::mapper::HashMapper::getHash
uint32_t getHash(HcalTrigTowerDetId const &tid) const override
Definition: HashMapper.h:33
hcaldqm::mapper::HashMapper::isEHash
virtual bool isEHash() const
Definition: HashMapper.h:59
hcaldqm::hashfunctions::name_eid
const name_function_eid name_eid[nHashType_eid - nHashType_did - 1]
Definition: HashFunctions.h:214
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14