Accessing Variables from a Complex TTree

ROOT Version: 6.22/08
Platform: CentOS
Compiler: 4.8.5


I am using the MakeClass method to obtain the skeleton of a TTree with multiple Branches and the Branches having multiple TLeafs. I can print the event variables using the code below.

I want to access multiple TLeafs from different branches of each entry for calculation.
How can I access certain variables of each entry?

 for (Long64_t jentry=0; jentry<nentries;jentry++) {
      Long64_t ientry = LoadTree(jentry);
      if (ientry < 0) break;
      cout<< ientry <<endl;
      nb =  fChain->GetEntry(jentry);   nbytes += nb;
      // if (Cut(ientry) < 0) continue;
   }

“ROOT User’s Guide” → “Trees” → “Using TTree::MakeClass”

…and really, save your time and nerves and just advance to RDataFrame directly. You can run in all kinds of weird issues with accessing TLeafs directly, and your analysis will be much faster (multithreaded).