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

TTreeReader is retrieving the containers properly, but when used in a for loop, the elements get somehow "overridden"

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • High
    • Resolution: Fixed
    • 6.04.00
    • 6.06/00, 6.02/14, 6.04/04
    • TTree
    • None
    • root 6-04-00-patches

    Description

      The following loop gives differing results if one changes the vector to check the size. Even printing all the elements except for the first one also gives completely different values for the rest of the vectors.

      for(int i(0), njet = jet_px.GetSize(); ; i < njet; ++i)

      { printf(" (px, py, pz, e) = ( % 6.1f GeV, % 5.2f, % 5.2f, % 5.1f GeV) : \n", jet_px[i], jet_py[i], jet_pz[i], jet_E[i]); }

      The output looks like this depending on whether i start with the first or second element (if it exists), whether i use jet_px, jet_py, etc to get the range of the vector (which all have the same size).

      (px, py, pz, e) = ( -16.1 GeV, -16.15, 44.81, 44.8 GeV) :
      (px, py, pz, e) = ( 32.0 GeV, 31.98, 31.98, 32.0 GeV) :
      (px, py, pz, e) = ( 29.3 GeV, 29.27, 29.27, 29.3 GeV) :
      (px, py, pz, e) = ( -62.7 GeV, -62.74, -62.74, -62.7 GeV) :

      (px, py, pz, e) = ( 44.8 GeV, 44.81, -57.53, -57.5 GeV) :
      (px, py, pz, e) = ( -14.9 GeV, -14.89, -14.89, -14.9 GeV) :
      (px, py, pz, e) = ( -51.2 GeV, -51.21, -51.21, -51.2 GeV) :
      (px, py, pz, e) = ( 9.4 GeV, 9.44, 9.44, 9.4 GeV) :

      (px, py, pz, e) = ( -10.5 GeV, -10.52, -1.62, -1.6 GeV) :
      (px, py, pz, e) = ( 44.8 GeV, 44.81, 44.81, 44.8 GeV) :
      (px, py, pz, e) = ( -14.9 GeV, -14.89, -14.89, -14.9 GeV) :
      (px, py, pz, e) = ( -51.2 GeV, -51.21, -51.21, -51.2 GeV) :
      (px, py, pz, e) = ( 9.4 GeV, 9.44, 9.44, 9.4 GeV) :

      Attachments

        Activity

          People

            axel Axel Naumann
            jigonzal Jimmy Gonzalez Nunez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: