Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-9142

[TDF] members of leaflists (e.g. "b.v") are not recognized as valid column names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 6.14/00
    • Component/s: None
    • Labels:
      None
    • Environment:

      any

      Description

      Thanks to Wolf Behrenhoff for reporting the problem.
      Reproducer:

      #include <ROOT/TDataFrame.hxx>
      #include <TBrowser.h>
      #include <TCanvas.h>
      #include <TTree.h>
      #include <iostream>
      #include <random>
       
      using namespace std;
       
      struct BrVal {
          Float_t a;
          Int_t i;
      };
       
      int main() {
          auto t = new TTree("t", "t");
          BrVal val;
          t->Branch("b", &val, "a/F:i/I");
          mt19937 rng;
          normal_distribution<Float_t> nd1(0, 1);
          uniform_int_distribution<Int_t> ud(-10, 10);
          for (size_t n = 1000; n; --n) {
              val.a = nd1(rng);
              val.i = ud(rng);
              t->Fill();
          }
       
          using TDF = ROOT::Experimental::TDataFrame;
          try {
              TDF df(*t);
       
              df.Histo1D("b.a")->Draw();
       
              auto h = df.Define("aa", [](Float_t bv) { return bv; }, {"b.a"}).Histo1D("aa");
              h->GetEntries();
       
          } catch (std::runtime_error &e) {
              cout << e.what() << '\n';
          }
          return 0;
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              eguiraud Enrico Guiraud
              Reporter:
              eguiraud Enrico Guiraud
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Actual Start:
                Actual End: