Index: modules/VertexFinder.cc
===================================================================
--- modules/VertexFinder.cc	(revision 7da1826092cf0024c639e1bc9be71db4f32dca72)
+++ modules/VertexFinder.cc	(revision 95b4e9f53f115f744fd16d3ccbc8713b04dacea4)
@@ -28,4 +28,14 @@
 #include "TVector3.h"
 
+#include <utility>
+#include <algorithm>
+#include <stdexcept>
+#include <iostream>
+#include <vector>
+#include <map>
+#include <string>
+
+using namespace std;
+
 static const Double_t mm  = 1.;
 static const Double_t m = 1000.*mm;
@@ -73,22 +83,22 @@
 
 //------------------------------------------------------------------------------
-//
-Bool_t VertexFinder::secondAscending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
+
+static Bool_t secondAscending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
 {
   return (pair0.second < pair1.second);
 }
 
-Bool_t VertexFinder::secondDescending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
+static Bool_t secondDescending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
 {
   return (pair0.second > pair1.second);
 }
 
+//------------------------------------------------------------------------------
+
 void VertexFinder::Process()
 {
   Candidate *candidate;
 
-////////////////////////////////////////////////////////////////////////////////
-// Clear the track and cluster maps before starting
-////////////////////////////////////////////////////////////////////////////////
+  // Clear the track and cluster maps before starting
   trackIDToDouble.clear ();
   trackIDToInt.clear ();
@@ -99,16 +109,10 @@
   trackPT.clear ();
   clusterSumPT2.clear ();
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// Create the initial cluster seeds
-////////////////////////////////////////////////////////////////////////////////
+
+  // Create the initial cluster seeds
   createSeeds ();
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// In order of descending seed pt, grow each cluster. If a cluster ends up with
-// fewer than MinNDF tracks, release the tracks for other clusters to claim.
-////////////////////////////////////////////////////////////////////////////////
+
+  // In order of descending seed pt, grow each cluster. If a cluster ends up with
+  // fewer than MinNDF tracks, release the tracks for other clusters to claim.
   sort (clusterSumPT2.begin (), clusterSumPT2.end (), secondDescending);
   for (vector<pair<UInt_t, Double_t> >::const_iterator cluster = clusterSumPT2.begin (); cluster != clusterSumPT2.end (); cluster++)
@@ -138,9 +142,6 @@
         trackIDToBool[clusterIDToInt.at (cluster->first).at ("seed")]["claimed"] = true;
     }
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// Add tracks to the output array after updating their ClusterIndex.
-////////////////////////////////////////////////////////////////////////////////
+
+  // Add tracks to the output array after updating their ClusterIndex.
   fItInputArray->Reset ();
   while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
@@ -151,10 +152,7 @@
       fOutputArray->Add(candidate);
     }
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// Add clusters with at least MinNDF tracks to the output array in order of
-// descending sum(pt**2).
-////////////////////////////////////////////////////////////////////////////////
+
+  // Add clusters with at least MinNDF tracks to the output array in order of
+  // descending sum(pt**2).
   clusterSumPT2.clear ();
   for (map<UInt_t, map<string, Int_t> >::const_iterator cluster = clusterIDToInt.begin (); cluster != clusterIDToInt.end (); cluster++)
@@ -181,16 +179,14 @@
     fVertexOutputArray->Add(candidate);
   }
-////////////////////////////////////////////////////////////////////////////////
-}
-
-void
-VertexFinder::createSeeds ()
+}
+
+//------------------------------------------------------------------------------
+
+void VertexFinder::createSeeds ()
 {
   Candidate *candidate;
   UInt_t clusterIndex = 0, maxSeeds = 0;
 
-////////////////////////////////////////////////////////////////////////////////
-// Loop over all tracks, initializing some variables.
-////////////////////////////////////////////////////////////////////////////////
+  // Loop over all tracks, initializing some variables.
   fItInputArray->Reset();
   while((candidate = static_cast<Candidate*>(fItInputArray->Next())))
@@ -213,10 +209,7 @@
       trackPT.push_back (make_pair (candidate->GetUniqueID (), candidate->Momentum.Pt ()));
     }
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// Sort tracks by pt and leave only the SeedMinPT highest pt ones in the
-// trackPT vector.
-////////////////////////////////////////////////////////////////////////////////
+
+  // Sort tracks by pt and leave only the SeedMinPT highest pt ones in the
+  // trackPT vector.
   sort (trackPT.begin (), trackPT.end (), secondDescending);
   for (vector<pair<UInt_t, Double_t> >::const_iterator track = trackPT.begin (); track != trackPT.end (); track++, maxSeeds++)
@@ -233,9 +226,6 @@
       trackPT.erase (trackPT.begin () + maxSeeds, trackPT.end ());
     }
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// Create the seeds from the SeedMinPT highest pt tracks.
-////////////////////////////////////////////////////////////////////////////////
+
+  // Create the seeds from the SeedMinPT highest pt tracks.
   for (vector<pair<UInt_t, Double_t> >::const_iterator track = trackPT.begin (); track != trackPT.end (); track++, clusterIndex++)
     {
@@ -243,9 +233,9 @@
       clusterSumPT2.push_back (make_pair (clusterIndex, track->second * track->second));
     }
-////////////////////////////////////////////////////////////////////////////////
-}
-
-void
-VertexFinder::growCluster (const UInt_t clusterIndex)
+}
+
+//------------------------------------------------------------------------------
+
+void VertexFinder::growCluster (const UInt_t clusterIndex)
 {
   Bool_t done = false;
@@ -256,8 +246,6 @@
   nearTracks.clear ();
 
-////////////////////////////////////////////////////////////////////////////////
-// Grow the cluster until there are no more tracks within Sigma standard
-// deviations of the cluster.
-////////////////////////////////////////////////////////////////////////////////
+  // Grow the cluster until there are no more tracks within Sigma standard
+  // deviations of the cluster.
   while (!done)
     {
@@ -323,15 +311,16 @@
         }
     }
-////////////////////////////////////////////////////////////////////////////////
-}
-
-Double_t
-VertexFinder::weight (const UInt_t trackID)
+}
+
+//------------------------------------------------------------------------------
+
+Double_t VertexFinder::weight (const UInt_t trackID)
 {
   return ((trackIDToDouble.at (trackID).at ("pt") / (trackIDToDouble.at (trackID).at ("ept") * trackIDToDouble.at (trackID).at ("ez"))) * (trackIDToDouble.at (trackID).at ("pt") / (trackIDToDouble.at (trackID).at ("ept") * trackIDToDouble.at (trackID).at ("ez"))));
 }
 
-void
-VertexFinder::removeTrackFromCluster (const UInt_t trackID, const UInt_t clusterID)
+//------------------------------------------------------------------------------
+
+void VertexFinder::removeTrackFromCluster (const UInt_t trackID, const UInt_t clusterID)
 {
   Double_t wz = weight (trackID);
@@ -348,6 +337,7 @@
 }
 
-void
-VertexFinder::addTrackToCluster (const UInt_t trackID, const UInt_t clusterID)
+//------------------------------------------------------------------------------
+
+void VertexFinder::addTrackToCluster (const UInt_t trackID, const UInt_t clusterID)
 {
   Double_t wz = weight (trackID);
Index: modules/VertexFinder.h
===================================================================
--- modules/VertexFinder.h	(revision 7da1826092cf0024c639e1bc9be71db4f32dca72)
+++ modules/VertexFinder.h	(revision 95b4e9f53f115f744fd16d3ccbc8713b04dacea4)
@@ -12,17 +12,11 @@
 
 #include "classes/DelphesModule.h"
-#include "classes/DelphesClasses.h"
-#include <utility>
-#include <algorithm>
-#include <stdexcept>
-#include <iostream>
+
+#include <string>
 #include <vector>
-#include <unordered_map>
-
-using namespace std;
+#include <map>
 
 class TObjArray;
-class Candidate;
-class TVector3;
+class TIterator;
 
 class VertexFinder: public DelphesModule
@@ -36,7 +30,4 @@
   void Process();
   void Finish();
-
-  static Bool_t secondDescending (pair<UInt_t, Double_t>, pair<UInt_t, Double_t>);
-  static Bool_t secondAscending (pair<UInt_t, Double_t>, pair<UInt_t, Double_t>);
 
 private:
@@ -61,13 +52,13 @@
   TObjArray *fVertexOutputArray;
 
-  map<UInt_t, map<string, Double_t> > trackIDToDouble;
-  map<UInt_t, map<string, Int_t> > trackIDToInt;
-  map<UInt_t, map<string, Bool_t> > trackIDToBool;
+  std::map<UInt_t, std::map<std::string, Double_t> > trackIDToDouble;
+  std::map<UInt_t, std::map<std::string, Int_t> > trackIDToInt;
+  std::map<UInt_t, std::map<std::string, Bool_t> > trackIDToBool;
 
-  map<UInt_t, map<string, Double_t> > clusterIDToDouble;
-  map<UInt_t, map<string, Int_t> > clusterIDToInt;
-  map<UInt_t, map<string, Bool_t> > clusterIDToBool;
-  vector<pair<UInt_t, Double_t> > trackPT;
-  vector<pair<UInt_t, Double_t> > clusterSumPT2;
+  std::map<UInt_t, std::map<std::string, Double_t> > clusterIDToDouble;
+  std::map<UInt_t, std::map<std::string, Int_t> > clusterIDToInt;
+  std::map<UInt_t, std::map<std::string, Bool_t> > clusterIDToBool;
+  std::vector<std::pair<UInt_t, Double_t> > trackPT;
+  std::vector<std::pair<UInt_t, Double_t> > clusterSumPT2;
 
   ClassDef(VertexFinder, 1)
Index: modules/VertexFinderDA4D.cc
===================================================================
--- modules/VertexFinderDA4D.cc	(revision 7da1826092cf0024c639e1bc9be71db4f32dca72)
+++ modules/VertexFinderDA4D.cc	(revision 95b4e9f53f115f744fd16d3ccbc8713b04dacea4)
@@ -27,4 +27,12 @@
 #include "TMatrixT.h"
 #include "TVector3.h"
+
+#include <utility>
+#include <algorithm>
+#include <stdexcept>
+#include <iostream>
+#include <vector>
+
+using namespace std;
 
 static const Double_t mm  = 1.;
Index: modules/VertexFinderDA4D.h
===================================================================
--- modules/VertexFinderDA4D.h	(revision 7da1826092cf0024c639e1bc9be71db4f32dca72)
+++ modules/VertexFinderDA4D.h	(revision 95b4e9f53f115f744fd16d3ccbc8713b04dacea4)
@@ -11,19 +11,11 @@
 
 
+#include "classes/DelphesModule.h"
 
-#include "classes/DelphesModule.h"
-#include "classes/DelphesClasses.h"
-#include <utility>
-#include <algorithm>
-#include <stdexcept>
-#include <iostream>
 #include <vector>
-#include <unordered_map>
-
-using namespace std;
 
 class TObjArray;
+class TIterator;
 class Candidate;
-class TVector3;
 
 class VertexFinderDA4D: public DelphesModule
@@ -38,37 +30,35 @@
   void Finish();
 
-  struct track_t{
-  double z;              // z-coordinate at point of closest approach to the beamline
-  double t;              // t-coordinate at point of closest approach to the beamline
-  double dz2;            // square of the error of z(pca)
-  double dtz;            // covariance of z-t
-  double dt2;            // square of the error of t(pca)
-  //const reco::TransientTrack* tt;  // a pointer to the Transient Track
-  Candidate* tt;  // a pointer to the Candidate Track
-  double Z;              // Z[i]   for DA clustering
-  double pi;             // track weight
-  double pt;
-  double eta;
-  double phi;
-
-};
+  struct track_t
+  {
+    double z;      // z-coordinate at point of closest approach to the beamline
+    double t;      // t-coordinate at point of closest approach to the beamline
+    double dz2;    // square of the error of z(pca)
+    double dtz;    // covariance of z-t
+    double dt2;    // square of the error of t(pca)
+    Candidate* tt; // a pointer to the Candidate Track
+    double Z;      // Z[i]   for DA clustering
+    double pi;     // track weight
+    double pt;
+    double eta;
+    double phi;
+  };
 
 
-struct vertex_t{
-  double z;    //           z coordinate
-  double t;    //           t coordinate
-  double pk;   //           vertex weight for "constrained" clustering
-  // --- temporary numbers, used during update
-  double ei;
-  double sw;
-  double swz;
-  double swt;
-  double se;
-  // ---for Tc
-  double swE;
-  double Tc;
-};
-
-
+  struct vertex_t
+  {
+    double z;
+    double t;
+    double pk;     // vertex weight for "constrained" clustering
+    // --- temporary numbers, used during update
+    double ei;
+    double sw;
+    double swz;
+    double swt;
+    double se;
+    // ---for Tc
+    double swE;
+    double Tc;
+  };
 
   void clusterize(const TObjArray & tracks, TObjArray & clusters);
@@ -78,30 +68,29 @@
   std::vector<track_t> fill() const;
 
-  bool split( double beta,
+  bool split(double beta,
              std::vector<track_t> & tks,
              std::vector<vertex_t> & y) const;
 
-  double update( double beta,
+  double update(double beta,
                 std::vector<track_t> & tks,
-                std::vector<vertex_t> & y ) const;
+                std::vector<vertex_t> & y) const;
 
   double update(double beta,
-               std::vector<track_t> & tks,
-               std::vector<vertex_t> & y,
-               double & )const;
+                std::vector<track_t> & tks,
+                std::vector<vertex_t> & y,
+                double &)const;
 
   void dump(const double beta, const std::vector<vertex_t> & y, const std::vector<track_t> & tks) const;
   bool merge(std::vector<vertex_t> &) const;
-  bool merge(std::vector<vertex_t> &,double & ) const;
-  bool purge(std::vector<vertex_t> &, std::vector<track_t> & , double &, const double ) const;
+  bool merge(std::vector<vertex_t> &, double &) const;
+  bool purge(std::vector<vertex_t> &, std::vector<track_t> & , double &, const double) const;
 
-  void splitAll( std::vector<vertex_t> & y ) const;
+  void splitAll(std::vector<vertex_t> &y) const;
 
   double beta0(const double betamax,
-	       std::vector<track_t> & tks,
-	       std::vector<vertex_t> & y )const;
+	       std::vector<track_t> &tks,
+	       std::vector<vertex_t> &y)const;
 
-  double Eik(const track_t & t, const vertex_t & k)const;
-
+  double Eik(const track_t &t, const vertex_t &k)const;
 
 private:
Index: modules/VertexSorter.cc
===================================================================
--- modules/VertexSorter.cc	(revision 7da1826092cf0024c639e1bc9be71db4f32dca72)
+++ modules/VertexSorter.cc	(revision 95b4e9f53f115f744fd16d3ccbc8713b04dacea4)
@@ -29,4 +29,14 @@
 #include "TMatrixT.h"
 #include "TVector3.h"
+
+#include <utility>
+#include <algorithm>
+#include <stdexcept>
+#include <iostream>
+#include <vector>
+#include <map>
+#include <string>
+
+using namespace std;
 
 static const Double_t mm  = 1.;
@@ -76,5 +86,5 @@
   fOutputArray = ExportArray(GetString("OutputArray", "clusters"));
 
-  fMethod = GetString ("Method", "BTV");
+  fMethod = GetString("Method", "BTV");
 }
 
@@ -88,19 +98,22 @@
 
 //------------------------------------------------------------------------------
-//
-Bool_t VertexSorter::secondDescending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
+
+static Bool_t secondDescending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
 {
   return (pair0.second > pair1.second);
 }
-Bool_t VertexSorter::secondAscending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
+
+static Bool_t secondAscending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
 {
   return (pair0.second < pair1.second);
 }
 
+//------------------------------------------------------------------------------
+
 void VertexSorter::Process()
 {
   Candidate *candidate, *jetCandidate, *beamSpotCandidate;
-  unordered_map<Int_t, UInt_t> clusterIDToIndex;
-  unordered_map<Int_t, Double_t> clusterIDToSumPT2;
+  map<Int_t, UInt_t> clusterIDToIndex;
+  map<Int_t, Double_t> clusterIDToSumPT2;
   vector<pair<Int_t, Double_t> > sortedClusterIDs;
 
@@ -112,5 +125,5 @@
     }
 
-  if (fMethod == "BTV")
+  if(fMethod == "BTV")
     {
       if (!fJetInputArray)
Index: modules/VertexSorter.h
===================================================================
--- modules/VertexSorter.h	(revision 7da1826092cf0024c639e1bc9be71db4f32dca72)
+++ modules/VertexSorter.h	(revision 95b4e9f53f115f744fd16d3ccbc8713b04dacea4)
@@ -13,19 +13,10 @@
 
 #include "classes/DelphesModule.h"
-#include "classes/DelphesClasses.h"
-#include <utility>
-#include <algorithm>
-#include <stdexcept>
-#include <iostream>
-#include <vector>
+
 #include <string>
-#include <unordered_map>
-
-
-using namespace std;
 
 class TObjArray;
+class TIterator;
 class Candidate;
-class TVector3;
 
 class VertexSorter: public DelphesModule
@@ -39,7 +30,4 @@
   void Process();
   void Finish();
-
-  static Bool_t secondDescending (pair<UInt_t, Double_t>, pair<UInt_t, Double_t>);
-  static Bool_t secondAscending (pair<UInt_t, Double_t>, pair<UInt_t, Double_t>);
 
 private:
@@ -58,5 +46,5 @@
   TObjArray *fOutputArray;
 
-  string fMethod;
+  std::string fMethod;
 
   ClassDef(VertexSorter, 1)
