10 TString inputFile(
"18x275_DVMP_1M_ascii.out");
11 TString outputFile(
"18x275_DVMP_1M_ascii_converted.out");
12 std::ifstream
file(inputFile);
16 std::ofstream
output(outputFile);
17 output <<
"MILOU\n============================================\nI, ievent, linesnum, weight, genprocess, radcorr, truex, trueQ2, truey, truet, treuphi, phibelgen, phibelres, phibelrec\n============================================\nI, K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1) P(I,2) P(I,3) P(I,4) P(I,5) V(I,1) V(I,2) V(I,3)\n============================================\n";
21 int particle_count = 0;
22 while (std::getline(file, str))
25 if(file_contents.size()==0)
27 if(file_contents.at(0)==
'F')
31 stringstream str_strm(file_contents);
35 while (str_strm >> tmp) {
38 if(tmp.find(
"e")<tmp.length())
39 tmp=tmp.replace(tmp.find(
"e"),1,
"E");
46 if(event_count%100==0)
48 cout <<
"Processing Event " << event_count << endl;
51 if(file_contents.at(0)==
'P')
55 int index_jpsi = file_contents.find(
" 443 ");
56 int index_other = file_contents.find(
" 1 0 0 ");
57 if(index_jpsi>0||index_other>0)
59 output << ++particle_count;
70 stringstream str_strm(file_contents);
74 while (str_strm >> tmp) {
78 output <<
"\t 0 \t 0 \t 0 \t";
80 if(counter>=3&&counter<=7)
82 if(tmp.find(
"e")<tmp.length())
83 tmp=tmp.replace(tmp.find(
"e"),1,
"E");
90 output <<
"0 \t 0 \t 0\n";
95 output<<
" =============== Event finished =============== \n";
100 gSystem->Load(
"$OPT_SPHENIX/eic-smear_root-5.34.36/lib/libeicsmear.so");
102 BuildTree(outputFile);
111 ss <<
"0" <<
"\t" << x <<
" 5 1.00000000 0 0 7.56711757E-04 " << Q <<
" 0.373815268 0.177931070 0.00000000 2.9 2728496 110.619263 -0.310856074\n ============================================\n";