Ntuple or TTree

In that case, you cannot dump your txt file into array even with the help of TTree, because array lives in the memory.

If you go line by line, and do analysis on the go, only each line’s content lives in the memory so you don’t have a problem. If one line is an event, you can fill to histogram with those contents, or do more things.

I found this thread where you can use TTree’s utility to create a TTree from the txt file, and uses TTree’s mechanism if you really wish to.

If you are not restricted to c++, I recommend go python with numpy or panda dataframe for very efficient data processing with csv files, etc