Hi,
I’m attempting to write a class where a RooHistPdf is a data member, but the histogram on which it is based isn’t defined until after initialization. I’ve been attempting to use a RooDataHist and the importTH1 function to achieve this. The behavior of this is rather fickle, and I don’t know why: sometimes importTH1 works, sometimes it segfaults, sometimes it flips the distribution negative (!), sometimes the functionality depends on the number of bins in the histogram.
I imagine the problem is not with the importTH1 method, but with something that I’m doing wrong. Unfortunately, I have no idea what it is…
Can someone tell me what I need to change? I have attached the code.
Test.h (421 Bytes)
Test.cxx (989 Bytes)