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

TFile::GetObject can return an object from a different file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: I/O
    • Labels:
      None
    • Environment:

      all

      Description

      Since forever, this code

         auto filename = "foo.root";
         auto treename = "myTree";
         auto fulltreename = "foo.root://myTree";
       
         auto f1 = TFile::Open(filename);
         TTree *t1;
         f1->GetObject(treename, t1);
         std::cout << f1 << std::endl;
         std::cout << t1 << std::endl;
       
         auto f3 = TFile::Open(filename);
         TTree *t3;
         f3->GetObject(fulltreename, t3);
         std::cout << f3 << std::endl;
         std::cout << t3 << std::endl;
      

      yields

      0x5588fb9ac650
      0x5588fbb0c710
      0x5588fbff1300
      0x5588fbb0c710
      

        Attachments

          Activity

            People

            • Assignee:
              dpiparo Danilo Piparo
              Reporter:
              dpiparo Danilo Piparo
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Actual End: