Re: [ROOT] questions on histogram errors

From: Stephane Plaszczynski (plaszczy@lal.in2p3.fr)
Date: Thu Sep 18 2003 - 13:11:37 MEST


--On Thursday, September 18, 2003 12:02:44 PM +0200 Rene Brun 
<Rene.Brun@cern.ch> wrote:

> I don't know what you mean by sigma_y?
> If you just want to draw a set of points with eerrors, use TGraphErrors
> TGraphErrors(n,x,y,ex,ey)


OK. So I guess my question is whether there is an "automated" way of 
creating this Graph directly from the ntuple entries (I am used to a tool 
that can do it): something like Draw("y:x") but where each point displayed 
would have an error bar given by two other ntuple entries "sigmax,sigmay"?

>
II tried the following unamed script (following your suggestion). It is in 
"myscript.C"
I log in interactively to root and type
.x myscript.C
but the ntuple points do not appear....

I can send you the root file but it is very basic.

Could it be because I draw a TH1 and try to project a TH2-like onto it? but 
why does it work interactively?...

{
TFile *f = new TFile("wmap_fisher.root");
TH1 *hfcl = (TH1*)f->Get("hfcl");
TTree *cl = (TTree*)f->Get("cl");

c1 = new TCanvas("c1","plots",600,600);
gPad->SetBottomMargin(0.15);
gPad->SetLeftMargin(0.16);

hfcl->SetStats(kFALSE);

//titre
hfcl->SetTitleSize(0.05, "x");
hfcl->SetTitleOffset(1., "x");
hfcl->SetTitleSize(0.05, "y");
hfcl->SetTitleOffset(1.5, "y");
hfcl->GetXaxis()->SetTitle("l");
hfcl->GetYaxis()->SetTitle("l(l+1)C_{l}/2#pi  (#muK^{2})");


hfcl->SetLineStyle(1);
hfcl->SetLineWidth(1);
hfcl->SetLineColor(13);
hfcl->SetFillColor(13);

hfcl->Draw();
hcl->SetLineColor(16);

cl->Draw("y:x","","same");
////////////////////

c1->Update();
}


-------------------------------------------------------------------
S. Plaszczynski
Laboratoire de l'accélérateur linéaire   tel: 01 64 46 85 38
Centre d'Orsay- bat 200                    fax: 01 64 46 83 97
BP34- 91989 ORSAY cedex
-------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET