Commit ca0a1302 authored by LongGang Pang's avatar LongGang Pang

Save the particle lists from mc sampling for SMASH afterburner

parent e2e5cddd
......@@ -94,8 +94,8 @@ int main(int argc, char ** argv) {
int particle_number = 0;
std::stringstream fname_particle_list;
//fname_particle_list << path << "/mc_particle_list" << nevent;
//std::ofstream fpmag(fname_particle_list.str());
fname_particle_list << path << "/mc_particle_list" << nevent;
std::ofstream fpmag(fname_particle_list.str());
for ( const auto & par : sampler.particles_ ) {
int nid = sampler.newpid[par.pdgcode];
......@@ -118,24 +118,26 @@ int main(int argc, char ** argv) {
// write the output to mc_particle_list0
particle_number ++;
// if (nevent == 0 )
// {
// fpmag << std::setprecision(6);
// fpmag << std::scientific;
// fpmag << std::setw(14) << par.position.x0()
// << std::setw(14) << par.position.x1()
// << std::setw(14) << par.position.x2()
// << std::setw(14) << par.position.x3()
// << std::setw(14) << sampler.list_hadrons_.at(nid).mass
// << std::setw(14) << par.momentum.x0()
// << std::setw(14) << par.momentum.x1()
// << std::setw(14) << par.momentum.x2()
// << std::setw(14) << par.momentum.x3()
// << std::setw(14) << par.pdgcode
// << std::setw(9) << particle_number << std::endl;
// }
{
fpmag << std::setprecision(6);
fpmag << std::scientific;
fpmag << par.position.x0()
<< ' ' << par.position.x1()
<< ' ' << par.position.x2()
<< ' ' << par.position.x3();
fpmag << std::setprecision(16);
fpmag << ' ' << sampler.list_hadrons_.at(nid).mass
<< ' ' << par.momentum.x0()
<< ' ' << par.momentum.x1()
<< ' ' << par.momentum.x2()
<< ' ' << par.momentum.x3()
<< ' ' << par.pdgcode
<< ' ' << particle_number
<< ' ' << sampler.list_hadrons_.at(nid).charge << std::endl;
}
}
//fpmag.close();
fpmag.close();
sampler.particles_.clear();
std::cout << "#finished" << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment