Re: Copying a histogram.
Rene Brun (Rene.Brun@cern.ch)
Wed, 10 Mar 1999 11:17:51 +0000
Sean Kelly wrote:
>
> Hi Rooters,
>
> I realize this has been the subject of previous posts. My question is
> does the code frag below represent the simplest way to duplicate
> a histogram ?
>
> TH1F *vxDHi = (TH1F*) vx->Clone();
> vxDHi->SetName("vxDHi");
>
> thanks
>
> Sean Kelly
Yes, This is the recommended way. TH1::Clone make sure that all the data
structure supported by a TH1 object is copied.
Rene Brun