|
[Rivet-svn] rivet: Replace manual event count & weight handling with a YODA ...Rivet Mercurial rivet at projects.hepforge.orgMon Dec 11 11:30:02 GMT 2017
details: https://rivet.hepforge.org/hg/rivet/rev/88d7ad853a67 branches: changeset: 6168:88d7ad853a67 user: Andy Buckley <andy at insectnation.org> date: Mon Dec 11 11:16:06 2017 +0000 description: Replace manual event count & weight handling with a YODA Counter object. diffs (truncated from 121 to 50 lines): --- a/ChangeLog Sun Dec 10 21:50:03 2017 +0000 +++ b/ChangeLog Mon Dec 11 11:16:06 2017 +0000 @@ -1,3 +1,7 @@ +2017-12-11 Andy Buckley <andy.buckley at cern.ch> + + * Replace manual event count & weight handling with a YODA Counter object. + 2017-11-28 Andy Buckley <andy.buckley at cern.ch> * Providing neater & more YODA-consistent sumW and sumW2 methods on AnalysisHandler and Analysis. --- a/include/Rivet/AnalysisHandler.hh Sun Dec 10 21:50:03 2017 +0000 +++ b/include/Rivet/AnalysisHandler.hh Mon Dec 11 11:16:06 2017 +0000 @@ -59,20 +59,21 @@ /// Get the number of events seen. Should only really be used by external /// steering code or analyses in the finalize phase. - size_t numEvents() const { return _numEvents; } + size_t numEvents() const { return _eventcounter.numEntries(); } /// @brief Access the sum of the event weights seen /// /// This is the weighted equivalent of the number of events. It should only /// be used by external steering code or analyses in the finalize phase. - double sumW() const { return sumOfWeights(); } + double sumW() const { return _eventcounter.sumW(); } /// Access to the sum of squared-weights - double sumW2() const { return _sumOfWeightsSq; } + double sumW2() const { return _eventcounter.sumW2(); } /// @brief Compatibility alias for sumOfWeights /// /// @deprecated Prefer sumW - double sumOfWeights() const { return _sumOfWeights; } + double sumOfWeights() const { return sumW(); } + /// @brief Set the sum of weights /// /// This is useful if Rivet is steered externally and @@ -82,7 +83,13 @@ /// @todo What about the sumW2 term? That needs to be set coherently. Need a /// new version, with all three N,sumW,sumW2 numbers (or a counter) /// supplied. - void setSumOfWeights(const double& sum) { _sumOfWeights = sum; } + /// + /// @deprecated Weight sums are no longer tracked this way... + void setSumOfWeights(const double& sum) { + //_sumOfWeights = sum; + throw Error("Can't set sum of weights independently, since it's now tracked by a Counter. " + "Please contact the Rivet authors if you need this."); + }
More information about the Rivet-svn mailing list |