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

[TTreeReader] Wrong value read when multiple TTreeReaderValues read the same branch

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • 6.16/00, 6.14/04
    • None
    • None
    • None
    • any

    Description

      First reported in the context of RDataFrame here: https://root-forum.cern.ch/t/rdataframe-filter-result-incorrect/31209

      Reproducer:

      #include <TTreeReader.h>
      #include <TTreeReaderValue.h>
      #include <TFile.h>
       
      int main()
      {
         TFile f("M1200.root");
         TTreeReader r("fullmassplane", &f);
         TTreeReaderValue<int> v1(r, "event.truth_type");
         TTreeReaderValue<int> v2(r, "event.truth_type");
         TTreeReaderValue<int> v3(r, "event.truth_type");
       
         r.Next();
         std::cout << *v1 << " " << *v2 << " " << *v3 << std::endl;
         
         return 0;
      }
      

      Output:

      0 0 685504398
      

      Input file (shared with sft-root): /eos/user/b/bstanisl/DebugFile/M1200/M1200.root

      Attachments

        Issue Links

          Activity

            People

              dpiparo Danilo Piparo
              eguiraud Enrico Guiraud
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Actual End: