[ROOT] Re:

From: Perrot Luc (perrot@isn.in2p3.fr)
Date: Tue Aug 07 2001 - 20:51:45 MEST


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.
>
> I will be grateful for any help.
>         Zibi
>

    Hi,

Hi, you can find here a example:
{

    TFile *pfic_root = new TFile("file.root","READ");

     TH1F *h_1 = (TH1F*)pfic_root->Get("h_1_dans_root_file");
        h_1->SetName("h_1");
        h_1->SetDirectory(0);
   TH1F *h_2 = (TH1F*)pfic_root->Get("h_2_dans_root_file");
        h_2->SetName("h_2");
        h_2->SetDirectory(0);
    pfic_root->Close();

    h_1->Draw();
    h_2->Draw("same");

}


---------------------------------------------
Luc Perrot
Etudiant doctorant (PhD)
Groupe Reacteurs Hybrides
53 Avenue des Martyrs 38026 Grenoble Cedex France
tel : 04 76 28 40 93
---------------------------------------------



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