Read a root file containing directrory

Hello :wave:,
I need your help please :pray: :pray: :pray:.
I have a root file called ntuple_array.root containing a directory (file) called ntupleProducer;1 . This ntupleProducer;1 contains two trees, the name of the first one is tree;1 and the name of the second one is tree;2 . Each tree contains some histograms of course.
How can I read this root file please?

I used the following methods but when I draw histograms, I get empty plots (nothing appears on my figures, they are white!):

// --------
//first method to read the root file
TFile *f = TFile::Open(“ntuple_array.root”);
// …
// --------

// -------
//second method to read the root file
TFile *f;
f = new TFile(“ntuple_array.root”);
TDirectoryFile dir1 = (TDirectoryFile)f->Get(“ntupleProducer;1”);
TTree tree = (TTree)dir1->FindObject(“tree;1”);
// -------

// -------
//third method to read the root file
TFile *f = new TFile(“ntuple_array.root”);
TTree tree = (TTree)f->Get(“ntupleProducer/tree;1”);
// -------

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.