Skip to content

Commit

Permalink
Merge pull request #31479 from lwang046/split-HOdepth
Browse files Browse the repository at this point in the history
HcalDQM - Separating HO and HB in depth plots (11_1_X backport)
  • Loading branch information
cmsbuild committed Sep 17, 2020
2 parents fe67bdf + a19dd60 commit a2fe219
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions DQM/HcalCommon/src/HashFunctions.cc
Expand Up @@ -33,7 +33,12 @@ namespace hcaldqm {

uint32_t hash_ieta(HcalDetId const &did) { return utilities::hash(HcalDetId(HcalBarrel, did.ieta(), 1, 1)); }

uint32_t hash_depth(HcalDetId const &did) { return utilities::hash(HcalDetId(HcalBarrel, 1, 1, did.depth())); }
uint32_t hash_depth(HcalDetId const &did) {
if (did.subdet() == HcalOuter)
return 9; // key of map, can be any uint32_t valure that is not a raw hcal detid
else
return utilities::hash(HcalDetId(HcalBarrel, 1, 1, did.depth()));
}

uint32_t hash_HFPMiphi(HcalDetId const &did) {
return utilities::hash(HcalDetId(HcalForward, did.ieta() > 0 ? 1 : -1, did.iphi(), 1));
Expand Down Expand Up @@ -169,13 +174,19 @@ namespace hcaldqm {

std::string name_depth(HcalDetId const &did) {
char name[10];
sprintf(name, "depth%d", did.depth());
if (did.subdet() == HcalOuter)
sprintf(name, "depthHO");
else
sprintf(name, "depth%d", did.depth());
return std::string(name);
}

uint32_t hash_depth(std::string const &name) {
int depth = std::stoi(name.substr(5, name.length() - 5), nullptr);
return HcalDetId(HcalBarrel, 1, 1, depth).rawId();
if (name.find("HO") != std::string::npos)
return 9; // must match the value in method hash_depth(& digi)
else
return HcalDetId(HcalBarrel, 1, 1, depth).rawId();
}

std::string name_HFPMiphi(HcalDetId const &did) {
Expand Down

0 comments on commit a2fe219

Please sign in to comment.