00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <fstream>
00010 #include <iostream>
00011
00012 #include "HepPDT/TableBuilder.hh"
00013 #include "HepPDT/ParticleDataTable.hh"
00014
00015 int main()
00016 {
00017 const char infile1[] = "@top_srcdir@/examples/data/evt.pdl";
00018 const char outfile[] = "listEvtGenNames.out";
00019
00020 std::ifstream pdfile1( infile1 );
00021 if( !pdfile1 ) {
00022 std::cerr << "cannot open " << infile1 << std::endl;
00023 exit(-1);
00024 }
00025
00026 HepPDT::ParticleDataTable datacol( "EvtGen Table" );
00027 {
00028
00029 HepPDT::TableBuilder tb(datacol);
00030
00031 if( !addEvtGenParticles( pdfile1, tb ) ) { std::cout << "error reading EvtGen pdt file " << std::endl; }
00032 }
00033
00034 std::ofstream wpdfile( outfile );
00035 if( !wpdfile ) {
00036 std::cerr << "cannot open " << outfile << std::endl;
00037 exit(-1);
00038 }
00039
00040 datacol.writeParticleTranslation( wpdfile );
00041
00042 return 0;
00043 }