Creating c++ file to extract data from root output

I have a root file from simulation, and wanted a C++ file to extract from it several information including number of coincidences, trues coincidences, scatter and random coincidences. What energy between gamma1 and 2 experience more scatters, the energy deposited in a Crystal number x and its Neighbors crystals?
But also to track the photons that scatters and those passing the material without scatter

you mean you have TTree in a ROOT file ?

Yes, a TTree

Does TTree::Draw help in that case ?

I did not understand.

But as I said, i have a root file ( 2 Hits folders, 2 Singles folders, 2 Coincidence folders, one delay and optical folder), and wanted to extract from root file the number of singles which are in coincidence (prompt, random, true and scatter)…and bse i am having two gamma lines, i want to know how much of the photons form gamma 1 reach the detector without scatter and for gamma 2 as well.

may be @pcanal has an idea.

What did you try so far?