Re: summation of histograms

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Mon, 30 Jan 2006 21:29:43 +0100 (MET)


Do, for example

TFile *f1 = new TFile("file1.root");
TH1 *h1 = (TH1*)f1->Get("myhist");
TFile *f2 = new TFile("file2.root");
TH1 *h2 = (TH1*)f2->Get("myhist");
h1->Add(h2);
h1->Add(h2,-1);
TH1F h3 = (*h1) + (*h2);

Rene Brun

On Mon, 30 Jan 2006, nasim wrote:

>
> Hi,
>
> If we have two or more written histograms with the same name in two
> different files. how we can find the sum of these histograms (H1+H2+...)or
> (H1-H2);
>
> Thanks for any help.
>
> Nasim.
>
Received on Mon Jan 30 2006 - 21:31:55 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET