Index: external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh	(revision 9687203133c32a58144435a449f6d077a04b38c7)
+++ external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh	(revision be2222cc14ff474f18d30a4e0ebc21a952777df5)
@@ -5,4 +5,5 @@
 //  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
 //
+//  $Id: Nsubjettiness.hh 670 2014-06-06 01:24:42Z jthaler $
 //----------------------------------------------------------------------
 // This file is part of FastJet contrib.
@@ -32,5 +33,4 @@
 #include <string>
 #include <climits>
-
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -49,14 +49,67 @@
 public:
 
-   // Main constructor, which takes N, axes/measure modes,
-   // and up to four parameters for parameters (i.e. beta, Rcutoff, etc depending on measure)
+   
+   // Main constructor, which takes N, the AxesDefiniation, and the MeasureDefinition.
+   // The Definitions are given in NjettinessDefinition.hh
+   //
+   // The recommended AxesDefinitions are (more are available as listed in the README
+   // and defined in NjettinessDefinition.hh):
+   //   KT_Axes             : exclusive kt axes
+   //   WTA_KT_Axes         : exclusive kt with winner-take-all recombination
+   //   OnePass_KT_Axes     : one-pass minimization from kt starting point
+   //   OnePass_WTA_KT_Axes : one-pass min. from wta_kt starting point
+   //
+   // The recommended measure definitions are (with the corresponding parameters)
+   //   NormalizedMeasure(beta,R0)
+   //      :  This was the original N-subjettiness measure (dimensionless)
+   //   UnnormalizedMeasure(beta)
+   //      :  This is the new recommended default, same as above but without
+   //      :  the normalization factor, and hence has units of GeV
+   //   NormalizedCutoffMeasure(beta,R0,Rcutoff)
+   //      :  Same as normalized_measure, but cuts off at Rcutoff
+   //   UnnormalizedCutoffMeasure(beta,Rcutoff)
+   //      :  Same as unnormalized_measure, but cuts off at Rcutoff
+   Nsubjettiness(int N,
+                 const AxesDefinition& axes_def,
+                 const MeasureDefinition& measure_def)
+   : _njettinessFinder(axes_def,measure_def), _N(N) {}
+   
+   
+   // Alternative constructors that define the measure via enums and parameters
+   // These constructors are likely be removed
+   // Zero parameter arguments
+   // (Currently, no measure uses this)
+   Nsubjettiness(int N,
+                 Njettiness::AxesMode axes_mode,
+                 Njettiness::MeasureMode measure_mode)
+   : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {}
+
+   // One parameter argument
+   // (for unnormalized_measure, para1=beta)
    Nsubjettiness(int N,
                  Njettiness::AxesMode axes_mode,
                  Njettiness::MeasureMode measure_mode,
-                 double para1 = NAN,
-                 double para2 = NAN,
-                 double para3 = NAN,
-                 double para4 = NAN)
-   : _njettinessFinder(axes_mode, measure_mode, para1, para2, para3, para4), _N(N) {}
+                 double para1)
+   : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {}
+
+   // Two parameter arguments
+   // (for normalized_measure, para1=beta, para2=R0)
+   // (for unnormalized_cutoff_measure, para1=beta, para2=Rcutoff)
+   Nsubjettiness(int N,
+                 Njettiness::AxesMode axes_mode,
+                 Njettiness::MeasureMode measure_mode,
+                 double para1,
+                 double para2)
+   : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) {}
+
+   // Three parameter arguments
+   // (for unnormalized_cutoff_measure, para1=beta, para2=R0, para3=Rcutoff)
+   Nsubjettiness(int N,
+                 Njettiness::AxesMode axes_mode,
+                 Njettiness::MeasureMode measure_mode,
+                 double para1,
+                 double para2,
+                 double para3)
+   : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) {}
 
    // Old constructor for backwards compatibility with v1.0,
@@ -67,7 +120,6 @@
                  double R0,
                  double Rcutoff=std::numeric_limits<double>::max())
-   : _njettinessFinder(axes_mode, Njettiness::normalized_cutoff_measure, beta, R0, Rcutoff), _N(N) {}
-
-
+   : _njettinessFinder(axes_mode, NormalizedCutoffMeasure(beta,R0,Rcutoff)), _N(N) {}
+   
    /// returns tau_N, measured on the constituents of this jet 
    double result(const PseudoJet& jet) const;
@@ -86,6 +138,17 @@
    }
    
+   /// returns subjet regions found by result() calculation (these have valid constituents)
+   /// Note that the axes and the subjets are not the same
+   std::vector<fastjet::PseudoJet> currentSubjets() const {
+      return _njettinessFinder.currentJets();
+   }
+
+   /// returns components of tau_N without recalculating anything
+   TauComponents currentTauComponents() const {
+      return _njettinessFinder.currentTauComponents();
+   }
+   
    // To set axes for manual use
-   void setAxes(std::vector<fastjet::PseudoJet> myAxes) {
+   void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) {
       // Cross check that manual axes are being used is in Njettiness
     	_njettinessFinder.setAxes(myAxes);
@@ -95,5 +158,5 @@
 private:
    
-   mutable Njettiness _njettinessFinder; // TODO:  should muck with this so result can be const without this mutable
+   Njettiness _njettinessFinder; // TODO:  should muck with this so result can be const without this mutable
    int _N;
 
@@ -112,14 +175,47 @@
    NsubjettinessRatio(int N,
                       int M,
+                      const AxesDefinition & axes_def,
+                      const MeasureDefinition & measure_def)
+   : _nsub_numerator(N,axes_def,measure_def),
+   _nsub_denominator(M,axes_def,measure_def) {}
+   
+   // Alternative constructor with enums and parameters
+   // Again, likely to be removed
+   NsubjettinessRatio(int N,
+                      int M,
+                      Njettiness::AxesMode axes_mode,
+                      Njettiness::MeasureMode measure_mode)
+   : _nsub_numerator(N, axes_mode, measure_mode),
+   _nsub_denominator(M, axes_mode, measure_mode) {}
+
+   
+   NsubjettinessRatio(int N,
+                      int M,
                       Njettiness::AxesMode axes_mode,
                       Njettiness::MeasureMode measure_mode,
-                      double para1 = NAN,
-                      double para2 = NAN,
-                      double para3 = NAN,
-                      double para4 = NAN)
-   : _nsub_numerator(N, axes_mode, measure_mode, para1, para2, para3, para4),
-   _nsub_denominator(M, axes_mode, measure_mode, para1, para2, para3, para4) {}
-
-   //returns tau_N/tau_M based off the input jet using result function from Nsubjettiness 
+                      double para1)
+   : _nsub_numerator(N, axes_mode, measure_mode, para1),
+   _nsub_denominator(M, axes_mode, measure_mode, para1) {}
+
+   NsubjettinessRatio(int N,
+                      int M,
+                      Njettiness::AxesMode axes_mode,
+                      Njettiness::MeasureMode measure_mode,
+                      double para1,
+                      double para2)
+   : _nsub_numerator(N, axes_mode, measure_mode, para1, para2),
+   _nsub_denominator(M, axes_mode, measure_mode, para1, para2) {}
+   
+   NsubjettinessRatio(int N,
+                      int M,
+                      Njettiness::AxesMode axes_mode,
+                      Njettiness::MeasureMode measure_mode,
+                      double para1,
+                      double para2,
+                      double para3)
+   : _nsub_numerator(N, axes_mode, measure_mode, para1, para2, para3),
+   _nsub_denominator(M, axes_mode, measure_mode, para1, para2, para3) {}
+
+   //returns tau_N/tau_M based off the input jet using result function from Nsubjettiness
    double result(const PseudoJet& jet) const;
 
