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

Fix failure during merge when histogram limits are invalid #5671

Merged
merged 2 commits into from Oct 6, 2014
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
9 changes: 7 additions & 2 deletions DataFormats/Histograms/interface/MEtoEDMFormat.h
Expand Up @@ -113,10 +113,15 @@ class MEtoEDM
MEtoEdmObject[j].object.GetYaxis()->GetXmax() == newMEtoEDMObject[i].object.GetYaxis()->GetXmax() &&
MEtoEdmObject[j].object.GetNbinsZ() == newMEtoEDMObject[i].object.GetNbinsZ() &&
MEtoEdmObject[j].object.GetZaxis()->GetXmin() == newMEtoEDMObject[i].object.GetZaxis()->GetXmin() &&
MEtoEdmObject[j].object.GetZaxis()->GetXmax() == newMEtoEDMObject[i].object.GetZaxis()->GetXmax()) {
MEtoEdmObject[j].object.GetZaxis()->GetXmax() == newMEtoEDMObject[i].object.GetZaxis()->GetXmax() &&
// Also check that the min is less than the max. Root allows this to be booked but then
// crashes when it adds them.
(MEtoEdmObject[j].object.GetXaxis()->GetXmin() < MEtoEdmObject[j].object.GetXaxis()->GetXmax()) &&
(MEtoEdmObject[j].object.GetYaxis()->GetXmin() < MEtoEdmObject[j].object.GetYaxis()->GetXmax()) &&
(MEtoEdmObject[j].object.GetZaxis()->GetXmin() < MEtoEdmObject[j].object.GetZaxis()->GetXmax())) {
MEtoEdmObject[j].object.Add(&newMEtoEDMObject[i].object);
} else {
std::cout << "ERROR MEtoEDM::mergeProducts(): found histograms with different axis limits, '" << name << "' not merged" << std::endl;
std::cout << "ERROR MEtoEDM::mergeProducts(): found histograms with different or invalid axis limits, '" << name << "' not merged" << std::endl;
#if debug
std::cout << MEtoEdmObject[j].name << " " << newMEtoEDMObject[i].name << std::endl;
std::cout << MEtoEdmObject[j].object.GetNbinsX() << " " << newMEtoEDMObject[i].object.GetNbinsX() << std::endl;
Expand Down