TH2::Interpolate() fails for some values

@bou For the moment, you MUST use the trick which @OSchaile shows (i.e. you MUST “randomize” X and Y and strongly hope that the current “Interpolate” method will return a “proper” value).

@couet No it does NOT do it properly. Everything still depends on how the bins are created / defined. You will get “blank pixels” in different places if you try one of:
tg2d->SetNpx(101); tg2d->SetNpy(101);
tg2d->SetNpx(102); tg2d->SetNpy(102);
tg2d->SetNpx(103); tg2d->SetNpy(103);

Yes, the trick will probably help but I have no guarantee that the returned value will be 100% OK. I admit that the probability should be (very) low.

Yes … as @OSchaile pointed it really depends if the point fall on a triangle border or not … and I have no clue how to fix that.

@couet How about you talk to those who maintain this “external code”? There have already been significant bug fixes implemented in this code between ROOT 5 and 6.

In ROOT 5 it was an other code (ROOT specific)
We move to something more robust and a lot faster (with the old implementation the macro we are talking about takes ages to execute).
The algorithm produces triangles … and produce them right … just plot the surface using TRI1 … you will see there is no holes. Then we extended the functionally to fill an underlaying histogram with the value of the triangle above a given bin… But that’s beyond the initial purpose of the triangles package we use.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.