Construction of a m_top dependent template model in RooFit


I am currently migrating our top mass measurement using the template method technique from a self-implemented binned likelihood fit to an unbinned fit using Roofit and I am having some problems to find the correct implementation of the top mass dependent template model.

To give you some details of the procedure I am using the reconstructed top mass m(l \nu b) as a variable sensitive to the top mass and fit the distribution with a function that is a Landau/Gaussian convolution with three parameters (+ normalisation). This fit is done individually for 9 different mc based datasets with 9 different top masses used during event generation. All three parameters have a linear dependence on the top mass and in the end I do have three linear functions as calibration curves that give the prediction for the respective parameter for a certain top mass.
What I want to do now is implementing the template fit using the three calibration curves where the only free parameter of the fit is the top mass itself. Since for each mass I can predict each parameter and therefore the m(l \nu b) distribution. So in the end the fit should give me the top mass that best discribes the m(l \nu b) distribution in data.

The procedure itself is pretty much standard in HEP but I did not find any examples of how to construct the model that only has the mass (or another physics parameter) as a free parameter left. Actually in the end there will also be a mass dependent background model which is handled the same way and I will have two free parameters (mass, bkgd fraction).

I would appreciate it a lot if somebody could give some basic example of how to deal with my problem in principle or point me to some kind of tutorial et cetera.