Index: trunk/src/SmearUtil.cc
===================================================================
--- trunk/src/SmearUtil.cc	(revision 261)
+++ trunk/src/SmearUtil.cc	(revision 264)
@@ -30,4 +30,5 @@
 ***********************************************************************/
 
+
 /// \file SmearUtil.cc
 /// \brief RESOLution class, and some generic definitions
@@ -42,18 +43,4 @@
 #include <iomanip>
 using namespace std;
-
-
-ParticleUtil::ParticleUtil(const TLorentzVector &genMomentum, int pid) {
-  _pid=pid;
-  _e = genMomentum.E();
-  _px = genMomentum.Px();
-  _py = genMomentum.Py();
-  _pz = genMomentum.Pz();
-  _pt = genMomentum.Pt();
-
-  //_e, _px, _py, _pz, _pt;
-  //float _eta, _etaCalo, _phi, _phiCalo;
-  //int _pid;
-}
 
 //------------------------------------------------------------------------------
@@ -78,8 +65,8 @@
   // Energy resolution for hadrons in ecal/hcal/hf
   // \sigma/E = C + N/E + S/\sqrt{E}
-  HAD_Shcal         = 1.5;               // S term for central HCAL 
+  HAD_Shcal         = 1.5;               // S term for central HCAL
   HAD_Nhcal         = 0.;                // N term for central HCAL
   HAD_Chcal         = 0.05;              // C term for central HCAL
-  HAD_Shf           = 2.7;               // S term for FCAL
+  HAD_Shf           = 2.7;               // S term for FCAL 
   HAD_Nhf           = 0.;                // N term for FCAL
   HAD_Chf           = 0.13;              // C term for FCAL
@@ -128,4 +115,5 @@
   FLAG_bfield      = 1;                       //1 to run the bfield propagation else 0
   FLAG_vfd         = 1;                       //1 to run the very forward detectors else 0
+  FLAG_zdc         = 1;                       //1 to run the zero degree calorimeter else 0
   FLAG_trigger     = 1;                       //1 to run the trigger selection else 0
   FLAG_frog        = 1;                       //1 to run the FROG event display
@@ -186,6 +174,4 @@
   RP_cross_y        = 0.0;
   RP_cross_ang      = 142.5;
-
-
   
 }
@@ -250,4 +236,5 @@
   FLAG_bfield      = DET.FLAG_bfield;
   FLAG_vfd         = DET.FLAG_vfd;
+  FLAG_zdc         = DET.FLAG_zdc;
   FLAG_trigger     = DET.FLAG_trigger;
   FLAG_frog        = DET.FLAG_frog;
@@ -279,5 +266,4 @@
   RP_IP_name        = DET.RP_IP_name;
 
-
   // In case FROG event display allowed
   NEvents_Frog      = DET.NEvents_Frog;
@@ -364,4 +350,5 @@
   FLAG_bfield      = DET.FLAG_bfield;
   FLAG_vfd         = DET.FLAG_vfd;
+  FLAG_zdc         = DET.FLAG_zdc;
   FLAG_trigger     = DET.FLAG_trigger;
   FLAG_frog        = DET.FLAG_frog;
@@ -504,4 +491,5 @@
 
     else if(strstr(temp_string.c_str(),"FLAG_vfd"))         {curstring >> varname >> ivalue; FLAG_vfd         = ivalue;}
+    else if(strstr(temp_string.c_str(),"FLAG_zdc"))         {curstring >> varname >> ivalue; FLAG_zdc         = ivalue;}
     else if(strstr(temp_string.c_str(),"FLAG_trigger"))     {curstring >> varname >> ivalue; FLAG_trigger     = ivalue;}
     else if(strstr(temp_string.c_str(),"FLAG_frog"))        {curstring >> varname >> ivalue; FLAG_frog        = ivalue;}
@@ -604,5 +592,5 @@
   if(FLAG_vfd==1){
     f_out<<"#**********************************                                  *"<<"\n";
-    f_out<<"# Very forward detector switches on                                  *"<<"\n";
+    f_out<<"# Very forward detector switched on                                  *"<<"\n";
     f_out<<"#**********************************                                  *"<<"\n";
     f_out<<"*                                                                    *"<<"\n";
@@ -639,10 +627,9 @@
     f_out << left << setw(44) <<"* Angle of  beam crossing:"<<""
           << left << setw(6) <<RP_cross_ang           <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
-
     f_out<<"*                                                                    *"<<"\n";
   }
   else {
     f_out<<"#***********************************                                 *"<<"\n";
-    f_out<<"# Very forward detector switches off                                 *"<<"\n";
+    f_out<<"# Very forward detector switched off                                 *"<<"\n";
     f_out<<"#***********************************                                 *"<<"\n";
     f_out<<"*                                                                    *"<<"\n";
@@ -692,5 +679,5 @@
   if(FLAG_bfield==1){
     f_out<<"#***************************                                         *"<<"\n";
-    f_out<<"# Magnetic field switches on                                         *"<<"\n";
+    f_out<<"# Magnetic field switched on                                         *"<<"\n";
     f_out<<"#***************************                                         *"<<"\n";
     f_out<<"*                                                                    *"<<"\n";
@@ -713,5 +700,5 @@
   else {
     f_out<<"#****************************                                        *"<<"\n";
-    f_out<<"# Magnetic field switches off                                        *"<<"\n";
+    f_out<<"# Magnetic field switched off                                        *"<<"\n";
     f_out<<"#****************************                                        *"<<"\n";
     f_out << left << setw(55) <<"* Minimal pT needed to reach the calorimeter [GeV]: "<<""
@@ -953,5 +940,6 @@
 //******************************************************************************************
 
-void RESOLution::SortedVector(vector<ParticleUtil> &vect)
+//void RESOLution::SortedVector(vector<ParticleUtil> &vect)
+void RESOLution::SortedVector(vector<D_Particle> &vect)
 {
   int i,j = 0;
@@ -966,5 +954,6 @@
           if ( vect[j].Pt() > vect[j-1].Pt() )
              {
-               ParticleUtil tmp = vect[j-1];
+               //ParticleUtil tmp = vect[j-1];
+               D_Particle tmp = vect[j-1];
                vect[j-1] = vect[j];
                vect[j] = tmp;
@@ -1062,6 +1051,6 @@
   //********** returns a segmented value for eta and phi, for calo towers *****
 void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){
-   iEta = -100; 
-   int index=-100;
+   iEta = UNDEFINED; 
+   int index= iUNDEFINED;
    for (unsigned int i=1; i< TOWER_number+1; i++) {
 	if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) {
@@ -1072,6 +1061,6 @@
 	}
    }
-   if(index==-100) return; 
-   iPhi = -100;
+   if(index==UNDEFINED) return; 
+   iPhi = UNDEFINED;
    float dphi = TOWER_dphi[index]*pi/180.; 
    for (unsigned int i=1; i < 360/TOWER_dphi[index]; i++ ) {
@@ -1085,4 +1074,6 @@
    if (phi > pi-dphi) iPhi = pi-dphi;
 }
+
+
 
 //**************************** Returns the delta Phi ****************************
