Currently I am working on a fit of the invariant mass distribution of D^0. For this I currently use an exponential background, gaussian signal and template function for reflections which I obtain from Monte Carlo (MC). This template function is an interpolation of a invariant mass histogram of reflections. I scale this template function based on the ratio between the amplitude of the gaussian signal from MC and the gaussian signal I get from fitting on the real data. The template function is a linear interpolation (which i wrapped in a RooAbsPdf derived class). In mathematical form that would make the model:
M(x) = A_S \left[ G(x; \mu, \sigma) + \dfrac{T(x)}{ A_S^{ (MC) } }\right] + A_B E(x; \lambda)
Where G=\exp[-(x-\mu)^2/(2 \sigma^2)] and E=\exp(\lambda x), also A_S^{(MC)} is fixed in this model and determined from another fit on the MC signal. There might be other methods on how to “scale” this template function, currently I use the ratio between the gaussian signal in the experimental data and the gaussian signal in the monte carlo data. Now I have trouble with how to implement such a model with RooFit and would like to have some advice on how to do this.