#include #include #include #include #include #include void main() { int atarget,ztarget,a,z; int ZSYSTEM,ASYSTEM; double initialsum,finalsum,TEMPERATURE; char header[100]; char option[2]; char filename[100]; ofstream sorted_file; ifstream summary_file; cout << "Type a to sort by A, Type z to sort by Z" << endl; cin >> option; cout << "What are the Z_system A_system and Temperature of the run?\n"; cin >> ZSYSTEM >> ASYSTEM >> TEMPERATURE; strcpy(filename,form("results/summary_Z%d_A%d_T%g.dat", ZSYSTEM,ASYSTEM,TEMPERATURE)); cout << "Will open " << filename << endl; summary_file.open(filename); summary_file.getline(header,80); cout << header << endl; if(option[0]=='A' || option[0]=='a'){ cout << "What is the target mass a?" << endl; cin >> atarget; sorted_file.open(form("sorted_Z%d_A%d_T%g_a%d.dat", ZSYSTEM,ASYSTEM,TEMPERATURE,atarget)); sorted_file << "!n-z finalsum initialsum" << endl; while(summary_file >> z >> a >> finalsum >> initialsum){ if(a==atarget) sorted_file << a-2*z << " " << finalsum << " " << initialsum << endl; } sorted_file.close(); } if(option[0]=='Z' || option[0]=='z'){ cout << "What is the target charge z?" << endl; cin >> ztarget; sorted_file.open(form("sorted_Z%d_A%d_T%g_z%d.dat", ZSYSTEM,ASYSTEM,TEMPERATURE,ztarget)); sorted_file << "!a finalsum initialsum" << endl; while(summary_file >> z >> a >> finalsum >> initialsum){ if(z==ztarget) sorted_file << a << " " << finalsum << " " <