00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <fstream>
00013
00014 #include "HepPDT/defs.h"
00015 #include "HepPDT/TableBuilder.hh"
00016 #include "HepPDT/ParticleDataTable.hh"
00017
00018 int main()
00019 {
00020 char pdgfile[300] = "@top_srcdir@/examples/data/isaparticles.dat";
00021 const char outfile[] = "testReadIsajet.out";
00022
00023 HepPDT::ParticleDataTable datacol( "Isajet Table" );
00024 {
00025
00026 std::ifstream pdfile( pdgfile );
00027 if( !pdfile ) {
00028 std::cerr << "cannot open " << pdgfile << std::endl;
00029 exit(-1);
00030 }
00031
00032 HepPDT::TableBuilder tb(datacol);
00033
00034 if( !HepPDT::addIsajetParticles( pdfile, tb ) ) {
00035 std::cout << "error reading " << pdgfile << std::endl;
00036 }
00037 }
00038 std::ofstream wpdfile( outfile );
00039 if( !wpdfile ) {
00040 std::cerr << "cannot open " << outfile << std::endl;
00041 exit(-1);
00042 }
00043 datacol.writeParticleData(wpdfile);
00044 wpdfile << std::endl;
00045
00046
00047 datacol.writeParticleInfo(wpdfile);
00048
00049 return 0;
00050 }