Re: dynamical versus non dynamical for TH1F

From: John Idarraga <idarraga_at_cern.ch>
Date: Sat, 23 Jan 2010 22:16:40 -0500


Also, if you are using a lot of memory with any kind of objects or basic types (ex. huge arrays), you need to allocate your objects with the 'new' operator.

cheers,

John

On Sat, 2010-01-23 at 17:48 +0100, Marc Escalier wrote:
> Hello,
>
> i'm using a basic root program (.C) that allows to make some
> histograms of variables of a given ntuple (a .root file)
>
> Up to now, i created the histogram dynamically with
> TH1F *myhisto=new TH1F(...)
>
> i was wondering what it the more optimal (in terms of memory, cpu usage,
> or any other criterious you know better than me) way to do ? :
>
> *this kind of dynamical allocation
>
> or
>
> *a non dynamical allocation
> (i mean :
> TH1F myhisto(...)
> )
>
> (just in case : i do always the same plots and there variables
> are always in the ntuple)
>
> thanks !
>
> (i'll reply in private to answers to prevent spamming you all)
>
Received on Sun Jan 24 2010 - 04:16:49 CET

This archive was generated by hypermail 2.2.0 : Sun Jan 24 2010 - 05:50:02 CET