-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue with Cling and TTree object in memory #16730
Comments
Try with
|
With
Also tested with |
Other problem with Cling and tree in memory:
lxplus.cern.ch (RHEL 9.4), root v6.32.06
|
The version if the tree is saved to a file works as expected. #include "TTree.h"
#include "TRandom.h"
TFile *f = nullptr;
TTree *t = nullptr;
void tree(const char *fname = "file.root")
{
const Int_t kMax = 10;
Int_t n;
Float_t a[kMax];
SafeDelete(t); SafeDelete(f);
if (fname) f = new TFile(fname, "recreate");
// else in memory
t = new TTree("t", "tree");
t->Branch("n", &n, "n/I");
t->Branch("a", a, "a[n]/F");
for (Int_t i = 0; i < 5; i++) {
n = gRandom->Rndm()*(kMax-1);
for (Int_t j = 0; j < n; j++)
a[j] = gRandom->Gaus(0, 1);
t->Fill();
}
if (f) {
t->Write();
SafeDelete(t); SafeDelete(f);
f = new TFile(fname);
t = (TTree*)f->Get("t");
}
// t->Draw("a[0]");
}
|
musinsky
changed the title
Issue with Cling and TTree:Scan()
Issue with Cling and TTree in memory
Oct 23, 2024
musinsky
changed the title
Issue with Cling and TTree in memory
Issue with Cling and TTree object in memory
Oct 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check duplicate issues.
Description
Strange issue with Cling and TTree:Scan(), please see table in Reproducer.
Reproducer
file
scan.C
ROOT version
see in table
Installation method
build from source
Operating system
Linux
Additional context
No response
The text was updated successfully, but these errors were encountered: