[ROOT] Re: your mail

From: Patois Yannick (patois@ganil.fr)
Date: Tue Aug 07 2001 - 21:18:31 MEST


On Tue, 7 Aug 2001, Chejeck subatech etudiant polonais wrote:

> 
>  Hello,
> 
>  I have a litle problem. I take two histograms from two different files
> *.root, and I'd like to have these ones one the same graph to compare
> them. Maybe it's very easy what I'm asking but I spent few hours, I'was
> looking for help on root's sites, but I didn't find it.

Hi, 

This is what you may want:
<<< File smalltest.C
{
   TFile file1("data1.root");
   file1.cd();
   TH1 *h1 = (TH1*)gROOT->FindObject("myHisto1");
   h1->Draw();
   TFile file2("data2.root");
   file2.cd();
   TH1 *h2 = (TH1*)gROOT->FindObject("myHisto1");
   h2->Draw("same");
}
>>>

	Yannick



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:56 MET