Writing TGraph with its histogram to TFile

Dear rooters,
I dont know if this is a bug or a feature:
I try to write a TGraph for which I set a selfmade histo to TFile
(see att macro) This crashes in TClass::Streamer
With the auto generated histo it works
Cheers
Otto
twg.C (362 Bytes)

Hi Otto,

In your script replace the line

TH1D * hist = new TH1D("htemp", "ttt", 100, 0, 3); by

TH1F * hist = new TH1F("htemp", "ttt", 100, 0, 3);
TGraph expects a TH1F pointer. In principle it could be just a TH1 (we will fix that)

Rene

Hi Rene,
thanks for the quick answer,.
In our “real application” we used a TH1D, since the axis was a timescale implying huge numbers.
Cheers
Otto