#include #include #include #include "JAAnet/JPDB.hh" #include "JLang/JComparator.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Auxiliary program to print particle codes and masses. * \author mdejong */ int main(int argc, char **argv) { using namespace std; string key; int debug; try { JParser<> zap("Auxiliary program to print particle codes and masses."); zap['k'] = make_field(key) = "name", "geant", "pdg", "mass"; zap['d'] = make_field(debug) = 2; zap(argc, argv); } catch(const exception& error) { FATAL(error.what() << endl); } using namespace JPP; JPDB pdb = JPDB::getInstance(); if (key == "name") sort(pdb.begin(), pdb.end(), make_comparator(&JParticle::name)); else if (key == "pdg") sort(pdb.begin(), pdb.end(), make_comparator(&JParticle::pdg)); else if (key == "geant") sort(pdb.begin(), pdb.end(), make_comparator(&JParticle::geant)); else if (key == "mass") sort(pdb.begin(), pdb.end(), make_comparator(&JParticle::mass)); cout << pdb << endl; }