Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TTreeReader] Cannot read Float16_t branch #10645

Closed
eguiraud opened this issue May 24, 2022 · 4 comments
Closed

[TTreeReader] Cannot read Float16_t branch #10645

eguiraud opened this issue May 24, 2022 · 4 comments
Assignees
Milestone

Comments

@eguiraud
Copy link
Member

Reproducer:

#include <TFile.h>
#include <TTreeReader.h>

int main() {
  {
    TFile f("f16.root", "recreate");
    TTree t("t", "t");
    float x = 42.f;
    t.Branch("x", &x, "x/f");
    t.Fill();
    f.Write();
  }

  {
    TFile f("f16.root");
    TTreeReader r("t", &f);
    TTreeReaderValue<Float16_t> rv(r, "x");
    r.Next();
  }
}

produces

Error in <TTreeReaderValueBase::CreateProxy()>: The branch x contains data of type Float16_t, which does not have a dictionary.
@Pawan-Johnson
Copy link
Contributor

The same issue exists for the Double32_t data type.

#include <TFile.h>
#include <TTreeReader.h>

int main() {
  {
    TFile f("d32.root", "recreate");
    TTree t("t", "t");
    double x = 42.;
    t.Branch("x", &x, "x/d");
    t.Fill();
    f.Write();
  }

  {
    TFile f("d32.root");
    TTreeReader r("t", &f);
    TTreeReaderValue<Double32_t> rv(r, "x");
    r.Next();
  }
  return 0;
}

Error produced:

Error in <TTreeReaderValueBase::CreateProxy()>: The branch x contains data of type Double32_t, which does not have a dictionary.

@Triple-S
Copy link
Contributor

Some additional information on this: I also experienced this bug and found out that it is due to the types Float16_t and Double32_t missing in TDataType. I tried to add them there which fixes the issue, but results in an issue with the TStreamerInfo Compilation which I myself did not understand and therefore could not fix. Also see the corresponding PR: #9008

@eguiraud
Copy link
Member Author

@Triple-S this issue should be fixed in master, v6-26-00-patches and v6-24-00-patches, is that not the case for you?

@Triple-S
Copy link
Contributor

Triple-S commented Sep 27, 2022

@Triple-S this issue should be fixed in master, v6-26-00-patches and v6-24-00-patches, is that not the case for you?

@pcanal Has pointed me to the PR which implemented the fix #11261. I was just confused because I completely overlooked this in the issue - Shame on me XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants