Combined weight for RooDataSet

Dear all,

I am trying to obtain a weighted dataset, where the weights is the product of multiple branches of the dataset. The dataset is created started from a ttree. A possible solution is given here:

but in my case the tree is very big and looping on that will be very time-consuming. Are there other options without looping on the dataset?
I can build the weight also at TTree level (before entering in rooFit), but again, how can I add a branch to the ttree without looping over the tree itself?

One solution which is working (in the sense that the code is running) is the following:

var = RooRealVar('var','var',1,0,100)
w1= RooRealVar('w1','w1',0,1)
w2= RooRealVar('w2','w2',1,0,1)
cut= RooRealVar('cut','cut',1,0,1)

w_string='w1*w2'
cut_string='cut==1'

RooDataSet('data','data',inputTree, RooArgSet(var,cut, w1,w2), w_sring+'*'+cut_string)

However with this solution, when I try to plotOn some variable on a frame seems that the multiplicative part of the cuts is simply ignored, while the cut==1 part is applied. So I guess the cut argument is only a boolean (differently from TTree)

I think @jonas can help

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