I have a tree and I am able to get the histogram of a leaf. But I am trying to print out the values of the leaf using a for loop but I am getting all the entries as 0.
So here is the root file I am trying to access. It contains a leaf called Imp with 10k entries. I want tthe array Imp and I am trying to print out all the 10k entries of Imp[ ].
TFile *input = new TFile(“AuAu200GeV_SM_NT3_DecaysOff_0_20fm_file0.root”, “read”);
TTree tree = (TTree)input->Get(“tr”);
Float_t Imp[12000];
tree->SetBranchAddress(“Imp”, &Imp);
for(Int_t i = 0; i<entries; i++){
tree->GetEntry(i);
cout << Imp[i] << endl;
}