[ROOT] Problems with output of Tree:Draw giving into histogram

From: Alexander Dietz (adietz@mickey.mpi-hd.mpg.de)
Date: Wed Jul 31 2002 - 14:27:46 MEST


Hi Rooters,

I have the following code:

 TCanvas* c1=new TCanvas("c1","c1",10,10,800,600);
  TFile f("Event.root");
  T->SetMarkerStyle(7);

  // draw picture 1
  T->Draw("fNvertex:fNtrack>>htemp");
  c1->Print("test1.ps");

  TH1F* htemp=(TH1F*)gDirectory->Get("htemp");
  htemp->SetTitle("title");
  htemp->Draw();
  htemp->GetXaxis()->SetTitle("title1");
  htemp->GetYaxis()->SetTitle("title2");

  // draw picture 2
  c1->Print("test2.ps");

I create a picture with a tree, give the output into a histogram and draw
the histogram.
While doing that, 'test1.ps' stores the output from the Tree:Draw and
'test2.ps' stores the output from TH1F:Draw.
When you compare the two pictures you will find that they are completely
different!

My questions are:

1. How to give the output of a Tree:Draw into a histogram to draw exactly
the same picture

2. Or how can I set titles to axis when drawing a tree? (There is no
command TTree::GetXaxis() or similar..

Cheers

	Alex



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