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 
37  // get name of the hashed element
38  using Mapper::getName;
39  std::string getName(HcalDetId const &did) const override { return hashfunctions::name_did[_htype](did); }
40  std::string getName(HcalElectronicsId const &eid) const override {
42  }
43  std::string getName(HcalTrigTowerDetId const &tid) const override {
45  }
46 
47  // get the Hash Type Name
49  virtual hashfunctions::HashType getHashType() const { return _htype; }
50 
51  // determine the type of the hash
52  virtual bool isDHash() const { return _htype < hashfunctions::nHashType_did ? true : false; }
53  virtual bool isEHash() const {
55  }
56  virtual bool isTHash() const {
58  }
59 
60  // get the Linear Hash Type
61  virtual int getLinearHashType(hashfunctions::HashType htype) const {
62  int l = 0;
63  if (htype < hashfunctions::nHashType_did)
64  l = htype;
65  else if (htype < hashfunctions::nHashType_eid)
66  l = htype - 1;
67  else
68  l = htype - 2;
69  return l;
70  }
71 
72  protected:
74  };
75  } // namespace mapper
76 } // namespace hcaldqm
77 
78 #endif
hcaldqm::mapper::HashMapper::getLinearHashType
virtual int getLinearHashType(hashfunctions::HashType htype) const
Definition: HashMapper.h:61
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:135
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:52
hcaldqm::hashfunctions::HashType
HashType
Definition: HashFunctions.h:122
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:73
hcaldqm::hashfunctions::hash_names
const std::string hash_names[nhashes]
Definition: HashFunctions.h:214
hcaldqm::hashfunctions::hash_eid
const hash_function_eid hash_eid[nHashType_eid - nHashType_did - 1]
Definition: HashFunctions.h:175
hcaldqm::mapper::HashMapper::getName
std::string getName(HcalDetId const &did) const override
Definition: HashMapper.h:39
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:56
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:43
hcaldqm::hashfunctions::hash_did
const hash_function_did hash_did[nHashType_did]
Definition: HashFunctions.h:163
hcaldqm::mapper::HashMapper::getName
std::string getName(HcalElectronicsId const &eid) const override
Definition: HashMapper.h:40
hcaldqm::hashfunctions::nHashType_tid
Definition: HashFunctions.h:154
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
funct::true
true
Definition: Factorize.h:173
hcaldqm::hashfunctions::name_tid
const name_function_tid name_tid[nHashType_tid - nHashType_eid - 1]
Definition: HashFunctions.h:211
hcaldqm::hashfunctions::hash_tid
const hash_function_tid hash_tid[nHashType_tid - nHashType_eid - 1]
Definition: HashFunctions.h:186
HcalDetId
Definition: HcalDetId.h:12
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
hcaldqm::mapper::Mapper::getName
virtual std::string getName(HcalDetId const &) const
Definition: Mapper.h:30
hcaldqm::mapper::HashMapper::getHashType
virtual hashfunctions::HashType getHashType() const
Definition: HashMapper.h:49
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
HashFunctions.h
hcaldqm::hashfunctions::nHashType_eid
Definition: HashFunctions.h:147
hcaldqm::mapper::HashMapper::getHashTypeName
virtual std::string getHashTypeName() const
Definition: HashMapper.h:48
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:188
hcaldqm::mapper::HashMapper::HashMapper
HashMapper(hashfunctions::HashType htype)
Definition: HashMapper.h:21
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:53
hcaldqm::hashfunctions::name_eid
const name_function_eid name_eid[nHashType_eid - nHashType_did - 1]
Definition: HashFunctions.h:200
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14