Hello,
I’m stuck and I need some help. I’m trying to write to a file a TClonesArray with an array of float as object but because TArrayF are not TObjects I use TH1F… so my problem is correctly write (and then read back) a TClonesArray of TH1F. I wrote 2 simple macro which illustrate my problem: what I’m not able to do is to reset the TH1F… it looks like each time I instantiate the TH1F, the histogram is not reset and all the bins keep the previous value adding the new TH1F to the old one…
tmpHisto = (TH1F*)muoHits->ConstructedAt(n);
I tried different solutions but I was not able to find the correct way to implement what I’d like to do. So if you run first the macro testTClonesArraty.cpp, you write to disk the file out.root with the TClonesArray and then readTClonesArraty.cpp read it back… but what I get is not what I intended to write… What am I doing wrong?
Thanks for helping…
Attilio
testTClonesArraty.cpp (1.1 KB)
readTClonesArraty.cpp (974 Bytes)