Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HcalDQM - Separating HO and HB in depth plots (11_1_X backport) #31479

Merged
merged 1 commit into from Sep 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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