Index: trunk/Examples/Convertors_Only.cpp
===================================================================
--- trunk/Examples/Convertors_Only.cpp	(revision 379)
+++ trunk/Examples/Convertors_Only.cpp	(revision 380)
@@ -45,4 +45,5 @@
 #include "DataConverter.h"
 #include "HEPEVTConverter.h"
+#include "HepMCConverter.h"
 #include "LHEFConverter.h"
 #include "STDHEPConverter.h"
@@ -60,16 +61,4 @@
 
 using namespace std;
-
-//------------------------------------------------------------------------------
-void todo(string filename) {
-  ifstream infile(filename.c_str());
-  cout << "** TODO list ..." << endl;
-  while(infile.good()) {
-    string temp;
-    getline(infile,temp);
-    cout << "*" << temp << endl;
-  }
-  cout << "** done...\n"; 
-}
 
 //------------------------------------------------------------------------------
@@ -88,8 +77,9 @@
   delete [] appOpt;
 
-  if(argc != 3) {
-    cout << " Usage: " << argv[0] << " input_file output_file " << endl;
+  if(argc != 4) {
+    cout << " Usage: " << argv[0] << " input_file output_file PDG_Table" << endl;
     cout << " input_list - list of files in Ntpl, StdHep of LHEF format," << endl;
-    cout << " output_file - output file." << endl;
+    cout << " output_file - output file," << endl;
+    cout << " PDG_Table - file with PDG particle table" << endl;
     exit(1);
   }
@@ -160,10 +150,14 @@
   
   //read the output TROOT file
-  string inputFileList(argv[1]), outputfilename(argv[2]);
+  string inputFileList(argv[1]), outputfilename(argv[2]), pdgtablefilename(argv[3]);
   if(outputfilename.find(".root") > outputfilename.length()) {
     cout <<"**    ERROR: 'output_file' should be a .root file. Exiting...      **"<< endl;
     exit(1);
   }
-  
+ 
+  RESOLution DET;
+  DET.PdgTableFilename = pdgtablefilename;
+  DET.ReadParticleDataGroupTable(); //  DET.PDGtable.print();
+
   TFile *outputFile = TFile::Open(outputfilename.c_str(), "RECREATE"); // Creates the file, but should be closed just after
   outputFile->Close();
@@ -174,34 +168,40 @@
   
   // data converters
-  DataConverter *converter=NULL;
   cout <<"**                                                                 **"<<endl;
   cout <<"**        ####### Start convertion to TRoot format ########        **"<< endl;
 
-  if(strstr(line.c_str(),".hep"))
-    {                           
+  if(line.length() == 1+line.find_last_of(".hep"))
+    {
       cout <<"**                 StdHEP file format detected                     **"<<endl;
       cout <<"**                This can take several minutes                    **"<< endl;
-      converter = new STDHEPConverter(inputFileList,outputfilename);//case ntpl file in input list
-    }
-  else if(strstr(line.c_str(),".lhe"))
+      STDHEPConverter converter(inputFileList,outputfilename,DET.PDGtable);//case ntpl file in input list
+    }
+  else if(line.length() == 1+line.find_last_of(".lhe"))
     {
       cout <<"**                   LHEF file format detected                     **"<<endl;
       cout <<"**                 This can take several minutes                   **"<< endl;
-      converter = new LHEFConverter(inputFileList,outputfilename);//case ntpl file in input list
-    }
-  else if(strstr(line.c_str(),".root"))
+      LHEFConverter converter(inputFileList,outputfilename,DET.PDGtable);//case ntpl file in input list
+    }
+  else if(line.length() == 1+line.find_last_of(".root"))
     {
       cout <<"**                   h2root file format detected                   **"<<endl;
       cout <<"**                  This can take several minutes                  **"<< endl;
-      converter = new HEPEVTConverter(inputFileList,outputfilename);//case ntpl file in input list
+      HEPEVTConverter converter(inputFileList,outputfilename,DET.PDGtable);//case ntpl file in input list
+    }
+  else if(line.length() == 1+line.find_last_of(".hepmc"))
+    {
+      cout <<"**                HepMC ASCII file format detected                 **"<<endl;
+      cout <<"**                  This can take several minutes                  **"<< endl;
+      HepMCConverter converter(inputFileList,outputfilename,DET.PDGtable);
     }
   else {
-      cerr << left  << setw(4) <<"**  "<<""
-           << left  << setw(63) << line.c_str() <<""
-           << right << setw(2) <<"**"<<endl;
-      cerr <<"**         ERROR: File format not identified --  Exiting...        **"<< endl;
-      cout <<"**                                                                 **"<< endl;
-      cout <<"*********************************************************************"<< endl;
-      return -1;};
+    cerr << left  << setw(4) <<"**  "<<""
+         << left  << setw(63) << line.c_str() <<""
+         << right << setw(2) <<"**"<<endl;
+    cerr <<"**         ERROR: File format not identified --  Exiting...        **"<< endl;
+    cout <<"**                                                                 **"<< endl;
+    cout <<"*********************************************************************"<< endl;
+    return -1;};
+
   cout <<"**                       Exiting conversion...                     **"<< endl;
   cout <<"*********************************************************************"<< endl;
@@ -209,5 +209,4 @@
 
 
-  delete converter;
   
 }
