Index: trunk/src/HEPMCConverter.cc
===================================================================
--- trunk/src/HEPMCConverter.cc	(revision 354)
+++ 	(revision )
@@ -1,120 +1,0 @@
-/***********************************************************************
-**                                                                    **
-**          /----------------------------------------------\          **
-**         |  Delphes, a framework for the fast simulation  |         **
-**         |       of a  generic collider experiment        |         **
-**          \-------------  arXiv:0903.2225v1  ------------/          **
-**                                                                    **
-**                                                                    **
-**   This package uses:                                               **
-**   ------------------                                               **
-**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      ** 
-**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       ** 
-**   FROG: [hep-ex/0901.2718v1]                                       **
-**                                                                    **
-** ------------------------------------------------------------------ **
-**                                                                    **
-**   Main authors:                                                    **
-**   -------------                                                    **
-**                                                                    **
-**                Severine Ovyn                Xavier Rouby           ** 
-**          severine.ovyn@uclouvain.be      xavier.rouby@cern         ** 
-**                                                                    ** 
-**         Center for Particle Physics and Phenomenology (CP3)        ** 
-**                Universite catholique de Louvain (UCL)              **       
-**                     Louvain-la-Neuve, Belgium                      **            
-**                                                                    **
-**                      Copyright (C) 2008-2009,                      **
-**                        All rights reserved.                        **  
-**                                                                    **
-***********************************************************************/
-
-
-#include <iostream>
-#include <fstream>
-#include "TLorentzVector.h"
-#include "BlockClasses.h"
-#include "ExRootTreeWriter.h"
-#include "ExRootTreeBranch.h"
-#include "HEPMCConverter.h"
-
-using namespace std;
-
-//------------------------------------------------------------------------------
-
-HEPMCConverter::~HEPMCConverter() {}
-
-//------------------------------------------------------------------------------
-
-HEPMCConverter::HEPMCConverter(const string& inputFileList, const string& outputFileName, const int& Nevents) : DataConverter(Nevents)
-{
-//  int ierr, entryType;
-//  int nevt = 0;
-
-  // export the generator-level data to the outputfile
-  ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputFileName, "GEN");
-  ExRootTreeBranch *branchGenEvent = treeWriter->NewBranch("Event", TRootGenEvent::Class());
-  ExRootTreeBranch *branchGenParticle = treeWriter->NewBranch("Particle", TRootC::GenParticle::Class());
-  
-  // Open the datafile list
-  ifstream infile(inputFileList.c_str());
-  if(!infile.is_open()) {
-      cerr << left  << setw(30) <<"**   ERROR: Can't open  "<<""
-                    << left  << setw(20) << inputFileList   <<""
-                    << right << setw(19) <<"for input **"<<""<<endl;
-      exit(1);  // could not open the list : exit
-  }
-
-  string filename;
-  while(1) {
-      infile >> filename;
-      if(!infile.good()) break; // quits when the inputfile list is depleted
-
-      ifstream datafile(filename.c_str());
-      if(!datafile.good()) {  // i.e. datafile could not be opened
-             cerr << left  << setw(30) <<"**   ERROR: Can't find file  "<<""
-                  << left  << setw(20) << filename                      <<""
-                  << right << setw(19) <<"for input **"<<""<<endl;
-             continue;	      // go to the next item in the list
-      }
-     
-      // else : if the datafile was successfully opened 
-      Long64_t allEntries = Nevents;
-      if(allEntries > 0) {
-	/*
-	  // Loop over all objects
-	  Long64_t recordNumber = 1;
-	  for(Long64_t entry = 0; entry < allEntries; ++entry) {
-	      ierr = StdHepXdrRead(&entryType, istr);
-	      if(ierr != 0) {
-                  cerr << left  << setw(49) <<"**   ERROR: Unexpected end of file after"<<""
-                       << left  << setw(10) << entry                                    <<""
-                       << right << setw(10) <<"entries **"<<""<<endl;
-		  break;
-              } // if ierr !=0
-	      
-	      // analyse only entries with standard HEPEVT common block
-	      if(entryType == 1) {
-		  // add empty events for missing event numbers
-		  while(recordNumber < myhepevt.nevhep) {
-		      treeWriter->Clear();
-		      AnalyseEvent(branchGenEvent, recordNumber);
-		      treeWriter->Fill();
-		      ++recordNumber;
-		  } // while
-	*/	  
-		  treeWriter->Clear();
-	//	  AnalyseEvent(branchGenEvent, myhepevt.nevhep);
-	//	  AnalyseParticles(branchGenParticle);
-		  treeWriter->Fill();
-		  //++recordNumber;
-	//    } // if entryType == 1
-	//  } // for entry < allEntries
-      } // if allEntries
-      datafile.close();
-    } // while : loop on the list file contents
-
-  treeWriter->Write();
-  delete treeWriter;
-}
-
Index: trunk/src/VeryForward.cc
===================================================================
--- trunk/src/VeryForward.cc	(revision 354)
+++ trunk/src/VeryForward.cc	(revision 355)
@@ -117,11 +117,8 @@
 {
   int pid=abs(particle->PID);
-  float eta=fabs(particle->Eta);
-  
-  
   TRootZdcHits *elementZdc;
   TLorentzVector genMomentum; 
   // Zero degree calorimeter, for forward neutrons and photons
-  if (particle->Status ==1 && (pid == pN || pid == pGAMMA ) && eta > DET->VFD_min_zdc ) {
+  if (particle->Status ==1 && (pid == pN || pid == pGAMMA ) && fabs(particle->Eta) > DET->VFD_min_zdc ) {
     genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
     // !!!!!!!!! vÃ©rifier que particle->Z est bien en micromÃštres!!!
@@ -136,8 +133,9 @@
     //double theta = (1E-6)*sqrt( pow(tx,2) + pow(ty,2) );
     //double flight_distance = (DET->ZDC_S - particle->Z*(1E-6))/cos(theta) ; // assumes that Z is in micrometers
-    double flight_distance = (DET->VFD_s_zdc - particle->Z*(1E-6));
+    double flight_distance = DET->VFD_s_zdc - particle->Z*(1E-6);
     // assumes also that the emission angle is so small that 1/(cos theta) = 1
-    elementZdc->T = 0*particle->T + flight_distance/speed_of_light; // assumes highly relativistic particles
-    elementZdc->side = sign(eta);
+    elementZdc->T = particle->T + flight_distance/speed_of_light; // assumes highly relativistic particles
+cout << "ZDC: T = " << particle->T << " ; " << flight_distance/speed_of_light << endl;
+    elementZdc->side = sign(particle->Eta);
     
     
@@ -147,6 +145,5 @@
 void VeryForward::RomanPots(ExRootTreeWriter *treeWriter, ExRootTreeBranch *branchRP220,ExRootTreeBranch *branchFP420,TRootGenParticle *particle) 
 {
-  int pid=abs(particle->PID);
-  float eta=fabs(particle->Eta);
+  int pid=particle->PID;
   
   TRootRomanPotHits* elementRP220;
@@ -180,8 +177,11 @@
 	  elementRP220->Ty = (1E-6)*p1.getTY(); // [rad]
 	  elementRP220->S = p1.getS();          // [m]
-	  elementRP220->T = -1;                 // not yet implemented
-	  elementRP220->E = p1.getE();  // not yet implemented
+	  // in first approximation only ! this number is always lower than the real distance-of-flight
+          double flight_distance = p1.getS() - particle->Z*(1E-6); 
+    	  elementRP220->T = particle->T + flight_distance/speed_of_light; // assumes highly relativistic particles
+cout << "T = " << particle->T << " ; " << flight_distance/speed_of_light << endl;
+	  elementRP220->E = p1.getE();  	// not yet implemented
 	  elementRP220->q2 = -1;                // not yet implemented
-	  elementRP220->side = sign(eta);
+	  elementRP220->side = sign(particle->Eta);
 	  
 	} else if (p1.getStoppingElement()->getName()=="rp420_1" || p1.getStoppingElement()->getName()=="rp420_2") {
@@ -192,23 +192,26 @@
 	  elementFP420->Tx = (1E-6)*p1.getTX(); // [rad]
 	  elementFP420->Ty = (1E-6)*p1.getTY(); // [rad]
-	  elementFP420->S = p1.getS();        // [m]
-	  elementFP420->T = -1;                       // not yet implemented
+	  elementFP420->S = p1.getS();          // [m]
+	  // in first approximation only ! this number is always lower than the real distance-of-flight
+          double flight_distance = p1.getS() - particle->Z*(1E-6);
+cout << "T = " << particle->T << " ; " << flight_distance/speed_of_light << endl;
+          elementFP420->T = particle->T + flight_distance/speed_of_light;
 	  elementFP420->E = p1.getE();          // not yet implemented
 	  elementFP420->q2 = -1;                // not yet implemented
-          elementFP420->side = sign(eta);
+          elementFP420->side = sign(particle->Eta);
 	}
 
       }
-      //                if(p1.stopped(beamline) && (p1.getStoppingElement()->getS() > 100))
-      //                        cout << "Eloss ="  << 7000.-p1.getE() << " ; " << p1.getStoppingElement()->getName() << endl;
+      //  if(p1.stopped(beamline) && (p1.getStoppingElement()->getS() > 100))
+      //     cout << "Eloss ="  << 7000.-p1.getE() << " ; " << p1.getStoppingElement()->getName() << endl;
     } // if forward proton
 }
 
     // Forward particles in CASTOR ?
-    //           /*      if (particle->Status == 1 && (fabs(particle->Eta) > DET->MIN_CALO_VFWD)
-    //                             && (fabs(particle->Eta) < DET->MAX_CALO_VFWD)) {
+    //    if (particle->Status == 1 && (fabs(particle->Eta) > DET->MIN_CALO_VFWD)
+    //                              && (fabs(particle->Eta) < DET->MAX_CALO_VFWD)) {
     //
     //
-    //                                               } // CASTOR
-    //                                                         */
-    //
+    //    } // CASTOR
+    // */
+
