[ROOT] TH1::GetHistogram()

From: Rajat Bhatnagar (rajb@SLAC.stanford.edu)
Date: Fri Jul 05 2002 - 20:48:19 MEST


Hi,

I'm trying to use the TH1::GetHistogram() method to get a histogram fitted
to a certain formula.  Using the simplest case I could think of, I tried

root [0] TF1* identity = new TF1("identity", "1", 0., 10.);
root [1] TCanvas c_new;
root [2] TH1F* idH = (TH1F*) identity->GetHistogram();
root [3] idH->Draw();
Error: illegal pointer to class object idH 0x0 136
FILE:/tmp/fileAGKUbL_cint LINE:1
*** Interpreter error recovered ***

but got the error above.  Any suggestions on what to do?

Also, I noticed that if a TCanvas does not already exist, there is a
segmentation violation.  Does anyone have thoughts on how to work around
this?

Thanks,
Raj Bhatnagar



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