Index: trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/basexecut.cc	(revision 440)
+++ trunk/SophyaPI/PIext/basexecut.cc	(revision 447)
@@ -234,4 +234,40 @@
   mObjMgr->AddObj(h, tokens[0]);
   }
+
+// Creation de NTuple
+else if (kw == "newnt") {
+  if(tokens.size() < 2)
+    {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);}
+  vector<string> varname;
+  int nvar = 0;
+  const char *c = tokens[1].c_str();
+  if(isdigit(c[0])) {
+    nvar = atoi(tokens[1].c_str());
+    if(nvar<=0 || nvar>=10000)
+      {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl;
+       return(0);}
+    for(int i=0;i<nvar;i++) {
+      char str[16]; sprintf(str,"%d",i);
+      string dum = "v"; dum += str;
+      varname.push_back(dum.c_str());
+    }
+  } else if( islower(c[0]) || isupper(c[0]) ) {
+    for(int i=1;i<tokens.size();i++) {
+      varname.push_back(tokens[i].c_str());
+      nvar++;
+    }
+  } else {
+    cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl
+        <<"newnt name nvar : nvar must be an positive integer"<<endl;
+    return(0);
+  }
+  char **noms = new char*[nvar];
+  for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str();
+  NTuple* nt = new NTuple(nvar,noms);
+  delete [] noms;
+  mObjMgr->AddObj(nt,tokens[0]);
+  }
+
+// Creation de GeneralFitData
 else if (kw == "newgfd") {
   if (tokens.size() < 3)
@@ -510,4 +546,15 @@
 
 // Remplissage NTuple,Vecteurs, ... , boucle de NTuple
+else if (kw == "ntfrascii" ) {
+  if(tokens.size() < 2) { 
+    cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl;
+    return(0);
+    }
+  cout<<"CMV -> Reza tu dois mettre ici (def_val) la valeur par defaut"<<endl;
+  double def_val = 0.;
+  if(tokens.size()>=3) def_val = atof(tokens[2].c_str());
+  srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val);
+  }
+
 else if (kw == "fillnt" ) {
   if (tokens.size() < 5) { 
@@ -717,17 +764,22 @@
 kw = "newh1d";
 usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
-usage += "\n  Related commands: newh2d  newprof  newgfd ";  
+usage += "\n  Related commands: newh2d  newprof 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  newgfd ";  
+usage += "\n  Related commands: newh1d  newprof 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  Related commands: newh1d  newh2d newgfd ";  
+usage += "\n  Related commands: newh1d  newh2d 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 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 ";  
+usage += "\n  Related commands: newh1d  newh2d  newprof newnt ";  
 mpiac->RegisterCommand(kw, usage, this, "Objects");
 kw = "newvec";
@@ -866,4 +918,10 @@
 mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
 
+kw = "ntfrascii";
+usage = "Fills an existing NTuple from ASCII table file";
+usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
+usage += "\n  Related commands: ntloop fillnt ";
+mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
+
 kw = "fillnt";
 usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
Index: trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.cc	(revision 440)
+++ trunk/SophyaPI/PIext/servnobjm.cc	(revision 447)
@@ -703,4 +703,30 @@
 mOmg->DisplayObj(nomvec, dopt);
 return;  
+}
+
+/* --Methode-- */
+void Services2NObjMgr::NtFromASCIIFile(string& nom,string& filename,double def_val)
+//	Pour remplir un ntuple "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.
+{
+NamedObjMgr omg;
+AnyDataObj* mobj = omg.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;
+cout<<"CMV -> Reza tu dois mofidier FillFromASCIIFile"<<endl;
+cout<<"CMV -> Reza pour permettre une valeur par defaut"<<endl;
+cout<<"CMV -> Reza n oublie AUSSI pas l arg par def dans servnobj.h"<<endl;
+cout<<"CMV -> Reza > nt->FillFromASCIIFile(filename,def_val);"<<endl;
+nt->FillFromASCIIFile(filename);
+return;
 }
 
Index: trunk/SophyaPI/PIext/servnobjm.h
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.h	(revision 440)
+++ trunk/SophyaPI/PIext/servnobjm.h	(revision 447)
@@ -76,4 +76,5 @@
   virtual void          ExpressionToVector(string & nom, string& expx, string& expcut, 
                                            string& nomvec, string dopt="", string loop="");
+  virtual void          NtFromASCIIFile(string& nom,string& filename,double def_val=0.);
   virtual void          FillNT(string & nom, string& expx, string& expy, string& expz,
                                string& expt, string& expcut, string& nomnt, string loop=""); 
