ok, the files are very big their size exceeds 40MB, I tried to create these files to test this code. try to change:
TH1F * he = new TH1F ("he", "with Histogram", 20, -50.50)
test1.txt (707 Bytes) test2.txt (688 Bytes)