[Rivet] scaling 2d histograms

Andy Buckley andy.buckley at cern.ch
Fri Nov 13 00:10:17 GMT 2015


Hi Jonas,

Sorry to have taken so long to look at this. I just used the trunk 
version of rivet-cmphistos (which hasn't changed recently) and YODA 
1.5.5, and in the resulting dat file the bin ratios have the same values 
that you said were correct.

I guess your version of a "correct" bin value is 
sum(weights)/x_width/y_height? (since the raw sum(w) values don't give 
the ratios that you quoted)

On plotting that .dat file, the output looks identical to what Holger 
sent, so I think our copies of Rivet & YODA agree.

I've attached my .dat file, maybe it helps. Otherwise I think just make 
sure that you are using the latest versions. The 2D histograms do still 
need some development work (which is all planned out), but I don't see a 
bug here...

Thanks for your patience,
Andy


On 16/10/15 16:37, Jonas Lindert wrote:
> Hi Holgar,
>
> for example in the yoda file I sent you the ratio between the bins
>
> ((30,100),(30,100)) / ((100,200),(30,100)) = 1.6800665396007495
> ((30,100),(30,100)) / ((100,200),(100,200)) = 10.362426278417804
>
> (which is correct)
>
> while in the dat-file from rivet-cmphisto the ratios are
>
> ((30,100),(30,100)) / ((100,200),(30,100)) = 1.1760461535641622
> ((30,100),(30,100)) / ((100,200),(100,200)) = 5.07758844116815
>
>
> cheers,
> Jonas
>
>
>
>
> On 10/16/15 14:23, Holger Schulz wrote:
>> On 16/10/15 10:46, Jonas Lindert wrote:
>>> Hi Andy,
>>>
>>> attached you find a yoda file with a 2D Histogram (and the result I
>>> get with rivet-cmphistos).
>> Hi Jonas,
>>
>> this is a bit hard to debug. Could you please tell me what shape/plot
>> you would expect?
>>
>> I attached the plot I get from you yoda file when setting LogZ=1.
>>
>> Maybe we can use that as a basis for discussion.
>>
>> Thanks,
>> Holger
>>>
>>> cheers,
>>> Jonas
>>>
>>>
>>>
>>>
>>> On 10/16/15 11:05, Andy Buckley wrote:
>>>> Hi Jonas,
>>>>
>>>> Could you send us a .yoda file with your 2D histogram in it, and
>>>> we'll do some testing / bugfixing? Thanks.
>>>>
>>>> Andy
>>>>
>>>>
>>>> On 15/10/15 23:56, Jonas Lindert wrote:
>>>>> Hi Andy,
>>>>>
>>>>> i’ve got another Problem with 2D Histograms. This time on the yoda
>>>>> side.
>>>>> The histogram rivet-cmphistos produces for a 2D yoda does not seem
>>>>> to be
>>>>> correct.
>>>>>
>>>>> Look at the attached yoda file and the resulting dat-file from
>>>>> rivet-cmphistos. The shape of the two histograms is completely
>>>>> different.
>>>>>
>>>>> cheers,
>>>>> Jonas
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On 15 Oct 2015, at 01:33, Jonas Lindert <lindert at physik.uzh.ch
>>>>>> <mailto:lindert at physik.uzh.ch>> wrote:
>>>>>>
>>>>>> 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
>>>>>>> <mailto: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
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
>>>>>>> Particle Physics Expt Group, University of Glasgow
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Rivet mailing list
>>> Rivet at projects.hepforge.org
>>> https://www.hepforge.org/lists/listinfo/rivet
>>
>
>
> --
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Dr. Jonas Lindert
> Universitaet Zuerich
> Institut fuer Theoretische Physik
> Winterthurerstrasse 190
> CH-8057 Zuerich                  Email:lindert at physik.uzh.ch
> Switzerland                      Web:http://www.physik.uzh.ch/~lindert
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>


-- 
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
Particle Physics Expt Group, University of Glasgow
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_2d_pTj1__pTj2.dat
Type: application/x-ns-proxy-autoconfig
Size: 4784 bytes
Desc: not available
URL: <https://www.hepforge.org/lists-archive/rivet/attachments/20151113/222057f0/attachment.dat>


More information about the Rivet mailing list