You are not filling the RooDataSet correctly. The RooDataSet::weight() function takes the weight as a second parameter. The RooArgSet that you pass is only for the non-weight variables. I your code that would look like this:
ds.add(argSet, 1./threshold);
From the mathematics, there is nothing special going on in the weighted fits. The log-likelihoods are just weighted by the weights and the observed number of events for the extended term is the sum of weights and not just the number of entries.
For some more advanced options related to the weights, you can check out the documentation of RooAbsPdf::fitTo, in particular the SumW2Error() and AsymptoticError() options. Let me know if you have further questions about this.