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

[TTreeReader] Unable to read TBranchObject

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Fixed
    • 6.18/00
    • 6.24/00, 6.22/02
    • None
    • None
    • any

    Description

      Problems with RDataFrame and TBranchObjects first reported on the forum here.

      Using the file provided by the forum user, at https://cernbox.cern.ch/index.php/s/CcgXcCJMweaaTck , a simple reproducer for the issue is:

      #include <TFile.h>
      #include <TTreeReader.h>
      #include <TTreeReaderValue.h>
      #include <TH2F.h>
       
      int main()
      {
              TFile *_file0 = TFile::Open("dqmio.root");
              TTree *MEs = nullptr;
              _file0->GetObject("MEs", MEs);
              TTreeReader r(MEs);
              TTreeReaderValue<TH2F> histo(r, "value");
              r.Next();
              *histo;
              return 0;
      }
      

      which prints Error in <TBranchProxy::Read>: Unable to initialize value.

      The problem seems to be that TBranchProxy::Setup does not have any logic to deal with TBranchObject s, cannot retrieve the value address (fWhere ) and therefore returns false at TBranchProxy.cxx:487 .

      Attachments

        Issue Links

          Activity

            People

              eguiraud Enrico Guiraud
              eguiraud Enrico Guiraud
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: