[Rivet-svn] rivet: trap case when histo is empty

Rivet Mercurial rivet at projects.hepforge.org
Thu May 24 21:00:02 BST 2018


details:   https://rivet.hepforge.org/hg/rivet/rev/4ef17cffcc6c
branches:  release-2-6-x
changeset: 6319:4ef17cffcc6c
user:      Jon Butterworth <j.butterworth at cern.ch>
date:      Thu May 24 20:56:55 2018 +0100
description:
trap case when histo is empty

diffs (19 lines):

--- a/analyses/pluginATLAS/ATLAS_2018_I1646686.cc	Thu May 24 11:37:03 2018 +0100
+++ b/analyses/pluginATLAS/ATLAS_2018_I1646686.cc	Thu May 24 20:56:55 2018 +0100
@@ -238,11 +238,15 @@
       //////////////////////////////////////////////////
 
       void finalize() {
+
+	cout << "finalising" << endl;
+
         // Normalize histograms
         const double sf = crossSection() / sumOfWeights();
         for (auto &hist : _h) {
+	  cout << hist.second << endl;
           scale(hist.second, sf);
-          if (hist.first.find("_norm") != string::npos)  hist.second->normalize(1.0, false);
+          if ((hist.first.find("_norm") != string::npos) && hist.second->integral(false)>0) hist.second->normalize(1.0, false);
         } 
       } // finalize
 


More information about the Rivet-svn mailing list