Index: /Interface_Web/trunk/pspaWT/sources/controler/include/bareParticle.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/bareParticle.h	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/bareParticle.h	(revision 342)
@@ -87,7 +87,3 @@
 
 };
-
-
-
-
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h	(revision 342)
@@ -18,57 +18,58 @@
 {
   abstractSoftware* createSoftwareConnexion(nomDeLogiciel logi);
-public:
+
+ public:
+  
+  dataManager(PspaApplication*);
+  virtual ~dataManager();
+  void consoleMessage(string message);
+  int getBeamLineSize();
+  inline globalParameters* getGlobalParameters()  {return &globParam_;}
+  inline particleBeam* getCurrentBeam() {return currentBeam_;}
     
-    dataManager(PspaApplication*);
-    virtual ~dataManager();
-    void consoleMessage(string message);
-    int getBeamLineSize();
-    inline globalParameters* getGlobalParameters()  {return &globParam_;}
-    inline particleBeam* getCurrentBeam() {return currentBeam_;}
+  particleBeam* getDiagnosticBeam(unsigned index);
     
-    particleBeam* getDiagnosticBeam(unsigned index);
+  void addSectionToExecute(int debut, int fin, nomDeLogiciel prog);
     
-    void addSectionToExecute(int debut, int fin, nomDeLogiciel prog);
-    
-    abstractElement* addElement(typedElement elemType);
-    void removeElement(string);
-
-    /**
+  abstractElement* addElement(typedElement elemType);
+  void removeElement(string);
+  
+  /**
      Get the label from the order number in the beam line
      @return return "" if not found
-     */
-    string getLabelFromElementNumero(int numero);
-
-    /**
+  */
+  string getLabelFromElementNumero(int numero);
+  
+  /**
      Get the numero from the label in the beam line
      @return return -1 if not found
-     */
-    int getNumeroFromElementLabel(string);
-    abstractElement* getElementPointerFromNumero(int);
+  */
+  int getNumeroFromElementLabel(string);
+  abstractElement* getElementPointerFromNumero(int);
+  
+  void initializeExecution();
+  trivaluedBool checkExecute(string& diagnostic);
+  trivaluedBool checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic);
+  bool executeAll();
+  void saveConfiguration(string nameOfCase);
+  bool restoreElements(string inputFileName);
+  void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor);
+  void donneesRmsEnveloppe(string type,unsigned int lineSize,vector<double>& xcor,vector<double>& ycor);
+  
+  inline void setWorkingDir(string wd) {
+    workingDir_ = wd;
+  }
     
-    void initializeExecution();
-    trivaluedBool checkExecute(string& diagnostic);
-    trivaluedBool checkElementsForExec(nomDeLogiciel logiciel, unsigned indexDeb, unsigned indexFin, string& diagnostic);
-    bool executeAll();
-    void saveConfiguration(string nameOfCase);
-    bool restoreElements(string inputFileName);
-    void donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor);
-    /* inline void setWorkingDir(string wd) { */
-    /*     workingDir_ = wd; */
-    /* } */
+ private :
+
+  PspaApplication* pspa_;
+  globalParameters globParam_;
+  particleBeam* currentBeam_;
     
-private:
-    globalParameters globParam_;
-    particleBeam* currentBeam_;
-    
-    vector<particleBeam> diagnosticBeam_;
-    
-    vector<sectionToExecute*> jobList_;
-    
-    void removeFile(string nameOfFile);
-    void clearSectionToExecute();
-
-    //   string workingDir_;
-    PspaApplication* pspa_;
-};
+  vector<particleBeam> diagnosticBeam_;  
+  vector<sectionToExecute*> jobList_;
+  
+  void removeFile(string nameOfFile);
+  void clearSectionToExecute();
+  };
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/elementSnapshot.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/elementSnapshot.h	(revision 342)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/elementSnapshot.h	(revision 342)
@@ -0,0 +1,30 @@
+#ifndef SNAPSHOTDEFINITION_SEEN
+#define SNAPSHOTDEFINITION_SEEN
+
+#include <string>
+#include "abstractElement.h"
+
+using namespace std;
+
+class elementSnapshot : public abstractElement
+{
+    
+  void setDefaultValues();
+  void setDefaults();
+    
+ public :
+    
+  elementSnapshot();
+  ~elementSnapshot() {;}
+  
+  virtual trivaluedBool is_accepted_by_software(nomDeLogiciel soft) const;
+  virtual string* getParametersString() const;
+  virtual void setParametersString(string* param);
+  virtual  string parmelaOutputFlow() const;
+  virtual string transportOutputFlow() const;  
+   
+  virtual string FileOutputFlow() const;  
+  virtual void FileInput(ifstream& ifs);
+  string print();  
+};
+#endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/nomdElements.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/nomdElements.h	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/nomdElements.h	(revision 342)
@@ -4,5 +4,5 @@
 using namespace std;
 
-enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, inconnu};
+enum typedElement {beam, RFgun, drift, cell, bend, soleno, fit, snapshot, inconnu};
 
 
Index: /Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/include/particleBeam.h	(revision 342)
@@ -4,11 +4,8 @@
 #include <sstream>
 #include <stdio.h>
-
 #include<cmath>
-
 #include <vector>
 
 #include "bareParticle.h"
-//#include "mathematicalTools.h"
 #include "nomdElements.h"
 #include "beam2Moments.h"
@@ -16,40 +13,26 @@
 using namespace std;
 
-
-
 class particleBeam 
 {
-
   bool particleRepresentationOk_;
   bool momentRepresentationOk_;
-
   bareParticle referenceParticle_;
+  beam2Moments rij_;
+  double P0Transport_;
 
   vector<bareParticle> goodPartic_;
-
-  beam2Moments rij_;
-
-
   vector<double> centroid_;
-  double P0Transport_;
-
 
   void impressionDesMoments() const;
   void razDesMoments();
 
-
  public:
 
   particleBeam(); 
-
   virtual ~particleBeam() {;}
 
   void buildMomentRepresentation();
-
-
   void clear();
-
   int getNbParticles() const;
-
   const beam2Moments&  getTransportMoments() const;
   double getSigmaTransportij(unsigned i, unsigned j);
@@ -59,36 +42,19 @@
   bool particleRepresentationOk() const;
   bool momentRepresentationOk() const;
-
-
   void  addParticle( bareParticle p);
-
-
-
   const vector<bareParticle>& getParticleVector() const;
-
   vector<bareParticle>& getParticleVector(); 
-
   double getXmaxRms();
-
   void getVariance(double& varx, double& vary, double& varz) const;
- 
   void set2Moments(beam2Moments& moments);
   void setWithParticles(vector<double>& centroid, bareParticle& referencePart, vector<bareParticle>& particles);
   void printAllXYZ() const;
-
-
   void Zrange(double& zmin, double& zmax) const;
-
   void donneesDessinEllipseXxp(vector<double>& xcor, vector<double>& ycor);
   void donneesDessinEllipse(vector<double>& xcor, vector<double>& ycor, unsigned indexAbs, unsigned indexOrd);
 
   virtual string FileOutputFlow() const;
-
-
   virtual bool FileInput(ifstream& ifs);
-
   void histogramme(vector<double>&xcor,vector<int>& hist,int& cnts,double out[3]);
 };
-
-
 #endif
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractElement.cc	(revision 342)
@@ -77,8 +77,7 @@
 
 trivaluedBool abstractElement::is_accepted_by_software(nomDeLogiciel soft) const {
-    cout << " abstractElement : generic method is_accepted_by_software()  " << endl;
+  cout << " abstractElement : generic method is_accepted_by_software()  " << endl;
   return error;
 }
-
 
 double abstractElement::getInitialKineticEnergy() const {
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/abstractSoftware.cc	(revision 342)
@@ -6,5 +6,4 @@
   globParamPtr_ = NULL;
   dataManager_ = NULL;
-
 }
 
@@ -18,13 +17,13 @@
 bool abstractSoftware::launchJob(string commandLine, string& resul)
 {
+  bool ExecuteStatus = true;
+
+  FILE* pp = popen(commandLine.c_str(), "r");
   ostringstream sortie;
-  bool ExecuteStatus = true;
-  FILE* pp = popen(commandLine.c_str(), "r");
   if (pp == NULL) {
     sortie << " launching  failed : " << commandLine << endl;
     ExecuteStatus = false;
-  }
-  else {
-    cout << " executind command :  "  << commandLine << endl;
+  } else {
+    cout << " executing command :  "  << commandLine << endl;
     // on copie la sortie dans le fichier assigne
     char buf[132];
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 342)
@@ -11,27 +11,23 @@
 #include <stdio.h>
 #include <fstream>
-//#include <algorithm>
-
 
 dataManager::dataManager(PspaApplication* pspa) :
-currentBeam_(NULL)
-,pspa_ ( pspa)
-{
-  //  workingDir_ = pspa_->getWorkingDir();
-}
-
-
-dataManager::~dataManager() {
-    unsigned k;
-    for (k=0; k < jobList_.size();k++) {
-        if ( jobList_[k] != NULL ) delete jobList_[k];
-    }
-    if ( currentBeam_ == NULL ) delete currentBeam_;
+  currentBeam_(NULL),
+  pspa_ (pspa)
+{}
+
+dataManager::~dataManager() 
+{
+  unsigned k;
+  for (k=0; k < jobList_.size();k++) {
+    if ( jobList_[k] != NULL ) delete jobList_[k];
+  }
+  if ( currentBeam_ == NULL ) delete currentBeam_;
 }
 
 void dataManager::consoleMessage(string message) {
-   GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
-   if (console) console->addConsoleMessage(message);
-   pspa_->processEvents();
+  GWt_console* console = static_cast<GWt_console*> (wApp->findWidget ("console"));
+  if (console) console->addConsoleMessage(message);
+  pspa_->processEvents();
 }
 
@@ -44,24 +40,25 @@
 
 
-int dataManager::getNumeroFromElementLabel(string label){
-    int index = -1;
-    unsigned int k;
-    
-    for (k = 0; k < getBeamLineSize() ; k++)
-    {
-        if (pspa_->getBeamLine()->getAbstractElement(k) != NULL){
-            if ( pspa_->getBeamLine()->getAbstractElement(k)->getLabel() == label )
-            {
-                index = (int)k + 1;
-                return index;
-            }
-        }
-    }
-    return index;
-}
-
-
-abstractElement* dataManager::getElementPointerFromNumero(int k){
-    return pspa_->getBeamLine()->getAbstractElement(k-1);
+int dataManager::getNumeroFromElementLabel(string label)
+{
+  int index = -1;
+  
+  for (int k = 0; k < getBeamLineSize() ; k++)
+    {
+      if (pspa_->getBeamLine()->getAbstractElement(k) != NULL){
+	if ( pspa_->getBeamLine()->getAbstractElement(k)->getLabel() == label )
+	  {
+	    index = (int)k + 1;
+	    return index;
+	  }
+      }
+    }
+  return index;
+}
+
+
+abstractElement* dataManager::getElementPointerFromNumero(int k)
+{
+  return pspa_->getBeamLine()->getAbstractElement(k-1);
 }
 
@@ -69,77 +66,70 @@
 void dataManager::addSectionToExecute(int debut, int fin, nomDeLogiciel prog)
 {
-    jobList_.push_back(new sectionToExecute);
-    jobList_.back()->firstElement = debut;
-    jobList_.back()->lastElement = fin;
-    jobList_.back()->software  = prog;
+  jobList_.push_back(new sectionToExecute);
+  jobList_.back()->firstElement = debut;
+  jobList_.back()->lastElement = fin;
+  jobList_.back()->software  = prog;
 }
 
 void dataManager::clearSectionToExecute()
 {
-    unsigned k;
-    for(k = 0; k < jobList_.size(); k++)
-    {
-        if ( jobList_[k] != NULL ) delete jobList_[k];
-    }
-    jobList_.clear();
+  unsigned k;
+  for(k = 0; k < jobList_.size(); k++)
+    {
+      if ( jobList_[k] != NULL ) delete jobList_[k];
+    }
+  jobList_.clear();
 }
 
 trivaluedBool dataManager::checkExecute(string& diagnostic)
 {
-   cout << "dataManager::checkExecute()" << endl;
-   consoleMessage(" VERIFICATION AVANT EXECUTION ");
-   //   console_ = static_cast<GWt_console*> (wApp->findWidget ("console"));
-   //   if (console_) console_->addConsoleMessage(" VERIFICATION AVANT EXECUTION ");
-
+  cout << "dataManager::checkExecute()" << endl;
+  consoleMessage(" VERIFICATION AVANT EXECUTION ");
+  
   trivaluedBool resul = ok;
-  unsigned k,j;
   diagnostic.clear();
-  unsigned numeroDeb, numeroFin;
-  cout << "controle execution : " << endl;
-  for(k = 0; k < jobList_.size(); k++) {
-    numeroDeb = jobList_[k]->firstElement;
-    numeroFin = jobList_[k]->lastElement;
-    if ( numeroFin  < numeroDeb )
-      {
-	diagnostic += " last element before first  for job " + (jobList_[k]->software).getString() + " \n";
-	resul = error;
-        break;
-      }
-    cout << " numeroDeb= " << numeroDeb << " numeroFin= " << numeroFin << endl;
-    // indexDeb--;
-    // indexFin--;
-    
-    abstractElement* elPtr;
+  
+  for(unsigned k = 0; k < jobList_.size(); k++) {
+    
+    unsigned numeroDeb = jobList_[k]->firstElement;
+    unsigned numeroFin = jobList_[k]->lastElement;
+    
+    if ( numeroFin  < numeroDeb ) {
+      diagnostic += " last element before first for job " + (jobList_[k]->software).getString() + " \n";
+      resul = error;
+      break;
+    }
+
     string checkCompatibility;
-    resul = checkElementsForExec(jobList_[k]->software, numeroDeb, numeroFin, checkCompatibility);
+    resul = checkElementsForExec(jobList_[k]->software,numeroDeb,numeroFin,checkCompatibility);
     diagnostic += checkCompatibility;
+  } //k
+
+  return resul;
+}
+
+trivaluedBool dataManager::checkElementsForExec(nomDeLogiciel logiciel,unsigned numeroDeb,unsigned numeroFin,string& diagnostic)
+{
+  trivaluedBool resul = ok;
+  trivaluedBool accepted;
+
+  diagnostic.clear();  
+  abstractElement* elPtr;
+
+  for(unsigned j = numeroDeb; j <= numeroFin; j++) {
+    elPtr = pspa_->getBeamLine()->getAbstractElement(j-1);
+    accepted = elPtr->is_accepted_by_software(logiciel);
+
+    if(accepted == error) {
+      diagnostic += " the element " + elPtr->getNomdElement().getElementName() + " is not allowed with " + logiciel.getString() + " \n";
+      resul = error;
+    } else if (accepted  == warning) {
+      diagnostic += " the element " + elPtr->getNomdElement().getElementName() + " will be ignored by " + logiciel.getString() + " \n";
+      if ( resul != error ) resul = warning;
+    }
   }
-  cout << " data manager renvoie resul = " << resul << endl;
+
   return resul;
 }
-
-
-trivaluedBool dataManager::checkElementsForExec(nomDeLogiciel logiciel, unsigned numeroDeb, unsigned numeroFin, string& diagnostic)
-{
-    trivaluedBool resul = ok;
-    diagnostic.clear();
-    trivaluedBool accepted;
-    abstractElement* elPtr;
-    for(unsigned j = numeroDeb; j <= numeroFin; j++) {
-        elPtr = pspa_->getBeamLine()->getAbstractElement(j-1);
-        accepted = elPtr->is_accepted_by_software(logiciel);
-        if(accepted  == error  ) {
-            diagnostic += " the element " + elPtr->getNomdElement().getElementName() + " is not allowed with " + logiciel.getString() + " \n";
-            resul = error;
-        } else if ( accepted  == warning ) {
-            diagnostic += " the element " + elPtr->getNomdElement().getElementName() + " will be ignored by " + logiciel.getString() + " \n";
-            if ( resul != error ) resul = warning;
-        }
-    }
-    return resul;
-}
-
-
-
 
 void dataManager::initializeExecution()
@@ -174,32 +164,30 @@
 bool dataManager::executeAll()
 {
-    bool success = true;
-    //    resul.clear();
-    //    string resultatPartiel;
-    unsigned k;
-    abstractSoftware* softw =NULL;
-    string workingDir = pspa_->getWorkingDir();
-    for(k = 0; k < jobList_.size(); k++)
-    {
+  bool success = true;
+  abstractSoftware* softw = NULL;
+  string workingDir = pspa_->getWorkingDir();
+
+  for(unsigned k = 0; k < jobList_.size(); k++)
+    { 
+      cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->software).getString() << endl;
+      
       int debut = jobList_[k]->firstElement;
       int fin = jobList_[k]->lastElement;
-      cout << " dataManager::executeAll je m'apprete a executer : " << (jobList_[k]->software).getString() << endl;
-
-      softw = createSoftwareConnexion(jobList_[k]->software );
-
-      if ( softw == NULL ) {
+      softw = createSoftwareConnexion(jobList_[k]->software);
+      
+      if (softw == NULL) {
 	success = false;
 	consoleMessage("dataManager::executeAll : unknown software");
-	//	resultatPartiel =  " unknown software -- STOP \n ";	
 	break;
       }
 
-      success = softw->createInputFile(currentBeam_, debut, fin, workingDir);
+      success = softw->createInputFile(currentBeam_,debut,fin,workingDir);
       if ( success ) {
 	success = softw->execute(debut,fin,workingDir);
 	if ( success ) {
-	  success = softw->buildBeamAfterElements(debut, fin, diagnosticBeam_, workingDir);
+	  success = softw->buildBeamAfterElements(debut,fin,diagnosticBeam_,workingDir);
 	}
       }
+      
       delete softw;
       if ( success ) {
@@ -211,29 +199,36 @@
       }
       if ( !success ) break;
-    }
-    return success;
-}
-
+  
+      //debug
+      cout << "dataManager::executeAll #diagnosticBeam= " << diagnosticBeam_.size() << endl;
+      cout << "dataManager::executeAll #getBeamLineSize()= " << getBeamLineSize() << endl;
+      for (int j = debut; j <= fin; j++) {
+	abstractElement* elPtr= getElementPointerFromNumero(j);
+	cout << "[" << j << "] " << elPtr->getNomdElement().getElementName() << endl;
+      } 
+
+    } //k
+  
+  return success;
+}
 
 void dataManager::saveConfiguration( string nameOfCase)
 {
-    ofstream outfile;
-    string name = pspa_->getWorkingDir() + nameOfCase + ".save";
-    outfile.open(name.c_str(), ios::out);
-    if (!outfile) {
-        cerr << " error opening output file for persistency " << name << endl;
-    }
-    
-    outfile << globParam_.FileOutputFlow();
-    unsigned k;
-    abstractElement* elPtr;
-    for ( k=0 ; k < getBeamLineSize() ; k++)
-    {
-        elPtr = pspa_->getBeamLine()->getAbstractElement(k);
-        outfile << elPtr->FileOutputFlow();
-    }
-    outfile.close();
-}
-
+  ofstream outfile;
+  string name = pspa_->getWorkingDir() + nameOfCase + ".save";
+  outfile.open(name.c_str(), ios::out);
+  if (!outfile) {
+    cerr << " error opening output file for persistency " << name << endl;
+    }
+  
+  outfile << globParam_.FileOutputFlow();
+  abstractElement* elPtr;
+  for(unsigned k = 0; k < getBeamLineSize() ; k++)
+    {
+      elPtr = pspa_->getBeamLine()->getAbstractElement(k);
+      outfile << elPtr->FileOutputFlow();
+    }
+  outfile.close();
+}
 
 bool dataManager::restoreElements( string inputFileName)
@@ -281,76 +276,102 @@
 
     // debug
-    unsigned k;
-    for(k = 0; k < getBeamLineSize(); k++) {
-        abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(k);
+    // unsigned k;
+    // for(k = 0; k < getBeamLineSize(); k++) {
+    //     abstractElement* ptr = pspa_->getBeamLine()->getAbstractElement(k);        
+    //     cout << "reupere " << ptr->getLabel() << endl;
+    // }
+    return true;
+}
+
+particleBeam* dataManager::getDiagnosticBeam(unsigned index)
+{
+  if (index >= diagnosticBeam_.size()) {
+    return NULL;
+  } else {
+    return &diagnosticBeam_.at(index);
+  }
+}
+
+void dataManager::donneesRmsEnveloppe(string type,unsigned int numeroDeb,unsigned int numeroFin, vector<double>& xcor,vector<double>& ycor)
+{
+  unsigned k;
+  if ( numeroDeb < 1 ) numeroDeb = 1;
+  if ( numeroFin > diagnosticBeam_.size() ) numeroFin = diagnosticBeam_.size();
         
-        cout << "reupere " << ptr->getLabel() << endl;
-    }
-    return true;
-}
-
-
-particleBeam* dataManager::getDiagnosticBeam(unsigned index)
-{
-    
-    
-    if (  index >= diagnosticBeam_.size() ) {
-        return NULL;
-    }
-    else {
-        return &diagnosticBeam_.at(index);
-    }
-}
-
-
-void dataManager::donneesRmsEnveloppe( string type, unsigned int numeroDeb, unsigned int numeroFin, vector<double>& xcor, vector<double>& ycor)
-{
-    unsigned k;
-    if ( numeroDeb < 1 ) numeroDeb = 1;
-    if ( numeroFin > diagnosticBeam_.size() ) numeroFin = diagnosticBeam_.size();
-        
-    double longueur = 0.0;
-    double valeur = 0.0;
-    xcor.clear();
-    ycor.clear();
-    if ( type == "x" )
-    {
-        for (k= numeroDeb; k <= numeroFin; k++)
+  double longueur = 0.0;
+  double valeur = 0.0;
+  xcor.clear();
+  ycor.clear();
+  if ( type == "x" )
+    {
+      for (k= numeroDeb; k <= numeroFin; k++)
         {
-            if ( !diagnosticBeam_.at(k-1).momentRepresentationOk() ) diagnosticBeam_.at(k-1).buildMomentRepresentation();
-            longueur += pspa_->getBeamLine()->getAbstractElement(k-1)->getLenghtOfElement();
-            valeur = diagnosticBeam_.at(k-1).getXmaxRms();
-            xcor.push_back(longueur);
-            ycor.push_back(valeur);
+	  if ( !diagnosticBeam_.at(k-1).momentRepresentationOk() ) diagnosticBeam_.at(k-1).buildMomentRepresentation();
+	  longueur += pspa_->getBeamLine()->getAbstractElement(k-1)->getLenghtOfElement();
+	  valeur = diagnosticBeam_.at(k-1).getXmaxRms();
+	  xcor.push_back(longueur);
+	  ycor.push_back(valeur);
         }
     }
-    else
-    {
-        cerr << " dataManager::donneesRmsEnveloppe type " << type << " not programmed " << endl;
-        return;
-    }
+  else
+    {
+      cerr << " dataManager::donneesRmsEnveloppe type " << type << " not programmed " << endl;
+      return;
+    }
+}
+
+// on ne tient pas compte des elements "snapshot" presents dans la beamLine
+void dataManager::donneesRmsEnveloppe(string type,unsigned int lineSize,vector<double>& xcor,vector<double>& ycor)
+{
+  double longueur = 0.0;
+  double valeur = 0.0;
+  xcor.clear();
+  ycor.clear();
+
+  if ( type == "x" ) {
+    unsigned i = 0;
+    for (unsigned k = 0; k < lineSize; k++) {
+      abstractElement* elPtr = pspa_->getBeamLine()->getAbstractElement(k);
+      if(elPtr->getNomdElement().getElementType() == snapshot) {
+	cout << "TOP 1" << endl;
+	continue;
+      }
+
+      if ( !diagnosticBeam_.at(i).momentRepresentationOk() ) {
+	diagnosticBeam_.at(i).buildMomentRepresentation();
+      }
+
+      longueur += elPtr->getLenghtOfElement();
+      valeur = diagnosticBeam_.at(i).getXmaxRms();
+      xcor.push_back(longueur);
+      ycor.push_back(valeur);
+      i++;
+    }
+  } else {
+    cerr << " dataManager::donneesRmsEnveloppe type " << type << " not programmed " << endl;
+    return;
+  }
 }
 
 int dataManager::getBeamLineSize() {
-    return pspa_->getBeamLine()->getBeamLineSize();
-}
-
-abstractSoftware* dataManager::createSoftwareConnexion(nomDeLogiciel logi) {
-
-      string inputFileName;
-      if(logi == nomDeLogiciel::parmela) {
-	inputFileName = "parmin";
-	return new softwareParmela(inputFileName, &globParam_, this);
-      } else if (logi == nomDeLogiciel::transport) {
-	inputFileName = "transport.input";
-	return new softwareTransport(inputFileName, &globParam_, this);
-      } else if (logi == nomDeLogiciel::generator) {
-	inputFileName = "generator.in";
-	return new softwareGenerator(inputFileName, &globParam_, this);
-      } else if (logi == nomDeLogiciel::test) {
-	return new softwareTest(inputFileName, &globParam_, this);
-      } else {
-	return NULL;
-      }
-
-}
+  return pspa_->getBeamLine()->getBeamLineSize();
+}
+
+abstractSoftware* dataManager::createSoftwareConnexion(nomDeLogiciel logi) 
+{
+  string inputFileName;
+  if(logi == nomDeLogiciel::parmela) {
+    inputFileName = "parmin";
+    return new softwareParmela(inputFileName, &globParam_, this);
+  } else if (logi == nomDeLogiciel::transport) {
+    inputFileName = "transport.input";
+    return new softwareTransport(inputFileName, &globParam_, this);
+  } else if (logi == nomDeLogiciel::generator) {
+    inputFileName = "generator.in";
+    return new softwareGenerator(inputFileName, &globParam_, this);
+  } else if (logi == nomDeLogiciel::test) {
+    return new softwareTest(inputFileName, &globParam_, this);
+  } else {
+    return NULL;
+  } 
+}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/elementSnapshot.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/elementSnapshot.cc	(revision 342)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/elementSnapshot.cc	(revision 342)
@@ -0,0 +1,92 @@
+
+#include <iostream>
+#include "elementSnapshot.h"
+#include "mixedTools.h"
+
+elementSnapshot::elementSnapshot() : abstractElement() 
+{
+  setDefaultValues();
+  setDefaults();
+  elementName_ = nomdElements("snapshot");
+  nbParam_ = elementName_.getElementNbParameters();
+  parametersString_ = new string[nbParam_+1];
+}
+
+void elementSnapshot::setDefaultValues()
+{
+  defaultLabel_ = "shot";
+}
+
+void elementSnapshot::setDefaults()
+{
+  label_ = defaultLabel_;
+}
+
+trivaluedBool elementSnapshot::is_accepted_by_software(nomDeLogiciel soft) const 
+{
+  return warning;
+}
+
+string* elementSnapshot::getParametersString() const 
+{
+  int compteur = -1;
+  parametersString_[++compteur] = mixedTools::intToString(nbParam_);
+  parametersString_[++compteur] = label_;
+  
+  if ( compteur != nbParam_ ) {
+    cerr << " elementSnapshot::getParametersString() : ERROR parameters doesnt match " << endl;
+    return NULL;
+  }
+  return parametersString_;
+}
+
+void elementSnapshot::setParametersString(string* param)
+{
+  if ( param == NULL )
+    {
+      cerr << " elementSnaphot::setParametersString parameters empty parameter set";
+      return;
+    }
+  
+  int compteur = -1;
+  int nbparam = atoi(param[++compteur].c_str());
+  if ( nbparam != nbParam_ ) 
+    {
+      cerr << " elementSnaphot:: setParametersString parameters do not match for a DRIFT";
+      return;
+    }
+
+  label_ = param[++compteur];
+}
+
+string elementSnapshot::parmelaOutputFlow() const
+{
+  return string(" ");
+}
+
+
+string elementSnapshot::transportOutputFlow() const
+{
+  return string(" ");
+}
+
+
+string elementSnapshot::FileOutputFlow() const
+{
+  ostringstream sortie;
+  sortie << elementName_.getElementLabel() << endl;
+  sortie  << label_ << endl;
+  return sortie.str();
+}
+
+void elementSnapshot::FileInput(ifstream& ifs)
+{
+  ifs >> label_;
+}
+
+string elementSnapshot::print() 
+{
+  string txt = "";  
+  txt += label_;
+  return txt;
+}
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/nomdElements.cc	(revision 342)
@@ -13,4 +13,5 @@
   else if( strstr(s.c_str(),"soleno") ) return soleno;
   else if( strstr(s.c_str(),"fit") ) return fit;
+  else if( strstr(s.c_str(),"shot") ) return snapshot;
   return inconnu;
 }
@@ -24,9 +25,8 @@
   else if( s == "bend" ) return bend;
   else if( s == "solnd" ) return soleno; 
-  else if( s == "fit" ) return fit; 
+  else if( s == "fit" ) return fit;
+  else if( s == "shot" ) return snapshot;
   return inconnu;
 }
-
-
 
 std::string nomdElements::toName(typedElement eType)
@@ -40,8 +40,8 @@
   case soleno : return "SOLENOID"; break;
   case fit : return "FIT"; break;
+  case snapshot : return "SNAPSHOT"; break;
   default : return "UNKNOWN";
   }
 }
-
 
 std::string nomdElements::toLabel(typedElement eType)
@@ -55,4 +55,5 @@
   case soleno :   return "solnd";
   case fit :   return "fit";
+  case snapshot : return "shot";
   default : return string("");
   }
@@ -69,4 +70,5 @@
   case soleno :   return 5;
   case fit :   return 4;
+  case snapshot : return 1;
   default : return 0;
   }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/particleBeam.cc	(revision 342)
@@ -1,20 +1,15 @@
+
 #include "particleBeam.h"
 #include "mathematicalConstants.h"
 #include "PhysicalConstants.h"
 #include "mathematicalTools.h"
-//#include <string>
+
 #include <stdio.h>
 #include <algorithm>
 #include <sstream>
-//#include "environmentVariables.h"
+
 using namespace std;
 
 particleBeam::particleBeam()  {
-  // rij_transportMoments_.resize(6);
-  // unsigned dim=0;
-  // unsigned k;
-  // for ( k=0; k < 6; k++){
-  //   rij_transportMoments_.at(k).resize(++dim); 
-  // }
   P0Transport_ = 0.0;
   particleRepresentationOk_ = false;
@@ -34,6 +29,6 @@
 }
 
-const beam2Moments&   particleBeam::getTransportMoments() const  { 
-    return rij_;
+const beam2Moments& particleBeam::getTransportMoments() const  { 
+  return rij_;
 }
 
@@ -58,6 +53,6 @@
 }
 
-
-double particleBeam::getUnnormalizedEmittanceX() {
+double particleBeam::getUnnormalizedEmittanceX() 
+{
   double r = getSigmaTransportij(2,1);
   double rac = (1 - r*r);
@@ -82,6 +77,4 @@
   }
 }
-
-
 
 void particleBeam::set2Moments(beam2Moments& moments) {
@@ -98,8 +91,6 @@
   goodPartic_ = particles;
   cout << " particleBeam::setWithParticles taille vect. part. ENREGISTRE " << goodPartic_.size() << endl;
-  //  printAllXYZ();
   particleRepresentationOk_ = true;
 }
-
 
 bool particleBeam::particleRepresentationOk() const {
@@ -119,11 +110,9 @@
   return goodPartic_;
 }
+
 vector<bareParticle>& particleBeam::getParticleVector() 
 {
   return goodPartic_;
 }
-
-
-
 
 void particleBeam::getVariance(double& varx, double& vary, double& varz) const {
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareGenerator.cc	(revision 342)
@@ -1,2 +1,3 @@
+
 #include "softwareGenerator.h"
 #include "abstractElement.h"
@@ -4,20 +5,10 @@
 #include "mathematicalConstants.h"
 #include "PhysicalConstants.h"
-//#include "dataManager.h"
-
 
 softwareGenerator::softwareGenerator() : abstractSoftware()
-{
-  ;
-}
-
-
-
+{;}
 
 softwareGenerator::softwareGenerator(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
-{
-  ;
-}
-
+{;}
 
 bool softwareGenerator::createInputFile(particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
@@ -33,4 +24,5 @@
     return false;
   }
+
   ofstream outfile;
   string name = workingDir + inputFileName_;
@@ -53,36 +45,31 @@
 }
 
-
-bool  softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) {
+bool softwareGenerator::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir) {
+  
+  bool ExecuteStatus = true;
+  
   ostringstream sortie;
-  bool ExecuteStatus = true;
-  //  resul.clear();
   sortie << " EXECUTION DE GENERATOR DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
 
-  char buf[132];
   string generatorJob = workingDir + "generator";
   generatorJob += string("   ");
   generatorJob += workingDir + inputFileName_;
 
-
-  ofstream outfile;
-  string nameOut = workingDir + "generator.output";
   string resultOfRun;
-  bool success = launchJob(generatorJob, resultOfRun);
+  bool success = launchJob(generatorJob,resultOfRun);
   sortie << resultOfRun << endl;
-  if ( !success) {
+  if ( !success ) {
     sortie << " launching of generator failed " << endl;
     ExecuteStatus = false;
-  }
-  else {
+  } else {
     cout << " execution generator MARCHE " << endl;
     sortie << resultOfRun;
+    string nameOut = workingDir + "generator.output";
+    ofstream outfile;
     outfile.open(nameOut.c_str(), ios::out);
-    if (!outfile) 
-      {
-	sortie << " error first opening transport output stream " << nameOut << endl;
-	ExecuteStatus = false;
-      }
-    else {
+    if (!outfile) {
+      sortie << " error first opening transport output stream " << nameOut << endl;
+      ExecuteStatus = false;
+    } else {
       // on copie la sortie dans un fichier 'generator.out'
       outfile << resultOfRun << endl;
@@ -90,6 +77,6 @@
     }
   }
-  //  resul =  sortie.str();
-    dataManager_->consoleMessage(sortie.str());
+  
+  dataManager_->consoleMessage(sortie.str());
   return ExecuteStatus;
 }
Index: /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc	(revision 341)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/softwareParmela.cc	(revision 342)
@@ -8,12 +8,8 @@
 
 softwareParmela::softwareParmela() : abstractSoftware()
-{
-  ;
-}
+{;}
 
 softwareParmela::softwareParmela(string inputFileName, globalParameters* globals, dataManager* dt) : abstractSoftware(inputFileName, globals, dt)
-{
-  ;
-}
+{;}
 
 bool softwareParmela::createInputFile( particleBeam* beamBefore, unsigned int numeroDeb, unsigned int numeroFin, string workingDir)
@@ -26,5 +22,4 @@
     return false;
   }
-
 
   ofstream outfile;
@@ -54,5 +49,5 @@
   }
 
-
+  
   outfile << "TITLE" << endl;
   outfile << " titre provisoire " << endl;
@@ -66,10 +61,13 @@
     outfile << "INPUT 0 /NP=" << beamBefore->getNbParticles() << endl;
   }
+
+  
   for ( k = premier; k <= numeroFin; k++)
     {
       elPtr = dataManager_->getElementPointerFromNumero(k);
+      if(elPtr->getNomdElement().getElementType() == snapshot) continue;
       outfile << elPtr->parmelaOutputFlow() << endl;
     }
-
+  
   outfile << "ZOUT" << endl;
   outfile << "START /wt=0.0 /dwt=" << globParamPtr_->getIntegrationStep() << "  /nsteps=" << globParamPtr_->getNbSteps() << "  nsc=" << globParamPtr_->getScPeriod() << "  /nout=10" << endl;
@@ -81,25 +79,22 @@
 
 
-bool  softwareParmela::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
-{
+bool softwareParmela::execute(unsigned int numeroDeb,unsigned int numeroFin,string workingDir)
+{
+  bool ExecuteStatus = true;
+  
   ostringstream sortie;
-  bool ExecuteStatus = true;
-  //  resul.clear();
   sortie << " EXECUTION DE PARMELA DE l'ELEMENT " << numeroDeb << " A L'ELEMENT " << numeroFin << endl;
 
-  char buf[132];
   string parmelaJob = workingDir + "parmela";
   parmelaJob += string("   ");
   parmelaJob += workingDir;
-  //  cout << " job parmela= " << parmelaJob << endl;
-
+  
   string resultOfRun;
-  bool success = launchJob(parmelaJob, resultOfRun);
+  bool success = launchJob(parmelaJob,resultOfRun);
   sortie << resultOfRun << endl;
-  if ( !success) {
+  if ( !success ) {
     sortie << " launching of parmela failed " << endl;
     ExecuteStatus = false;
-  }
-  else {
+  } else {
     sortie << " successful launching of parmela " << endl;
     cout << " execution parmela MARCHE " << endl;
@@ -112,74 +107,78 @@
   }
 
-  //  resul =  sortie.str();
-    dataManager_->consoleMessage(sortie.str());
-  
+  dataManager_->consoleMessage(sortie.str());
   return ExecuteStatus;
 }
 
-
-bool  softwareParmela::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir) {
+bool softwareParmela::buildBeamAfterElements(unsigned int numeroDeb,unsigned int numeroFin, vector<particleBeam>& beams, string workingDir) 
+{
   bool result = true;
-  unsigned k;
-
-  for ( k= numeroDeb; k <= numeroFin; k++)
-    {
+  cout << "debug:: debut " << numeroDeb << ", fin " << numeroFin << endl;
+
+  // index du premier element de parmela
+  int id= numeroDeb-offsetNumElem_;
+
+  for(unsigned k = numeroDeb; k <= numeroFin; k++) 
+    {
+      abstractElement* elem = dataManager_->getElementPointerFromNumero(k);
+
+      // si l'element est un snapshot, recuperer la sortie precedente
+      if(elem->getNomdElement().getElementType() == snapshot) {
+	int avantDernier = beams.size() - 1;
+	cout<<"["<<k<<"] : ecrit sur fichier le contenu de beam["<<avantDernier<<"]"<<endl;
+	continue;
+      }
+
+      // sinon c'est un element de parmela d'index id
       beams.push_back(particleBeam());
       vector<double> centroid;
       bareParticle refPart;
       vector<bareParticle> particles;
-      if (!beamFromParmela(workingDir,k - offsetNumElem_ , globParamPtr_->getFrequency(), centroid, refPart,particles ))
+      double freq= globParamPtr_->getFrequency();
+
+      if(!beamFromParmela(workingDir,id,freq,centroid,refPart,particles)) 
 	{
-	  abstractElement* elem = dataManager_->getElementPointerFromNumero(k);
-	  if ( elem->is_accepted_by_software(nomDeLogiciel::parmela) == warning) {
+	  if(elem->is_accepted_by_software(nomDeLogiciel::parmela) == warning) {
 	    int avantDernier = beams.size() -2;
 	    beams.back() = beams.at(avantDernier);
 	  } else {
-	    // sortie << " reading parmdesz  failed " << endl;
-	    dataManager_->consoleMessage(" softwareParmela::buildBeamAfterElements : reading parmdesz  failed " );
+	    dataManager_->consoleMessage("softwareParmela::buildBeamAfterElements : reading parmdesz failed");
 	    result = false;
 	    break;
 	  }
-	}
-      else {
-	beams.back().setWithParticles(centroid, refPart,particles); 
-      }
+	} else {
+	beams.back().setWithParticles(centroid,refPart,particles); 
+      }
+
+      // l'element de parmela suivant
+      id++;
     }
+
   return result;
 }
 
-
-
-
-bool softwareParmela::beamFromParmela(string workingDir,unsigned numeroParmel, double referencefrequency, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles ) {
-  unsigned  k;
-  FILE* filefais;
+bool softwareParmela::beamFromParmela(string workingDir,unsigned numeroParmel, double referencefrequency, vector<double>& centroid, bareParticle& refPart,vector<bareParticle>& particles ) 
+{
   string nomfilefais = workingDir + "parmdesz";
   cout << " nom fichier desz : " << nomfilefais << endl;
-  filefais = fopen(nomfilefais.c_str(), "r");
+  FILE *filefais = fopen(nomfilefais.c_str(), "r");
 
   if ( filefais == (FILE*)0 ) {
     dataManager_->consoleMessage(" beamFromParmela() erreur a l'ouverture du fichier 'parmdesz'");
-    cerr << " beamFromParmela() erreur a l'ouverture du fichier" << nomfilefais  << endl;; 
-    return false;
-  }
-  else cout << " beamFromParmela() : ouverture du fichier " << nomfilefais << endl; 
-
+    cerr << " beamFromParmela() erreur a l'ouverture du fichier" << nomfilefais  << endl; 
+    return false;
+  } else 
+    cout << " beamFromParmela() : ouverture du fichier " << nomfilefais << endl; 
+  
   parmelaParticle partic;
   std::vector<parmelaParticle> faisceau;
-
-  //  unsigned indexElement = numeroElement-1;
- 
-
-
-
   int testNombrePartRef =0;
   double phaseRef = 0.0;
 
-  while( partic.readFromParmelaFile(filefais) > 0 ) {
-    if ( partic.ne == (int)numeroParmel )
-      {
+  while( partic.readFromParmelaFile(filefais) > 0 ) 
+    {
+
+      if ( partic.ne == (int)numeroParmel ) {
 	faisceau.push_back(partic);
-
 	if ( partic.np == 1 ) {
 	  // en principe on est sur la particule de reference
@@ -200,5 +199,5 @@
 	}
       }
-  }
+    } //while
 
   if ( faisceau.size() == 0) 
@@ -213,6 +212,4 @@
   // avec freq en Mhz et dphi en degres et rÃ©sultat en cm: 
   double FACTEUR =  83.3333;  // ameliorer la precision
-
-
 
   // pour l'instant on choisit un centroid nul;
@@ -232,10 +229,9 @@
   // contrairement a ce qu'indique la notice PARMELA, dans parmdesz, les xp et yp 
   // sont donnes en radians
-  for ( k=0; k < faisceau.size(); k++) {
-    x=faisceau.at(k).xx;
+  for (unsigned k = 0; k < faisceau.size(); k++) {
+    x= faisceau.at(k).xx;
     xp=faisceau.at(k).xxp;
-    y=faisceau.at(k).yy;
+    y= faisceau.at(k).yy;
     yp=faisceau.at(k).yyp;
-
     // dephasage par rapport a la reference  
     dephas = faisceau.at(k).phi - phaseRef; // degrÃ©s
@@ -250,4 +246,5 @@
     particles.at(k) = bareParticle(pos,betagamma);
   }
+  
   return true;
 }
