Index: external/fastjet/contribs/Nsubjettiness/AxesFinder.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/AxesFinder.cc	(revision 49234af6f43184fff8e2bfee34c7b17846289882)
+++ external/fastjet/contribs/Nsubjettiness/AxesFinder.cc	(revision e2a76ae00ae9004d131355e0d7c6871ed1353c77)
@@ -5,5 +5,4 @@
 //  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
 //
-//  $Id: AxesFinder.cc 670 2014-06-06 01:24:42Z jthaler $
 //----------------------------------------------------------------------
 // This file is part of FastJet contrib.
@@ -38,5 +37,5 @@
 template <int N>
 std::vector<LightLikeAxis> AxesFinderFromOnePassMinimization::UpdateAxesFast(const std::vector <LightLikeAxis> & old_axes, 
-                                  const std::vector <fastjet::PseudoJet> & inputJets) const {
+                                  const std::vector <fastjet::PseudoJet> & inputJets) {
    assert(old_axes.size() == N);
    
@@ -46,5 +45,10 @@
    for (int n = 0; n < N; ++n) {
       new_axes[n].reset(0.0,0.0,0.0,0.0);
+#ifdef FASTJET2
+      new_jets[n].reset(0.0,0.0,0.0,0.0);
+#else
+      // use cheaper reset if available
       new_jets[n].reset_momentum(0.0,0.0,0.0,0.0);
+#endif
    }
 
@@ -131,5 +135,5 @@
 // (This is just a wrapper for the templated version above.)
 std::vector<LightLikeAxis> AxesFinderFromOnePassMinimization::UpdateAxes(const std::vector <LightLikeAxis> & old_axes,
-                                      const std::vector <fastjet::PseudoJet> & inputJets) const {
+                                      const std::vector <fastjet::PseudoJet> & inputJets) {
    int N = old_axes.size();
    switch (N) {
@@ -162,5 +166,5 @@
 // uses minimization of N-jettiness to continually update axes until convergence.
 // The function returns the axes found at the (local) minimum
-std::vector<fastjet::PseudoJet> AxesFinderFromOnePassMinimization::getAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) const {
+std::vector<fastjet::PseudoJet> AxesFinderFromOnePassMinimization::getBetterAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) {
 	  
    // convert from PseudoJets to LightLikeAxes
@@ -207,5 +211,5 @@
 }
 
-PseudoJet AxesFinderFromKmeansMinimization::jiggle(const PseudoJet& axis) const {
+PseudoJet AxesFinderFromKmeansMinimization::jiggle(const PseudoJet& axis) {
    double phi_noise = ((double)rand()/(double)RAND_MAX) * _noise_range * 2.0 - _noise_range;
    double rap_noise = ((double)rand()/(double)RAND_MAX) * _noise_range * 2.0 - _noise_range;
@@ -222,5 +226,5 @@
    
 // Repeatedly calls the one pass finder to try to find global minimum
-std::vector<fastjet::PseudoJet> AxesFinderFromKmeansMinimization::getAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) const {
+std::vector<fastjet::PseudoJet> AxesFinderFromKmeansMinimization::getBetterAxes(int n_jets, const std::vector <fastjet::PseudoJet> & inputJets, const std::vector<fastjet::PseudoJet>& seedAxes) {
    
    // first iteration
@@ -252,8 +256,8 @@
 // It continually updates until it reaches convergence or it reaches the maximum number of attempts.
 // This is essentially the same as a stable cone finder.
-std::vector<fastjet::PseudoJet> AxesFinderFromGeometricMinimization::getAxes(int /*n_jets*/, const std::vector <fastjet::PseudoJet> & particles, const std::vector<fastjet::PseudoJet>& currentAxes) const {
+std::vector<fastjet::PseudoJet> AxesFinderFromGeometricMinimization::getBetterAxes(int n_jets, const std::vector <fastjet::PseudoJet> & particles, const std::vector<fastjet::PseudoJet>& currentAxes) {
 
    std::vector<fastjet::PseudoJet> seedAxes = currentAxes;
-   double seedTau = _function.tau(particles, seedAxes);
+   double seedTau = _function->tau(particles, seedAxes);
    
    for (int i = 0; i < _nAttempts; i++) {
@@ -266,9 +270,9 @@
          // start from unclustered beam measure
          int minJ = -1;
-         double minDist = _function.beam_distance_squared(particles[i]);
+         double minDist = _function->beam_distance_squared(particles[i]);
          
          // which axis am I closest to?
          for (unsigned int j = 0; j < seedAxes.size(); j++) {
-            double tempDist = _function.jet_distance_squared(particles[i],seedAxes[j]);
+            double tempDist = _function->jet_distance_squared(particles[i],seedAxes[j]);
             if (tempDist < minDist) {
                minDist = tempDist;
@@ -283,5 +287,5 @@
       // calculate tau on new axes
       seedAxes = newAxes;
-      double tempTau = _function.tau(particles, newAxes);
+      double tempTau = _function->tau(particles, newAxes);
       
       // close enough to stop?
