[Rivet-svn] rivet: Run-time errors if histo bookings are mishandled.

Rivet Mercurial rivet at projects.hepforge.org
Mon Sep 11 13:15:02 BST 2017


details:   https://rivet.hepforge.org/hg/rivet/rev/e3e86c124b92
branches:  multiweight
changeset: 6011:e3e86c124b92
user:      David Grellscheid <david.grellscheid at durham.ac.uk>
date:      Mon Sep 11 13:07:05 2017 +0100
description:
Run-time errors if histo bookings are mishandled.

diffs (truncated from 448 to 50 lines):

--- a/configure.ac	Fri Sep 08 15:11:38 2017 +0100
+++ b/configure.ac	Mon Sep 11 13:07:05 2017 +0100
@@ -53,7 +53,7 @@
 AC_DISABLE_STATIC
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
-
+AX_EXECINFO
 
 ## YODA histogramming library
 AC_CEDAR_LIBRARYANDHEADERS([YODA], , , [AC_MSG_ERROR([YODA is required])])
--- a/include/Rivet/Analyses/MC_JetAnalysis.hh	Fri Sep 08 15:11:38 2017 +0100
+++ b/include/Rivet/Analyses/MC_JetAnalysis.hh	Mon Sep 11 13:07:05 2017 +0100
@@ -50,6 +50,7 @@
     std::vector<Histo1DPtr> _h_rap_jet;
     std::vector<Histo1DPtr> _h_rap_jet_plus, _h_rap_jet_minus;
     std::vector<Histo1DPtr> _h_mass_jet;
+    std::vector<Scatter2DPtr> tmpeta, tmprap;
     std::map<std::pair<size_t, size_t>, Histo1DPtr> _h_deta_jets;
     std::map<std::pair<size_t, size_t>, Histo1DPtr> _h_dphi_jets;
     std::map<std::pair<size_t, size_t>, Histo1DPtr> _h_dR_jets;
--- a/include/Rivet/AnalysisHandler.hh	Fri Sep 08 15:11:38 2017 +0100
+++ b/include/Rivet/AnalysisHandler.hh	Mon Sep 11 13:07:05 2017 +0100
@@ -209,8 +209,16 @@
 
     //@}
 
+    /// Indicate which Rivet stage we're in. 
+    /// At the moment, only INIT is used to enable booking.
+    enum class Stage { OTHER, INIT };
+
+    /// Which stage are we in?
+    Stage stage() const { return _stage; }
 
   private:
+    /// Current handler stage
+    Stage _stage = Stage::OTHER;
 
     /// The collection of Analysis objects to be used.
     set<AnaHandle, CmpAnaHandle> _analyses;
--- a/include/Rivet/Tools/RivetYODA.hh	Fri Sep 08 15:11:38 2017 +0100
+++ b/include/Rivet/Tools/RivetYODA.hh	Mon Sep 11 13:07:05 2017 +0100
@@ -46,6 +46,8 @@
             /// rename to setActive(Idx)?
             virtual void setActiveWeightIdx(unsigned int iWeight) = 0;
 
+            virtual void blockDestructor(bool) = 0;
+
             bool operator ==(const AnalysisObjectPtr& p) { return (this == &p); }
 


More information about the Rivet-svn mailing list