Okay, this is indeed very useful and will save me some memory if I can put it to the correct use. Thanks. However, I have problem, that I think can be fixed. I just don’t know how.
In my macro I want to store the THnSparse in some file. (This is why I wanted to compress the information in the first place. The file has to be small.) This is done by making the THnSparse a datamember of my class and filling it in some other function. However, it seems I cannot store my THnSparse as a (global) data member of my class. So, let me show you the code.
The class in my macro.
[code]//=========================================================
ClassName::ClassName():TObject(){
//=========================================================
// Constructor. Sets values to data members.
//=========================================================
// DEFAULT CONSTRUCTOR
[…]
Int_t bins[5] = {20,6,10,32,256};
Double_t xmin[5] = {0.,0.,0.,0.,0.};
Double_t xmax[5] = {20,6,10,32,256};
THnSparseI fTest(“test”,“test”,5,bins,xmin,xmax);
[…]
} // ClassName::ClassName:TObject[/code]
Header file.
[..]
#include <THnSparse.h>
[..]
class ClassName:public TObject{
[..]
protected:
THnSparseI fTest;
[..]
}
So, if I now try to use the THnSparse in some class function, it doesn’t work. The object exists, but it has 0 dimensions and it doesn’t save my data. Does anyone see what I am doing wrong?