Skip to content

Commit

Permalink
Print a table of the MDP
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Kislat committed Jul 24, 2017
1 parent 0c8f1f7 commit 93869b9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gpst.C
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Result result;
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
Expand Down Expand Up @@ -2346,6 +2347,22 @@ void gpst(const char *name, bool plot_clean, bool large, bool debug)
bMdp->SetMarkerColor(mdpColor);
if ((mdp_legend >= 0) && !mdpLabel.empty())
legends[mdp_legend].legend->AddEntry(bMdp, mdpLabel.c_str(), "L");

const double mdpPrintScale = (fractionunit == Frac ? 100 : 1);

int coutPrecision = cout.precision();
ios::fmtflags coutFlags = cout.flags();
cout.setf(ios::fixed, ios::floatfield);
std::cout << "\n";
log_info("MDP data:");
std::cout << " Energy [MeV] | MDP [%] \n"
<< "----------------------------\n";
for (int i = 0; i < kd; ++i) {
std::cout << std::setprecision(3) << std::setw(6) << (xc[i]-xem[i])*1e-3 << " ... " << std::setw(6) << (xc[i]+xep[i])*1e-3 << " | " << std::setprecision(2) << std::setw(5) << mdpPrintScale * ycMdp[i] << "\n";
}
std::cout << std::endl;
cout.precision(coutPrecision);
cout.flags(coutFlags);
}

if (fluxunit == CGSe9) {
Expand Down

0 comments on commit 93869b9

Please sign in to comment.