Dataset appending problem

Hello,all

I met this Error while trying to append two dataset and I don’t know what is wrong with the code. And I only got one gauss peak instead of two which was expected.

[#1] INFO:Eval – RooTreeData::loadValues(data1) Ignored 10000 out of range events

Cheers,
Fangzhou
test3.C (1.36 KB)

Hi Fangzhou,

This message means that in your TTree there were 10000 entries where one or more of the observables that you are trying to import in a RooDataSet has a numeric value outside the range of the corresponding RooRealVar. You should have a look at the ranges you have set for each of the RooRealVars that represent your observable and widen those as necessary.

Wouter

Hi Wouter,

I’ve checked the code again. But I think I’ve kept all the 20000 entries in the rage of [-5,5] using a cut before importing them into the dataset. And curiously, I am able to import either of the 10000 entries while I failed to combine the two group. In addition, I was using ROOT 5.18 and Roofit 2.30.

Fangzhou

Hi Fangzhou,

I’ve managed to reproduce your problem with the SVN head (very close to 5.21/06). The events get rejected because the weight variable is out of range. If you add a variable
through addColumn() the range of the added observable is by default automatically
adjusted to fit around the actual range of the observables as calculated on the dataset.
If you request to keep the original range, i.e.

    data1->addColumn(w,kFALSE) ;
    data2->addColumn(w,kFALSE) ;

no events get stripped and the macro works fine for me.

I note though that the range adjustment feature was only added in RooFit 2.90 so you must have run into a different problem in your release, but I am not able to debug that with my current setup. The solution is in any case to upgrade to a more recent ROOT/RooFit version (I note that ROOT 5.22 production release is due next week)

Wouter

Hi Fangzhou,

I’ve managed to reproduce your problem with the SVN head (very close to 5.21/06). The events get rejected because the weight variable is out of range. If you add a variable
through addColumn() the range of the added observable is by default automatically
adjusted to fit around the actual range of the observables as calculated on the dataset.
If you request to keep the original range, i.e.

    data1->addColumn(w,kFALSE) ;
    data2->addColumn(w,kFALSE) ;

no events get stripped and the macro works fine for me.

I note though that the range adjustment feature was only added in RooFit 2.90 so you must have run into a different problem in your release, but I am not able to debug that with my current setup. The solution is in any case to upgrade to a more recent ROOT/RooFit version (I note that ROOT 5.22 production release is due next week)

Wouter

Hi Wouter,

Thank you so much for your help. I’ve tried in Roofit 2.90(ROOT 5.21) and there was no such error.

Cheers,
Fangzhou