Index: cards/CMS_PhaseII/CMS_PhaseII_Substructure_PIX4022_0PU.tcl
===================================================================
--- cards/CMS_PhaseII/CMS_PhaseII_Substructure_PIX4022_0PU.tcl	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ cards/CMS_PhaseII/CMS_PhaseII_Substructure_PIX4022_0PU.tcl	(revision 95b353126d0e8d573480ad6f8163d370eb39d003)
@@ -47,4 +47,5 @@
   LeptonFilterLep
   RunPUPPIBase
+  RunPUPPIMerger
   RunPUPPI
 
@@ -134,4 +135,5 @@
   # pre-generated minbias input file
   set PileUpFile ../eos/cms/store/group/upgrade/delphes/PhaseII/MinBias_100k.pileup
+  #set PileUpFile MinBias.pileup
 
   # average expected pile up
@@ -651,7 +653,13 @@
 }
 
-module Merger RunPUPPI {
+module Merger RunPUPPIMerger {
   add InputArray RunPUPPIBase/PuppiParticles
   add InputArray LeptonFilterLep/eflowTracksLeptons
+  set OutputArray PuppiParticles
+}
+
+# need this because of leptons that were added back
+module RecoPuFilter RunPUPPI {
+  set InputArray RunPUPPIMerger/PuppiParticles
   set OutputArray PuppiParticles
 }
Index: cards/CMS_PhaseII/CMS_PhaseII_Substructure_PIX4022_200PU.tcl
===================================================================
--- cards/CMS_PhaseII/CMS_PhaseII_Substructure_PIX4022_200PU.tcl	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ cards/CMS_PhaseII/CMS_PhaseII_Substructure_PIX4022_200PU.tcl	(revision 95b353126d0e8d573480ad6f8163d370eb39d003)
@@ -47,4 +47,5 @@
   LeptonFilterLep
   RunPUPPIBase
+  RunPUPPIMerger
   RunPUPPI
 
@@ -134,4 +135,5 @@
   # pre-generated minbias input file
   set PileUpFile ../eos/cms/store/group/upgrade/delphes/PhaseII/MinBias_100k.pileup
+  #set PileUpFile MinBias.pileup
 
   # average expected pile up
@@ -651,7 +653,13 @@
 }
 
-module Merger RunPUPPI {
+module Merger RunPUPPIMerger {
   add InputArray RunPUPPIBase/PuppiParticles
   add InputArray LeptonFilterLep/eflowTracksLeptons
+  set OutputArray PuppiParticles
+}
+
+# need this because of leptons that were added back
+module RecoPuFilter RunPUPPI {
+  set InputArray RunPUPPIMerger/PuppiParticles
   set OutputArray PuppiParticles
 }
Index: cards/FCC/FCChh_PileUp.tcl
===================================================================
--- cards/FCC/FCChh_PileUp.tcl	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ cards/FCC/FCChh_PileUp.tcl	(revision 95b353126d0e8d573480ad6f8163d370eb39d003)
@@ -42,4 +42,5 @@
   LeptonFilterLep
   RunPUPPIBase
+  RunPUPPIMerger
   RunPUPPI
   
@@ -98,5 +99,5 @@
   
   # average expected pile up
-  set MeanPileUp 1000
+  set MeanPileUp 100
 
   # maximum spread in the beam direction in m
@@ -539,7 +540,13 @@
 }
 
-module Merger RunPUPPI {
+module Merger RunPUPPIMerger {
   add InputArray RunPUPPIBase/PuppiParticles
   add InputArray LeptonFilterLep/eflowTracksLeptons
+  set OutputArray PuppiParticles
+}
+
+# need this because of leptons that were added back
+module RecoPuFilter RunPUPPI {
+  set InputArray RunPUPPIMerger/PuppiParticles
   set OutputArray PuppiParticles
 }
@@ -760,5 +767,5 @@
 
   # isolation collection
-  set IsolationInputArray EFlowFilter/eflow
+  set IsolationInputArray RunPUPPI/PuppiParticles
 
   # output array
@@ -788,7 +795,11 @@
 module Isolation ElectronIsolation {
   set CandidateInputArray ElectronFilter/electrons
-  set IsolationInputArray EFlowFilter/eflow
+  set IsolationInputArray RunPUPPI/PuppiParticles
 
   set OutputArray electrons
+
+  # veto isolation cand. based on proximity to input cand.
+  set DeltaRMin 0.01
+  set UseMiniCone true
 
   set DeltaRMax 0.3
@@ -808,7 +819,11 @@
 module Isolation MuonIsolation {
   set CandidateInputArray MuonMomentumSmearing/muons
-  set IsolationInputArray EFlowFilter/eflow
+  set IsolationInputArray RunPUPPI/PuppiParticles
 
   set OutputArray muons
+
+  # veto isolation cand. based on proximity to input cand.
+  set DeltaRMin 0.01
+  set UseMiniCone true
 
   set DeltaRMax 0.3
@@ -983,4 +998,5 @@
   add Branch GenJetFinder/jets GenJet Jet
   add Branch GenMissingET/momentum GenMissingET MissingET
+  add Branch GenPileUpMissingET/momentum GenPileUpMissingET MissingET
 
   add Branch UniqueObjectFinder/photons Photon Photon
@@ -990,4 +1006,5 @@
 
   add Branch MissingET/momentum MissingET MissingET
+  add Branch PuppiMissingET/momentum PuppiMissingET MissingET
   add Branch ScalarHT/energy ScalarHT ScalarHT
 }
Index: classes/DelphesClasses.cc
===================================================================
--- classes/DelphesClasses.cc	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ classes/DelphesClasses.cc	(revision 95b353126d0e8d573480ad6f8163d370eb39d003)
@@ -254,4 +254,5 @@
   object.Mass = Mass;
   object.IsPU = IsPU;
+  object.IsRecoPU = IsRecoPU;
   object.IsConstituent = IsConstituent;
   object.IsFromConversion = IsFromConversion;
@@ -380,4 +381,5 @@
   Mass = 0.0;
   IsPU = 0;
+  IsRecoPU = 0;
   IsConstituent = 0;
   IsFromConversion = 0;
Index: modules/RunPUPPI.cc
===================================================================
--- modules/RunPUPPI.cc	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ modules/RunPUPPI.cc	(revision 95b353126d0e8d573480ad6f8163d370eb39d003)
@@ -166,5 +166,4 @@
   Candidate *pv = static_cast<Candidate*>(fPVItInputArray->Next());
   if (pv) PVZ = pv->Position.Z();
-
   // Fill input particles for puppi
   std::vector<RecoObj> puppiInputVector;
@@ -179,6 +178,5 @@
       curRecoObj.phi = momentum.Phi();
       curRecoObj.m   = momentum.M();  
-      particle = static_cast<Candidate*>(candidate->GetCandidates()->Last());
-      //if(fApplyNoLep && TMath::Abs(candidate->PID) == 11) continue; //Dumb cut to minimize the nolepton on electron
+      particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));//if(fApplyNoLep && TMath::Abs(candidate->PID) == 11) continue; //Dumb cut to minimize the nolepton on electron
       //if(fApplyNoLep && TMath::Abs(candidate->PID) == 13) continue;
       if (candidate->IsRecoPU and candidate->Charge !=0) { // if it comes fromPU vertexes after the resolution smearing and the dZ matching within resolution
@@ -192,5 +190,5 @@
         curRecoObj.dZ = particle->Position.Z()-PVZ;
       } 
-      else if(!candidate->IsRecoPU and candidate->Charge !=0) {
+      else if(!candidate->IsRecoPU && candidate->Charge !=0) {
 	curRecoObj.id    = 1;  // charge from LV
         curRecoObj.vtxId = 1; // from PV
@@ -219,6 +217,5 @@
       curRecoObj.m   = momentum.M();
       curRecoObj.charge = 0;
-      particle = static_cast<Candidate*>(candidate->GetCandidates()->Last());
-
+      particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0));
       if(candidate->Charge == 0){
 	curRecoObj.id    = 0; // neutrals have id==0
Index: modules/TrackPileUpSubtractor.cc
===================================================================
--- modules/TrackPileUpSubtractor.cc	(revision 7d8363633177b762d8293d313bd4ce0cbbc397e8)
+++ modules/TrackPileUpSubtractor.cc	(revision 95b353126d0e8d573480ad6f8163d370eb39d003)
@@ -161,5 +161,5 @@
       // assume perfect pile-up subtraction for tracks outside fZVertexResolution
 
-      if(candidate->IsPU && TMath::Abs(z-zvtx) > fFormula->Eval(pt, eta, phi, e)* 1.0e3)
+      if(candidate->Charge !=0 && TMath::Abs(z-zvtx) > fFormula->Eval(pt, eta, phi, e)* 1.0e3)
       {
         candidate->IsRecoPU = 1;
@@ -173,4 +173,2 @@
   }
 }
-
-//------------------------------------------------------------------------------
