[ROOT] Add Histograms

From: matthew dunseth wood (mdwood@midway.uchicago.edu)
Date: Fri Aug 09 2002 - 21:09:31 MEST


I am trying to add two histograms that I generated with TTree::Draw.  The
commands I typed are as follows:

TFile f("atlfast.root");
TTree *t1 = (TTree*)f.Get("Atlfast/50");

t1->Draw("APHOE>>h1");
t1->Draw("BPHOE>>h2");

h1->Add(h2);

When I attempt to add the histograms I get the following:

Error: Symbol h2 is not defined in current scope 
FILE:/tmp/filewYtM0M_cint LINE:1
*** Interpreter error recovered ***

Why is h2 not defined in current scope?  For that matter what is the
current scope?  My knowledge of C++ is quite rudimentary so excuse me if
the answer to this is obvious.

Matthew Wood



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:03 MET