ROOT & stringstream

This happens because you exhaust the stringstream in the previous line, i.e. the eofbit gets set. That isn’t cleared by the str() function and thus followings reads will fail.

Two simple possible solutions:
a) replace all lineStream.str(line); with lineStream.str(line); lineStream.clear();
or b) replace all lineStream.str(line); with lineStream = stringstream(line);

You can see where this behavior comes from here:

root [0] stringstream ss("42");
root [1] int i; ss >> i;
root [2] ss.rdstate()
(std::ios_base::iostate) (std::_Ios_Iostate::_S_eofbit) : (int) 2
root [3] (bool)ss
(bool) true
root [4] ss.str("23");
root [5] ss.rdstate()
(std::ios_base::iostate) (std::_Ios_Iostate::_S_eofbit) : (int) 2
root [6] (bool) (ss >> i)
(bool) false
root [7] i
(int) 42
root [8] ss.clear(); (bool) (ss >> i)
(bool) true
root [9] i
(int) 23

And more things: while copying your code in an editor, I noticed that the variable p1pt was not declared, instead there are a lot of unused variables. Consider cleaning this up a bit.
Also, I assume your input file is small. Otherwise I would first open the file, then create the TNTuple (and opening with “r” - should that read “recreate”?).