[Rivet-svn] rivet: 2 new changesets

Rivet Mercurial rivet at projects.hepforge.org
Fri Oct 6 16:00:02 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/8eaef5080f96
branches:  multiweight
changeset: 6081:8eaef5080f96
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Fri Oct 06 15:31:05 2017 +0100
description:
Fix analysis crashes

details:   https://rivet.hepforge.org/hg/rivet/rev/45880ab462dd
branches:  multiweight
changeset: 6082:45880ab462dd
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Fri Oct 06 15:48:01 2017 +0100
description:
Re-enable first Binnedhisto analysis after the rivet_shared_ptr change. Setup is still ugly but works.

diffs (truncated from 524 to 50 lines):

--- a/analyses/pluginATLAS/ATLAS_2014_I1288706.cc	Wed Oct 04 12:34:22 2017 +0100
+++ b/analyses/pluginATLAS/ATLAS_2014_I1288706.cc	Fri Oct 06 15:48:01 2017 +0100
@@ -58,6 +58,7 @@
     void FillPlots(const ZFinder& zfinder, Histo1DPtr hist, double leading_pT) {
 
       if(zfinder.bosons().size() != 1) return;
+      if(zfinder.particles().size() < 2) return;
 
       const FourMomentum el1 = zfinder.particles()[0].momentum();
       const FourMomentum el2 = zfinder.particles()[1].momentum();
--- a/analyses/pluginATLAS/ATLAS_2016_I1419070.cc	Wed Oct 04 12:34:22 2017 +0100
+++ b/analyses/pluginATLAS/ATLAS_2016_I1419070.cc	Fri Oct 06 15:48:01 2017 +0100
@@ -97,9 +97,9 @@
           ydiff2 -= forward_2GeV->bin(i).numEntries()?   forward_2GeV->bin(i).mean()   : 0.0;
           ydiff5 -= forward_5GeV->bin(i).numEntries()?   forward_5GeV->bin(i).mean()   : 0.0;
 
-          double yerr  = bsum.numEntries()?  bsum.stdErr()  : 0.0;
-          double yerr2 = bsum2.numEntries()? bsum2.stdErr() : 0.0;
-          double yerr5 = bsum5.numEntries()? bsum5.stdErr() : 0.0;
+          double yerr  = bsum.numEntries()  > 1.0 ?  bsum.stdErr() : 0.0;
+          double yerr2 = bsum2.numEntries() > 1.0 ? bsum2.stdErr() : 0.0;
+          double yerr5 = bsum5.numEntries() > 1.0 ? bsum5.stdErr() : 0.0;
 
 	      diff_500MeV->point(i).setY(ydiff, yerr);
           diff_2GeV->point(i).setY(ydiff2, yerr2);
--- a/analyses/pluginCMS/CMS_2014_I1305624.cc	Wed Oct 04 12:34:22 2017 +0100
+++ b/analyses/pluginCMS/CMS_2014_I1305624.cc	Fri Oct 06 15:48:01 2017 +0100
@@ -121,6 +121,16 @@
         book(_h_tottrnsmass[ij] ,1, 4, ij+1);
         book(_h_y23c[ij] ,1, 5, ij+1);
         //
+      }
+      _needBinInit = true;
+    }
+
+
+    /// Perform the per-event analysis
+    void analyze(const Event& event) {
+
+      if (_needBinInit) {
+      	for (int ij=0; ij < NJETPTMN; ij++) {
         _alow1[ij] = _h_thrustc[ij]->xMin();
         _alow2[ij] = _h_broadt[ij]->xMin();
         _alow3[ij] = _h_tot3dmass[ij]->xMin();
@@ -132,12 +142,10 @@
         _ahgh3[ij] = _h_tot3dmass[ij]->xMax();
         _ahgh4[ij] = _h_tottrnsmass[ij]->xMax();
         _ahgh5[ij] = _h_y23c[ij]->xMax();
+
+        _needBinInit = false;


More information about the Rivet-svn mailing list