I uploaded the file here:
/afs/cern.ch/user/g/gbak/public/OniaRooDataSet_isMC0_Psi2S_pp_y0.00_2.40_Effw0_Accw0_PtW0_TnP0_230117.root
Or you can download the root file from the link.
Hi @gbak, thanks for providing the file so quickly!
I have inspected it, and it seems that the nan value is already in the file itself. You can check it with this simple script:
void repro()
{
std::unique_ptr<TFile> f1{
TFile::Open("OniaRooDataSet_isMC0_Psi2S_pp_y0.00_2.40_Effw0_Accw0_PtW0_TnP0_230117.root", "READ")};
auto dataset = f1->Get<RooDataSet>("dataset");
dataset->Print();
auto &ctau3D = static_cast<RooRealVar &>((*dataset->get())["ctau3D"]);
// do iteration over dataset to see which values of ctau3D are nan
for (std::size_t i = 0; i < dataset->numEntries(); ++i) {
dataset->get(i); // load entry "i"
double val = ctau3D.getVal(); // get value of ctau3D for entry "i"
// simple check for nan values (if it's nan, if will not be in any range)
if (!(val > ctau3D.getMin() && val < ctau3D.getMax())) {
std::cout << val << std::endl; // you will see the printed nans here
}
}
}
So you do everything correct. The problem is that the nans are already in the input file. Maybe you should ask the person who gave you the file why it contains nans? We can probably not tell you this here on the forum