Re: Assignment operator of TClonesArray invalidates GetEntriesFast()

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Wed, 30 Mar 2011 12:44:42 +0200


Hi Vassili,

  I've made this correction.

Cheers, Fons.

On 30/03/2011 11:50, Vassili Maroussov wrote:
> Dear ROOTers,
>
> It seems there should be "fLast = tc.fLast" instead of "fLast = tc.fSize -
> 1" in the body of the TClonesArray assignment operator, otherwise
> GetEntriesFast() returns the capacity of assigned object instead of number
> of entries.
>
> Regards,
>
> Vassili
>
> [vmarouss_at_Ezhik-HDX18 PlayROOT]$ root
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 5.28/00a 21 February 2011 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> ROOT 5.28/00a (tags/v5-28-00a_at_38195, Feb 23 2011, 14:22:24 on linuxx8664gcc)
>
> CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0] .x testClones.C+
> Info in <TUnixSystem::ACLiC>: creating shared library
> /home/vmarouss/PlayROOT/./testClones_C.so
> Creating a TClonesArray T...
> Step 0: Capacity = 5 Count = 0
> Filling up 7 entries...
> Checking T:
> GetEntries = 7 GetEntriesFast = 7
> Capacity = 10 Data :
> X = 0 Y = -0
> X = 1 Y = -1
> X = 2 Y = -2
> X = 3 Y = -3
> X = 4 Y = -4
> X = 5 Y = -5
> X = 6 Y = -6
> Creating a TClonesArray T1...
> Assigning T1 = T...
> Deleting T...
> Checking T1:
> GetEntries = 7 GetEntriesFast = 10
> Capacity = 10 Data :
> X = 0 Y = -0
> X = 1 Y = -1
> X = 2 Y = -2
> X = 3 Y = -3
> X = 4 Y = -4
> X = 5 Y = -5
> X = 6 Y = -6
> root [1] .q
> [vmarouss_at_Ezhik-HDX18 PlayROOT]$
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640


Received on Wed Mar 30 2011 - 12:44:50 CEST

This archive was generated by hypermail 2.2.0 : Wed Mar 30 2011 - 17:50:01 CEST