Index: /trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- /trunk/SophyaPI/PIext/basexecut.cc	(revision 2791)
+++ /trunk/SophyaPI/PIext/basexecut.cc	(revision 2792)
@@ -22,4 +22,5 @@
 #include "ntuple.h"
 #include "generaldata.h"
+#include "datatable.h"
 
 #ifdef SANS_EVOLPLANCK
@@ -284,4 +285,40 @@
   mObjMgr->AddObj(nt,tokens[0]);
   }
+
+// Creation de DataTable
+else if (kw == "newdt") {
+  if(tokens.size() < 2)
+    {cout<<"Usage: newdt name v1:t1 v2:t2 ... vn:tn / newdt name nvar"<<endl; return(0);}
+  DataTable* dt = new DataTable();
+  const char *c = tokens[1].c_str();
+  if(isdigit(c[0])) {
+    int n = atoi(tokens[1].c_str());
+    if(n<=0 || n>=10000) {
+      cout<<"newdt name nvar : nvar="<<n<<" must be an positive integer<10000"<<endl;
+      delete dt; return(0);
+    }
+    for(int i=0;i<n;i++) {
+      char str[16]; sprintf(str,"v%d",i);
+      dt->AddDoubleColumn(str);
+    }
+  } else {
+    for(int i=1;i<tokens.size();i++) {
+      string vname = tokens[i];
+      uint_4 p = tokens[i].find(':');
+      if(p<tokens[i].size()) vname = vname.substr(0,p);
+      if(vname.size()<1) {
+        cout<<"Zero size name for variable: tokens["<<i<<"]="<<tokens[i]<<endl;
+        delete dt; return(0);
+      }
+      if     (tokens[i].find(":r4")<tokens[i].size()) dt->AddFloatColumn(vname);
+      else if(tokens[i].find(":r8")<tokens[i].size()) dt->AddDoubleColumn(vname);
+      else if(tokens[i].find(":i4")<tokens[i].size()) dt->AddIntegerColumn(vname);
+      else if(tokens[i].find(":i8")<tokens[i].size()) dt->AddLongColumn(vname);
+      else if(tokens[i].find(":s") <tokens[i].size()) dt->AddStringColumn(vname);
+      else                                            dt->AddDoubleColumn(vname);
+    }
+  }
+  mObjMgr->AddObj(dt,tokens[0]);
+}
 
 // Creation de GeneralFitData
@@ -889,5 +926,5 @@
 mpiac->RegisterCommand(kw, usage, this, "FileIO");
 kw = "ntfrascii";
-usage = "Fills an existing NTuple from ASCII table file";
+usage = "Fills an existing NTuple or DataTable from ASCII table file";
 usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
 usage += "\n  Related commands: ntloop fillnt ";
@@ -982,28 +1019,38 @@
 kw = "newh1d";
 usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
-usage += "\n  Related commands: newh2d  newprof[e] newnt  newgfd ";  
+usage += "\n  Related commands: newh2d  newprof[e] newdt newnt  newgfd ";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newh2d";
 usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
-usage += "\n  Related commands: newh1d  newprof[e] newnt  newgfd ";  
+usage += "\n  Related commands: newh1d  newprof[e] newdt newnt  newgfd ";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newprof";
 usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
 usage += "\n  Errors represent the data spread in the X bin ";  
-usage += "\n  Related commands: newh1d  newh2d newprofe newnt newgfd ";  
+usage += "\n  Related commands: newh1d  newh2d newprofe newdt newnt newgfd ";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newprofe";
 usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
 usage += "\n  Errors represent the error on the data mean in the X bin ";  
-usage += "\n  Related commands: newh1d  newh2d newprof newnt newgfd ";  
+usage += "\n  Related commands: newh1d  newh2d newprof newdt newnt newgfd ";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newnt";
 usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
 usage += "\n        newnt name nvar";  
-usage += "\n  Related commands: newh1d  newh2d newprof[e] newgfd ";  
+usage += "\n  Related commands: newdt newh1d  newh2d newprof[e] newgfd ";  
+mpiac->RegisterCommand(kw, usage, this, "Objects");
+kw = "newdt";
+usage = "Creates a datatable \n Usage: newdt name v1:t1 v2:t2 v3:t3 .. vn:tn";
+usage += "\n        newdt name nvar";  
+usage += "\n    vi : variable name";  
+usage += "\n    ti : variable type";  
+usage += "\n         r8,r4 for 8 and 4 bytes float";  
+usage += "\n         i8,i4 for 8 and 4 bytes signed integer";  
+usage += "\n         s for string";  
+usage += "\n  Related commands: newnt newh1d  newh2d newprof[e] newgfd";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newgfd";
 usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
-usage += "\n  Related commands: newh1d  newh2d  newprof[e] newnt ";  
+usage += "\n  Related commands: newh1d  newh2d  newprof[e] newdt newnt ";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newvec";
Index: /trunk/SophyaPI/PIext/pawexecut.cc
===================================================================
--- /trunk/SophyaPI/PIext/pawexecut.cc	(revision 2791)
+++ /trunk/SophyaPI/PIext/pawexecut.cc	(revision 2792)
@@ -13,4 +13,5 @@
 #include "histerr.h"
 #include "ntuple.h"
+#include "datatable.h"
 
 #include "pawexecut.h"
@@ -99,8 +100,10 @@
 
 kw = "n/read";
-usage = "Read columns in an ASCII file and fill a NTuple";
+usage = "Read columns in an ASCII file and fill a NTuple or a DataTable";
 usage += "\n n/read nt fascii [options] var_1,c_1 var_2,c_2 ... var_n,c_n ";
-usage += "\n var_i,c_i : ntuple variable name, associated column in ASCII file [0,n[";
+usage += "\n nt : NTuple or DataTable (see options) name";
+usage += "\n var_i,c_i : variable name, associated column in ASCII file [0,n[";
 usage += "\n where [options] are:";
+usage += "\n   \"-dt\": create a DataTable of double instead of a NTuple";
 usage += "\n   \"=s\": separator character is \'s\' (could be \"\t\")";
 usage += "\n   \"-^abcd\": do not read lines beginning with string \"abcd\" ";
@@ -655,4 +658,5 @@
  string nament = tokens[0];
  string nameascii = tokens[1];
+ bool create_datatable = false;
  vector<string> donotreadbeg;
  vector<string> donotreadin;
@@ -667,4 +671,8 @@
    int lc = tokens[i].size();
    if(lc<2) continue;
+   if(tokens[i].find("-dt")==0) { // create DataTable instead of NTuple
+     create_datatable = true;
+     continue;
+   }
    const char *c = tokens[i].c_str();
    if(c[0]=='=') { // Separator
@@ -739,9 +747,17 @@
  }
 
- // Creation du NTuple
- char** ntvn = new char*[nvar];
- for(int i=0;i<nvar;i++) ntvn[i] = const_cast<char *>(varname[i].c_str());
+ // Creation du NTuple ou de la DataTable
+ NTuple *nt = NULL;
+ DataTable *dt = NULL;
+ if(!create_datatable) { //create NTuple
+   char** ntvn = new char*[nvar];
+   for(int i=0;i<nvar;i++) ntvn[i] = const_cast<char *>(varname[i].c_str());
+   nt = new NTuple(nvar,ntvn);
+   delete [] ntvn;
+ } else { //create DataTable
+   dt = new DataTable();
+   for(int i=0;i<nvar;i++) dt->AddDoubleColumn(varname[i]);
+ }
  r_8 *xnt = new r_8[nvar];
- NTuple *nt = new NTuple(nvar,ntvn);
 
  // Read file
@@ -808,5 +824,5 @@
    if(lvs<numcolmaxi) continue; // Pas assez de champs decodes, mauvaise ligne
 
-   // Remplissage du NTuple
+   // Remplissage du NTuple ou de la DataTable
    for(int i=0;i<nvar;i++) {
      xnt[i] = 0.;
@@ -815,16 +831,23 @@
      xnt[i] = atof(vs[ic].c_str());
    }
-   nt->Fill(xnt);
+   if(nt)      nt->Fill(xnt);
+   else if(dt) dt->Fill(xnt);
    //cout<<"...xnt"; for(int i=0;i<nvar;i++) cout<<" "<<xnt[i]; cout<<endl;
 
  }
+ int_4 nentries = (nt)? nt->NEntry(): dt->NEntry();
  cout<<"n_read: "<<nline<<" lines in file, "
      <<nlinecom<<" commentary, "
-     <<nt->NEntry()<<" Ntuple entries"<<endl;
-
- // On sauve le NTuple si besoin, on ferme et detruit ce qu'il faut
+     <<nentries<<" object entries"<<endl;
+
+ // On sauve le NTuple/DataTable si besoin, on ferme et detruit ce qu'il faut
  NamedObjMgr omg;
- if(nt->NEntry()>0) omg.AddObj(nt,nament); else delete nt;
- delete [] ntvn;
+ if(nentries>0) {
+   if(nt) omg.AddObj(nt,nament);
+   if(dt) omg.AddObj(dt,nament);
+ } else {
+   if(nt) delete nt;
+   if(dt) delete dt;
+ }
  delete [] xnt;
  delete [] line;
Index: /trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- /trunk/SophyaPI/PIext/servnobjm.cc	(revision 2791)
+++ /trunk/SophyaPI/PIext/servnobjm.cc	(revision 2792)
@@ -34,6 +34,7 @@
 #include "histos.h"
 #include "histos2.h"
+#include "hisprof.h"
 #include "ntuple.h"
-#include "hisprof.h"
+#include "datatable.h"
 
 #include "piyfxdrw.h"
@@ -823,20 +824,28 @@
 /* --Methode-- */
 void Services2NObjMgr::NtFromASCIIFile(string& nom,string& filename,double def_val)
-//	Pour remplir un ntuple "nom" existant a partir du fichier
+//	Pour remplir un NTuple/DataTable "nom" existant a partir du fichier
 //	ASCII table "filename". Si il y a plus de variables dans le
 //	ntuple que dans le fichier "filename",
-//	les sur-numeraires sont mises a "def_val" par defaut.
+//	les sur-numeraires numeriques sont mises a "def_val" par defaut.
 {
 AnyDataObj* mobj = MyObjMgr()->GetObj(nom);
-if(mobj == NULL)
-  {cout<<"NtFromASCIIFile() Error, object "<<nom<<" not existing"<<endl;
-   return;}
-if(typeid(*mobj) != typeid(NTuple))
-  {cout<<"NtFromASCIIFile() Error, object "<<nom<<" not an NTuple"<<endl;
-   return;}
-if (!mImgapp)  return; 
-
-NTuple* nt = (NTuple*) mobj;
-nt->FillFromASCIIFile(filename, def_val);
+if(mobj == NULL) {
+  cout<<"NtFromASCIIFile() Error, object "<<nom<<" not existing"<<endl;
+  return;
+}
+
+NTuple* nt = NULL;
+DataTable* dt = NULL;
+if(typeid(*mobj) == typeid(NTuple))         nt = (NTuple*) mobj;
+else if(typeid(*mobj) == typeid(DataTable)) dt = (DataTable*) mobj;
+
+if(nt==NULL && dt==NULL) {
+  cout<<"NtFromASCIIFile() Error, object "<<nom<<" not an NTuple nor a DataTable"<<endl;
+  return;
+}
+if (!mImgapp)  return; 
+
+if(nt)      nt->FillFromASCIIFile(filename, def_val);
+else if(dt) dt->FillFromASCIIFile(filename);
 return;
 }
