TH1F to TH1D conversion

Hi ROOT gurus,

Is it possible to convert a TH1F histogram to TH1D? If not, what would be the syntax to create a new TH1D histogram with the same entries as the old TH1F histogram?

I have searched for examples of this but have been unable to find any. Thanks in advance!

Will

2 Likes

[code]TH1F h1F…


TH1D h1D;
h1F.Copy(h1D);
[/code]

Well, this will also copy the name and title, I’m not sure if it’s ok for you.

Thank you tpochep. That is exactly what I was looking for.

Cheers,
Will