[Rivet] problem with Analysis::divide?

James Monk jmonk at hep.ucl.ac.uk
Mon Dec 10 18:30:52 GMT 2012


Hi,

I think there's a problem with the histogram divide method on the YODA-fied version of Rivet.  It takes a pointer to a scatter plot for the result, thus:

	  void Analysis::divide(const Histo1D & h1, const Histo1D & h2, Scatter2DPtr s) const

and then assigns 

	*s = h1 / h2;

but that / operator returns a temporary that is not valid outside of the divide method.  I'm not sure what the intent is here - should it be 

	s = new Scatter2DPtr(h1 / h2);

but in that case, why not do away with passing the pointer in and just return it? 

cheers,

James


More information about the Rivet mailing list