Index: trunk/src/SmearUtil.cc
===================================================================
--- trunk/src/SmearUtil.cc	(revision 43)
+++ trunk/src/SmearUtil.cc	(revision 44)
@@ -19,4 +19,29 @@
 #include <sstream>
 #include <fstream>
+
+#include <cstdio>
+#include <cstdio>
+#include <TCanvas.h>
+#include <TLorentzVector.h>
+#include <string>
+#include <fstream>
+#include <istream>
+#include <iostream>
+#include <TMath.h>
+#include <vector>
+#include "TRandom.h"
+#include <cstdlib>
+#include <math.h>
+#include <time.h>
+
+#include <iostream>
+#include <iomanip>
+
+#include <iostream>
+#include <sstream>
+
+#include <fstream>
+#include <vector>
+
 using namespace std;
 
@@ -164,6 +189,224 @@
  M_MAXITERATIONS     =   100;
 
-}
-
+//Define SISCone algorithm.
+ NPASS = 0;               
+ PROTOJET_PTMIN = 0.0; 
+
+
+}
+
+void RESOLution::Logfile(string LogName) { 
+//void RESOLution::Logfile(string outputfilename) { 
+
+  ofstream f_out(LogName.c_str());
+  
+  f_out<<"#*********************************************************************"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#                  ---- DELPHES release 1.0 ----                     *"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#        A Fast Simulator for general purpose LHC detector           *"<<"\n";
+  f_out<<"#                 Written by S. Ovyn and X. Rouby                    *"<<"\n";
+  f_out<<"#                   severine.ovyn@uclouvain.be                       *"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#                   http:                                            *"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#         Center for Particle Physics and Phenomenology (CP3)        *"<<"\n";
+  f_out<<"#              Universite Catholique de Louvain (UCL)                *"<<"\n";
+  f_out<<"#                     Louvain-la-Neuve, Belgium                      *"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#....................................................................*"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#                This package uses FastJet algorithm,                *"<<"\n";
+  f_out<<"#              Phys. Lett. B641 (2006) [hep-ph/0512210]              *"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#....................................................................*"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"# This file contains all the running parameters (detector and cuts)  *"<<"\n";
+  f_out<<"# necessary to reproduce the detector simulation                     *"<<"\n";
+  f_out<<"#                                                                    *"<<"\n";
+  f_out<<"#....................................................................*"<<"\n";
+  f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#********************************                                    *"<<"\n";
+  f_out<<"# Central detector caracteristics                                    *"<<"\n";
+  f_out<<"#********************************                                    *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(30) <<"* Maximum tracking system:                   "<<""
+	<< left << setw(10) <<MAX_TRACKER   <<""<< right << setw(15)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* Maximum central calorimeter:               "<<""
+	<< left << setw(10) <<MAX_CALO_CEN  <<""<< right << setw(15)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* Maximum forward calorimeter:               "<<""
+	<< left << setw(10) <<MAX_CALO_FWD  <<""<< right << setw(15)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* Muon chambers coverage:                    "<<""
+	<< left << setw(10) <<MAX_MU        <<""<< right << setw(15)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#*************************************                               *"<<"\n";
+  f_out<<"# Very forward detector caracteristics                               *"<<"\n";
+  f_out<<"#*************************************                               *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(55) <<"* Minimum very forward calorimeter:          "<<""
+	<< left << setw(5) <<MIN_CALO_VFWD <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Maximum very forward calorimeter:          "<<""
+	<< left << setw(5) <<MAX_CALO_VFWD <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Distance of the ZDC to the IP, in meters:  "<<""
+	<< left << setw(5) <<ZDC_S         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Distance of the RP to the IP, in meters:   "<<""
+	<< left << setw(5) <<RP220_S       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Distance of the RP to the beam, in meters: "<<""
+	<< left << setw(5) <<RP220_X       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Distance of the RP to the IP, in meters:   "<<""
+	<< left << setw(5) <<FP420_S       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Distance of the RP to the beam, in meters: "<<""
+	<< left << setw(5) <<FP420_X       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#************************************                                *"<<"\n";
+  f_out<<"# Electromagnetic smearing parameters                                *"<<"\n";
+  f_out<<"#************************************                                *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  //# \sigma/E = C + N/E + S/\sqrt{E}
+  f_out << left << setw(30) <<"* S term for central ECAL: "<<""
+	<< left << setw(30) <<ELG_Scen       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* N term for central ECAL: "<<""
+	<< left << setw(30) <<ELG_Ncen       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* C term for central ECAL: "<<""
+	<< left << setw(30) <<ELG_Ccen       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* S term for forward ECAL: "<<""
+	<< left << setw(30) <<ELG_Sfwd       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* N term for forward ECAL: "<<""
+	<< left << setw(30) <<ELG_Nfwd       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* C term for forward ECAL: "<<""
+	<< left << setw(30) <<ELG_Cfwd       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#*****************************                                       *"<<"\n";
+  f_out<<"# Hadronic smearing parameters                                       *"<<"\n";
+  f_out<<"#*****************************                                       *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(30) <<"* S term for central HCAL: "<<""
+	<< left << setw(30) <<HAD_Shcal       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* N term for central HCAL: "<<""
+	<< left << setw(30) <<HAD_Nhcal       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* C term for central HCAL: "<<""
+	<< left << setw(30) <<HAD_Chcal       <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* S term for forward HCAL: "<<""
+	<< left << setw(30) <<HAD_Shf         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* N term for forward HCAL: "<<""
+	<< left << setw(30) <<HAD_Nhf         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(30) <<"* C term for forward HCAL: "<<""
+	<< left << setw(30) <<HAD_Chf         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#***************************                                         *"<<"\n";
+  f_out<<"# Tracking system acceptance                                         *"<<"\n";
+  f_out<<"#***************************                                         *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(55) <<"* Minimal pT needed to reach the calorimeter [GeV]: "<<""
+	<< left << setw(10) <<PT_TRACKS_MIN         <<""<< right << setw(5)<<"*"<<"\n";
+  f_out << left << setw(55) <<"* Efficiency associated to the tracking: "<<""
+	<< left << setw(10) <<TRACKING_EFF          <<""<< right << setw(5)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#*************************                                           *"<<"\n";
+  f_out<<"# Muon smearing parameters                                           *"<<"\n";
+  f_out<<"#*************************                                           *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  //MU_SmearPt       0.01
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#******************************                                      *"<<"\n";
+  f_out<<"# Tau-jet definition parameters                                      *"<<"\n";
+  f_out<<"#******************************                                      *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(45) <<"* Cone radius for calorimeter tagging:  "<<""
+	<< left << setw(5) <<TAU_CONE_ENERGY                           <<""<< right << setw(20)<<"*"<<"\n";
+  f_out << left << setw(45) <<"* Fraction of energy in the small cone: "<<""
+        << left << setw(5) <<TAU_EM_COLLIMATION*100                    <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
+  f_out << left << setw(45) <<"* Cone radius for tracking tagging:     "<<""
+	<< left << setw(5) <<TAU_CONE_TRACKS                           <<""<< right << setw(20)<<"*"<<"\n";
+  f_out << left << setw(45) <<"* Minimum track pT [GeV]:               "<<""
+	<< left << setw(5) <<PT_TRACK_TAU                              <<""<< right << setw(20)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#*******************                                                 *"<<"\n";
+  f_out<<"# Minimum pT's [GeV]                                                 *"<<"\n";
+  f_out<<"#*******************                                                 *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(40) <<"* Minimum pT for electrons: "<<""
+	<< left << setw(20) <<ELEC_pt         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(40) <<"* Minimum pT for muons: "<<""
+	<< left << setw(20) <<MUON_pt         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(40) <<"* Minimum pT for jets: "<<""
+	<< left << setw(20) <<JET_pt         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(40) <<"* Minimum pT for Tau-jets: "<<""
+	<< left << setw(20) <<TAUJET_pt         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#***************************                                         *"<<"\n";
+  f_out<<"# B-tagging efficiencies [%]                                         *"<<"\n";
+  f_out<<"#***************************                                         *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out << left << setw(50) <<"* Efficiency to tag a \"b\" as a b-jet: "<<""
+	<< left << setw(10) <<TAGGING_B         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(50) <<"* Efficiency to mistag a c-jet as a b-jet: "<<""
+	<< left << setw(10) <<MISTAGGING_C         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out << left << setw(50) <<"* Efficiency to mistag a light jet as a b-jet: "<<""
+	<< left << setw(10) <<MISTAGGING_L         <<""<< right << setw(10)<<"*"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#***************                                                     *"<<"\n";
+  f_out<<"# Jet definition                                                     *"<<"\n";
+  f_out<<"#***************                                                     *"<<"\n";
+  f_out<<"*                                                                    *"<<"\n";
+  switch(JETALGO) {
+  default:
+  case 1: {
+    f_out<<"* CDF JetClu jet algorithm with:                                     *"<<"\n";
+    f_out << left << setw(40) <<"*        - Seed threshold:    "<<""
+	  << left << setw(10) <<SEEDTHRESHOLD                   <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Cone radius:       "<<""
+	  << left << setw(10) <<CONERADIUS                      <<""<< right << setw(20)<<"*"<<"\n";
+    f_out << left << setw(40) <<"*        - Adjacency cut:     "<<""
+	  << left << setw(10) <<C_ADJACENCYCUT                  <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Max iterations:    "<<""
+	  << left << setw(10) <<C_MAXITERATIONS                 <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Iratch:            "<<""
+	  << left << setw(10) <<C_IRATCH                        <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Overlap threshold: "<<""
+	  << left << setw(10) <<OVERLAPTHRESHOLD                <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
+  }
+    break;
+  case 2: {
+    f_out<<"* CDF midpoint jet algorithm with:                                     *"<<"\n";
+    f_out << left << setw(40) <<"*        - Seed threshold:    "<<""
+	  << left << setw(20) <<SEEDTHRESHOLD                   <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Cone radius:       "<<""
+	  << left << setw(20) <<CONERADIUS                      <<""<< right << setw(10)<<"*"<<"\n";
+    f_out << left << setw(40) <<"*        - Cone area fraction:"<<""
+	  << left << setw(20) <<M_CONEAREAFRACTION              <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Maximum pair size: "<<""
+	  << left << setw(20) <<M_MAXPAIRSIZE                   <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Max iterations:    "<<""
+	  << left << setw(20) <<M_MAXITERATIONS                 <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Overlap threshold: "<<""
+	  << left << setw(20) <<OVERLAPTHRESHOLD                <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+  }
+    break;
+  case 3: {
+    f_out<<"* SISCone jet algorithm with:                                     *"<<"\n";
+    f_out << left << setw(40) <<"*        - Cone radius:             "<<""
+	  << left << setw(20) <<CONERADIUS                            <<""<< right << setw(10)<<"*"<<"\n";
+    f_out << left << setw(40) <<"*        - Overlap threshold:       "<<""
+	  << left << setw(20) <<OVERLAPTHRESHOLD                      <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Number pass max:         "<<""
+	  << left << setw(20) <<NPASS                                 <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+    f_out << left << setw(40) <<"*        - Minimum pT for protojet: "<<""
+	  << left << setw(20) <<PROTOJET_PTMIN                        <<""<< right << setw(10)<<"! not in datacard  *"<<"\n";
+  }
+    break;
+  case 4: {
+    f_out<<"* KT jet algorithm with:                                          *"<<"\n";
+    f_out << left << setw(40) <<"*        - Cone radius: "<<""
+	  << left << setw(20) <<CONERADIUS                <<""<< right << setw(10)<<"*"<<"\n";
+  }
+    break;
+  }
+  f_out<<"*                                                                    *"<<"\n";
+  f_out<<"#....................................................................*"<<"\n";
+  f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n";
+
+}
 
 // **********Provides the smeared TLorentzVector for the electrons********
