Index: cards/FCC/FCChh_PileUpVtx.tcl
===================================================================
--- cards/FCC/FCChh_PileUpVtx.tcl	(revision d4e5b6a29d976f833d389ea7af3115081d34d5d5)
+++ cards/FCC/FCChh_PileUpVtx.tcl	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -17,5 +17,4 @@
 set ExecutionPath {
 
-  BeamSpotFilter
   PileUpMerger
   ParticlePropagator
@@ -32,16 +31,21 @@
 
   TrackSmearing
-  TimeSmearing  
-
-  VertexFinderDA4D  
-
-  TrackTimingPileUpSubtractor  
+  TimeSmearing      
 
   ECal
   HCal
+
+  TimeSmearingMIP
+  TimeSmearingPhotons
+  TimeSmearingNH  
 
   Calorimeter
   EFlowMerger
   EFlowFilter
+
+  VertexFinderDA4D
+  TrackTimingPileUpSubtractor
+
+  HighMassVertexRecover    
 
   PhotonEfficiency
@@ -78,15 +82,4 @@
 
   TreeWriter
-}
-
-#######################
-# GenBeamSpotFilter
-# Saves a particle intended to represent the beamspot
-#######################
-
-module BeamSpotFilter BeamSpotFilter {
-    set InputArray Delphes/stableParticles
-    set OutputArray beamSpotParticle
-
 }
 
@@ -288,54 +281,5 @@
 
   # assume 20 ps resolution for now
-  set TimeResolution 20E-12
-}
-
-##################################
-# Primary vertex reconstruction
-##################################
-
-
-module VertexFinderDA4D VertexFinderDA4D {
-  set InputArray TimeSmearing/tracks
-
-  set OutputArray tracks
-  set VertexOutputArray vertices
-
-  set Verbose 0
-  set MinPT 1.0
-
-  # in mm
-  set VertexSpaceSize 0.5
-
-  # in s
-  set VertexTimeSize 10E-12
-
-  set UseTc 1
-  set BetaMax 0.1
-  set BetaStop 1.0
-  set CoolingFactor 0.8
-  set MaxIterations 100
-
-  # in mm
-  set DzCutOff 40
-  set D0CutOff 30
-
-}
-
-##########################
-# Track pile-up subtractor
-##########################
-
-module TrackTimingPileUpSubtractor TrackTimingPileUpSubtractor {
-# add InputArray InputArray OutputArray
-
-  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
-  add InputArray ElectronMomentumSmearing/electrons
-  add InputArray MuonMomentumSmearing/muons
-  
-  set VertexInputArray VertexFinderDA4D/vertices
-  # assume perfect pile-up subtraction for tracks with |z| > fZVertexResolution
-  # Z vertex resolution in m
-  set ZVertexResolution {0.0001}
+  set TimeResolution {20E-12}
 }
 
@@ -506,4 +450,37 @@
 }
 
+########################################
+#   Time Smearing Neutral MIP
+########################################
+
+module TimeSmearingNeutral TimeSmearingMIP {
+  set InputArray HCal/eflowTracks
+  set OutputArray timeSmearingMIP
+
+  # assume 20 ps resolution for now
+  set TimeResolution {30E-12}
+}
+
+########################################
+#   Time Smearing Neutral Photons
+########################################
+
+module TimeSmearingNeutral TimeSmearingPhotons {
+  set InputArray HCal/eflowTracks
+  set OutputArray timeSmearingPhotons
+}
+
+########################################
+#   Time Smearing Neutral NeutralHadrons
+########################################
+
+module TimeSmearingNeutral TimeSmearingNH {
+  set InputArray HCal/eflowTracks
+  set OutputArray timeSmearingNH
+
+  # assume 20 ps resolution for now
+  set TimeResolution {30E-12}
+}
+
 
 #################
@@ -573,4 +550,68 @@
 }
 
+##################################
+# Primary vertex reconstruction
+##################################
+
+
+module VertexFinderDA4D VertexFinderDA4D {
+  set InputArray TimeSmearing/tracks
+
+  set OutputArray tracks
+  set VertexOutputArray vertices
+
+  set Verbose 0
+  set MinPT 1.0
+
+  # in mm
+  set VertexSpaceSize 0.5
+
+  # in s
+  set VertexTimeSize 10E-12
+
+  set UseTc 1
+  set BetaMax 0.1
+  set BetaStop 1.0
+  set CoolingFactor 0.8
+  set MaxIterations 100
+
+  # in mm
+  set DzCutOff 40
+  set D0CutOff 30
+
+}
+
+##########################
+# Track pile-up subtractor
+##########################
+
+module TrackTimingPileUpSubtractor TrackTimingPileUpSubtractor {
+# add InputArray InputArray OutputArray
+
+  add InputArray ChargedHadronMomentumSmearing/chargedHadrons
+  add InputArray ElectronMomentumSmearing/electrons
+  add InputArray MuonMomentumSmearing/muons
+  add InputArray EFlowMerger/eflow
+
+  set VertexInputArray VertexFinderDA4D/vertices
+
+  set ZVertexResolution {3}
+  set TVertexResolution {3}
+}
+
+######################################
+# Heavy(slow) particles vertex recover
+######################################
+
+module HighMassVertexRecover HighMassVertexRecover {
+  set TrackInputArray VertexFinderDA4D/tracks
+  set VertexInputArray VertexFinderDA4D/vertices
+
+  set TrackOutputArray tracks
+  set VertexOutputArray vertices
+
+  set Verbose 0
+
+}
 
 ###################
@@ -1024,4 +1065,6 @@
   add Branch ScalarHT/energy ScalarHT ScalarHT
   add Branch VertexFinderDA4D/vertices Vertex4D Vertex
-}
-
+
+  add Branch HighMassVertexRecover/tracks Track Track
+}
+
Index: modules/ModulesLinkDef.h
===================================================================
--- modules/ModulesLinkDef.h	(revision d4e5b6a29d976f833d389ea7af3115081d34d5d5)
+++ modules/ModulesLinkDef.h	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -38,4 +38,5 @@
 #include "modules/ImpactParameterSmearing.h"
 #include "modules/TimeSmearing.h"
+#include "modules/TimeSmearingNeutral.h"
 #include "modules/SimpleCalorimeter.h"
 #include "modules/DenseTrackFilter.h"
@@ -55,5 +56,4 @@
 #include "modules/PileUpMerger.h"
 #include "modules/JetPileUpSubtractor.h"
-#include "modules/TrackPileUpSubtractor.h"
 #include "modules/TrackTimingPileUpSubtractor.h"
 #include "modules/TaggingParticlesSkimmer.h"
@@ -95,4 +95,5 @@
 #pragma link C++ class ImpactParameterSmearing+;
 #pragma link C++ class TimeSmearing+;
+#pragma link C++ class TimeSmearingNeutral+;
 #pragma link C++ class SimpleCalorimeter+;
 #pragma link C++ class DenseTrackFilter+;
@@ -112,5 +113,4 @@
 #pragma link C++ class PileUpMerger+;
 #pragma link C++ class JetPileUpSubtractor+;
-#pragma link C++ class TrackPileUpSubtractor+;
 #pragma link C++ class TrackTimingPileUpSubtractor+;
 #pragma link C++ class TaggingParticlesSkimmer+;
Index: modules/TimeSmearingNeutral.cc
===================================================================
--- modules/TimeSmearingNeutral.cc	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
+++ modules/TimeSmearingNeutral.cc	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -0,0 +1,130 @@
+/*
+ *  Delphes: a framework for fast simulation of a generic collider experiment
+ *  Copyright (C) 2012-2014  Universite catholique de Louvain (UCL), Belgium
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/** \class TimeSmearingNeutral
+ *
+ *  Performs transverse momentum resolution smearing.
+ *
+ *  \author P. Demin - UCL, Louvain-la-Neuve
+ *
+ */
+
+#include "modules/TimeSmearingNeutral.h"
+
+#include "classes/DelphesClasses.h"
+#include "classes/DelphesFactory.h"
+#include "classes/DelphesFormula.h"
+
+#include "ExRootAnalysis/ExRootClassifier.h"
+#include "ExRootAnalysis/ExRootFilter.h"
+#include "ExRootAnalysis/ExRootResult.h"
+
+#include "TDatabasePDG.h"
+#include "TFormula.h"
+#include "TLorentzVector.h"
+#include "TMath.h"
+#include "TObjArray.h"
+#include "TRandom3.h"
+#include "TString.h"
+
+#include <algorithm>
+#include <iostream>
+#include <sstream>
+#include <stdexcept>
+
+using namespace std;
+
+//------------------------------------------------------------------------------
+
+TimeSmearingNeutral::TimeSmearingNeutral() :
+  fFormula(0), fItInputArray(0)
+{
+  fFormula = new DelphesFormula;
+}
+
+//------------------------------------------------------------------------------
+
+TimeSmearingNeutral::~TimeSmearingNeutral()
+{
+  if(fFormula) delete fFormula;
+}
+
+//------------------------------------------------------------------------------
+
+void TimeSmearingNeutral::Init()
+{
+  // read resolution formula
+
+  //fFormula->Compile(GetString("TimeResolution", "1.0"));
+  fTimeResolution = GetDouble("TimeResolution", 1.);
+  // import input array
+  fEtaMax = GetDouble("EtaMax", 6.);
+  fInputArray = ImportArray(GetString("InputArray", "MuonMomentumSmearing/muons"));
+  fItInputArray = fInputArray->MakeIterator();
+
+  // create output array
+
+  fOutputArray = ExportArray(GetString("OutputArray", "muons"));
+}
+
+//------------------------------------------------------------------------------
+
+void TimeSmearingNeutral::Finish()
+{
+  if(fItInputArray) delete fItInputArray;
+}
+
+//------------------------------------------------------------------------------
+
+void TimeSmearingNeutral::Process()
+{
+  Candidate *candidate, *mother;
+  Double_t ti, tf_smeared, tf, timeResolution;
+  Double_t pt, eta, phi, e, p, d0, dz, ctgTheta;
+  Double_t beta_particle;
+  Double_t l;
+  Double_t sigma_t;
+
+  const Double_t c_light = 2.99792458E8;
+
+  fItInputArray->Reset();
+  while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
+  {
+    ti = candidate->InitialPosition.T()*1.0E-3/c_light;
+    tf = candidate->Position.T()*1.0E-3/c_light;
+    e = candidate->Momentum.E();
+    p = candidate->Momentum.P();
+    beta_particle = p/e;
+    l = candidate->L;
+
+    if(candidate->Charge == 0)
+    {
+      sigma_t = sqrt(pow(20,2) + pow(150,2)/e)*1.0E-12;
+    }else
+      sigma_t = fTimeResolution*gRandom->Gaus(0, 1);;
+
+    ti = sigma_t - l*1.0E3/(c_light*beta_particle);
+
+
+    candidate->InitialPosition.SetT(ti);
+    candidate->ErrorT = sigma_t*1.0E3*c_light;
+    fOutputArray->Add(candidate);
+  }
+}
+
+//------------------------------------------------------------------------------
Index: modules/TimeSmearingNeutral.h
===================================================================
--- modules/TimeSmearingNeutral.h	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
+++ modules/TimeSmearingNeutral.h	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -0,0 +1,60 @@
+/*
+ *  Delphes: a framework for fast simulation of a generic collider experiment
+ *  Copyright (C) 2012-2014  Universite catholique de Louvain (UCL), Belgium
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TimeSmearingNeutral_h
+#define TimeSmearingNeutral_h
+
+/** \class TimeSmearingNeutral
+ *
+ *  Performs transverse time smearing.
+ *
+ *  \author Michele Selvaggi - UCL, Louvain-la-Neuve
+ *
+ */
+
+#include "classes/DelphesModule.h"
+
+class TIterator;
+class TObjArray;
+class DelphesFormula;
+
+class TimeSmearingNeutral: public DelphesModule
+{
+public:
+  TimeSmearingNeutral();
+  ~TimeSmearingNeutral();
+
+  void Init();
+  void Process();
+  void Finish();
+
+private:
+  DelphesFormula *fFormula; //!
+  Double_t fEtaMax;
+  Double_t fTimeResolution;
+
+  TIterator *fItInputArray; //!
+
+  const TObjArray *fInputArray; //!
+
+  TObjArray *fOutputArray; //!
+
+  ClassDef(TimeSmearingNeutral, 1)
+};
+
+#endif
Index: modules/TrackTimingPileUpSubtractor.cc
===================================================================
--- modules/TrackTimingPileUpSubtractor.cc	(revision d4e5b6a29d976f833d389ea7af3115081d34d5d5)
+++ modules/TrackTimingPileUpSubtractor.cc	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -75,5 +75,6 @@
 
   // read resolution formula in m
-  fFormula->Compile(GetString("ZVertexResolution", "0.001"));
+  fZVertexResolution = GetDouble("ZVertexResolution", 3);
+  fTVertexResolution = GetDouble("TVertexResolution", 3);
 
   fPTMin = GetDouble("PTMin", 0.);
@@ -128,5 +129,5 @@
   Double_t tempPTSquare = 0;
   Double_t pt, eta, phi, e;
-  Double_t distance = 0;
+  Double_t distanceCharged, distanceNeutral = 0;
 
   // find z position of primary vertex
@@ -143,5 +144,4 @@
       tvtx = candidate->Position.T();
       tvtx_err = candidate->PositionError.T();
-      cout << " initial : " << candidate->InitialPosition.T() << " final : " << candidate->Position.T() << endl;
     } 
   }
@@ -167,18 +167,18 @@
       z = particle->Position.Z();
       z_err = particle->PositionError.Z();
-      t = particle->Position.T();
+      t = particle->InitialPosition.T();
       t_err = particle->PositionError.T();
 
-      // apply pile-up subtraction
-      distance = pow((zvtx - z),2)/pow((zvtx_err - z_err),2) + pow((tvtx - t),2)/pow((tvtx_err - t_err),2);
-      //cout << " t : " << tvtx << "  t(particle)" << t << endl;
-      // here I calculated distance using Z and T of selected vertex (highest sum Pt square) and particles
-      // however z_err of vertices is gives 0 because of using CMS trackResolutionCMS.tcl (in that formula, there is limitation on |eta| < 2.5)
-      // thats why I used TMath::Abs(z - zvtx) < 0.005 && TMath::Abs(t - tvtx) < 5.0
+      distanceCharged = pow((zvtx - z),2)/pow((zvtx_err - z_err),2) + pow((tvtx - t),2)/pow((tvtx_err - t_err),2);
+      distanceNeutral = pow((tvtx - t),2)/pow((tvtx_err - t_err),2);
 
-      if(candidate->Charge != 0 && TMath::Abs(z - zvtx) < 0.005 && TMath::Abs(t - tvtx) < 5.0)
+      if(candidate->Charge != 0 && distanceCharged < fZVertexResolution)
       {
         candidate->IsRecoPU = 1;
       }
+      else if(candidate->Charge == 0 && distanceNeutral < fTVertexResolution)
+      {
+        candidate->IsRecoPU = 1;
+      }  
       else
       {
Index: modules/TrackTimingPileUpSubtractor.h
===================================================================
--- modules/TrackTimingPileUpSubtractor.h	(revision d4e5b6a29d976f833d389ea7af3115081d34d5d5)
+++ modules/TrackTimingPileUpSubtractor.h	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -49,4 +49,7 @@
   DelphesFormula *fFormula; //!
 
+  Double_t fZVertexResolution;
+  Double_t fTVertexResolution;
+
   Double_t fPTMin;
 
Index: modules/VertexFinderDA4D.cc
===================================================================
--- modules/VertexFinderDA4D.cc	(revision d4e5b6a29d976f833d389ea7af3115081d34d5d5)
+++ modules/VertexFinderDA4D.cc	(revision 03b9c0fbe7936bb91f439038c258bdfab33241c3)
@@ -425,4 +425,5 @@
     candidate->ClusterIndex = k;
     candidate->Position.SetXYZT(0.0, 0.0, vtx.z[k] , vtx.t[k]*1E-9*c_light);
+    candidate->InitialPosition.SetXYZT(0.0, 0.0, vtx.z[k] , vtx.t[k]*1E-9*c_light);    
     candidate->PositionError.SetXYZT(0.0, 0.0, fVertexZSize , fVertexTSize*1E-9*c_light);
     candidate->SumPT2 = 0;
