RDataFrame Histo1D causes crash when weights added


ROOT Version: 6.14/06
Platform: Fedora 28
Compiler: gcc


I have some code I’m using to run selection cut on a ROOT file with a series of filters and histograms drawn at each stage. It was working fine but I hadn’t yet accounted for event weights. When I added my column with the weights for each event to each call of Histo1D, I get a crash at runtime. The crash happens After several filters have been made and several histograms drawn already.

This is the beginning of the output I get on crash

In file included from /builddir/build/BUILD/root-6.14.06/builddir/input_line_12:24:
In file included from /builddir/build/BUILD/root-6.14.06/builddir/etc/dictpch/allHeaders.h:785:
In file included from /builddir/build/BUILD/root-6.14.06/builddir/include/ROOT/RCsvDS.hxx:14:
In file included from /builddir/build/BUILD/root-6.14.06/builddir/include/ROOT/RDataFrame.hxx:26:
In file included from /builddir/build/BUILD/root-6.14.06/builddir/include/ROOT/RDFInterface.hxx:32:
In file included from /builddir/build/BUILD/root-6.14.06/builddir/include/ROOT/RDFInterfaceUtils.hxx:18:
/builddir/build/BUILD/root-6.14.06/builddir/include/ROOT/RDFNodes.hxx:401:15: error: no matching member function for call to 'Exec'
      fHelper.Exec(slot, std::get<S>(fValues[slot]).Get(entry)...);
      ~~~~~~~~^~~~
/builddir/build/BUILD/root-6.14.06/builddir/include/ROOT/RDFNodes.hxx:394:10: note: in instantiation of function template specialization 'ROOT::Internal::RDF::RAction<ROOT::Internal::RDF::FillTOHelper<TH1D>, ROOT::Detail::RDF::RJittedFilter, ROOT::TypeTraits::TypeList<ROOT::VecOps::RVec<float>,
      double> >::Exec<0, 1>' requested here
         Exec(slot, entry, TypeInd_t());

…and so on with a large series of notes. All the errors are in reference to this Exec method.

Unfortunately my code and data are far too long to post, and I doubt I could replicate the error in a MWE.

Hi Harry,

it is very hard to give you a hand with this information at disposal. Could you add some more context at least?

Cheers,
D

If the error is related to Exec then it’s something to do with the booking process?

Not sure exactly what information will be relevant but perhaps the issue could be with where I’m making the histograms.
I have a lambda which is called for each cut:

auto make_cut = [&d,&d_curr,&scale,&unweighted_scale,&histname,&savefile,&bins,&rmin,&rmax,&cut_event_weights]
      (string filterFunc, string filterName, bool makeHist=false,string plotColumn="", string graphName="", int l_bins=0, double l_rmin=0, double l_rmax=0, string xlabel="", string unit="")
      {
         if (makeHist)
         {
            bins = l_bins; rmin=l_rmin; rmax=l_rmax;
            TH1F* h = (TH1F*)d_curr->Histo1D({"",histname(xlabel,unit),bins,rmin,rmax},plotColumn,"Relative_Event_Weight")->Clone(graphName.c_str());
            h->Scale(unweighted_scale); h->Draw("hist"); gPad->SaveAs(savefile(graphName));
         }
         auto d_rtn = d_curr->Filter(filterFunc,filterName);
         cut_event_weights.push_back(d_rtn.Sum("Event_Weight").GetValue());
         d_curr = &d_rtn; 
         return d_rtn;  
      };

But as I said before, this did work before I added the third parameter to Histo1D, so really not sure.

Hi Harry,

I understand you are passing to your RDataFrame instance as a cut a lambda which extract from the very same computation graph an histogram: is this correct?

Cheers,
D

Ah no, this lambda is not passed to any data frame, just called repeatedly throughout the code.

Hi Harry,

I fear I have too little information at disposal to further help you out. Can you slim down your code to the minimal form which shows your problem?

Cheers,
D

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