|
[Rivet] [Rivet-svn] r1768 - in trunk: include/Rivet srcAndy Buckley andy.buckley at durham.ac.ukThu Aug 20 12:01:52 BST 2009
Hi Frank, Sorry I didn't have time to reply to your mail yet. Anyway, I have no issue with this change, as long as it doesn't affect the standard operation from the 'rivet' script, and the API remains clear. From the diff below, I think it's pretty obvious that that is the case. I don't see this being something that we would want to make use of as standard via the rivet script, but it's reassuring that once one wants to do something more involved than basic ol' "complete events streamed from the generator", Rivet is still usable as a library. Makes me feel like we did something right! The one thing that popped into my mind was that we are effectively "static-free" apart from the LWH histograms, since they write to one global histo tree. Did you find a way around that? The idea of writing multiple histograms for each analysis overlaps quite strongly with the multiple-weights implementation that James has been working on, and since both use-cases are driven by Sherpa maybe you can have a think about how to make this coherent? ;) Andy blackhole at projects.hepforge.org wrote: > Author: fsiegert > Date: Wed Aug 19 17:46:01 2009 > New Revision: 1768 > > Log: > Allow for setting the sum of weights from outside, so that one can use > Rivet for analysing sub-contributions in one run. > > Modified: > trunk/include/Rivet/AnalysisHandler.hh > trunk/src/AnalysisHandler.cc > > Modified: trunk/include/Rivet/AnalysisHandler.hh > ============================================================================== > --- trunk/include/Rivet/AnalysisHandler.hh Wed Aug 19 14:53:27 2009 (r1767) > +++ trunk/include/Rivet/AnalysisHandler.hh Wed Aug 19 17:46:01 2009 (r1768) > @@ -70,6 +70,12 @@ > /// or analyses in the finalize phase. > double sumOfWeights() const; > > + /// Set sum of weights. This is useful if Rivet is steered externally and > + /// the analyses are run for a sub-contribution of the events > + /// (but of course have to be normalised to the total sum of weights) > + void setSumOfWeights(const double& sum); > + > + > /// Get a list of the currently registered analyses' names. > std::vector<std::string> analysisNames(); > > > Modified: trunk/src/AnalysisHandler.cc > ============================================================================== > --- trunk/src/AnalysisHandler.cc Wed Aug 19 14:53:27 2009 (r1767) > +++ trunk/src/AnalysisHandler.cc Wed Aug 19 17:46:01 2009 (r1768) > @@ -218,6 +218,10 @@ > size_t AnalysisHandler::numEvents() const { return _numEvents; } > double AnalysisHandler::sumOfWeights() const { return _sumOfWeights; } > > + void AnalysisHandler::setSumOfWeights(const double& sum) { > + _sumOfWeights=sum; > + } > + > > std::vector<std::string> AnalysisHandler::analysisNames() { > std::vector<std::string> rtn; > _______________________________________________ > Rivet-svn mailing list > Rivet-svn at projects.hepforge.org > http://www.hepforge.org/lists/listinfo/rivet-svn
More information about the Rivet mailing list |