[Rivet] scaling 2d histograms

Jonas Lindert lindert at physik.uzh.ch
Thu Oct 15 00:33:27 BST 2015


Hi Andy,

thanks a lot - this seems to work!

I will let you know if I have further issues with 2D histograms.

cheers,
Jonas



> On 14 Oct 2015, at 16:05, Andy Buckley <andy.buckley at cern.ch> wrote:
> 
> Hi Jonas,
> 
> Hmm, this does seem to be a bug. I'm not sure how the compiler allowed a method of Analysis to be declared but never defined, but that's what happened. In the development trunk I have added the lines below to src/Core/Analysis.cc <http://analysis.cc/> -- feel free to do the same to your local copy, and let us know if it works!
> 
> This will go into the next patch release. Thanks for the report, and please let us know if you have any more trouble with 2D histograms since until recently they haven't been used much in Rivet/YODA.
> 
> 
> Patch:
> ----
> 
>  void Analysis::normalize(Histo2DPtr histo, double norm, bool includeoverflows) {
>    if (!histo) {
>      MSG_ERROR("Failed to normalize histo=NULL in analysis " << name() << " (norm=" << norm << ")");
>      return;
>    }
>    MSG_TRACE("Normalizing histo " << histo->path() << " to " << norm);
>    try {
>      histo->normalize(norm, includeoverflows);
>    } catch (YODA::Exception& we) {
>      MSG_WARNING("Could not normalize histo " << histo->path());
>      return;
>    }
>  }
> 
> 
>  void Analysis::scale(Histo2DPtr histo, double scale) {
>    if (!histo) {
>      MSG_ERROR("Failed to scale histo=NULL in analysis " << name() << " (scale=" << scale << ")");
>      return;
>    }
>    if (std::isnan(scale) || std::isinf(scale)) {
>      MSG_ERROR("Failed to scale histo=" << histo->path() << " in analysis: " << name() << " (invalid scale factor = " << scale << ")");
>      scale = 0;
>    }
>    MSG_TRACE("Scaling histo " << histo->path() << " by factor " << scale);
>    try {
>      histo->scaleW(scale);
>    } catch (YODA::Exception& we) {
>      MSG_WARNING("Could not scale histo " << histo->path());
>      return;
>    }
>  }
> 
> ----
> 
> Cheers,
> Andy
> 
> 
> On 14/10/15 14:45, Jonas Lindert wrote:
>> Dear Rivet/Yoda Developers,
>> 
>> I have got a problem with 2D Histograms within Rivet 2.3. In particular
>> normalizing them via
>> 
>> scale (Histo2DPtr histo, double scale)
>> 
>> gives:
>> 
>> Rivet.Analysis.Handler: INFO  Finalising analyses
>> python: symbol lookup error: /zbox/user/lindert/rivet/RivetTwoD_test.so:
>> undefined symbol:
>> _ZN5Rivet8Analysis5scaleEN5boost10shared_ptrIN4YODA7Histo2DEEEd
>> 
>> where I use the standalone version of Rivet.
>> 
>> Attached you find an example including an hepmc file.
>> 
>> Am I using 2D histograms in a wrong way or is there a bug in Rivet/Yoda?
>> 
>> 
>> cheers,
>> Jonas
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Rivet mailing list
>> Rivet at projects.hepforge.org <mailto:Rivet at projects.hepforge.org>
>> https://www.hepforge.org/lists/listinfo/rivet <https://www.hepforge.org/lists/listinfo/rivet>
>> 
> 
> 
> -- 
> Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
> Particle Physics Expt Group, University of Glasgow

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20151015/9c5ea1f1/attachment.html>


More information about the Rivet mailing list