Re: Re: Add THnSparse problem

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Fri, 16 May 2008 18:04:05 +0200


Hi Smbat,

the bug was triggered by THnSparse objects read from file that got additional bins appended; it's fixed in the trunk. Thanks so much for pointing it out!

In your hadd script you commented the nextsource->cd( path ); line - uncomment it and it will work. Otherwise you are adding the first histogram to the first histogram. In your failing example the number of entries was twice the number of entries of the first histogram. BUT this will only work with the trunk, i.e. ROOT from today!

Btw, ROOT's hadd utility will soon add THnSparses, too.

Cheers, Axel.

On 2008-05-15 19:18, Axel Naumann wrote:

> Hi Smbat,
> 
> I see that in your example THnSpare::Add() writes to a memory location 
> that it shouldn't be writing to. I'll fix it tomorrow. It might or might 
> not be related to the problem with the number of entries you observed.
> 
> Cheers, Axel
> 
> 
> Smbat Grigoryan wrote:

>> Hi,
>>
>> I have the following problem when merging root files including
>> THnSparse. I've modified the hadd.C macro from the tutorials,
>> adding the part for THnSparse like it is done for histograms
>> (see Add.C in the attachment). To show the problem I included
>> in the attachment 2 root files containing THnSparse of dim 5
>> and the resulting root file obtained using Add.C. The problem is that
>> the number of entries of the resulting THnSparse is not equal (is
>> smaller) to the sum of entries of the initial THnSparse-s. In the
>> attachment you can find a
>> small macro which shows that the method THnSparse::Add() works
>> correctly when used directly, but not in Add.C.
>> Apparently the problem is in Add.C
>> Could anybody help to correct Add.C for THnSparse?
>>
>> Thanks in advance,
>> Smbat

>
> Received on Fri May 16 2008 - 18:04:08 CEST

This archive was generated by hypermail 2.2.0 : Fri May 16 2008 - 23:50:02 CEST