I have got an error message when trying to project a THnSparse after having defined the axis range :
Int_t nvarbins[1]={3}
THnSparseF * h =new THnSparseF(“sparse”,“blablabla”,1,nvarbins)
Double_t array0[4]={0,1,2,3}
h->SetBinEdges(0,array0)
h->GetAxis(0)->SetRangeUser(2,3)
h->Projection(0)
Error in TAxis::TAxis::Set: bins must be in increasing order
If I don’t call SetRangeUser I get everything is OK.
I am using root v5-22-00 recompiled with THnSparse from yesterday’s trunk. I didn’t try with a whole fresh trunk… could this explain my problem ?
I actually still get problems using this piece of code :
Int_t bins[1] = {2};
THnSparseF* hn = new THnSparseF(“hn”,"",1,bins);
Double_t limits0[3]={0,1,2};
hn->SetBinEdges(0,limits0);
hn->GetAxis(0)->SetBit(TAxis::kAxisRange);
hn->Projection(0);
—> Error in TAxis::TAxis::Set: bins must be in increasing order
just setting the bit TAxis::kAxisRange causes the mess. that shouldn’t be right ?
unfortunately I really need to be able to do that for my projections.