Hello,
I read many similar topics but I didn’t reach a solution.
I have a C+ code where I save some Branching Ratio values in a TTree in this way:
TTree *Branching_ratios = new TTree ("Branching_ratios", "Branching ratios");
Branching_ratios->Branch("Electron_channel", &BRe);
Branching_ratios->Fill();
Branching_ratios->Branch("Muon_channel", &BRm);
Branching_ratios->Fill();
Branching_ratios->Branch("Hadronic_channel", &BRq);
Branching_ratios->Fill();
Branching_ratios->Branch("Tau_channel", &BRtau);
Branching_ratios->Fill();
And it’s ok, the values are correctly saved. If I check in interactive ROOT and open the Leaf the value is saved in the “Mean” voice.
Here an example:
Now I’m makin a Python macro where I want save that value in an array, but I couldn’t find a solution.
rootfile = ROOT.TFile.Open(filename)
files.append(rootfile)
h1=rootfile.Branching_ratios.GetBranch("Electron_channel").GetValue()
h2=rootfile.Branching_ratios.GetBranch("Muon_channel").GetValue()
h3=rootfile.Branching_ratios.GetBranch("Hadronic_channel").GetValue()
h4=rootfile.Branching_ratios.GetBranch("Tau_channel").GetValue()
print(h1)
print(h2)
print(h3)
print(h4)
filename is correctly taken, rootfile idem.
I tried also GetLeaf, GetEntry, GetMean (GetMean and GetValue are not attributes of TBranch i know, but I tried everything).
How can I resolve this?
ROOT Version: Not Provided
Platform: lxplus
Compiler: Not Provided