TKDE or TH1K for weighted events


I’m trying to approximate some distributions that are used as a template for a fit. The distributions are a bit spiky due to a lack of statistics and the hope was, that a reasonable approximation would be smoother and therefore easier to fit.
The first things I found were the TKDE and TH1K classes, but both do not support weighted entries. My templates are generated from a Monte Carlo data set with weighted entries. Is there a generalization of one of these classes for weighted entries, or even a better way to do something like this?

Thank you,


It is true TKDE does not support weighted events. It is something that needs to be implemented in the class.
However, you can try to use then the class RooKeysPdf of Roofit, I think it supports weighted events
(see )

Best Regards