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

TChain::GetEntry reads multiple clusters without prefetching

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Fixed
    • 6.15/01
    • 6.16/00, 6.18/00
    • I/O
    • None
    • Centos7, gcc7

    Description

      When creating a new TChain and invoking GetEntry on it for a given entry, that call reads multiple clusters instead of just the one where the entry belongs.

      In particular, it has been observed that all the clusters starting from the one of the entry until the end of the file are read.

      A ROOT file from the TOTEM experiment has been used as input. The following code triggers the issue, when trying to read branch "track_rp_5.y". Entry 467370 is the first of the n-1 cluster in the file. The code triggers the reading of the n-1 and n clusters in the file, instead of just the n-1.

      TChain chain(treeName);
      chain.Add(fileName);
       
      chain.SetBranchStatus("*", false);
      chain.SetBranchStatus("track_rp_5.y", true);
       
      chain.GetEntry(467370)

      The following code, with TTreeReader, triggers the same issue:

      TChain chain(treeName);
      chain.Add(fileName);
       
      TTreeReader reader(&chain);
      TTreeReaderValue<double> vd(reader, "track_rp_5.y");
      reader.SetEntriesRange(467370, 467371);
      reader.Next();
      *vd;
      

       

      On the contrary, the following code has the correct behaviour, i.e. it only reads the n-1 cluster.

      TChain chain(treeName);
      chain.Add(fileName);
       
      TBranch *br = nullptr;
      double d = 0;
      chain.SetBranchAddress("track_rp_5.y", &d, &br);
      br->GetEntry(467370);

       

      The number of bytes read is measured by invoking

      chain.GetFile()->GetBytesRead(); 

       

      Attachments

        Activity

          People

            pcanal Philippe Canal
            etejedor Enric Tejedor Saavedra
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Actual End: