I have a class that contains a vector<TH1*>. When I Write() the class to a file and read it back, it appears to work but I also get messages of:
Error in TClass::New: cannot create object of class TH1
Is there something I can do to remove these messages? I’ve attached a simple compiled macro that reproduces the error message. Thanks! test_vector_hist.C (621 Bytes)
Do you mean only put TH1Fs into the vector? Unfortunately, the file I’m reading into the vector has both TH1Fs and TH1Ds. Or do you mean use a TH1F* even for the TH1Ds? Does this even work, since it is not the base class of TH1D?
Is there an easy way to construct a TH1D from a TH1F (same internals, just copy the floats to doubles)? That would present an easier solution when reading in the file.
[quote]Do you mean only put TH1Fs into the vector? Unfortunately, the file I’m reading into the vector has both TH1Fs and TH1Ds.[/quote]Humm, no. If you have both then your option are only either to ignore the message or to upgrade to the head of the trunk (or to patch your download of ROOT with the patch I made in revision 30890).