IAP GITLAB

Skip to content
Snippets Groups Projects
Commit e4cb7f9f authored by ralfulrich's avatar ralfulrich
Browse files

fixed formating problem

parent 2c4d10ec
No related branches found
No related tags found
No related merge requests found
...@@ -35,37 +35,39 @@ using namespace std; ...@@ -35,37 +35,39 @@ using namespace std;
int main() { int main() {
logging::set_level(logging::level::info); logging::set_level(logging::level::info);
corsika_logger->set_pattern("[%n:%^%-8l%$] custom pattern: %v"); corsika_logger->set_pattern("[%n:%^%-8l%$] %v");
logging::info( logging::info(
"\n"
"------------------------------------------\n" "------------------------------------------\n"
"particles in CORSIKA\n" " particles in CORSIKA\n"
"------------------------------------------\n" "------------------------------------------\n");
"Name | " int const width = 20 + 10 + 10 + 10 + 15 + 15 + 17;
logging::info(
"Name | "
"PDG-id | " "PDG-id | "
"SIBYLL-id | " "SIBYLL-id | "
"QGSJETII-id| " "QGSJETII-id| "
"PDG-mass (GeV) | " "PDG-mass (GeV) | "
"SIBYLL-mass (GeV)|\n" "SIBYLL-mass (GeV)|");
"{:-}", logging::info("{:->{}}", ' ', width);
"", 104);
for (auto p : get_all_particles()) { for (auto p : get_all_particles()) {
if (!is_nucleus(p)) { if (!is_nucleus(p)) {
corsika::sibyll::SibyllCode sib_id = corsika::sibyll::convertToSibyll(p); corsika::sibyll::SibyllCode sib_id = corsika::sibyll::convertToSibyll(p);
auto const sib_mass = (sib_id != corsika::sibyll::SibyllCode::Unknown auto const sib_mass = (sib_id != corsika::sibyll::SibyllCode::Unknown
? to_string(corsika::sibyll::getSibyllMass(p) / 1_GeV) ? to_string(corsika::sibyll::getSibyllMass(p) / 1_GeV)
: "--"); : "");
auto const qgs_id = corsika::qgsjetII::convertToQgsjetII(p); auto const qgs_id = corsika::qgsjetII::convertToQgsjetII(p);
logging::info("{:20} | {:10} | {:10} | {:10.5} | {:18.5}", p, logging::info("{:20} | {:10} | {:10} | {:10} | {:>15.5} | {:>15.5} |", p,
static_cast<int>(get_PDG(p)), static_cast<int>(get_PDG(p)),
(sib_id != corsika::sibyll::SibyllCode::Unknown (sib_id != corsika::sibyll::SibyllCode::Unknown
? to_string(static_cast<int>(sib_id)) ? to_string(static_cast<int>(sib_id))
: "--"), : ""),
(qgs_id != corsika::qgsjetII::QgsjetIICode::Unknown (qgs_id != corsika::qgsjetII::QgsjetIICode::Unknown
? to_string(static_cast<int>(qgs_id)) ? to_string(static_cast<int>(qgs_id))
: "--"), : ""),
get_mass(p) / 1_GeV, sib_mass); get_mass(p) / 1_GeV, sib_mass);
} }
} }
logging::info("{:-104}", ""); logging::info("{:->{}}", ' ', width);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment