Automatised way of reading and processing data from Root-Files with c++

I think, the best for you would be to try an “analysis skeleton”. See, for example, links in: How are multiple TTree->Draw()s done?