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@/data/pdt.table";
00018 const char infile2[] = "@top_srcdir@/data/DECAY.DEC";
00019 const char outfile[] = "listEvtGenNames.out";
00020
00021 std::ifstream pdfile1( infile1 );
00022 if( !pdfile1 ) {
00023 std::cerr << "cannot open " << infile1 << std::endl;
00024 exit(-1);
00025 }
00026 std::ifstream pdfile2( infile2 );
00027 if( !pdfile2 ) {
00028 std::cerr << "cannot open " << infile2 << std::endl;
00029 exit(-1);
00030 }
00031
00032 HepPDT::ParticleDataTable datacol( "EvtGen Table" );
00033 {
00034
00035 HepPDT::TableBuilder tb(datacol);
00036
00037 if( !addEvtGenParticles( pdfile1, tb ) ) { std::cout << "error reading EvtGen pdt file " << std::endl; }
00038 if( !addEvtGenParticles( pdfile2, tb ) ) { std::cout << "error reading EvtGen decay file " << std::endl; }
00039 }
00040
00041 std::ofstream wpdfile( outfile );
00042 if( !wpdfile ) {
00043 std::cerr << "cannot open " << outfile << std::endl;
00044 exit(-1);
00045 }
00046
00047 datacol.writeParticleTranslation( wpdfile );
00048
00049 return 0;
00050 }