Home | News | Documentation | Download

RDataFrame column not found

Hello All,

I am trying to use an RDataFrame object to get histograms and I use the following lines:

auto h = dataFrame.Filter(selection.Data())
                      .Define(w_name.Data() , str_weight.Data())
                      .Define(var_name.Data(), branch_name.Data())                    .Histo1D(ROOT::RDF::TH1DModel(*histogram.hist),var_name.Data(),w_name.Data());

After that, I want to add an extra selection to the filter and get another histogram. I do this like this:

auto h_perDSID = dataFrame.Filter(selection_perDSID.Data())
                                      .Histo1D(ROOT::RDF::TH1DModel(*histogram.perDSIDHists[dsid]), var_name.Data(), w_name.Data());

But when I do that I get these errors:

what(): Unknown columns: $$var_name.Data(), w_name.Data()$$

and if I try to Define them as with the first call I get a Redefinition error…

I’m a bit confused because it says that the column is not found but when I try to define them it says I’m trying to redefine it.

Anyone has some ideas?

Thanks!
Sergio

Hi,
from the error message it seems like RDF is trying to access columns called "var_name.Data()", so maybe you are passing certain arguments as strings (with commas, like in "var_name.Data()" instead of just var_name.Data()). That would be my guess.

Otherwise I think we are going to need a small reproducer of your problem that we can run: from the snippets you posted above, things seem fine.

Cheers,
Enrico