Index: external/CMakeLists.txt
===================================================================
--- external/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,6 +1,0 @@
-add_subdirectory(fastjet)
-add_subdirectory(ExRootAnalysis)
-add_subdirectory(Hector)
-add_subdirectory(tcl)
-add_subdirectory(PUPPI)
-add_subdirectory(TrackCovariance)
Index: external/ExRootAnalysis/CMakeLists.txt
===================================================================
--- external/ExRootAnalysis/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,40 +1,0 @@
-include_directories(
-  ${CMAKE_SOURCE_DIR}/external
-  ${ROOT_INCLUDE_DIRS}
-)
-
-file(GLOB sources *.cc)
-file(GLOB headers *.h)
-
-list(REMOVE_ITEM headers ${CMAKE_CURRENT_SOURCE_DIR}/ExRootAnalysisLinkDef.h)
-
-# the macro invocation for ROOT6 ensures that the headers are relocatable
-if (NOT ${ROOT_VERSION} VERSION_LESS "6.0.0")
-  DELPHES_GENERATE_DICTIONARY(ExRootAnalysisDict
-    ExRootAnalysis/ExRootClassifier.h
-    ExRootAnalysis/ExRootConfReader.h
-    ExRootAnalysis/ExRootFilter.h
-    ExRootAnalysis/ExRootProgressBar.h
-    ExRootAnalysis/ExRootResult.h
-    ExRootAnalysis/ExRootTask.h
-    ExRootAnalysis/ExRootTreeBranch.h
-    ExRootAnalysis/ExRootTreeReader.h
-    ExRootAnalysis/ExRootTreeWriter.h
-    ExRootAnalysis/ExRootUtilities.h
-    LINKDEF ExRootAnalysisLinkDef.h)
-else()
-  # for ROOT5 the above fails, keep the following as workaround
-  DELPHES_GENERATE_DICTIONARY(ExRootAnalysisDict ${headers} LINKDEF ExRootAnalysisLinkDef.h)
-endif()
-
-add_library(ExRootAnalysis OBJECT ${sources} ExRootAnalysisDict.cxx)
-
-# install headers
-install(FILES ${headers} DESTINATION include/ExRootAnalysis)
-
-# install pcms if they are created
-if (NOT ${ROOT_VERSION} VERSION_LESS "6.0.0")
-  install(FILES
-      ${PROJECT_BINARY_DIR}/external/ExRootAnalysis/libExRootAnalysisDict_rdict.pcm
-      DESTINATION lib)
-endif()
Index: external/ExRootAnalysis/ExRootAnalysisLinkDef.h
===================================================================
--- external/ExRootAnalysis/ExRootAnalysisLinkDef.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootAnalysisLinkDef.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -4,4 +4,8 @@
  *  Lists classes to be included in cint dicitonary
  *
+ *  $Date: 2008-07-08 12:01:52 $
+ *  $Revision: 1.2 $
+ *
+ *  
  *  \author P. Demin - UCL, Louvain-la-Neuve
  *
Index: external/ExRootAnalysis/ExRootClassifier.h
===================================================================
--- external/ExRootAnalysis/ExRootClassifier.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootClassifier.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -11,5 +11,7 @@
   virtual ~ExRootClassifier() {}
   virtual Int_t GetCategory(TObject *object) = 0;
+
 };
 
 #endif /* ExRootClassifier */
+
Index: external/ExRootAnalysis/ExRootConfReader.cc
===================================================================
--- external/ExRootAnalysis/ExRootConfReader.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootConfReader.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -4,4 +4,8 @@
  *  Class handling output ROOT tree
  *
+ *  $Date: 2008-06-04 13:57:54 $
+ *  $Revision: 1.1 $
+ *
+ *
  *  \author P. Demin - UCL, Louvain-la-Neuve
  *
@@ -12,27 +16,23 @@
 #include "tcl/tcl.h"
 
-#include "TSystem.h"
-
+#include <iostream>
+#include <iomanip>
 #include <fstream>
-#include <iomanip>
-#include <iostream>
+#include <string>
+#include <stdexcept>
 #include <sstream>
-#include <stdexcept>
-#include <string>
 
 using namespace std;
 
 static Tcl_ObjCmdProc ModuleObjCmdProc;
-static Tcl_ObjCmdProc SourceObjCmdProc;
 
 //------------------------------------------------------------------------------
 
 ExRootConfReader::ExRootConfReader() :
-  fTopDir(0), fTclInterp(0)
+  fTclInterp(0)
 {
   fTclInterp = Tcl_CreateInterp();
 
   Tcl_CreateObjCommand(fTclInterp, "module", ModuleObjCmdProc, this, 0);
-  Tcl_CreateObjCommand(fTclInterp, "source", SourceObjCmdProc, this, 0);
 }
 
@@ -46,6 +46,14 @@
 //------------------------------------------------------------------------------
 
-void ExRootConfReader::ReadFile(const char *fileName, bool isTop)
-{
+void ExRootConfReader::ReadFile(const char *fileName)
+{
+/*
+  ifstream inputFileStream(fileName);
+  string cmdBuffer = string(istreambuf_iterator<char>(inputFileStream), istreambuf_iterator<char>());
+
+  Tcl_Obj *cmdObjPtr = Tcl_NewObj();
+  cmdObjPtr->bytes = const_cast<char *>(cmdBuffer.c_str());
+  cmdObjPtr->length = cmdBuffer.size();
+*/
   stringstream message;
 
@@ -56,6 +64,4 @@
     throw runtime_error(message.str());
   }
-
-  if(isTop) fTopDir = gSystem->DirName(fileName);
 
   int file_length = inputFileStream.tellg();
@@ -91,5 +97,5 @@
 {
   Tcl_Obj *object;
-  Tcl_Obj *variableName = Tcl_NewStringObj(const_cast<char *>(name), -1);
+  Tcl_Obj *variableName = Tcl_NewStringObj(const_cast<char *>(name),-1);
   object = Tcl_ObjGetVar2(fTclInterp, variableName, 0, TCL_GLOBAL_ONLY);
   return ExRootConfParam(name, object, fTclInterp);
@@ -186,15 +192,18 @@
 int ModuleObjCmdProc(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 {
-  ExRootConfReader *reader = static_cast<ExRootConfReader *>(clientData);
-
   if(objc < 3)
   {
+/*
+    Tcl_SetResult(interp, "wrong # args: should be \"module className moduleName arg ?arg...?\"", 0);
+*/
     Tcl_WrongNumArgs(interp, 1, objv, "className moduleName ?arg...?");
-    return TCL_ERROR;
-  }
+		return TCL_ERROR;
+  }
+
+  ExRootConfReader *test = (ExRootConfReader*) clientData;
 
   // add module to a list of modules to be created
 
-  reader->AddModule(Tcl_GetStringFromObj(objv[1], 0), Tcl_GetStringFromObj(objv[2], 0));
+  test->AddModule(Tcl_GetStringFromObj(objv[1], 0), Tcl_GetStringFromObj(objv[2], 0));
 
   if(objc > 3)
@@ -203,27 +212,8 @@
     Tcl_ListObjAppendElement(interp, object, Tcl_NewStringObj("namespace", -1));
     Tcl_ListObjAppendElement(interp, object, Tcl_NewStringObj("eval", -1));
-    Tcl_ListObjAppendList(interp, object, Tcl_NewListObj(objc - 2, objv + 2));
+    Tcl_ListObjAppendList(interp, object, Tcl_NewListObj(objc-2, objv+2));
 
     return Tcl_GlobalEvalObj(interp, object);
   }
-
-  return TCL_OK;
-}
-
-//------------------------------------------------------------------------------
-
-int SourceObjCmdProc(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
-{
-  ExRootConfReader *reader = static_cast<ExRootConfReader *>(clientData);
-  stringstream fileName;
-
-  if(objc != 2)
-  {
-    Tcl_WrongNumArgs(interp, 1, objv, "fileName");
-    return TCL_ERROR;
-  }
-
-  fileName << reader->GetTopDir() << "/" << Tcl_GetStringFromObj(objv[1], 0);
-  reader->ReadFile(fileName.str().c_str(), false);
 
   return TCL_OK;
@@ -245,5 +235,5 @@
   if(fObject && TCL_OK != Tcl_GetIntFromObj(fTclInterp, fObject, &result))
   {
-    message << "parameter '" << fName << "' is not an integer." << endl;
+    message << "parameter '"<< fName << "' is not an integer." << endl;
     message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
     throw runtime_error(message.str());
@@ -260,5 +250,5 @@
   if(fObject && TCL_OK != Tcl_GetLongFromObj(fTclInterp, fObject, &result))
   {
-    message << "parameter '" << fName << "' is not an long integer." << endl;
+    message << "parameter '"<< fName << "' is not an long integer." << endl;
     message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
     throw runtime_error(message.str());
@@ -275,5 +265,5 @@
   if(fObject && TCL_OK != Tcl_GetDoubleFromObj(fTclInterp, fObject, &result))
   {
-    message << "parameter '" << fName << "' is not a number." << endl;
+    message << "parameter '"<< fName << "' is not a number." << endl;
     message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
     throw runtime_error(message.str());
@@ -290,5 +280,5 @@
   if(fObject && TCL_OK != Tcl_GetBooleanFromObj(fTclInterp, fObject, &result))
   {
-    message << "parameter '" << fName << "' is not a boolean." << endl;
+    message << "parameter '"<< fName << "' is not a boolean." << endl;
     message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
     throw runtime_error(message.str());
@@ -303,5 +293,5 @@
   const char *result = defaultValue;
   if(fObject) result = Tcl_GetStringFromObj(fObject, 0);
-  return result;
+  return result;  
 }
 
@@ -314,9 +304,9 @@
   if(fObject && TCL_OK != Tcl_ListObjLength(fTclInterp, fObject, &length))
   {
-    message << "parameter '" << fName << "' is not a list." << endl;
-    message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
-    throw runtime_error(message.str());
-  }
-  return length;
+    message << "parameter '"<< fName << "' is not a list." << endl;
+    message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
+    throw runtime_error(message.str());
+  }
+  return length;  
 }
 
@@ -329,5 +319,5 @@
   if(fObject && TCL_OK != Tcl_ListObjIndex(fTclInterp, fObject, index, &object))
   {
-    message << "parameter '" << fName << "' is not a list." << endl;
+    message << "parameter '"<< fName << "' is not a list." << endl;
     message << fName << " = " << Tcl_GetStringFromObj(fObject, 0);
     throw runtime_error(message.str());
Index: external/ExRootAnalysis/ExRootConfReader.h
===================================================================
--- external/ExRootAnalysis/ExRootConfReader.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootConfReader.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -5,4 +5,8 @@
  *
  *  Class handling output ROOT tree
+ *
+ *  $Date: 2008-06-04 13:57:24 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -21,4 +25,5 @@
 {
 public:
+
   ExRootConfParam(const char *name = 0, Tcl_Obj *object = 0, Tcl_Interp *interp = 0);
 
@@ -33,4 +38,5 @@
 
 private:
+
   const char *fName; //!
   Tcl_Obj *fObject; //!
@@ -40,5 +46,5 @@
 //------------------------------------------------------------------------------
 
-class ExRootConfReader: public TNamed
+class ExRootConfReader : public TNamed
 {
 public:
@@ -48,5 +54,5 @@
   ~ExRootConfReader();
 
-  void ReadFile(const char *fileName, bool isTop = true);
+  void ReadFile(const char *fileName);
 
   int GetInt(const char *name, int defaultValue, int index = -1);
@@ -61,8 +67,5 @@
   void AddModule(const char *className, const char *moduleName);
 
-  const char *GetTopDir() const { return fTopDir; }
-
 private:
-  const char *fTopDir; //!
 
   Tcl_Interp *fTclInterp; //!
@@ -74,2 +77,3 @@
 
 #endif
+
Index: external/ExRootAnalysis/ExRootFilter.cc
===================================================================
--- external/ExRootAnalysis/ExRootFilter.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootFilter.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,4 +3,8 @@
  *
  *  Class simplifying classification and subarrays handling
+ *
+ *  $Date: 2008-06-04 13:57:55 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -11,15 +15,15 @@
 #include "ExRootAnalysis/ExRootClassifier.h"
 
+#include "TSeqCollection.h"
 #include "TObjArray.h"
-#include "TSeqCollection.h"
 
 #include <iostream>
+#include <stdexcept>
 #include <sstream>
-#include <stdexcept>
 
 using namespace std;
 
-typedef map<Int_t, TObjArray *> TCategoryMap;
-typedef map<ExRootClassifier *, pair<Bool_t, TCategoryMap> > TClassifierMap;
+typedef map<Int_t, TObjArray*> TCategoryMap;
+typedef map<ExRootClassifier*, pair<Bool_t, TCategoryMap> > TClassifierMap;
 
 ExRootFilter::ExRootFilter(const TSeqCollection *collection) :
@@ -40,5 +44,5 @@
         itSubMap != itMap->second.second.end(); ++itSubMap)
     {
-      delete(itSubMap->second);
+      delete (itSubMap->second);
     }
   }
@@ -132,2 +136,3 @@
 
 //------------------------------------------------------------------------------
+
Index: external/ExRootAnalysis/ExRootFilter.h
===================================================================
--- external/ExRootAnalysis/ExRootFilter.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootFilter.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -14,4 +14,5 @@
 {
 public:
+
   ExRootFilter(const TSeqCollection *collection);
   ~ExRootFilter();
@@ -22,9 +23,12 @@
 
 private:
+
   const TSeqCollection *fCollection; //!
   TIterator *fIter; //!
 
-  std::map<ExRootClassifier *, std::pair<Bool_t, std::map<Int_t, TObjArray *> > > fMap; //!
+  std::map<ExRootClassifier*, std::pair<Bool_t, std::map<Int_t, TObjArray*> > > fMap; //!
+
 };
 
 #endif /* ExRootFilter */
+
Index: external/ExRootAnalysis/ExRootProgressBar.cc
===================================================================
--- external/ExRootAnalysis/ExRootProgressBar.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootProgressBar.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,4 +3,8 @@
  *
  *  Class showing progress bar
+ *
+ *  $Date: 2008-06-04 13:57:55 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -14,6 +18,6 @@
 #include <iostream>
 
+#include <string.h>
 #include <stdio.h>
-#include <string.h>
 
 using namespace std;
@@ -46,5 +50,5 @@
   if(fEntries > 0)
   {
-    Int_t hashes = Int_t(Double_t(entry) / fEntries * fWidth);
+    Int_t hashes = Int_t(Double_t(entry)/fEntries*fWidth);
     if(hashes > fWidth) hashes = fWidth;
     if(hashes != fHashes)
@@ -53,5 +57,5 @@
       memset(fBar + hashes, '-', fWidth - hashes);
       fHashes = hashes;
-      fprintf(stderr, "** [%s] (%.2f%%)\r", fBar, Float_t(entry) / fEntries * 100.0);
+      fprintf(stderr, "** [%s] (%.2f%%)\r", fBar, Float_t(entry)/fEntries*100.0);
     }
   }
@@ -77,2 +81,3 @@
 
 //------------------------------------------------------------------------------
+
Index: external/ExRootAnalysis/ExRootProgressBar.h
===================================================================
--- external/ExRootAnalysis/ExRootProgressBar.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootProgressBar.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -7,4 +7,5 @@
 {
 public:
+
   ExRootProgressBar(Long64_t entries, Int_t width = 64);
   ~ExRootProgressBar();
@@ -14,4 +15,5 @@
 
 private:
+
   Long64_t fEntries, fEventCounter;
   Int_t fWidth;
@@ -21,5 +23,7 @@
 
   char *fBar; //!
+
 };
 
 #endif /* ExRootProgressBar */
+
Index: external/ExRootAnalysis/ExRootResult.cc
===================================================================
--- external/ExRootAnalysis/ExRootResult.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootResult.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -4,4 +4,8 @@
  *  Class simplifying work with histograms
  *
+ *  $Date: 2008-06-04 13:57:56 $
+ *  $Revision: 1.1 $
+ *
+ *
  *  \author P. Demin - UCL, Louvain-la-Neuve
  *
@@ -12,18 +16,18 @@
 #include "ExRootAnalysis/ExRootUtilities.h"
 
+#include "TROOT.h"
+#include "TFile.h"
+#include "TClass.h"
+#include "TStyle.h"
 #include "TCanvas.h"
-#include "TClass.h"
-#include "TFile.h"
-#include "TFolder.h"
+#include "TLegend.h"
+#include "TPaveText.h"
+#include "TPaveStats.h"
+#include "TList.h"
 #include "TH2.h"
 #include "THStack.h"
-#include "TLegend.h"
-#include "TList.h"
+#include "TProfile.h"
 #include "TObjArray.h"
-#include "TPaveStats.h"
-#include "TPaveText.h"
-#include "TProfile.h"
-#include "TROOT.h"
-#include "TStyle.h"
+#include "TFolder.h"
 
 #include <iostream>
@@ -37,6 +41,5 @@
 //------------------------------------------------------------------------------
 
-ExRootResult::ExRootResult() :
-  fCanvas(0), fFolder(0)
+ExRootResult::ExRootResult() : fCanvas(0), fFolder(0)
 {
 }
@@ -46,5 +49,5 @@
 ExRootResult::~ExRootResult()
 {
-  set<TObject *>::iterator itPool;
+  set<TObject*>::iterator itPool;
   for(itPool = fPool.begin(); itPool != fPool.end(); ++itPool)
   {
@@ -69,5 +72,5 @@
   TFile *file = new TFile(fileName, "RECREATE");
   file->cd();
-  std::map<TObject *, PlotSettings>::iterator itPlotMap;
+  std::map<TObject*, PlotSettings>::iterator itPlotMap;
   for(itPlotMap = fPlotMap.begin(); itPlotMap != fPlotMap.end(); ++itPlotMap)
   {
@@ -124,5 +127,5 @@
   // gStyle->SetOptFit(101);
 
-  fCanvas = static_cast<TCanvas *>(gROOT->FindObject("c1"));
+  fCanvas = static_cast<TCanvas*>(gROOT->FindObject("c1"));
   if(fCanvas)
   {
@@ -155,5 +158,5 @@
   if(!plot) return;
 
-  std::map<TObject *, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
+  std::map<TObject*, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
   if(itPlotMap != fPlotMap.end())
   {
@@ -179,8 +182,8 @@
   if(plot->IsA()->InheritsFrom(TH1::Class()))
   {
-    histogram = static_cast<TH1 *>(plot);
-  }
-
-  map<TObject *, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
+    histogram = static_cast<TH1*>(plot);
+  }
+
+  map<TObject*, PlotSettings>::iterator itPlotMap = fPlotMap.find(plot);
   if(itPlotMap != fPlotMap.end())
   {
@@ -225,5 +228,5 @@
   TCanvas *canvas = GetCanvas();
 
-  map<TObject *, PlotSettings>::iterator itPlotMap;
+  map<TObject*, PlotSettings>::iterator itPlotMap;
 
   for(itPlotMap = fPlotMap.begin(); itPlotMap != fPlotMap.end(); ++itPlotMap)
@@ -237,10 +240,10 @@
     if(object->IsA()->InheritsFrom(TH1::Class()))
     {
-      histogram = static_cast<TH1 *>(object);
+      histogram = static_cast<TH1*>(object);
     }
     else if(object->IsA()->InheritsFrom(THStack::Class()))
     {
-      stack = static_cast<THStack *>(object);
-      histogram = static_cast<TH1 *>(stack->GetHists()->First());
+      stack = static_cast<THStack*>(object);
+      histogram = static_cast<TH1*>(stack->GetHists()->First());
     }
 
@@ -272,5 +275,5 @@
     if(histogram)
     {
-      stats = static_cast<TPaveStats *>(histogram->FindObject("stats"));
+      stats = static_cast<TPaveStats*>(histogram->FindObject("stats"));
       if(stats)
       {
@@ -301,7 +304,7 @@
 
 TH1 *ExRootResult::AddHist1D(const char *name, const char *title,
-  const char *xlabel, const char *ylabel,
-  Int_t nxbins, Axis_t xmin, Axis_t xmax,
-  Int_t logx, Int_t logy)
+                             const char *xlabel, const char *ylabel,
+                             Int_t nxbins, Axis_t xmin, Axis_t xmax,
+                             Int_t logx, Int_t logy)
 {
   TH1F *hist = new TH1F(name, title, nxbins, xmin, xmax);
@@ -325,7 +328,7 @@
 
 TH1 *ExRootResult::AddHist1D(const char *name, const char *title,
-  const char *xlabel, const char *ylabel,
-  Int_t nxbins, const Float_t *bins,
-  Int_t logx, Int_t logy)
+                             const char *xlabel, const char *ylabel,
+                             Int_t nxbins, const Float_t *bins,
+                             Int_t logx, Int_t logy)
 {
   TH1F *hist = new TH1F(name, title, nxbins, bins);
@@ -349,7 +352,7 @@
 
 TProfile *ExRootResult::AddProfile(const char *name, const char *title,
-  const char *xlabel, const char *ylabel,
-  Int_t nxbins, Axis_t xmin, Axis_t xmax,
-  Int_t logx, Int_t logy)
+                                   const char *xlabel, const char *ylabel,
+                                   Int_t nxbins, Axis_t xmin, Axis_t xmax,
+                                   Int_t logx, Int_t logy)
 {
   TProfile *profile = new TProfile(name, title, nxbins, xmin, xmax);
@@ -373,8 +376,8 @@
 
 TH2 *ExRootResult::AddHist2D(const char *name, const char *title,
-  const char *xlabel, const char *ylabel,
-  Int_t nxbins, Axis_t xmin, Axis_t xmax,
-  Int_t nybins, Axis_t ymin, Axis_t ymax,
-  Int_t logx, Int_t logy)
+                             const char *xlabel, const char *ylabel,
+                             Int_t nxbins, Axis_t xmin, Axis_t xmax,
+                             Int_t nybins, Axis_t ymin, Axis_t ymax,
+                             Int_t logx, Int_t logy)
 {
   TH2F *hist = new TH2F(name, title, nxbins, xmin, xmax, nybins, ymin, ymax);
Index: external/ExRootAnalysis/ExRootResult.h
===================================================================
--- external/ExRootAnalysis/ExRootResult.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootResult.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,10 +2,10 @@
 #define ExRootResult_h
 
+#include "Rtypes.h"
 #include "Gtypes.h"
-#include "Rtypes.h"
 #include "TMath.h"
 
+#include <set>
 #include <map>
-#include <set>
 
 class TH1;
@@ -23,4 +23,5 @@
 
 public:
+
   ExRootResult();
   ~ExRootResult();
@@ -31,23 +32,23 @@
 
   TH1 *AddHist1D(const char *name, const char *title,
-    const char *xlabel, const char *ylabel,
-    Int_t nxbins, Axis_t xmin, Axis_t xmax,
-    Int_t logx = 0, Int_t logy = 0);
+                 const char *xlabel, const char *ylabel,
+                 Int_t nxbins, Axis_t xmin, Axis_t xmax,
+                 Int_t logx = 0, Int_t logy = 0);
 
   TH1 *AddHist1D(const char *name, const char *title,
-    const char *xlabel, const char *ylabel,
-    Int_t nxbins, const Float_t *bins,
-    Int_t logx = 0, Int_t logy = 0);
+                 const char *xlabel, const char *ylabel,
+                 Int_t nxbins, const Float_t *bins,
+                 Int_t logx = 0, Int_t logy = 0);
 
   TProfile *AddProfile(const char *name, const char *title,
-    const char *xlabel, const char *ylabel,
-    Int_t nxbins, Axis_t xmin, Axis_t xmax,
-    Int_t logx = 0, Int_t logy = 0);
+                       const char *xlabel, const char *ylabel,
+                       Int_t nxbins, Axis_t xmin, Axis_t xmax,
+                       Int_t logx = 0, Int_t logy = 0);
 
   TH2 *AddHist2D(const char *name, const char *title,
-    const char *xlabel, const char *ylabel,
-    Int_t nxbins, Axis_t xmin, Axis_t xmax,
-    Int_t nybins, Axis_t ymin, Axis_t ymax,
-    Int_t logx = 0, Int_t logy = 0);
+                 const char *xlabel, const char *ylabel,
+                 Int_t nxbins, Axis_t xmin, Axis_t xmax,
+                 Int_t nybins, Axis_t ymin, Axis_t ymax,
+                 Int_t logx = 0, Int_t logy = 0);
 
   THStack *AddHistStack(const char *name, const char *title);
@@ -61,9 +62,10 @@
   TCanvas *GetCanvas();
 
-  void PrintPlot(TObject *plot, const char *sufix = "", const char *format = "eps");
+  void PrintPlot(TObject *plot, const char *sufix = "",  const char *format = "eps");
 
   void SetFolder(TFolder *folder) { fFolder = folder; }
 
 private:
+
   struct PlotSettings
   {
@@ -77,10 +79,12 @@
   TCanvas *fCanvas; //!
 
-  std::set<TObject *> fPool; //!
+  std::set<TObject*> fPool; //!
 
-  std::map<TObject *, PlotSettings> fPlotMap; //!
+  std::map<TObject*, PlotSettings> fPlotMap; //!
 
   TFolder *fFolder; //!
+
 };
 
 #endif /* ExRootResult_h */
+
Index: external/ExRootAnalysis/ExRootTask.cc
===================================================================
--- external/ExRootAnalysis/ExRootTask.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTask.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,4 +3,8 @@
  *
  *  Class handling output ROOT tree
+ *
+ *  $Date: 2008-06-04 13:57:56 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -11,13 +15,13 @@
 #include "ExRootAnalysis/ExRootConfReader.h"
 
+#include "TROOT.h"
 #include "TClass.h"
 #include "TFolder.h"
-#include "TROOT.h"
 #include "TString.h"
 
+#include <iostream>
 #include <iomanip>
-#include <iostream>
+#include <stdexcept>
 #include <sstream>
-#include <stdexcept>
 
 static const char *const kINIT = "0";
@@ -144,5 +148,5 @@
 
   if(!cl) return 0;
-
+ 
   if(!cl->InheritsFrom(ExRootTask::Class()))
   {
@@ -310,2 +314,3 @@
   return object;
 }
+
Index: external/ExRootAnalysis/ExRootTask.h
===================================================================
--- external/ExRootAnalysis/ExRootTask.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTask.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -5,4 +5,8 @@
  *
  *  Class handling output ROOT tree
+ *
+ *  $Date: 2008-06-04 13:57:26 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -17,7 +21,8 @@
 class TFolder;
 
-class ExRootTask: public TTask
+class ExRootTask : public TTask
 {
 public:
+
   ExRootTask();
   virtual ~ExRootTask();
@@ -40,5 +45,5 @@
   ExRootTask *NewTask(const char *className, const char *taskName);
 
-  void Exec(Option_t *option);
+  void Exec(Option_t* option);
 
   int GetInt(const char *name, int defaultValue, int index = -1);
@@ -54,4 +59,5 @@
 
 protected:
+
   TFolder *GetFolder() const { return fFolder; }
   ExRootConfReader *GetConfReader() const { return fConfReader; }
@@ -61,4 +67,5 @@
 
 private:
+
   TFolder *fFolder; //!
   ExRootConfReader *fConfReader; //!
@@ -68,2 +75,3 @@
 
 #endif /* ExRootTask */
+
Index: external/ExRootAnalysis/ExRootTreeBranch.cc
===================================================================
--- external/ExRootAnalysis/ExRootTreeBranch.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTreeBranch.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,22 +1,26 @@
 
 /** \class ExRootTreeBranch
- *
- *  Class handling object creation
- *  It is also used for output ROOT tree branches
- *
- *  \author P. Demin - UCL, Louvain-la-Neuve
- *
- */
+*
+*  Class handling object creation
+*  It is also used for output ROOT tree branches
+*
+*  $Date: 2008-06-04 13:57:56 $
+*  $Revision: 1.1 $
+*
+*
+*  \author P. Demin - UCL, Louvain-la-Neuve
+*
+*/
 
 #include "ExRootAnalysis/ExRootTreeBranch.h"
 
+#include "TFile.h"
+#include "TTree.h"
+#include "TString.h"
 #include "TClonesArray.h"
-#include "TFile.h"
-#include "TString.h"
-#include "TTree.h"
 
 #include <iostream>
+#include <stdexcept>
 #include <sstream>
-#include <stdexcept>
 
 using namespace std;
@@ -28,6 +32,6 @@
 {
   stringstream message;
-  //  cl->IgnoreTObjectStreamer();
-  //  cl->BypassStreamer();
+//  cl->IgnoreTObjectStreamer();
+//  cl->BypassStreamer();
   fData = new TClonesArray(cl, fCapacity);
 
@@ -65,14 +69,9 @@
   if(fSize >= fCapacity)
   {
-    if(fCapacity < 10)
-      fCapacity = 10;
-    else if(fCapacity < 30)
-      fCapacity = 30;
-    else if(fCapacity < 100)
-      fCapacity = 100;
-    else if(fCapacity < 250)
-      fCapacity = 250;
-    else
-      fCapacity *= 2;
+    if(fCapacity < 10) fCapacity = 10;
+    else if(fCapacity < 30) fCapacity = 30;
+    else if(fCapacity < 100) fCapacity = 100;
+    else if(fCapacity < 250) fCapacity = 250;
+    else fCapacity *= 2;
 
     fData->ExpandCreateFast(fCapacity);
@@ -81,5 +80,5 @@
     fData->ExpandCreateFast(fSize);
   }
-
+  
   return fData->AddrAt(fSize++);
 }
@@ -94,2 +93,3 @@
 
 //------------------------------------------------------------------------------
+
Index: external/ExRootAnalysis/ExRootTreeBranch.h
===================================================================
--- external/ExRootAnalysis/ExRootTreeBranch.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTreeBranch.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -6,4 +6,8 @@
  *  Class handling object creation.
  *  It is also used for output ROOT tree branches
+ *
+ *  $Date: 2008-06-04 13:57:27 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -19,4 +23,5 @@
 {
 public:
+
   ExRootTreeBranch(const char *name, TClass *cl, TTree *tree = 0);
   ~ExRootTreeBranch();
@@ -26,4 +31,5 @@
 
 private:
+
   Int_t fSize, fCapacity; //!
   TClonesArray *fData; //!
@@ -31,2 +37,3 @@
 
 #endif /* ExRootTreeBranch */
+
Index: external/ExRootAnalysis/ExRootTreeReader.cc
===================================================================
--- external/ExRootAnalysis/ExRootTreeReader.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTreeReader.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,4 +3,8 @@
  *
  *  Class simplifying access to ROOT tree branches
+ *
+ *  $Date: 2008-06-04 13:57:57 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -10,10 +14,9 @@
 #include "ExRootAnalysis/ExRootTreeReader.h"
 
-#include "TBranchElement.h"
-#include "TCanvas.h"
-#include "TParameter.h"
-#include "TClonesArray.h"
 #include "TH2.h"
 #include "TStyle.h"
+#include "TCanvas.h"
+#include "TClonesArray.h"
+#include "TBranchElement.h"
 
 #include <iostream>
@@ -52,5 +55,5 @@
   if(fChain->IsA() == TChain::Class())
   {
-    TChain *chain = static_cast<TChain *>(fChain);
+    TChain *chain = static_cast<TChain*>(fChain);
     if(chain->GetTreeNumber() != fCurrentTree)
     {
@@ -95,5 +98,5 @@
       if(branch->IsA() == TBranchElement::Class())
       {
-        TBranchElement *element = static_cast<TBranchElement *>(branch);
+        TBranchElement *element = static_cast<TBranchElement*>(branch);
         const char *className = element->GetClonesName();
         Int_t size = element->GetMaximum();
@@ -116,17 +119,4 @@
 
   return array;
-}
-
-//------------------------------------------------------------------------------
-
-Double_t ExRootTreeReader::GetInfo(const char *name)
-{
-  TTree *tree = NULL;
-  TParameter<Double_t> *param = NULL;
-  Double_t result = -999.9;
-  if(fChain) tree = fChain->GetTree();
-  if(tree) param = static_cast<TParameter<Double_t> *>(tree->GetUserInfo()->FindObject(name));
-  if(param) result = param->GetVal();
-  return result;
 }
 
@@ -159,2 +149,3 @@
 
 //------------------------------------------------------------------------------
+
Index: external/ExRootAnalysis/ExRootTreeReader.h
===================================================================
--- external/ExRootAnalysis/ExRootTreeReader.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTreeReader.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -6,18 +6,23 @@
  *  Class simplifying access to ROOT tree branches
  *
+ *  $Date: 2008-06-04 13:57:27 $
+ *  $Revision: 1.1 $
+ *
+ *
  *  \author P. Demin - UCL, Louvain-la-Neuve
  *
  */
 
+#include "TROOT.h"
+#include "TNamed.h"
 #include "TChain.h"
 #include "TFile.h"
-#include "TNamed.h"
-#include "TROOT.h"
 
 #include <map>
 
-class ExRootTreeReader: public TNamed
+class ExRootTreeReader : public TNamed
 {
-public:
+public :
+
   ExRootTreeReader(TTree *tree = 0);
   ~ExRootTreeReader();
@@ -29,7 +34,7 @@
 
   TClonesArray *UseBranch(const char *branchName);
-  Double_t GetInfo(const char *name);
 
 private:
+
   Bool_t Notify();
 
@@ -37,5 +42,5 @@
   Int_t fCurrentTree; //! current Tree number in a TChain
 
-  typedef std::map<TString, std::pair<TBranch *, TClonesArray *> > TBranchMap;
+  typedef std::map<TString, std::pair<TBranch*, TClonesArray*> > TBranchMap;
 
   TBranchMap fBranchMap; //!
Index: external/ExRootAnalysis/ExRootTreeWriter.cc
===================================================================
--- external/ExRootAnalysis/ExRootTreeWriter.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTreeWriter.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,4 +3,8 @@
  *
  *  Class handling output ROOT tree
+ *
+ *  $Date: 2008-06-04 13:57:57 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -11,13 +15,12 @@
 #include "ExRootAnalysis/ExRootTreeBranch.h"
 
-#include "TParameter.h"
+#include "TROOT.h"
+#include "TFile.h"
+#include "TTree.h"
 #include "TClonesArray.h"
-#include "TFile.h"
-#include "TROOT.h"
-#include "TTree.h"
 
 #include <iostream>
+#include <stdexcept>
 #include <sstream>
-#include <stdexcept>
 
 using namespace std;
@@ -32,8 +35,8 @@
 ExRootTreeWriter::~ExRootTreeWriter()
 {
-  set<ExRootTreeBranch *>::iterator itBranches;
+  set<ExRootTreeBranch*>::iterator itBranches;
   for(itBranches = fBranches.begin(); itBranches != fBranches.end(); ++itBranches)
   {
-    delete(*itBranches);
+    delete (*itBranches);
   }
 
@@ -49,12 +52,4 @@
   fBranches.insert(branch);
   return branch;
-}
-
-//------------------------------------------------------------------------------
-
-void ExRootTreeWriter::AddInfo(const char *name, Double_t value)
-{
-  if(!fTree) fTree = NewTree();
-  fTree->GetUserInfo()->Add(new TParameter<Double_t>(name, value));
 }
 
@@ -78,5 +73,5 @@
 void ExRootTreeWriter::Clear()
 {
-  set<ExRootTreeBranch *>::iterator itBranches;
+  set<ExRootTreeBranch*>::iterator itBranches;
   for(itBranches = fBranches.begin(); itBranches != fBranches.end(); ++itBranches)
   {
@@ -104,5 +99,5 @@
 
   tree->SetDirectory(fFile);
-  tree->SetAutoSave(10000000); // autosave when 10 MB written
+  tree->SetAutoSave(10000000);  // autosave when 10 MB written
 
   return tree;
Index: external/ExRootAnalysis/ExRootTreeWriter.h
===================================================================
--- external/ExRootAnalysis/ExRootTreeWriter.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootTreeWriter.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -5,4 +5,8 @@
  *
  *  Class handling output ROOT tree
+ *
+ *  $Date: 2008-06-04 13:57:27 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -19,7 +23,8 @@
 class ExRootTreeBranch;
 
-class ExRootTreeWriter: public TNamed
+class ExRootTreeWriter : public TNamed
 {
 public:
+
   ExRootTreeWriter(TFile *file = 0, const char *treeName = "Analysis");
   ~ExRootTreeWriter();
@@ -28,9 +33,5 @@
   void SetTreeName(const char *name) { fTreeName = name; }
 
-  TTree* GetTree() { return fTree; }
-  void SetTree(TTree* t) { fTree = t; }
-
   ExRootTreeBranch *NewBranch(const char *name, TClass *cl);
-  void AddInfo(const char *name, Double_t value);
 
   void Clear();
@@ -39,4 +40,5 @@
 
 private:
+
   TTree *NewTree();
 
@@ -46,5 +48,5 @@
   TString fTreeName; //!
 
-  std::set<ExRootTreeBranch *> fBranches; //!
+  std::set<ExRootTreeBranch*> fBranches; //!
 
   ClassDef(ExRootTreeWriter, 1)
@@ -52,2 +54,3 @@
 
 #endif /* ExRootTreeWriter */
+
Index: external/ExRootAnalysis/ExRootUtilities.cc
===================================================================
--- external/ExRootAnalysis/ExRootUtilities.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootUtilities.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,4 +3,8 @@
  *
  *  Functions simplifying ROOT tree analysis
+ *
+ *  $Date: 2008-06-04 13:57:57 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
@@ -10,10 +14,10 @@
 #include "ExRootAnalysis/ExRootUtilities.h"
 
+#include "TROOT.h"
+#include "TH1.h"
 #include "TChain.h"
-#include "TH1.h"
-#include "TROOT.h"
 
+#include <iostream>
 #include <fstream>
-#include <iostream>
 
 using namespace std;
@@ -74,2 +78,3 @@
 
 //------------------------------------------------------------------------------
+
Index: external/ExRootAnalysis/ExRootUtilities.h
===================================================================
--- external/ExRootAnalysis/ExRootUtilities.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/ExRootAnalysis/ExRootUtilities.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -5,4 +5,8 @@
  *
  *  Functions simplifying ROOT tree analysis
+ *
+ *  $Date: 2008-06-04 13:57:28 $
+ *  $Revision: 1.1 $
+ *
  *
  *  \author P. Demin - UCL, Louvain-la-Neuve
Index: external/Hector/CMakeLists.txt
===================================================================
--- external/Hector/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,8 +1,0 @@
-include_directories(
-  ${CMAKE_SOURCE_DIR}/external
-  ${ROOT_INCLUDE_DIRS}
-)
-
-file(GLOB sources *.cc)
-
-add_library(Hector OBJECT ${sources})
Index: external/Hector/CREDITS
===================================================================
--- external/Hector/CREDITS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,20 +1,0 @@
-  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
- *                                                         *
-*                   --<--<--  A fast simulator --<--<--     *
-*                 / --<--<--     of particle   --<--<--     *
-*  ----HECTOR----<                                          *
-*                 \ -->-->-- transport through -->-->--     *
-*                   -->-->-- generic beamlines -->-->--     *
-*                                                           *
-* JINST 2:P09005 (2007)                                     *
-*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
-*                                                           *
-* Center for Cosmology, Particle Physics and Phenomenology  *
-*              Universite catholique de Louvain             *
-*                 Louvain-la-Neuve, Belgium                 *
- *                                                         *
-   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-   J. de Favereau, X. Rouby
-
-   (C) All rights reserved
Index: external/Hector/H_AbstractBeamLine.cc
===================================================================
--- external/Hector/H_AbstractBeamLine.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,632 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-
-/// \file H_AbstractBeamLine.cc
-/// \brief Class describing ideal beamline.
-///
-/// Units : angles [rad], distances [m], energies [GeV], c=[1].
-
-// c++ #includes
-#include <iostream>
-#include <cmath>
-
-// ROOT #includes
-//#include "TPaveLabel.h"
-//#include "TLine.h"
-//#include "TGaxis.h"
-//#include "TLegend.h"
-//#include "TF1.h"
-//#include "TROOT.h"
-
-// local #includes
-#include "H_Parameters.h"
-#include "H_TransportMatrices.h"
-#include "H_Drift.h"
-#include "H_AbstractBeamLine.h"
-#include "H_BeamParticle.h"
-#include "H_RomanPot.h"
-using namespace std;
-
-void H_AbstractBeamLine::init(const float length) {
-	beam_mat = new TMatrix(MDIM,MDIM);
-  	beam_length = length;
-	H_Drift * drift0 = new H_Drift("Drift0",0.,length);
-	add(drift0);
-	return;
-}
-
-H_AbstractBeamLine::H_AbstractBeamLine(const H_AbstractBeamLine& beamline) {
-	elements = beamline.elements;
-	matrices = beamline.matrices;
-	beam_mat = new TMatrix(*(beamline.beam_mat));
-	beam_length = beamline.beam_length;
-}
-
-H_AbstractBeamLine& H_AbstractBeamLine::operator=(const H_AbstractBeamLine& beamline) {
-	if(this== &beamline) return *this;
-        elements = beamline.elements;
-        matrices = beamline.matrices;
-        beam_mat = new TMatrix(*(beamline.beam_mat));
-	beam_length = beamline.beam_length;
-	return *this;
-}
-
-H_AbstractBeamLine::~H_AbstractBeamLine() {
-	vector<H_OpticalElement*>::iterator element_i;
-	for (element_i = elements.begin(); element_i<elements.end(); element_i++) {
-		delete (*element_i);
-	}
-	elements.clear(); 
-	matrices.clear(); 
-	delete beam_mat;
-}
-
-void H_AbstractBeamLine::add(H_OpticalElement * newElement) {
-	/// @param newElement is added to the beamline
-//	H_OpticalElement * el = new H_OpticalElement(*newElement);
-//	H_OpticalElement * el = const_cast<H_OpticalElement*> newElement; 
-//	H_OpticalElement * el = newElement;
-	elements.push_back(newElement);
- 	float a = newElement->getS()+newElement->getLength();
-	if (a > beam_length)	{
-		beam_length = a;
-		if(VERBOSE) cout<<"WARNING : element ("<< newElement->getName()<<") too far away. The beam length has been extended to "<< beam_length << ". "<<endl;
-	}
-	calcSequence();
-	calcMatrix();
-}
-
-void H_AbstractBeamLine::add(H_OpticalElement & newElement) {
-	/// @param newElement is added to the beamline
-//	H_OpticalElement * el = new H_OpticalElement(newElement);
-//	elements.push_back(el);
-	elements.push_back(&newElement);
- 	float a = newElement.getS()+newElement.getLength();
-	if (a > beam_length)	{
-		beam_length = a;
-		if(VERBOSE) cout<<"WARNING : element ("<< newElement.getName()<<") too far away. The beam length has been extended to "<< beam_length << ". "<<endl;
-	}
-	calcSequence();
-	calcMatrix();
-}
-
-const TMatrix * H_AbstractBeamLine::getBeamMatrix() const {
-	TMatrix * mat = new TMatrix(*beam_mat);
-	return mat;
-}
-
-const TMatrix * H_AbstractBeamLine::getBeamMatrix(const float eloss,const float p_mass, const float p_charge) {
-
-	vector<H_OpticalElement*>::iterator element_i;
-    TMatrix calc_mat(MDIM,MDIM);
-
-    // initialization
-	calc_mat.UnitMatrix();
-	
-	// multiplies the matrix of each beam's element
-	// and add each product matrix to the list of matrices.
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		calc_mat *= (*element_i)->getMatrix(eloss,p_mass,p_charge);
-	}
-	const TMatrix* bmat = new TMatrix(calc_mat);
-	return bmat;
-}
-
-const TMatrix * H_AbstractBeamLine::getPartialMatrix(const string elname, const float eloss, const float p_mass, const float p_charge) {
-
-	vector<H_OpticalElement*>::iterator element_i;
-	TMatrix calc_mat(MDIM,MDIM);
-
-	calc_mat.UnitMatrix();
-
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		calc_mat *= (*element_i)->getMatrix(eloss,p_mass,p_charge);
-		if(elname==(*element_i)->getName()) {
-			const TMatrix* bmat = new TMatrix(calc_mat);
-			return bmat;
-		}
-	}
-	cout<<"Element "<<elname<<" desn't exist. Returning full beam matrix"<<endl;
-	const TMatrix* bmat = new TMatrix(calc_mat);
-	return bmat;
-}
-
-const TMatrix * H_AbstractBeamLine::getPartialMatrix(const unsigned int element_position) const {
- 	//const int N = (element_position<0)?0:(( (element_position)>elements.size()-1)?elements.size()-1:element_position);
-	const int N = (element_position>elements.size()-1)?elements.size()-1:element_position;
-	return &(*(matrices.begin()+N)); // //for optimization of the code :same as return &matrices[N];
-}
-
-const TMatrix * H_AbstractBeamLine::getPartialMatrix(const H_OpticalElement * element) const{
-	// returns the transport matrix to transport until the end of the specified element
-	// !!! 2 elements should never have the same name in "elements" !!!
-
-	vector<H_OpticalElement*>::const_iterator element_i;
-	vector<TMatrix>::const_iterator matrix_i;
-	TMatrix * calc_mat = new TMatrix(MDIM,MDIM);
-
-	// parses the list of optical elements and find the searched one
-	for(element_i = elements.begin(),matrix_i = matrices.begin(); element_i < elements.end(); element_i++, matrix_i++) {
-		if(element->getName() == (*element_i)->getName()) {
-			// element has been found
-			calc_mat = const_cast<TMatrix*>( &(*matrix_i));
-        	}
-	}
-	return (const TMatrix*) calc_mat;
-}
-
-H_OpticalElement * H_AbstractBeamLine::getElement(const unsigned int element_position) {
-	const unsigned int N = (element_position>elements.size())?elements.size():element_position;
-	return *(elements.begin()+N);//for optimization of the code :same as return &elements[N];
-}
-
-const H_OpticalElement * H_AbstractBeamLine::getElement(const unsigned int element_position) const {
-	const unsigned int N = (element_position>elements.size())?elements.size():element_position;
-        return *(elements.begin()+N);//for optimization of the code :same as return &elements[N];
-}
-
-
-H_OpticalElement * H_AbstractBeamLine::getElement(const string el_name) {
-	for(unsigned int i=0; i < elements.size(); i++) {
-		if( (*(elements.begin()+i))->getName() == el_name ) 
-			return *(elements.begin()+i);
-	} // if found -> return ; else : not found at all !	
-	cout<<"Element "<<el_name<<" not found"<<endl;
-	return *(elements.begin()+1);
-}
-
-const H_OpticalElement * H_AbstractBeamLine::getElement(const string el_name) const {
-        for(unsigned int i=0; i < elements.size(); i++) {
-		if( (*(elements.begin()+i))->getName() == el_name)
-			return *(elements.begin()+i);
-	} // if found -> return ; else : not found at all !
-	cout<<"Element "<<el_name<<" not found"<<endl;
-	return *(elements.begin()+1);
-}
-
-void H_AbstractBeamLine::printProperties() const {
-	vector<H_OpticalElement*>::const_iterator element_i;
-	cout << "Pointeurs des elements du faisceau" << endl;
-	for (element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		cout << (int)(element_i-elements.begin()) << "\t" << (*element_i)->getName() << "\t" << (*element_i)->getS() << endl;	
-	}
-	return;
-}
-
-void H_AbstractBeamLine::showElements() const{
-	vector<H_OpticalElement*>::const_iterator element_i;
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		(*element_i)->printProperties();
-	}
-	cout << "Beam length = " << beam_length << endl;
-	cout << "Number of elements (including drifts) = " << getNumberOfElements() << endl;
-	return;
-}
-
-void H_AbstractBeamLine::showElements(const int type_el) const{
-	vector<H_OpticalElement*>::const_iterator element_i;
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		if ((*element_i)->getType()==type_el)
-			(*element_i)->printProperties();
-	}
-	return;
-}
-
-void H_AbstractBeamLine::showMatrix() const {
-	cout << "Transport matrix for the whole beam : " << endl;
-	cout << "(x,x',...) = (x*,x'*,...) M " <<endl;
-  	printMatrix(beam_mat);
-	return;
-}
-
-void H_AbstractBeamLine::showMatrices() const{
-	// prints the list of all transport matrices, from the whole beam.
-
-	vector<TMatrix>::const_iterator matrix_i;
-	vector<H_OpticalElement*>::const_iterator element_i;
-	TMatrix temp(MDIM,MDIM);
-
-	for(matrix_i = matrices.begin(), element_i = elements.begin(); matrix_i < matrices.end(); matrix_i++, element_i++) {
-		temp = *matrix_i;
-		cout << "Matrix for transport until s=" << (*element_i)->getS() + (*element_i)->getLength() << "m (" << (*element_i)->getName() << "). " << endl;
-		printMatrix(&temp);
-		cout << endl;
-	}
-	return ;
-}
-
-void H_AbstractBeamLine::calcSequence() {
-		// reorders the elements, computes the drifts;
-
-	vector<H_OpticalElement*> temp_elements;
-	vector<H_OpticalElement*>::iterator element_i;
-		// element_i is a pointer to elements[i]
-
-	if(elements.size()==1) { return; }
-
-	// getting rid of drifts before calculating
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		if((*element_i)->getType() == DRIFT) {elements.erase(element_i); }
-	}
-
-	// ordering the elements in position
-	sort(elements.begin(),elements.end(),ordering());
-	// inserting the drifts before the other elements
-	float current_pos = 0;
-	float drift_length=0;
-
-	for(element_i=elements.begin(); element_i < elements.end(); element_i++) {
-		drift_length = (*element_i)->getS() - current_pos;
-		if(drift_length>0) {
-  			H_Drift *dr = new H_Drift(current_pos,drift_length);
-			temp_elements.push_back(dr); 
-		}
-		temp_elements.push_back(*element_i);
-		current_pos = (*element_i)->getS() + (*element_i)->getLength();
-	}
-	
-	//adding the last drift
-	drift_length = beam_length - current_pos;
-	if (drift_length>0) {
-			H_Drift *dr = new H_Drift(current_pos,drift_length);
-			temp_elements.push_back(dr);
-	}
-	elements.clear();
-	for(element_i=temp_elements.begin(); element_i < temp_elements.end(); element_i++) {
-		elements.push_back(*element_i);
-	}
-}
-
-void H_AbstractBeamLine::calcMatrix() {
-	// computes the transport matrix for the beam upto here...
-	vector<H_OpticalElement*>::iterator element_i;
-	TMatrix calc_mat(MDIM,MDIM);
-
-	// initialization
-	matrices.clear();
-	calc_mat.UnitMatrix();
-
-	// multiplies the matrix of each beam's element
-	// and add each product matrix to the list of matrices.
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		calc_mat *= (*element_i)->getMatrix();
-		matrices.push_back(calc_mat);
-  	}
-
-	*beam_mat = calc_mat;
-	return;
-}
-
-float qh(float k) {
-        float beta = (log((float)10.0))/0.05;
-		// put (std::log((float)10.0)) instead of log(10) to avoid compilation errors
-        return 0.8*(1-exp(-beta*fabs(k)));
-}
-
-float dh(float k) {
-        float psi = (log((float)10.0))/0.002;
-		// put (std::log((float)10.0)) instead of log(10) to avoid compilation errors
-        return 0.8*(1-exp(-psi*fabs(k)));
-}
-
-void H_AbstractBeamLine::draw() const{
-/*	gROOT->SetStyle("Plain");
-	TLegend* leg = new TLegend(0.85,0.50,1,1,"Legend");
-	leg->SetBorderSize(1);
-	TBox* b1 = new TBox();
-	TBox* b2 = new TBox(0,0,10,10);
-	TBox* b3 = new TBox(0,0,0,0);
-	TBox* b4 = new TBox(0,0,0,0);
-	TBox* b5 = new TBox(0,0,0,0);
-	TBox* b6 = new TBox(0,0,0,0);
-	TBox* b7 = new TBox(0,0,0,0);
-	b1->SetFillColor(RDIPOLE);
-	b2->SetFillColor(SDIPOLE);
-	b3->SetFillColor(VQUADRUPOLE);
-	b4->SetFillColor(HQUADRUPOLE);
-	b5->SetFillColor(HKICKER);
-	b6->SetFillColor(VKICKER);
-	b7->SetFillColor(RCOLLIMATOR);
-	leg->AddEntry(b1,"R-Dipole");
-	leg->AddEntry(b2,"S-Dipole");
-	leg->AddEntry(b3,"V-Quadrupole");
-	leg->AddEntry(b4,"H-Quadrupole");
-	leg->AddEntry(b5,HKICKERNAME);
-	leg->AddEntry(b6,VKICKERNAME);
-	leg->AddEntry(b7,"RCollimator");
-	leg->Draw();
-*/ 
-/*	TLine* l1 = new TLine(0.05,0.5,0.95,0.5);
-	TLine* l2 = new TLine(0.1,0.1,0.1,0.9);
-	TLine* l3 = new TLine(0.9,0.1,0.9,0.9);
-	TPaveLabel* p1 = new TPaveLabel(0.05,0.5,0.1,0.6,"IP");
-	TPaveLabel* p2 = new TPaveLabel(0.9,0.5,0.95,0.6,"RP");
-	TGaxis* a1 = new TGaxis(0.1,0.1,0.9,0.1,0,beam_length);
-	a1->SetLabelSize(0.08);
-	p1->SetBorderSize(1);
-	p2->SetBorderSize(1);
-	p1->SetFillColor(0);
-	p2->SetFillColor(0);
-	l1->Draw();
-	l2->Draw();
-	l3->Draw();
-	p1->Draw();
-	p2->Draw();
-	float x1,x2,y1,y2;
-	vector<TPaveLabel*> boxes;
-	vector<H_OpticalElement*>::const_iterator element_i;
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-		x1 = 0.1 + ((*element_i)->getS()/beam_length)*0.8;
-		x2 = x1 + ((*element_i)->getLength()/beam_length)*0.8;
-		if((*element_i)->getType()>5) {
-			y1 = 0.3;
-			y2 = 0.7;
-		}
-		else if((*element_i)->getType()>3) {
-			y1 = 0.5 - qh((*element_i)->getK()*(*element_i)->getLength())/2.;
-			y2 = 0.5 + qh((*element_i)->getK()*(*element_i)->getLength())/2.;
-		} else {
-			y1 = 0.5 - dh((*element_i)->getK()*(*element_i)->getLength())/2.;
-			y2 = 0.5 + dh((*element_i)->getK()*(*element_i)->getLength())/2.;
-		}
-		TPaveLabel* cur_box = new TPaveLabel(x1,y1,x2,y2,"");
-		cur_box->SetFillStyle(1);
-		cur_box->SetFillColor(((int)(*element_i)->getType()));
-		cur_box->SetBorderSize(1);
-		if((*element_i)->getType()!=DRIFT) boxes.push_back(cur_box);
-	}
-	vector<TPaveLabel*>::iterator box_i;
-	for(box_i = boxes.begin(); box_i < boxes.end(); box_i++) {
-		(*box_i)->Draw();
-	}
-	a1->Draw();
-*/	
-	return;
-}
-
-void H_AbstractBeamLine::drawX(const float a_min, const float a_max) const{
-	/// @param a_min defines the size of the drawing
-	/// @param a_max defines the size of the drawing
-	const int N = getNumberOfElements();
-	for(int i=0;i<N;i++) {
-		float height = fabs(a_max);
-        	float meight = fabs(a_min);
-        	float size = (height>meight)?meight:height;
-		float middle = getElement(i)->getX()*URAD;
-        	if(getElement(i)->getType()!=DRIFT) getElement(i)->draw(middle+size/2.,middle-size/2.);
-    	}
-}
-
-void H_AbstractBeamLine::drawY(const float a_min, const float a_max) const{
-        /// @param a_min defines the size of the drawing 
-        /// @param a_max defines the size of the drawing
-        const int N = getNumberOfElements();
-        for(int i=0;i<N;i++) {
-                float height = fabs(a_max);
-                float meight = fabs(a_min);
-                float size = (height>meight)?meight:height;
-                float middle = getElement(i)->getY()*URAD;
-                if(getElement(i)->getType()!=DRIFT) getElement(i)->draw(middle+size/2.,middle-size/2.);
-        }
-}
-
-void H_AbstractBeamLine::moveElement(const string name, const float new_s) {
-	/// @param name identifies the element to move
-	/// @param new_s is where to put it
-       vector<H_OpticalElement*>::iterator element_i;
-       for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-	       if(name==(*element_i)->getName()) { (*element_i)->setS(new_s); }
-       }
-
-       calcSequence();
-       calcMatrix();
-       return;
-}
-
-void H_AbstractBeamLine::alignElement(const string name, const float disp_x, const float disp_y) {
-	/// @param name identifies the element to move
-	/// @param disp_x identifies the displacement to add in x [\f$ \mu m \f$]
-	/// @param disp_y identifies the displacement to add in y [\f$ \mu m \f$]
-		vector<H_OpticalElement*>::iterator element_i;
-		for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-			if(name==(*element_i)->getName()) { 
-				(*element_i)->setX((*element_i)->getX()+disp_x);
-				(*element_i)->setY((*element_i)->getY()+disp_y);
-				return ;
-			}
-		}
-		cout<<"Element "<<name<<" not found."<<endl; 
-		if(VERBOSE) cout<<"Element "<<name<<" not found."<<endl;
-		return;
-}
-
-void H_AbstractBeamLine::tiltElement(const string name, const float ang_x, const float ang_y) {
-	/// @param name identifies the element to move
-	/// @param ang_x identifies the angle to add in x
-	/// @param ang_y identifies the angle to add in y
-		vector<H_OpticalElement*>::iterator element_i;
-		for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-			if(name==(*element_i)->getName()) {
-				(*element_i)->setTX((*element_i)->getTX()+ang_x);
-				(*element_i)->setTY((*element_i)->getTY()+ang_y);
-				return ;
-			}
-		}
-		if(VERBOSE) cout<<"Element "<<name<<" not found."<<endl;
-		return;
-}
-
-void H_AbstractBeamLine::offsetElements(const float start, const float offset) {
-	/// @param start After this s [m] coordinate, all elements will be offset.
-	/// @param offset In meters
-
-	extern int relative_energy;
-	if(!relative_energy) {
-		vector<H_OpticalElement*>::iterator element_i;
-   	     for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-			if((*element_i)->getS() > start ) {
-    	       (*element_i)->setX(offset);
-       	    }
-		}
-	}
-}
-
-/*
-TGraph * H_AbstractBeamLine::getBetaX() const{
-        const int N = elements.size();
-        float * s = new float[N], * b = new float[N], temp;
-	int i=0, n=N;
-
-	vector<H_OpticalElement*>::const_iterator element_i;
-	for(element_i = elements.begin(); element_i < elements.end(); element_i++) {	
-		temp=(*element_i)->getBetaX();	
-		if (temp !=0) {
-			b[i] = (*element_i)->getBetaX();
-			s[i] = (*element_i)->getS();
-			i++;
-			n=i;
-		}
-	}
-
-        TGraph * betax = new TGraph(n,s,b);
-        betax->SetLineColor(1);
-	betax->SetLineStyle(2);
-	delete [] s;
-	delete [] b;
-        return betax;
-}
-
-TGraph * H_AbstractBeamLine::getBetaY() const{
-        const int N = elements.size();
-        float * s = new float[N], * b = new float[N], temp;
-        int i=0, n=N;
-
-        vector<H_OpticalElement*>::const_iterator element_i;
-        for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-                temp=(*element_i)->getBetaY();
-                if (temp !=0) {
-                        b[i] = (*element_i)->getBetaY();
-                        s[i] = (*element_i)->getS();
-                        i++;
-                        n=i;
-                }
-        }
-
-        TGraph * betay = new TGraph(n,s,b);
-        betay->SetLineColor(2);
-        betay->SetLineStyle(2);
-	delete [] s;
-	delete [] b;
-        return betay;
-}
-
-TGraph * H_AbstractBeamLine::getDX() const{
-        const int N = elements.size();
-        float * s = new float[N], * d = new float[N], temp;
-        int i=0, n=N;
-
-        vector<H_OpticalElement*>::const_iterator element_i;
-        for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-                temp=(*element_i)->getDX();
-                if (temp !=0) {
-                        d[i] = (*element_i)->getDX();
-                        s[i] = (*element_i)->getS();
-                        i++;
-                        n=i;
-                }
-        }
-
-        TGraph * dispx = new TGraph(n,s,d);
-        dispx->SetLineColor(8);
-        dispx->SetLineStyle(2);
-        delete [] s;
-        delete [] d;
-        return dispx;
-}
-
-TGraph * H_AbstractBeamLine::getDY() const{
-        const int N = elements.size();
-        float * s = new float[N], * d = new float[N], temp;
-        int i=0, n=N;
- 
-        vector<H_OpticalElement*>::const_iterator element_i;
-        for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-                temp=(*element_i)->getDY();
-                if (temp !=0) {
-                        d[i] = (*element_i)->getDY();
-                        s[i] = (*element_i)->getS();
-                        i++;
-                        n=i;
-                }
-        }
- 
-        TGraph * dispy = new TGraph(n,s,d);
-        dispy->SetLineColor(kBlue);
-        dispy->SetLineStyle(2);
-        delete [] s;
-        delete [] d;
-        return dispy;
-}
-
-
-TGraph * H_AbstractBeamLine::getRelX() const{
-        const int N = elements.size();
-        float * s = new float[N], * r = new float[N], temp;
-        int i=0, n=N;
-
-        vector<H_OpticalElement*>::const_iterator element_i;
-        for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-                temp=(*element_i)->getRelX();
-		if((*element_i)->getType() != DRIFT) {
-			r[i] = (*element_i)->getRelX();
-			s[i] = (*element_i)->getS();
-			i++;
-			n=i;
-		}
-	}
-
-        TGraph * relx = new TGraph(n,s,r);
-        relx->SetLineColor(kBlack);
-	relx->SetMarkerStyle(kOpenSquare);
-	relx->SetMarkerSize(0.6);
-        relx->SetLineStyle(2);
-        delete [] s;
-        delete [] r;
-        return relx;
-}
-
-TGraph * H_AbstractBeamLine::getRelY() const{
-        const int N = elements.size();
-        float * s = new float[N], * r = new float[N], temp;
-        int i=0, n=N;
-
-        vector<H_OpticalElement*>::const_iterator element_i;
-        for(element_i = elements.begin(); element_i < elements.end(); element_i++) {
-                temp=(*element_i)->getRelY();
-                if((*element_i)->getType() != DRIFT) {
-                        r[i] = (*element_i)->getRelY();
-                        s[i] = (*element_i)->getS();
-                        i++;
-                        n=i;
-                }
-        }
-
-        TGraph * rely = new TGraph(n,s,r);
-        rely->SetLineColor(kRed);
-	rely->SetMarkerStyle(kOpenSquare);
-	rely->SetMarkerSize(0.6);
-        rely->SetLineStyle(2);
-        delete [] s;
-        delete [] r;
-        return rely;
-}
-*/
Index: external/Hector/H_AbstractBeamLine.h
===================================================================
--- external/Hector/H_AbstractBeamLine.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,139 +1,0 @@
-#ifndef _H_AbstractBeamLine_
-#define _H_AbstractBeamLine_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-	http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de Phénoménologie (CP3)
-   Université Catholique de Louvain (UCL)
-*/
-
-/// \file H_AbstractBeamLine.h
-/// \brief Class aiming at simulating the LHC beamline.
-///
-/// Units : angles [µrad], distances [µm], energies [GeV], c=[1].
-
-	/// default length of the beam line
-#define LENGTH_DEF 100
-
-// c++ #includes
-#include <vector>
-#include <algorithm>
-#include <string>
-
-
-// ROOT #includes
-#include "TMatrix.h"
-////#include "TGraph.h"
-
-// local #includes
-#include "H_OpticalElement.h"
-using namespace std;
-
-/// Beamline made from a vector of H_OpticalElement.
-class H_AbstractBeamLine {
-
-	public:
-		void init(const float );
-		///     Constructors, destructor and operator
-		//@{
-		H_AbstractBeamLine() {init(LENGTH_DEF);};
-		H_AbstractBeamLine(const float length) {init(length);};
-		H_AbstractBeamLine(const H_AbstractBeamLine &);
-		H_AbstractBeamLine& operator=(const H_AbstractBeamLine&);
-		~H_AbstractBeamLine();
-		//@}
-		///     Adds an element to the beamline
-		//@{
-		void add(H_OpticalElement *);
-		void add(H_OpticalElement &);
-		//@}
-		///     Returns the (float) length of the beamline
-  		inline float getLength() const { return beam_length;};
-		///     Returns the (int) number of optics element of the beamline, including drifts
-  		inline int getNumberOfElements() const { return (int)elements.size();}; 
-		///     Returns the transport matrix for the whole beam
-		const TMatrix * getBeamMatrix() const;
-		///     Returns the transport matrix for the whole beam, for given energy loss/mass/charge
-		const TMatrix * getBeamMatrix(const float , const float, const float ) ;
-		///     Returns the transport matrix for a part of the beam from the IP to a given element
-		const TMatrix * getPartialMatrix(const H_OpticalElement *) const;
-		///     Returns the transport matrix for a part of the beam from the IP to the ith element
-		const TMatrix * getPartialMatrix(const unsigned int ) const;
-		///     Returns the transport matrix for a part of the beam from the IP to a given element, given energy loss/mass/charge
-		const TMatrix * getPartialMatrix(const string, const float, const float, const float);
-		///     Returns the ith element of the beamline
-		//@{
-		H_OpticalElement * getElement(const unsigned int );
-                const H_OpticalElement * getElement(const unsigned int ) const;
-		//@}
-		///	Returns a given element of the beamline, choosen by name 
-		//@{
-		H_OpticalElement * getElement(const string );
-                const H_OpticalElement * getElement(const string ) const;
-		//@}
-		///	Print some info
-		void printProperties() const;
-		///     Prints the element list
-		void showElements() const;
-		///     Prints the list of elements of a give type
-		void showElements(const int) const;
-		///     Prints the transport matrix for the whole beam
-		void showMatrix() const;
-		///     Prints the transport matrix for each element of the beamline
-		void showMatrices() const;
-		/// 	Reorders elements and adds the drift sections
-		void calcSequence();
-		/// 	Computes global transport matrix
-		void calcMatrix();
-		/// 	Draws the elements of the beam
-		void draw() const;
-		/// 	Draws the elements of the beam in the (x,s) plane
-		void drawX(const float, const float) const;
-		/// 	Draws the elements of the beam in the (y,s) plane
-		void drawY(const float, const float) const;
-		///	Moves an element in the list, reorders the lists and recomputes the transport matrix
-		void moveElement(const string, const float ); 
-		/// Moves the given element tranversely by given amounts.
-		void alignElement(const string, const float, const float);
-		/// Tilts the given element tranversely by given angles.
-		void tiltElement(const string, const float, const float);
-		///	Offsets all element in X pos from the start position
-		void offsetElements(const float start, const float offset);
-		///	Draws the beta functions, from MAD
-		//@{
-		////TGraph * getBetaX() const;
-		////TGraph * getBetaY() const;
-		//@}
-                ///     Draws the dispersion functions, from MAD
-                //@{
-                ////TGraph * getDX() const;
-                ////TGraph * getDY() const;
-                //@}
-                ///     Draws the relative position functions, from MAD
-                //@{
-                ////TGraph * getRelX() const;
-                ////TGraph * getRelY() const;
-                //@}
-
-
-	private:
-	        /// list of all optics elements, including drifts
-		vector<H_OpticalElement*> elements; 
-        	/// list of matrices, 1 matrix = the transport till the end of each element
-		vector<TMatrix> matrices; 
-	        /// transport matrix for the whole beam
-		TMatrix * beam_mat;		    	
-		/// Orderting method for the vector of H_OpticalElement*
-		struct ordering{ bool operator()(H_OpticalElement* el1, H_OpticalElement* el2) const { return (*el1 < *el2);}};
-
-	protected:
-		/// total length of the beamline
-		float beam_length;
-};
-
-#endif
Index: external/Hector/H_Aperture.cc
===================================================================
--- external/Hector/H_Aperture.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,101 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Aperture.cc
-/// \brief Classes aiming at simulating the aperture of the LHC beamline elements.
-
-// C++ #includes
-#include <iostream>
-
-// local #includes
-#include "H_Aperture.h"
-using namespace std;
-
-H_Aperture::H_Aperture() {
-        type = NONE;
-        setApertureString();
-        x1 = 0;
-        x2 = 0;
-        x3 = 0;
-        x4 = 0;
-        fx = 0;
-        fy = 0;
-}
-
-H_Aperture::H_Aperture(const int dtype, const float size1, const float size2, const float size3, const float size4, const float posx, const float posy) {
-    /// @param dtype defines the aperture shape
-        /// @param size1, size2, size3, size4 are the geometrical sizes (length/width or great/small radii) in m
-	/// @param posx, posy are the (x,y) coordinates of the center of the aperture [m]
-        type = dtype;
-        setApertureString();
-        x1 = size1;
-        x2 = size2;
-	x3 = size3;
-	x4 = size4;
-        fx = posx;
-        fy = posy;
-}
-
-H_Aperture::H_Aperture(const H_Aperture& ap) {
-        type = ap.type;
-	aptypestring = ap.aptypestring;
-        x1 = ap.x1;
-        x2 = ap.x2;
-        x3 = ap.x3;
-        x4 = ap.x4;
-        fx = ap.fx;
-        fy = ap.fy;
-}
-
-H_Aperture& H_Aperture::operator=(const H_Aperture& ap) {
-	if(this==&ap) return *this;
-	type = ap.type;
-	aptypestring = ap.aptypestring;
-	x1 = ap.x1;
-	x2 = ap.x2;
-	x3 = ap.x3;
-	x4 = ap.x4;
-	fx = ap.fx;
-	fy = ap.fy;
-	return *this;
-}
-
-void H_Aperture::printProperties() const {
-        cout << "Aperture shape:" << getTypeString() << ", parameters"<<x1<<", "<<x2<<", "<<x3<<", "<<x4<<endl;
-        cout << " \t Center : " << fx << "," << fy << endl;
-        return;
-}
-
-void H_Aperture::setPosition(const float posx, const float posy) {
-	/// @param posx, posy are the (x,y) coordinates of the center of the apertures [m]
-	// posx, posy, fx, fy = [m]
-	fx = posx;
-	fy = posy;
-	return;
-}
-
-bool H_Aperture::isInside(const float x, const float y) const {
-        /// @param x, y are the (x,y) coordinates of the proton, in [m]
-        cout << "aperture::isInside" << endl;
-        return false;
-}
-
-
-void H_Aperture::setApertureString() {
-	switch (type) {
-		case NONE: aptypestring = NONENAME; break;
- 		case RECTANGULAR: aptypestring = RECTANGULARNAME; break;
- 		case ELLIPTIC: aptypestring = ELLIPTICNAME; break;
- 		case CIRCULAR: aptypestring = CIRCULARNAME; break;
- 		case RECTELLIPSE: aptypestring = RECTELLIPSENAME; break;
-		default: aptypestring = NONENAME; break;
-	}
-}
Index: external/Hector/H_Aperture.h
===================================================================
--- external/Hector/H_Aperture.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#ifndef _H_Aperture_
-#define _H_Aperture_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Aperture.h
-/// \brief Defines the aperture of beamline elements.
-
-// C++ #defines
-#include <string>
-using namespace std;
-
-// local #defines
-#define NONE        0
-#define RECTANGULAR 1
-#define ELLIPTIC    2
-#define CIRCULAR    3
-#define RECTELLIPSE 4
-#define NONENAME        "None       "
-#define RECTANGULARNAME "Rectangle  "
-#define ELLIPTICNAME    "Ellipse    "
-#define CIRCULARNAME    "Circle     "
-#define RECTELLIPSENAME "Rectellipse"
-
-/// Defines the aperture of any optics element.
-class H_Aperture {
-
-	public:
-		/// Constructors, destructor and operators
-		//@{
-		H_Aperture();
-		H_Aperture(const int, const float, const float, const float, const float, const float, const float);
-		H_Aperture(const H_Aperture&);
-		H_Aperture& operator=(const H_Aperture&);
-		virtual ~H_Aperture() {return;};
-		//@}
-
-		/// Prints the aperture features
-		virtual void printProperties() const;
-		/// Draws the aperture shape
-		virtual void draw() const {return;};
-		/// Sets the (x,y) position in [m]
-		void setPosition(const float,const float);
-		/// Checks whether the point is inside the aperture or not
-		virtual bool isInside(const float, const float) const; 
-		/// Returns the (int) type of aperture
-		inline int getType() const {return type;};
-		/// Returns the (string) type of the aperture
-		inline const string getTypeString() const { return aptypestring; }
-		
-	
-	protected:
-		/// Aperture shape (either RECTANGULAR or ELLIPTIC or ...)
-		int type;
-		/// Aperture shape string
-		string aptypestring;
-
-		/// Aperture geometrical sizes (length/width or great/small radii) [m]
-		//@{
-		float x1, x2, x3, x4; 
-		//@}
-
-		/// Horizontal coordinate of the aperture center [m] (from the nominal beam position).
-		//@{
-		float fx, fy;
-		//@}
-		/// Sets the name of the aperture from its type.
-		void setApertureString();
-};
-
-#endif
Index: external/Hector/H_Beam.cc
===================================================================
--- external/Hector/H_Beam.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,442 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Beam.cc
-/// \brief Describes a set a particles as a beam
-///
-
-// ROOT #includes
-//#include "TGraph.h"
-#include "TRandom.h"
-
-// local #includes
-#include "H_Beam.h"
-using namespace std;
-
-H_Beam::H_Beam() {
-        setPosition(PX,PY,TX+CRANG,TY,PS);
-        setE(BE);
-        setDispersion(SX,SY,STX,STY,SS);
-        setDE(SBE);
-	Nparticles=0;
-}
-
-H_Beam::H_Beam(const H_Beam& be) {
-	beamParticles = be.beamParticles;
-	setPosition(be.fx_ini,be.fy_ini,tx_ini,ty_ini,be.fs_ini);
-	setE(be.fe_ini);
-	setDispersion(be.x_disp,be.y_disp,be.tx_disp,be.ty_disp,be.s_disp);
-	setDE(be.e_disp);
-	Nparticles = be.Nparticles;
-}
-
-H_Beam& H_Beam::operator=(const H_Beam& be) {
-	if(this==&be) return *this;
-        beamParticles = be.beamParticles;
-        setPosition(be.fx_ini,be.fy_ini,tx_ini,ty_ini,be.fs_ini);
-        setE(be.fe_ini);
-        setDispersion(be.x_disp,be.y_disp,be.tx_disp,be.ty_disp,be.s_disp);
-        setDE(be.e_disp);
-        Nparticles = be.Nparticles; 
-        return *this;
-}
-
-H_Beam::~H_Beam() {
-	beamParticles.clear(); 
-	return;
-};
-
-void H_Beam::createBeamParticles(const unsigned int Number_of_particles) {
-	createBeamParticles(Number_of_particles,MP,QP);
-}
-
-void H_Beam::createBeamParticles(const unsigned int Number_of_particles, const double p_mass, const double p_charge) {
-	beamParticles.clear();
-	Nparticles = (Number_of_particles<1) ? 1 : Number_of_particles;
-	for (unsigned int i=0; i<Nparticles; i++) {
-		H_BeamParticle p(p_mass,p_charge);
-		p.setPosition(fx_ini,fy_ini,tx_ini,ty_ini,fs_ini);
-		p.setE(fe_ini);
-		p.smearPos(x_disp,y_disp);
-		p.smearAng(tx_disp,ty_disp);
-		p.smearE(e_disp);
-		p.smearS(s_disp);
-		if (VERBOSE) {if (i==0) cout << " x_ini , tx_ini " << p.getX() << " " << p.getTX() << endl;}
-		beamParticles.push_back(p);
-	}
-}
-
-void H_Beam::createXScanningBeamParticles(const unsigned int Number_of_particles, const float fx_max) {
-        beamParticles.clear();
-	Nparticles = (Number_of_particles<2) ? 2 : Number_of_particles;
-        for (unsigned int i=0; i<Nparticles; i++) {
-                H_BeamParticle p;
-		float fx = fx_ini + i/(float)(Nparticles-1) * (fx_max-fx_ini);
-                p.setPosition(fx,fy_ini,0,0,fs_ini);
-                p.setE(fe_ini);
-                beamParticles.push_back(p);
-        }
-}
-
-void H_Beam::createYScanningBeamParticles(const unsigned int Number_of_particles, const float fy_max) {
-
-        beamParticles.clear();
-	Nparticles = (Number_of_particles<2) ? 2 : Number_of_particles;
-        for (unsigned int i=0; i<Nparticles; i++) {
-                H_BeamParticle p;
-                float fy = fy_ini + i/(float)(Nparticles-1) * (fy_max-fy_ini);
-                p.setPosition(fx_ini,fy,0,0,fs_ini);
-                p.setE(fe_ini);
-                beamParticles.push_back(p);
-        }
-}
-
-void H_Beam::createTXScanningBeamParticles(const unsigned int Number_of_particles, const float tx_max) {
-        beamParticles.clear();
-	Nparticles = (Number_of_particles<2) ? 2 : Number_of_particles;
-        for (unsigned int i=0; i<Nparticles; i++) {
-                H_BeamParticle p;
-                float tx = tx_ini + i/(float)(Nparticles-1) * (tx_max-tx_ini);
-                p.setPosition(fx_ini,fy_ini,tx,ty_ini,fs_ini);
-                p.setE(fe_ini);
-                beamParticles.push_back(p);
-        }
-}
-
-void H_Beam::createTYScanningBeamParticles(const unsigned int Number_of_particles, const float ty_max) {
-        beamParticles.clear(); 
-        Nparticles = (Number_of_particles<2) ? 2 : Number_of_particles;
-        for (unsigned int i=0; i<Nparticles; i++) { 
-                H_BeamParticle p; 
-                float ty = ty_ini + i/(float)(Nparticles-1) * (ty_max-ty_ini);
-                p.setPosition(fx_ini,fy_ini,tx_ini,ty,fs_ini);
-                p.setE(fe_ini); 
-                beamParticles.push_back(p); 
-        } 
-}
-
-const H_BeamParticle * H_Beam::getBeamParticle(const unsigned int particle_index) const {
-//	const int N = (particle_index<0)?0:(( particle_index>Nparticles)?Nparticles:particle_index);
-	const int N = (particle_index>Nparticles)?Nparticles:particle_index;
-	return &(*(beamParticles.begin()+N));// same as "return &beamParticles[N];" but more efficient
-}
-
-H_BeamParticle * H_Beam::getBeamParticle(const unsigned int particle_index) {
-//        const int N = (particle_index<0)?0:(( particle_index>Nparticles)?Nparticles:particle_index);
-	const int N = (particle_index>Nparticles)?Nparticles:particle_index;
-        return &(*(beamParticles.begin()+N));// same as "return &beamParticles[N];" but more efficient
-}
-
-void H_Beam::add(const H_BeamParticle &p) {
-	beamParticles.push_back(p);
-	Nparticles++;
-}
-
-void H_Beam::computePath(const H_AbstractBeamLine * beamline, const bool NonLinear) {
-	vector<H_BeamParticle>::iterator particle_i;
-
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-		particle_i->computePath(beamline,NonLinear);	
-	}
-}
-
-void H_Beam::computePath(const H_AbstractBeamLine * beamline) {
-	computePath(beamline,false);
-}
-
-/// Propagates the beam until a given s
-void H_Beam::propagate(const float position) {
-	vector<H_BeamParticle>::iterator particle_i;
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                particle_i->propagate(position);
-        }
-}
-
-void H_Beam::emitGamma(const double gee, const double gq2) {
-	/// @param gee = \f$ E_{\gamma} \f$ is the photon energy
-	/// @param gq2 = \f$ Q^2 < 0 \f$ is virtuality of photon \f$ Q^{2} = E^{2}-\vec{k}^{2} \f$
-	emitGamma(gee,gq2,0,2*PI);
-}
-
-void H_Beam::emitGamma(const double gee, const double gq2, const double phimin, const double phimax) {
-	/// @param gee = \f$ E_{\gamma} \f$ is the photon energy
-	/// @param gq2 = \f$ Q^2 < 0 \f$ is virtuality of photon \f$ Q^{2} = E^{2}-\vec{k}^{2} \f$
-	/// @param phimin : lower bound for \f$ \phi \f$
-	/// @param phimax : higher bound for \f$ \phi \f$
-	vector<H_BeamParticle>::iterator particle_i;
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++)
-                particle_i->emitGamma(gee,gq2,phimin,phimax);
-}
-
-float H_Beam::getBetaX(const float s, float& error_on_betax) {
-	/// @param s is the position [m] to propagate to
-	/// @param error_on_betax : getBetaX(...) returns its error in this variable
-	/// not a const method because does a propagate to s!
-	vector<H_BeamParticle>::iterator particle_i;
-	float EX2=0,dummy, mean=getX(s,dummy), temp;
-
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-		particle_i->propagate(s);
-		temp = particle_i->getX()-mean;
-		EX2 += temp*temp;
-	}
-	EX2 /= (float)Nparticles;
-	float emitx = getEmittanceX();	
-	EX2 = (emitx==0)?0:(float) (EX2 /(float) (emitx*URAD))/URAD;
-	error_on_betax = EX2 / (float) sqrt((double)2*Nparticles);
-	return EX2;
-}
-
-float H_Beam::getBetaY(const float s, float& error_on_betay) {
-        /// @param s is the position [m] to propagate to
-        /// @param error_on_betay : getBetaY(...) returns its error in this variable
-	/// not a const method because does a propagate to s!
- 	vector<H_BeamParticle>::iterator particle_i;
-	float EY2 =0, dummy, mean=getY(s,dummy), temp;
-
-        for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                particle_i->propagate(s);
-		temp = particle_i->getY() - mean;
-		EY2 += temp*temp;
-	}
-	EY2 /= (float)Nparticles;
-	float emity = getEmittanceY();
-	EY2 = (emity==0)?0:(float) (EY2 / (float) (emity*URAD))/URAD;
-	error_on_betay = EY2 / (float) sqrt((double)2*Nparticles);
-	return EY2;
-}
-/*
-TGraphErrors * H_Beam::getBetaX(const float length, const unsigned int number_of_points) {
-	/// @param length [m]
-	/// @number_of_points in the graph (typ. 200)
-	const unsigned int N = number_of_points;
-	float * s = new float[N], * b = new float[N], * es = new float[N], * eb = new float[N];
-	for (unsigned int i=0; i<N; i++) {
-		s[i] = (float) fs_ini + i/(float)(N-1) *length; 
-		b[i] = getBetaX(s[i],eb[i]);
-		es[i] = 0;
-	}
-	TGraphErrors * betax = new TGraphErrors(N,s,b,es,eb);
-	betax->SetLineColor(kBlack);
-	betax->SetFillColor(kYellow);
-	delete [] s;
-	delete [] b;
-	delete [] es;
-	delete [] eb;
-	return betax;
-}
-
-TGraphErrors * H_Beam::getBetaY(const float length, const unsigned int number_of_points) {
-        /// @param length [m] 
-        /// @number_of_points in the graph (typ. 200)
-        const unsigned int N = number_of_points;
-        float * s = new float[N], * b = new float[N], * es = new float[N], *eb = new float[N];
-        for (unsigned int i=0; i<N; i++) {
-                s[i] = (float) fs_ini + i/(float)(N-1) *length;
-                b[i] = getBetaY(s[i],eb[i]);
-		es[i]=0;
-        }
-        TGraphErrors * betay = new TGraphErrors(N,s,b,es,eb);
-        betay->SetLineColor(kRed);
-	betay->SetFillColor(kYellow);
-        delete [] s;
-        delete [] b;
-        delete [] es;
-        delete [] eb;
-	return betay;
-}
-*/
-
-float H_Beam::getX(const float s, float& error_on_posx) {
-	vector<H_BeamParticle>::iterator particle_i;
-	float mean=0;
-
-        for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                particle_i->propagate(s);
-                mean += particle_i->getX();
-        }
-	mean = mean / (float) Nparticles;
-	error_on_posx = mean / (float) sqrt((double)Nparticles);
-        return mean;
-}
-
-float H_Beam::getY(const float s, float& error_on_posy) {
-	vector<H_BeamParticle>::iterator particle_i;
-	float mean=0;
-
-        for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                particle_i->propagate(s);
-        	mean += particle_i->getY();
-	}
-	mean = mean / (float) Nparticles;
-	error_on_posy = mean / (float) sqrt((double)Nparticles);
-        return mean;
-}
-
-unsigned int H_Beam::getStoppedNumber(const H_AbstractBeamLine * beamline) {
-	int number =0;
-	vector<H_BeamParticle>::iterator particle_i;
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-		if(particle_i->stopped(beamline)) number++;
-	}
-	return number;
-}
-
-void H_Beam::getStoppingElements(const H_AbstractBeamLine * beamline, vector<H_OpticalElement>& list, vector<int>& numb) {
-        vector<H_BeamParticle>::iterator particle_i;
-        vector<H_OpticalElement>::iterator element_i;
-        H_OpticalElement temp_el;
-        vector<int>::iterator n_i;
-        int number =0;
-        bool found;
-
-        list.clear();
-        numb.clear();
-
-        // creates a list of elements where beamParticles have stopped
-        for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                found = false;
-                if(particle_i->stopped(beamline)) {
-                        temp_el = *(particle_i->getStoppingElement());
-                        if(list.size()==0) {
-                                number=1;
-                                list.push_back(temp_el);
-                                numb.push_back(number);
-                        } else {
-                                for (element_i = list.begin(), n_i = numb.begin(); element_i < list.end(); element_i++, n_i++) {
-                                        string el_i_name = element_i->getName();
-                                        string temp_el_name = temp_el.getName();
-                                        if(el_i_name == temp_el_name) {
-                                                number = *n_i;
-                                                number++;
-                                                *n_i = number;
-                                                found = true;
-                                        }
-                                }
-                                if(!found) {
-                                                number=1;
-                                                list.push_back(temp_el);
-                                                numb.push_back(number);
-                                }
-                        }
-                } // if particle_i->stopped
-        }// for particle_i
-} // H_Beam::getStoppingElements
-
-void H_Beam::printInitialState() const {
-	cout << "Initial parameters of the beam" << endl;
-	cout << "(x,y,s) = (" << fx_ini << "," << fy_ini << "," << fs_ini << ") ";
-	cout << "(theta_x, theta_y) = (" << tx_ini << "," << ty_ini << ") ";
-	cout << "energy = " << fe_ini << endl; 
-	cout << endl;
-	cout << "Dispersion on these values : " << endl;
-	cout << "(dx,dy,ds) = (" << x_disp << "," << y_disp << "," << s_disp << ") ";
-	cout << "(dtheta_x, dtheta_y) = (" << tx_disp << "," << ty_disp << ") ";
-	cout << "de = " << e_disp << endl << endl;
-
-	float mean_ini =0;
-	vector<H_BeamParticle>::const_iterator particle_i;
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-		mean_ini += particle_i->getX();
-	}
-	mean_ini /= (float) beamParticles.size();
-	cout << "Mean ini x = " << mean_ini << endl;
-}
-
-void H_Beam::printProperties() const {
-	vector<H_BeamParticle>::const_iterator particle_i;
-	cout << "There are " << Nparticles << " in the beam." << endl;
-	for (particle_i = beamParticles.begin();particle_i < beamParticles.end(); particle_i++) {
-		particle_i->printProperties();
-	}
-}
-
-void H_Beam::printStoppingElements(const vector<H_OpticalElement>& list, const vector<int>& numb) const{
-	/// see also H_Beam::getStoppingElements
-	vector<H_OpticalElement>::const_iterator element_i;
-	vector<int>::const_iterator n_i;
-
-	// prints the list
-	for (element_i=list.begin(), n_i = numb.begin(); element_i < list.end(); element_i++, n_i++) {
-		cout << *n_i << " particules in " << element_i->getName();
-		cout <<  " (" << element_i->getTypeString() << ") at " << element_i->getS() << "m" << endl;
-		element_i->getAperture()->printProperties();
-	}
-} // H_Beam::printStoppingElements
-/*
-TH2F *  H_Beam::drawProfile(const float s) {
-	/// not a const method because does a propagate to s!
-	char title[50];
-	sprintf(title,"Beam profile at %.2f m",s);
-	vector<H_BeamParticle>::iterator particle_i;
-	float xmax, xmin, ymax, ymin;
-	float xx, yy, xborder, yborder;
-
-	particle_i=beamParticles.begin();
-	xmin = particle_i->getX();
-	xmax = particle_i->getX();
-	ymin = particle_i->getY();
-        ymax = particle_i->getY();
-
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                particle_i->propagate(s);
-		xx = particle_i->getX();
-		yy = particle_i->getY();
-
-                xmax = xx>xmax ? xx : xmax;
-		ymax = yy>ymax ? yy : ymax;
-		xmin = xx<xmin ? xx : xmin;
-		ymin = yy<ymin ? yy : ymin;
-        }
-
-	// in order to avoid some drawing problems, when the beam divergence is null
-	if(xmax == xmin) xmax += 0.1;
-	if(ymax == ymin) ymax += 0.1;
-	
-	xborder = (xmax-xmin)*0.2;
-	yborder = (ymax-ymin)*0.2;
-
-	xmax += xborder;
-	xmin -= xborder;
-	ymax += yborder;
-	ymin -= yborder;
-
-	TH2F * profile = new TH2F("profile",title,10000,xmin,xmax,1000,ymin,ymax);
-        for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-		profile->Fill(particle_i->getX(), particle_i->getY());
-	}
-	return profile;
-}*/
-/*
-TMultiGraph * H_Beam::drawBeamX(const int color) const {
-	int mycolor = color;
-	vector<H_BeamParticle>::const_iterator particle_i;
-	TMultiGraph * beam_profile_x = new TMultiGraph("beam_profile_x","");
-	
-	for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-		TGraph * ppath_x = particle_i->getPath(0,mycolor);
-		beam_profile_x->Add(ppath_x);
-	}
-	return beam_profile_x;
-}
-
-TMultiGraph * H_Beam::drawBeamY(const int color) const {
-	int mycolor = color;
-        vector<H_BeamParticle>::const_iterator particle_i;
-        TMultiGraph * beam_profile_y = new TMultiGraph("beam_profile_y","");
-
-        for (particle_i = beamParticles.begin(); particle_i < beamParticles.end(); particle_i++) {
-                TGraph * ppath_y = particle_i->getPath(1,mycolor);
-                beam_profile_y->Add(ppath_y);
-        }
-        return beam_profile_y;
-}
-*/
Index: external/Hector/H_Beam.h
===================================================================
--- external/Hector/H_Beam.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,184 +1,0 @@
-#ifndef _H_Beam_
-#define _H_Beam_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Beam.h
-/// \brief Describes a set a particles as a beam
-///
-
-// c++ #includes
-//#include <iostream>
-#include <vector>
-#include <sstream>
-#include <cmath>
-
-// ROOT #includes
-////#include "TH2F.h"
-////#include "TGraphErrors.h"
-////#include "TMultiGraph.h"
-
-// local #includes
-#include "H_BeamParticle.h"
-#include "H_AbstractBeamLine.h"
-#include "H_Parameters.h"
-#include "H_OpticalElement.h"
-using namespace std;
-
-/// \brief Beam made from a STL vector of H_BeamParticle.
-///
-/// Example of usage :
-/// <PRE>
-///   H_Beam mybeam;
-///   mybeam.createBeamParticles(100);
-///   H_AbstractBeamLine * beamline = new H_AbstractBeamLine(200);
-///	... (<-- fills the beam)
-///   mybeam.computePath(beamline)
-/// </PRE>
-class H_Beam {
-
-	public:
-	/// Constructors, destructor and operator
-	//@{
-		H_Beam();
-		H_Beam(const H_Beam&);
-		H_Beam& operator=(const H_Beam&);
-		~H_Beam();
-	//@}
-	/// Fills the beam with particles
-	//@{
-		void createBeamParticles(const unsigned int , const double , const double );
-		void createBeamParticles(const unsigned int);
-	//@}
-	/// Fills the beam with particles with incremental offset and no initial transverse momentum
-	//@{
-		void createXScanningBeamParticles(const unsigned int, const float);
-		void createYScanningBeamParticles(const unsigned int, const float);
-	//@}
-	/// Fills the beam with particles with incremental initial angle and no offset.
-	//@{
-		void createTXScanningBeamParticles(const unsigned int, const float);
-		void createTYScanningBeamParticles(const unsigned int, const float);
-	//@}
-	/// Returns the ith particle
-	//@{
-		const H_BeamParticle * getBeamParticle(const unsigned int ) const;
-		H_BeamParticle * getBeamParticle(const unsigned int );
-	//@}
-	/// Adds a particle to the beam
-		void add(const H_BeamParticle&);
-	/// Compute the position of each particle in the beamline
-	//@{	
-		void computePath(const H_AbstractBeamLine *, const bool);
-		void computePath(const H_AbstractBeamLine *);
-	//@}
-	// Photon emission by the particle
-	// @{
-                void emitGamma(const double, const double, const double, const double);
-		void emitGamma(const double, const double);
-	//@}
-	// Propagates the beam until a given s
-		void propagate(const float );
-	/// Returns the \f$ \beta \f$ function of the beam
-	//@{
-		float getBetaX(const float , float& );
-                float getBetaY(const float , float& );
-	//@}
-	/// Draws the \f$ \beta \f$ function of the beam
-	//@{
-        ////	TGraphErrors  * getBetaX(const float, const unsigned int);
-	////	TGraphErrors  * getBetaY(const float, const unsigned int);
-	//@}
-        /// Returns the position of the beam
-	//@{
-                float getX(const float , float& );
-                float getY(const float , float& );
-	//@}
-	/// Returns the emittance \f$ \epsilon \f$ of the beam in x and y
-	//@{
-		inline const float getEmittanceX() const {
-		    if(x_disp * tx_disp == 0) cout<<"Warning : Degenerate Beam : x-emittance = 0"<<endl; 	
-			return x_disp * tan(tx_disp/URAD)/URAD;
-		}
-        inline const float getEmittanceY() const { 
-		    if(y_disp * ty_disp == 0) cout<<"Warning : Degenerate Beam : y-emittance = 0"<<endl;
-			return y_disp * tan(ty_disp/URAD)/URAD;
-		}
-	//@}
-	/// Sets the initial parameters of the beam \f$ s , x , y , \theta_x , \theta_y \f$
-	//@{
-		void setS(const float fs) { fs_ini = fs;}
-		void setX(const float fx) { fx_ini = fx;}
-		void setY(const float fy) { fy_ini = fy;}
-		void setTX(const float tx) { tx_ini = tx;}
-		void setTY(const float ty) { ty_ini = ty;}
-		void setE(const float fe) {fe_ini = fe;}
-		void setPosition(const float fx, const float fy, const float tx, const float ty, const float fs) {setS(fs); setX(fx); setY(fy); setTX(tx); setTY(ty);}
-	//@}
-	/// Sets the initial divergence of the beam \f$ \sigma_x , \sigma_y , \sigma (\theta_x), \sigma(\theta_y) \f$
-	//@{
-		void setDS(const float ds) {s_disp = ds;}
-		void setDX(const float dx) {x_disp = dx;}
-		void setDY(const float dy) {y_disp = dy;}
-		void setDTX(const float dtx) {tx_disp = dtx;}
-		void setDTY(const float dty) {ty_disp = dty;}
-		void setDE(const float de) {e_disp = de;}
-		void setDispersion(const float dx, const float dy, const float dtx, const float dty, const float ds) {setDS(ds); setDX(dx); setDY(dy); setDTX(dtx); setDTY(dty);}
-	//@} 
-	/// Returns the number of particles which have been stopped
-		unsigned int getStoppedNumber(const H_AbstractBeamLine *);
-	/// Returns the list of the stopping elements in the beamline
-		void getStoppingElements(const H_AbstractBeamLine *, vector<H_OpticalElement>&, vector<int>&);
-	/// Prints the initial parameters
-		void printInitialState() const;
-	/// Prints the properties for each particle
-		void printProperties() const;
-	/// Prints the list of the stopping elements in the beamline
-		void printStoppingElements(const vector<H_OpticalElement>&, const vector<int>&) const;
-	/// Returns the number of particle is this beam
-		const int getNumberOfBeamParticles() const {return Nparticles;}
-	/// Draws the beam profile at a given s
-	////	TH2F * drawProfile(const float);
-	/// Draws the beam width and height
-	//@{
-	////	TMultiGraph * drawBeamX(const int) const;
-	////	TMultiGraph * drawBeamY(const int) const ;
-	//@}
-
-	protected:
-	/// List of particles
-		vector<H_BeamParticle> beamParticles;
-	/// IP position
-	//@{
-		float fx_ini, fy_ini, fs_ini;
-	//@}
-	/// IP \f$ \theta \f$ (angular) position
-	//@{
-		float tx_ini, ty_ini;
-	//@}
-	/// nominal beam energy
-		float fe_ini;
-	/// dispersion in position
-	//@{
-		float x_disp, y_disp, s_disp;
-	//@}
-	/// dispersion in \f$ \theta \f$
-	//@{
-		float tx_disp, ty_disp;
-	//@}
-	/// dispersion in energy
-		float e_disp;
-	/// Number of particles in this beam
-		unsigned int Nparticles;
-};
-
-#endif
Index: external/Hector/H_BeamLine.cc
===================================================================
--- external/Hector/H_BeamLine.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,254 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_BeamLine.cc
-/// \brief Reads external files and retrieves features of the real beam optical elements
-
-// c++ #includes
-#include <iostream>
-#include <fstream>
-#include <sstream>
-
-// local #includes
-#include "H_BeamLine.h"
-#include "H_BeamLineParser.h"
-#include "H_RectEllipticAperture.h"
-#include "H_RectangularAperture.h"
-#include "H_EllipticAperture.h"
-#include "H_CircularAperture.h"
-#include "H_RectangularDipole.h"
-#include "H_SectorDipole.h"
-#include "H_HorizontalQuadrupole.h"
-#include "H_VerticalQuadrupole.h"
-#include "H_HorizontalKicker.h"
-#include "H_VerticalKicker.h"
-#include "H_RectangularCollimator.h"
-#include "H_Marker.h"
-
-using namespace std;
-
-// Caution : mad conventions for vertically(horizontally) focusing quadrupoles
-// are opposite to Wille's. See fill() for more details.
-
-H_BeamLine::H_BeamLine(const int si, const float length) : H_AbstractBeamLine(length){
-	direction = (si >= abs(si)) ? 1 : -1;
-	ips=0;
-	ipx=0;
-	ipy=0;
-	iptx=0;
-	ipty=0;
-}
-
-H_BeamLine::H_BeamLine(const H_BeamLine& beam) : H_AbstractBeamLine(beam) {
-	direction = beam.direction;
-	ips = beam.ips;
-	ipx = beam.ipx;
-	ipy = beam.ipy;
-	iptx = beam.iptx;
-	ipty = beam.ipty;
-}
-
-H_BeamLine& H_BeamLine::operator=(const H_BeamLine& beam) {
-	if(this==&beam) return *this;
-	direction = beam.direction;
-	ips = beam.ips;
-	ipx = beam.ipx;
-    ipy = beam.ipy;
-    iptx = beam.iptx;
-    ipty = beam.ipty;
-	return *this;
-}
-
-void H_BeamLine::findIP(const string filename) {
-	findIP(filename,"IP5");
-	return;
-}
-
-void H_BeamLine::findIP(const string filename, const string ipname) {
-	// searches for the IP position in the extended table.
-	ifstream tabfile(filename.c_str());
-		if (! tabfile.is_open()) cout << "\t ERROR: I Can't open \"" << filename << "\"" << endl;
-	bool found = false;
-	int N_col=0;
-	string headers[40];  // table of all column headers
-	int header_type[40]; // table of all column types
-
-	string temp_string;
-	H_BeamLineParser e;
-	istringstream curstring;
-
-	while (	getline(tabfile,temp_string)) {
-		curstring.clear(); // needed when using istringstream::str(string) several times !
-		curstring.str(temp_string);
-
-		// gets the features of each element
-		if (found) {
-			for (int col=0; col < N_col; col++) e.setProperties(curstring,header_type[col]);
-			if(strstr(e.name.c_str(),ipname.c_str())) {
-				ips = e.s; //e.printProperties();
-				ipx = e.x;
-				ipy = e.y;
-				iptx = e.px*URAD;
-				ipty = e.py*URAD;
-			}
-		} else if (strstr(temp_string.c_str(),"K0L")) {  //searches for the beginning of the element list.
-			found = true;
-
-			// reads the title of each column
-			while(curstring.good()) { curstring >> headers[N_col]; if(headers[N_col]!="*") N_col++;}
-			if(VERBOSE) cout << N_col << " columns identified" << endl;
-
-			// identifies each column
-			for (int col=0; col< N_col; col++)	header_type[col] =  column_identification(headers[col]);
-			
-			getline(tabfile,temp_string); // skip one line
-		} // if(... "K0L")
-	} // while (!eof)
-
-	if (!found) cout << "\t ERROR ! IP not found." << endl;
-	tabfile.close();
-}
-
-double* H_BeamLine::getIPProperties() {
-	double* temp = new double[4];
-	temp[0] = ipx;
-	temp[1] = ipy;
-	temp[2] = iptx;
-	temp[3] = ipty;
-	return temp;
-}
-
-void H_BeamLine::fill(const string filename) {
-	fill(filename,1,"IP5");
-	return;
-}
-
-
-void H_BeamLine::fill(const string filename, const int dir, const string ipname) {
-	string headers[40];  // table of all column headers
-	int header_type[40]; // table of all column types
-	findIP(filename,ipname);
-	ifstream tabfile(filename.c_str());
-		if (! tabfile.is_open()) cout << "\t ERROR: I Can't open \"" << filename << "\"" << endl;
-	if(VERBOSE) {
-		cout<<"Using file : "<< filename <<" in the "<<((direction>0)?"positive":"negative")<<" direction."<<endl;
-		cout<<"IP was found at position : "<<ips<<endl<<endl;
-	}
-	bool found = false; // found = true when the beginning of the element list is reached
-	int type, N_col=0;
-	float previous_betax =0, previous_betay=0; // needed when direction ==1
-	float previous_dx =0, previous_dy=0; // needed when direction ==1
-	float previous_x =0, previous_y=0; // needed when direction ==1
-
-	string temp_string;
-	H_BeamLineParser e;
-	istringstream curstring;
-	H_OpticalElement *el = 0;
-	H_Aperture * ap = 0;
-
-
-	while (getline(tabfile,temp_string)) {
-		curstring.clear(); // needed when using several tims istringstream::str(string)
-		curstring.str(temp_string);
-
-        // gets the features of each element
-		if (found) {
-			// reads each column
-			for (int col=0; col < N_col; col++) {
-				e.setProperties(curstring,header_type[col]);
-			}
-			//e.printProperties();
-			
-			type =0; //init
-			if(e.k0l!=0) { if(strstr(e.name.c_str(),"MB.")) type = SDIPOLE; else type = RDIPOLE;} //all SBEND seems to be called MB.xxxxx.xx
-			else if(e.k1l!=0) type = (e.k1l>0)?HQUADRUPOLE:VQUADRUPOLE;
-			else if(e.hkick!=0) type = HKICKER;
-			else if(e.vkick!=0) type = VKICKER;
-			else if(strstr(e.name.c_str(),"DRIFT")) type=DRIFT;
-			else if((strstr(e.name.c_str(),"DFB"))||(strstr(e.name.c_str(),"TAS"))||(strstr(e.name.c_str(),"TAN"))||(strstr(e.name.c_str(),"TCL"))) type = RCOLLIMATOR;
-			else if(strstr(e.name.c_str(),ipname.c_str())) { type=IP; }
-			else type=MARKER;
-			
-			e.s = (e.s > ips) ? (e.s -ips - e.l)*(direction) : (e.s-ips)*(direction);
-			
-			el=0; //init
-			switch(type) {
-				case RDIPOLE:     { el = new H_RectangularDipole(e.name.c_str(),e.s,dir*e.k0l/e.l,e.l); } break;
-				case SDIPOLE:     { el = new H_SectorDipole(e.name.c_str(),e.s,dir*e.k0l/e.l,e.l); } break;
-				case VQUADRUPOLE: { el = new H_VerticalQuadrupole(e.name.c_str(),e.s,-(e.k1l/e.l),e.l); } break;
-				case HQUADRUPOLE: { el = new H_HorizontalQuadrupole(e.name.c_str(),e.s,-(e.k1l/e.l),e.l); } break;
-				case VKICKER:     { el = new H_VerticalKicker(e.name.c_str(),e.s,e.vkick,e.l); } break;
-				case HKICKER:     { el = new H_HorizontalKicker(e.name.c_str(),e.s,e.hkick,e.l); } break;
-				case RCOLLIMATOR: { el = new H_RectangularCollimator(e.name.c_str(),e.s,e.l); } break;
-				case DRIFT: {previous_betax = e.betx; previous_betay = e.bety; previous_dx = e.dx; previous_dy = e.dy; previous_x = e.x; previous_y = e.y;} break;
-				case IP: { el = new H_Marker(e.name.c_str(),e.s); } break;
-				default: break;
-			}
-
-			ap = 0; //init
-			if(e.aper_1 !=0 || e.aper_2 !=0 || e.aper_3 !=0 || e.aper_4 != 0) {
-				e.aper_1 *= URAD;
-				e.aper_2 *= URAD;
-				e.aper_3 *= URAD;
-				e.aper_4 *= URAD; // in [m] in the tables !
-
-				if(strstr(e.apertype.c_str(),"RECTELLIPSE")) ap = new H_RectEllipticAperture(e.aper_1,e.aper_2,e.aper_3,e.aper_4,0,0);
-				else if(strstr(e.apertype.c_str(),"CIRCLE")) ap = new H_CircularAperture(e.aper_1,0,0);
-				else if(strstr(e.apertype.c_str(),"RECTANGLE")) ap = new H_RectangularAperture(e.aper_1,e.aper_2,0,0);
-				else if(strstr(e.apertype.c_str(),"ELLIPSE")) ap = new H_EllipticAperture(e.aper_1,e.aper_2,0,0);
-			}
-
-			if(el!=0) {
-				if (direction<0) {
-					el->setBetaX(e.betx);
-					el->setBetaY(e.bety);
-					el->setDX(e.dx);
-					el->setDY(e.dy);
-					el->setRelX(e.x);
-					el->setRelY(e.y);
-				} else {
-					el->setBetaX(previous_betax);
-					el->setBetaY(previous_betay);
-					el->setDX(previous_dx);
-					el->setDY(previous_dy);
-					el->setRelX(previous_x);
-					el->setRelY(previous_y);
-				}
-				if(ap!=0) { 
-					el->setAperture(ap); 
-				//		delete ap; // ap deleted in H_AbstractBeamLine::~H_AbstractBeamLine
-				}
-	
-				/// Parses all the elements, but only keeps the ones from the IP till the desired length
-				if(e.s>=0 && e.s<beam_length) add(*el);
-
-			// delete el; // el deleted in H_AbstractBeamLine::~H_AbstractBeamLine
-			} // if(el!=0)
-		} // if (found)
-		else if(strstr(temp_string.c_str(),"K0L")) { // if (!found)
-		//searches for the beginning of the element list.
-			found = true;
-
-			// reads the title of each column
-			while(curstring.good()) { curstring >> headers[N_col]; if(headers[N_col]!="*") N_col++;}
-			if(VERBOSE) cout << N_col << " columns identified" << endl;
-
-			// identifies each column
-			for (int col=0; col< N_col; col++) {
-				header_type[col] =  column_identification(headers[col]);
-			}
-			getline(tabfile,temp_string);
-		} // if temp_string <-> "K0L"
-
-	} // while (!eof)
-	tabfile.close();
-}
-
Index: external/Hector/H_BeamLine.h
===================================================================
--- external/Hector/H_BeamLine.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#ifndef _H_BeamLine_
-#define _H_BeamLine_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_BeamLine.h
-/// \brief Class aiming at retrieving features of the real beam optical elements.
-
-// local #includes
-#include "H_AbstractBeamLine.h"
-
-// C++ #includes
-#include <string>
-using namespace std;
-
-// Caution : mad conventions for vertically(horizontally) focusing quadrupoles
-// are opposite to Wille's. See fill() for more details.
-
-/// Reads external files and retrieves features of the real beam optical elements.
-class H_BeamLine : public H_AbstractBeamLine {
-
-	public:
-	///     Constructors and destructor
-	//@{
-		H_BeamLine():H_AbstractBeamLine() {direction=1; ips=0; };
-		H_BeamLine(const H_BeamLine& );
-		H_BeamLine(const int, const float);
-		H_BeamLine& operator=(const H_BeamLine& );
-		~H_BeamLine() {return;};
-	//@
-		///     Finds the IP position (s) from the MAD table. Should be "IP5" or "IP1".
-		//@{
-		void findIP(const string);
-		void findIP(const string, const string);
-		//@}
-		///     Reader for the external MAD table
-		//@{
-		void fill(const string);
-		void fill(const string, const int, const string );
-		//@}
-		///     Returns the IP position (s)
-		double getIP() {return ips;};
-		///		Returns positions and angles of beam at IP
-		double* getIPProperties();
-
-	private:
-		int direction; // to or from the IP.
-		double ips; // s-position of the IP [m]
-		double ipx; // x-position of the IP [Âµm]
-		double ipy; // y-position of the IP [Âµm]
-		double iptx; // x-angle of momentum at IP [Âµrad]
-		double ipty; // y-angle of momentum at IP [Âµrad]
-};
-
-#endif
-
Index: external/Hector/H_BeamLineParser.cc
===================================================================
--- external/Hector/H_BeamLineParser.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,129 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_BeamLineParser.cc
-/// \brief Reader for madx tables
-///
-/// Notes : Vï¿œifier que tous les SBEND sont toujours appelï¿œ MB. Et seulement comme ï¿œ !
-/// Vï¿œifier qu'il n'y a pas de problï¿œe d'inversion H/V QUADRUPOLES
-/// no distinction between H and Vkickers ?
-/// The identification of the element is based on the values of k1l, k2l, hkick, vkick and on their name.
-/// x and y are put in m
-
-// c++ #includes
-#include <iostream>
-#include <fstream>
-#include <sstream>
-
-//local #includes
-#include "H_BeamLineParser.h"
-#include "H_Parameters.h"
-using namespace std;
-
-
-/// Identifies the column content from its header
-int column_identification(const string header) {
-	// identifies the column type from its name
-
-	     if (header=="NAME")    {return MADX_NAME; }
-	else if (header=="KEYWORD") {return MADX_KEYWORD; }
-	else if (header=="S")       {return MADX_S; }
-	else if (header=="L")       {return MADX_L; }
-	else if (header=="K0L")     {return MADX_K0L; }
-	else if (header=="K1L")     {return MADX_K1L;}
-	else if (header=="K2L")     {return MADX_K2L;}
-	else if (header=="K3L")     {return MADX_K3L;}
-	else if (header=="HKICK")   {return MADX_HKICK;}
-	else if (header=="VKICK")   {return MADX_VKICK;}
-	else if (header=="KICK")    {return MADX_KICK;}
-	else if (header=="BETX")    {return MADX_BETX;}
-	else if (header=="BETY")    {return MADX_BETY;}
-	else if (header=="ALFX")    {return MADX_ALFX;}
-	else if (header=="ALFY")    {return MADX_ALFY;}
-	else if (header=="MUX")     {return MADX_MUX;}
-	else if (header=="MUY")     {return MADX_MUY;}
-	else if (header=="DX")      {return MADX_DX;}
-	else if (header=="DY")      {return MADX_DY;}
-	else if (header=="DPX")     {return MADX_DPX;}
-	else if (header=="DPY")     {return MADX_DPY;}
-	else if (header=="X")       {return MADX_X;}
-	else if (header=="Y")       {return MADX_Y;}
-	else if (header=="PX")      {return MADX_PX;}
-	else if (header=="PY")      {return MADX_PY;}
-	else if (header=="APERTYPE") {return MADX_APERTYPE;}
-	else if (header=="APER_1")  {return MADX_APER_1;}
-	else if (header=="APER_2")  {return MADX_APER_2;}
-	else if (header=="APER_3")  {return MADX_APER_3;}
-	else if (header=="APER_4")  {return MADX_APER_4;}
-	else if (header=="PARENT")  {return MADX_PARENT;}
-	return MADX_UNKNOWN;
-}
-
-void H_BeamLineParser::init() {
-	name=""; 
-	apertype="";
-	keyword="";
-	parent="";
-	s=0;  l=0;  k0l=0;  k1l=0;  k2l=0;  k3l=0;  hkick=0;  vkick=0;  betx=0;
-	alfx=0;  mux=0;  dx=0;  dpx=0;  x=0;  px=0;  bety=0;  alfy=0;  muy=0;
-	dy=0;  dpy=0;  y=0;  py=0;  aper_1=0;  aper_2=0;  aper_3=0;  aper_4=0;
-}
-
-void H_BeamLineParser::setProperties(istream& input, const unsigned int col_type) {
-
-	switch(col_type) {
-		case   MADX_NAME:    input >> name; break;
-		case   MADX_KEYWORD: input >> keyword; break;
-		case   MADX_S:       input >> s; break;
-		case   MADX_L:       input >> l;   break;
-		case   MADX_K0L:     input >> k0l; break;
-		case   MADX_K1L :    input >> k1l; break;
-		case   MADX_K2L:     input >> k2l; break;
-		case   MADX_K3L:     input >> k3l; break;
-		case   MADX_HKICK:   input >> hkick; break;
-		case   MADX_VKICK:   input >> vkick; break;
-		case   MADX_BETX:    input >> betx; break;
-		case   MADX_ALFX:    input >> alfx; break;
-		case   MADX_MUX:     input >> mux; break;
-		case   MADX_DX:      input >> dx; break;
-		case   MADX_DPX:     input >> dpx; break;
-		case   MADX_X:       input >> x; x *=URAD; break;
-		case   MADX_PX:      input >> px; break;
-		case   MADX_BETY:    input >> bety; break;
-		case   MADX_ALFY:    input >> alfy; break;
-		case   MADX_MUY:     input >> muy; break;
-		case   MADX_DY:      input >> dy; break;
-		case   MADX_DPY:     input >> dpy; break;
-		case   MADX_Y:       input >> y; y*=URAD; break;
-		case   MADX_PY:      input >> py; break;
-		case   MADX_APERTYPE: input >> apertype; break;
-		case   MADX_APER_1:  input >> aper_1; break;
-		case   MADX_APER_2:  input >> aper_2; break;
-		case   MADX_APER_3:  input >> aper_3; break;
-		case   MADX_APER_4:  input >> aper_4; break;
- 		case   MADX_PARENT:  input >> parent; break;
-		default:break;
-	} // switch
-}
-
-
-void H_BeamLineParser::printProperties() const {
-//KEYWORD	NAME	PARENT	L	K0L	K1L	K2L	K3L	S	BETX	BETY	DX	DY	XC	YC	ALFX	ALFY	MUX	MUY	DPX	PXC	PYC
-	cout << " keyword = " << keyword;
-	cout << " name = " << name;
-	cout << " l = " << l;
-	cout << " k0l = " << k0l;
-	cout << " k1l = " << k1l;
-	cout << " k2l = " << k2l;
-	cout << " k3l = " << k3l;
-	cout << " s = " << s << endl;
-	cout << endl;
-}
Index: external/Hector/H_BeamLineParser.h
===================================================================
--- external/Hector/H_BeamLineParser.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,117 +1,0 @@
-#ifndef _H_BeamLineParser_
-#define _H_BeamLineParser_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_BeamLineParser.h
-/// \brief Reader for madx tables
-///
-/// Notes : Verifier que tous les SBEND sont toujours appeles MB. Et seulement comme ca !
-/// Verifier qu'il n'y a pas de probleme d'inversion H/V QUADRUPOLES
-/// no distinction between H and Vkickers ?
-/// The identification of the element is based on the values of k1l, k2l, hkick, vkick and on their name.
-
-// c++ #includes
-#include <iostream>
-#include <string>
-#include <fstream>
-#include <sstream>
-using namespace std;
-
-// local defines
-#define MADX_UNKNOWN 0
-#define MADX_NAME    1
-#define MADX_KEYWORD 2
-#define MADX_S       3
-#define MADX_L       4
-#define MADX_K0L     5
-#define MADX_K1L     6
-#define MADX_K2L     7
-#define MADX_K3L     8
-#define MADX_HKICK   9
-#define MADX_VKICK  10
-#define MADX_BETX   11
-#define MADX_ALFX   12
-#define MADX_MUX    13
-#define MADX_DX     14
-#define MADX_DPX    15
-#define MADX_X      16
-#define MADX_PX     17
-#define MADX_BETY   18
-#define MADX_ALFY   19
-#define MADX_MUY    20
-#define MADX_DY     21
-#define MADX_DPY    22
-#define MADX_Y      23
-#define MADX_PY     24
-#define MADX_APERTYPE 25
-#define MADX_APER_1 26
-#define MADX_APER_2 27
-#define MADX_APER_3 28
-#define MADX_APER_4 29
-#define MADX_KICK 30
-#define MADX_PARENT 31
-/* Apertures # parameters
-	CIRCLE 1
-	ELLIPSE	2
-	RECTANGLE	2
-	LHCSCREEN	3
-	MARGUERITE	3
-	RECTELLIPSE	4
-	RACETRACK	3
-*/
-
-extern int column_identification(const string );
-
-/// \brief Reader for madx tables to use in H_BeamLine
-///
-/// More info on http://project-mad9.web.cern.ch/project-mad9/mad/mad9/user/index.html
-class H_BeamLineParser {
-
-	public:
-	/// Constructor and destructor
-	//@{
-		H_BeamLineParser() {init();}
-		~H_BeamLineParser() {return;}
-	//@}
-		void init();
-		/// Retrieve the data from the line it reads, and sets the corresponding variable.
-		void setProperties(istream& , const unsigned int );
-		void printProperties() const;
-		string name, apertype, keyword, parent;
-		/// Optical element longitudinal (co-moving) coordinate.
-		double s;
-		/// Length of the element.
-		double l;
-	/// Magnetic field strength.
-	//@{
-		double k0l, k1l, k2l, k3l, hkick, vkick;
-	//@}
-	/// Phase (mu), \f$ \alpha \f$(alf) and \f$ \beta \f$(bet) functions, given by MAD.
-	//@{
-		double mux, muy, betx, alfx, bety, alfy;
-	//@}
-	/// Positions and their dispersion
-	//@{ 
-		double x, y, dx, dy;
-	//@}
-	/// Momentum and their dispersion
-	//@{
-		double px, py, dpx, dpy;
-	//@}
-	/// Aperture parameters
-	//@{
-		double aper_1, aper_2, aper_3, aper_4;
-	//@}
-};
-
-#endif
Index: external/Hector/H_BeamParticle.cc
===================================================================
--- external/Hector/H_BeamParticle.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,596 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_BeamParticle.cc
-/// \brief Class aiming at simulating a particle in the LHC beam
-
-// from IP to RP, with emission of a photon of defined energy and Q.
-// Units : angles [rad], distances [m], energies [GeV], c=[1].
-// !!! no comment statement at the end of a #define line !!!
-
-// c++ #includes
-#include <iostream>
-#include <iomanip>
-#include <vector>
-#include <string>
-#include <cmath>
-
-// ROOT #includes
-#include "H_Parameters.h"
-#include "TRandom.h"
-//#include "TView.h"
-//#include "TPolyLine3D.h"
-#ifdef _include_pythia_
-#include "TPythia6.h"
-#include "TRandom.h"
-#endif
-// local #includes
-#include "H_OpticalElement.h"
-#include "H_BeamParticle.h"
-#include "H_Drift.h"
-
-using namespace std;
-
-void H_BeamParticle::init() {
-	mp = MP;
-	qp = QP;
-        fx = 0;
-        fy = 0;
-        thx = 0;
-        thy = 0;
-        fs = 0;
-        energy = BE;
-        hasstopped = false;
-        hasemitted = false;
-	isphysical = true;
-	addPosition(fx,thx,fy,thy,fs);
-	stop_position = new TVectorD(LENGTH_VEC);
-	for (int i=0; i<LENGTH_VEC; i++) (*stop_position)[i] = -1;
-	stop_element = 0;
-}
-
-H_BeamParticle::H_BeamParticle() {
-	init();
-}
-
-H_BeamParticle::H_BeamParticle(const H_BeamParticle& p) {
-	mp = p.mp;
-	qp = p.qp;
-	fx = p.fx;
-	fy = p.fy;
-	thx = p.thx;
-	thy = p.thy;
-	fs = p.fs;
-	energy = p.energy;
-	hasstopped = p.hasstopped;
-	hasemitted = p.hasemitted;
-	isphysical = p.isphysical;
-	stop_position = new TVectorD(*(p.stop_position));
-	if(p.hasstopped) stop_element = new H_OpticalElement(*(p.stop_element)); 
-	positions = p.positions;
-}
-
-H_BeamParticle::H_BeamParticle(const double mass, const double charge) {
-	init();
-	mp = mass;
-	qp = (mass==0) ? 0 : charge;
-	/// rejects particles with mass = 0 and charge != 0
-}
-
-H_BeamParticle& H_BeamParticle::operator=(const H_BeamParticle& p) {
-	if(this==&p) return *this;
-	mp = p.mp;
-	qp = p.qp;
-        fx = p.fx;
-        fy = p.fy;
-        thx = p.thx;
-        thy = p.thy;
-        fs = p.fs;
-        energy = p.energy;
-        hasstopped = p.hasstopped;
-        hasemitted = p.hasemitted;
-	isphysical = p.isphysical;
-        stop_position = new TVectorD(*(p.stop_position));
-	if(p.hasstopped) stop_element = new H_OpticalElement(*(p.stop_element));
-        positions = p.positions;
-	return *this;
-}
-
-bool H_BeamParticle::stopped(const H_AbstractBeamLine * beamline) {
-	vector<TVectorD>::const_iterator position_i;
-	for(position_i = positions.begin(); position_i < positions.end()-1; position_i++) {
-		const unsigned int pos = position_i-positions.begin();
-		if(beamline->getElement(pos)->getAperture()->getType()!=NONE) {
-			bool has_passed_entrance = beamline->getElement(pos)->isInside((*position_i)[INDEX_X],(*position_i)[INDEX_Y]);
-			bool has_passed_exit     = beamline->getElement(pos)->isInside((*(position_i+1))[INDEX_X],(*(position_i+1))[INDEX_Y]); 
-			if(!(has_passed_entrance && has_passed_exit)) {
-	//			cout << "p =" << (*position_i)[INDEX_X] << "; el=" << beamline->getElement(pos)->getX()<<endl;
-	//			beamline->getElement(position_i-positions.begin())->printProperties();
-				if(VERBOSE) cout<<"particle stopped at "<<(beamline->getElement(pos))->getName();
-				if(VERBOSE) cout<<" (s = "<<(*position_i)[4] << ")" << endl;
-				if(VERBOSE && !has_passed_exit) cout << "Particle stopped inside the element" << endl;
-				hasstopped=true;
-				stop_element = const_cast<H_OpticalElement*>(beamline->getElement(pos));
-				*stop_position = *position_i;
-				return hasstopped;
-			} // if
-//			else cout << "outside aperture " << endl;
-		} // if
-	} // for
-	return hasstopped;
-}
-
-void H_BeamParticle::addPosition(const double x, const double tx, const double y, const double ty, const double s) {
-			// [x] = [y] = m ; [tx] = [ty] = rad; [s] = m
-		double xys[LENGTH_VEC];
-		xys[INDEX_X]=x;
-		xys[INDEX_TX]=tx;
-		xys[INDEX_Y]=y;
-		xys[INDEX_TY]=ty;
-		xys[INDEX_S]=s;
-		
-		TVectorD temp_vec(LENGTH_VEC,xys);
-		positions.push_back(temp_vec);
-}
-
-void H_BeamParticle::smearPos(const double dx,const double dy, TRandom* r) {
-  // the beam is centered on (fx,fy) at IP
-        fx = r->Gaus(fx,dx);
-        fy = r->Gaus(fy,dy);
-        positions.clear();
-        addPosition(fx,thx,fy,thy,fs);
-        return;
-}
-
-void H_BeamParticle::smearAng(const double tx, const double ty, TRandom* r) {
-  // the beam transverse direction is centered on (thx,thy) at IP
-        thx = r->Gaus(thx,tx);
-        thy = r->Gaus(thy,ty);
-	positions.clear();
-	addPosition(fx,thx,fy,thy,fs);
-	return;
-}
-
-void H_BeamParticle::smearE(const double erre, TRandom* r) {
-	energy = r->Gaus(energy,erre);
-	return;
-}
-
-void H_BeamParticle::smearS(const double errs, TRandom* r) {
-        fs= r->Gaus(fs,errs);
-	positions.clear();
-	addPosition(fx,thx,fy,thy,fs);
-        return;
-}
-
-void H_BeamParticle::set4Momentum(const double px, const double py, const double pz, const double ene) {
-	/// @param px, py, pz, ene is \f$ (\vec p , E) [GeV]\f$ 
-	///
-	/// Clears the H_BeamParticle::positions vector.
-	positions.clear();
-	if(pz==0) {
-		cout<<" ERROR in H_BeamParticle::set4Momentum : no momentum in the beamline direction !"<<endl;
-		return;
-	}
-        thx = thx + URAD*atan(px/pz);
-        thy = thy + URAD*atan(py/pz);
-        energy = ene;
-	positions.clear();
-        addPosition(fx,thx,fy,thy,fs);
-	return;
-}
-
-void H_BeamParticle::setE(const double ene) {
-	energy = ene;
-	return;
-}
-
-void H_BeamParticle::setPosition(const double x, const double y, const double tx, const double ty, const double s) {
-	/// @param x, y are the transverse positions in \f$ \mu \f$ m
-	/// @param tx, ty are the angles in \f$ \mu \f$ rad
-	/// @param s is the longitudinal coordinate in m
-	// clear positions and sets the initial one.
-		fx=x;
-		fy=y;
-		thx=tx;
-		thy=ty;
-		fs = s;
-		positions.clear();
-		addPosition(fx,thx,fy,thy,s);
-
-	return;
-}
-
-const H_OpticalElement* H_BeamParticle::getStoppingElement() const{
-	if(hasstopped) return stop_element;
-	else { H_OpticalElement * dummy_el = new H_Drift("",0,0); return dummy_el;}
-}
-
-void H_BeamParticle::emitGamma(const double gee, const double gq2) {
-	emitGamma(gee,gq2,0,2*PI);
-	return;
-}
-
-void H_BeamParticle::emitGamma(const double gee, const double gq2, const double phimin, const double phimax) {
-	/// @param gee = \f$ E_{\gamma} \f$ is the photon energy
-	/// @param gq2 = Q < 0 is virtuality of photon \f$ Q^{2} = E^{2}-\vec{k}^{2} \f$
-	/// @param phimin : lower bound for \f$ phi \f$
-	/// @param phimax : higher bound for \f$ phi \f$
-
-	if(gq2==0) { 
-		if(VERBOSE) cout<<"No virtuality : only energy has changed"<<endl;
-		setE(energy-gee);
-	    return;	
-	}
-
-	double m1 = mp;
-
-	double e1 = energy , e2 = energy - gee; // particle energy : before (1) / after (2)
-
-	double p1 = sqrt(pow(e1,2) - pow(m1,2)), p2 = sqrt(pow(e2,2) - pow(m1,2)); // particle momentum : before (1) / after (2)
-	double q2min = pow(gee,2) - pow(p1+p2,2); // lower bound from kinematics E^2 - (p1 + p2)^2
-	double q2max = -2 * pow(m1*gee/(p1+p2),2) * (1 + (pow(e1,2) + pow(e2,2) -pow(m1,2))/(e1*e2 + p1*p2) );
-			// upper bound from kinematics ; E^2 - (p1-p2)^2; is bad for numerical computations
-
-
-	// if q2min < q2 < q2max is NOT true, there will be mathematical problems (like cos(eta) > 1).
-	// so if q2 > q2max, we force q2 = q2max (-> cos(eta) = 1)
-	// and if q2 < q2min, we force q2 = q2min (-> cos(eta) = 1)
-	// BUT the user knows something was wrong with the value of "H_BeamParticle::isphysical"
-	const double q2 = (gq2 > q2max ) ? q2max : (gq2 < q2min) ? q2min : gq2;
-	
-	if( (gq2>q2max) || (gq2<q2min)) {
-		if(VERBOSE) cout<<"Non physical particle ! Q2 (" << q2 << ") and E ("<<gee << ") are not compatible." << endl; 
-		isphysical = false; 
-	}
-
-	if(hasemitted) { cout<<"particle has already emitted at least one gamma !"<<endl;}
-	hasemitted = true;
-	energy = energy - gee;
-	// gkk is k
-	double gkk = sqrt(pow(gee,2)-q2);
-	// eta is the angle between gamma and initial direction of the gamma-emitting particle
-        // ceta = cos(eta) and seta = sin(eta)
-
-	double ceta = sqrt( pow(mp/p1,2) + 1  ) * sqrt( q2/pow(gkk,2) + 1 ) - q2/(2*p1*gkk);
-	double seta = sqrt(1 - ceta*ceta); 
-	// theta is the angle between particle and beam
-        double theta = URAD*atan(seta/(BE/gkk - ceta));
-        double phi = phimin + gRandom->Uniform(phimax-phimin);
-        thx = thx + theta*cos(phi);
-        thy = thy - theta*sin(phi);
-
-	// caution : emitting a photon erases all known positions !
-	positions.clear();
-	addPosition(fx,thx,fy,thy,fs);
-	return;
-}
-
-void H_BeamParticle::doInelastic() {
-#ifdef _include_pythia_
-//	if(!gROOT->GetClass("TPythia6")) {
-//		gROOT->Reset();
-//	        gSystem->Load("libPythia6");
-//	        gSystem->Load("libEG");
-//	        gSystem->Load("libEGPythia6");
-//	}
-	
-	TPythia6 gen;
-	// select AB -> AX process 
-        gen.SetMSEL(0);
-        gen.SetMSUB(93,1);
-	// no showers/decays
-	gen.SetMSTP(111,0);
-	// no printouts
-	gen.SetMSTP(122,0);
-	gen.SetMSTU(12,0);
-	// generator initialization
-        gen.Initialize("CMS","p","p",14000);
-	// event generation
-	gen.GenerateEvent();
-	// list particles
-//	gen.Pylist(1);
-	thx = thx + URAD*atan(gen.GetP(5,1)/gen.GetP(5,3));
-	thy = thy + URAD*atan(gen.GetP(5,2)/gen.GetP(5,3));
-	energy = gen.GetP(5,4);
-	positions.clear();
-	addPosition(fx,thx,fy,thy,fs);
-#endif
-	return;
-}
-
-void H_BeamParticle::printProperties() const {
-	cout << " M   = " << getM()  << "GeV ";
-	cout << " Q   = " << getQ()  << "e";
-	cout << " fx  = " << getX()  << "m   ";
- 	cout << " fy  = " << getY()  << "m   ";
-	cout << " thx = " << getTX() << "rad ";
-	cout << " thy = " << getTY() << "rad ";
-	cout << endl;
-	return;
-}
-
-/// The phase space vector is (x,x',y,y',E)
-/// [x] = [y] = meters
-/// [x'] = [y'] = 1  with x' = dx/ds = tan (thetaX)
-/// [E] = GeV
-const TMatrixD * H_BeamParticle::getV() const {
-	double vec[MDIM] = {fx/URAD, tan(thx/URAD), fy/URAD, tan(thy/URAD),energy};
-	TMatrixD * mat = new TMatrixD(1,MDIM,vec);
-	return mat;
-}	
-
-void H_BeamParticle::printV() const {
-	TMatrixD X(*getV());
-	cout << " x  = " << (X.GetMatrixArray())[0] << "m ";
-	cout << " x' = " << (X.GetMatrixArray())[1] << "  ";
-	cout << " y  = " << (X.GetMatrixArray())[2] << "m ";
-	cout << " y' = " << (X.GetMatrixArray())[3] << "  ";
-	cout << endl;
-	return;
-}
-
-void H_BeamParticle::propagate(const double position) {
-	/// @param position is the s coordinate in m to reach
-	/// Does not propagate if position is in the middle of an otics element of the beamline.
-        vector<TVectorD>::const_iterator position_i = positions.begin();
-	double l = 0.;
-	if(position != fs) { // avoid repeating the computation if already done at this position
-		if(position == (*position_i)[INDEX_S]) {
-			fs = position;
-			fx = (*position_i)[INDEX_X];
-			fy = (*position_i)[INDEX_Y];
-			thx= (*position_i)[INDEX_TX];
-			thy= (*position_i)[INDEX_TY]; 
-			return;
-		} else 
-        	for(position_i = positions.begin(); position_i < positions.end(); position_i++) {
-			if((*position_i)[INDEX_S]>=position) {
-				if(position_i==positions.begin()) {
-					if(VERBOSE) cout<<"ERROR : non reachable value"<<endl;
-					return;
-				}
-				l = (*position_i)[INDEX_S] - (*(position_i-1))[INDEX_S];
-				if(l==0) {
-					if(VERBOSE) cout<<"WARNING : no luck in choosing position, no propagation done"<<endl;
-					return;
-				}
-				fs = position;
-				fx = (*(position_i-1))[INDEX_X] + (position-(*(position_i-1))[INDEX_S])*((*position_i)[INDEX_X] - (*(position_i-1))[INDEX_X])/l;
-				fy = (*(position_i-1))[INDEX_Y] + (position-(*(position_i-1))[INDEX_S])*((*position_i)[INDEX_Y] - (*(position_i-1))[INDEX_Y])/l;
-				thx = (*(position_i-1))[INDEX_TX];
-				thy = (*(position_i-1))[INDEX_TY];
-				return;
-			}
-		}
-		position_i = positions.begin();
-		cout << "Desired position is : " << position << " & positions.begin() is " << (*position_i)[INDEX_S] << endl;
-		cout<<"ERROR : position not reachable"<<endl;	
-		return;
-	}
-}
-
-/// Caution : do not use this method !!!
-void H_BeamParticle::propagate(const H_AbstractBeamLine * beam, const H_OpticalElement * element) {
-	TMatrixD X(*getV());
-	X *= *(beam->getPartialMatrix(element));
-	fx = URAD*(X.GetMatrixArray())[0];
-	thx = URAD*atan((X.GetMatrixArray())[1]);
-	fy = URAD*(X.GetMatrixArray())[2];
-	thy = URAD*atan((X.GetMatrixArray())[3]);
-	return;
-}
-
-void H_BeamParticle::propagate(const H_AbstractBeamLine * beam, const string el_name) {
-	propagate(beam->getElement(el_name)->getS());
-	return;
-}
-
-void H_BeamParticle::propagate(const H_AbstractBeamLine * beam) {
-	TMatrixD X(*getV());
-	X  *= *(beam->getBeamMatrix());
-	fx  = URAD*(X.GetMatrixArray())[0];
-	thx = URAD*atan((X.GetMatrixArray())[1]);
-	fy  = URAD*(X.GetMatrixArray())[2];
-	thy = URAD*atan((X.GetMatrixArray())[3]);
-	return;
-}
-
-void H_BeamParticle::showPositions() const{
-	vector<TVectorD>::const_iterator position_i;
-	TVectorD temp_vec(LENGTH_VEC);
-
-	for(position_i = positions.begin(); position_i < positions.end(); position_i++) {
-		cout << "Vector (x,y,s) = (" << (*position_i)[INDEX_X] << ", " << (*position_i)[INDEX_Y] << ", " << (*position_i)[INDEX_S] << "). " << endl;
-	}
-	return ;
-}
-/*
-TGraph * H_BeamParticle::getPath(const int x_or_y, const int color) const{
-        /// @param x_or_y = 0(1) draws the x(y) component;
-
-        const int N = (int) positions.size();
-	int mycolor = color;
-        if(N<2) cout<<"particle positions not calculated : please run computePath"<<endl; 
-        double * s = new double[N], * graph = new double[N];
-
-        int index;
-        if(x_or_y==0) {index = INDEX_X;} else {index = INDEX_Y;}
-
-        vector<TVectorD>::const_iterator position_i;
-        for(position_i = positions.begin(); position_i < positions.end(); position_i++) {
-                graph[(int)(position_i-positions.begin())] = (*position_i)[index];
-                s[(int)(position_i-positions.begin())] = (*position_i)[INDEX_S];
-        }
-
-        TGraph * ppath = new TGraph(N,s,graph);
-        ppath->SetLineColor(mycolor);
-	delete [] s;
-	delete [] graph;
-        return ppath;
-}
-
-TPolyLine3D *  H_BeamParticle::getPath3D(const H_AbstractBeamLine * beam, const bool isfirst, const int color, const int side) const{
-        const int N = (int) positions.size();
-	int mycolor = color;
-        if(N<2) cout<<"WARNING : particle positions not calculated. Run computePath"<<endl;
-        double * s = new double[N], * graphx = new double[N], * graphy = new double[N];
-	int direction = (side<0)?-1:1;
-
-
-        vector<TVectorD>::const_iterator position_i;
-        for(position_i = positions.begin(); position_i < positions.end(); position_i++) {
-                graphx[(int)(position_i-positions.begin())] = (*position_i)[INDEX_X];
-                graphy[(int)(position_i-positions.begin())] = (*position_i)[INDEX_Y];
-                s[(int)(position_i-positions.begin())] = (*position_i)[INDEX_S]*1000*direction;
-        }
-
-        float coi[3] = {beam->getLength()*(-1000),-10000,-5000};
-        float cof[3] = {beam->getLength()*1000,10000,5000};
-        TView *view = TView::CreateView(11);
-        view->SetRange(coi[0],coi[1],coi[2],cof[0],cof[1],cof[2]);
-        TPolyLine3D* ppath = new TPolyLine3D(N,s,graphx,graphy);
-	ppath->SetLineColor(mycolor);
-
-        if(isfirst) {
-                ppath->Draw();
-                view->ShowAxis();
-        } else {
-                ppath->Draw("same");
-        }
-
-        delete [] s;
-        delete [] graphx;
-        delete [] graphy;
-        return ppath;
-} // getPath3D
-*/
-void H_BeamParticle::computePath(const H_AbstractBeamLine * beam) {
-	computePath(beam,true);
-}
-
-// should be removed later, to keep only computePath(const H_AbstractBeamLine & , const bool)
-void H_BeamParticle::computePath(const H_AbstractBeamLine * beam, const bool NonLinear) {
-	TMatrixD temp_mat(MDIM,MDIM);
-	double temp_x, temp_y, temp_s, temp_tx, temp_ty;
-
-	temp_x = (positions.front())[INDEX_X];
-        temp_tx = (positions.front())[INDEX_TX];
-        temp_y = (positions.front())[INDEX_Y];
-        temp_ty = (positions.front())[INDEX_TY];
-        temp_s = (positions.front())[INDEX_S];
-
-		double vec[MDIM] = {temp_x/URAD, tan(temp_tx/URAD), temp_y/URAD, tan(temp_ty/URAD),energy,1};
-
-		extern bool relative_energy;
-		if(relative_energy) {
-        	vec[4] = energy-BE;
-		} else {
-        	vec[4] = energy;
-		}
-
-	TMatrixD mat(1,MDIM,vec);
-
-	const int N =beam->getNumberOfElements();
-	double xys[LENGTH_VEC];
-
-	double energy_loss = NonLinear?BE-energy:0;
-
-	for (int i=0; i<N; i++) {
-		const unsigned pos = i;
-		mat[0][0] = mat[0][0] - beam->getElement(pos)->getX();
-		mat[0][1] = mat[0][1] - tan(beam->getElement(pos)->getTX()/URAD)*URAD;
-		mat[0][2] = mat[0][2] - beam->getElement(pos)->getY();
-		mat[0][3] = mat[0][3] - tan(beam->getElement(pos)->getTY()/URAD)*URAD;
-		mat *= beam->getElement(pos)->getMatrix(energy_loss,mp,qp);
-		mat[0][0] = mat[0][0] + beam->getElement(pos)->getX();
-		mat[0][1] = mat[0][1] + tan(beam->getElement(pos)->getTX()/URAD)*URAD;
-		mat[0][2] = mat[0][2] + beam->getElement(pos)->getY();
-		mat[0][3] = mat[0][3] + tan(beam->getElement(pos)->getTY()/URAD)*URAD;
-                xys[0] = mat.GetMatrixArray()[0]*URAD;
-                xys[1] = atan(mat.GetMatrixArray()[1])*URAD;
-                xys[2] = mat.GetMatrixArray()[2]*URAD;
-                xys[3] = atan(mat.GetMatrixArray()[3])*URAD;
-                xys[4] = beam->getElement(pos)->getS()+beam->getElement(pos)->getLength();
-                addPosition(xys[0],xys[1],xys[2],xys[3],xys[4]);
-                fx = xys[0];
-                fy = xys[2];
-                thx = xys[1];
-                thy = xys[3];
-        }
-}
-
-void H_BeamParticle::computePath(const H_AbstractBeamLine & beam, const bool NonLinear) {
-	TMatrixD temp_mat(MDIM,MDIM);
-	double temp_x, temp_y, temp_s, temp_tx, temp_ty;
-
-	temp_x = (positions.front())[INDEX_X];
-        temp_tx = (positions.front())[INDEX_TX];
-        temp_y = (positions.front())[INDEX_Y];
-        temp_ty = (positions.front())[INDEX_TY];
-        temp_s = (positions.front())[INDEX_S];
-
-		double vec[MDIM] = {temp_x/URAD, tan(temp_tx/URAD), temp_y/URAD, tan(temp_ty/URAD),energy,1};
-
-		extern bool relative_energy;
-		if(relative_energy) {
-        	vec[4] = energy-BE;
-		} else {
-        	vec[4] = energy;
-		}
-
-	TMatrixD mat(1,MDIM,vec);
-
-	const int N =beam.getNumberOfElements();
-	double xys[LENGTH_VEC];
-
-	double energy_loss = NonLinear?BE-energy:0;
-
-	for (int i=0; i<N; i++) {
-		const unsigned pos = i;
-		mat[0][0] = mat[0][0] - beam.getElement(pos)->getX();
-		mat[0][1] = mat[0][1] - tan(beam.getElement(pos)->getTX());
-		mat[0][2] = mat[0][2] - beam.getElement(pos)->getY();
-		mat[0][3] = mat[0][3] - tan(beam.getElement(pos)->getTY());
-		mat *= beam.getElement(pos)->getMatrix(energy_loss,mp,qp);
-		mat[0][0] = mat[0][0] + beam.getElement(pos)->getX();
-		mat[0][1] = mat[0][1] + tan(beam.getElement(pos)->getTX());
-		mat[0][2] = mat[0][2] + beam.getElement(pos)->getY();
-		mat[0][3] = mat[0][3] + tan(beam.getElement(pos)->getTY());
-                xys[0] = mat.GetMatrixArray()[0]*URAD;
-                xys[1] = atan(mat.GetMatrixArray()[1])*URAD;
-                xys[2] = mat.GetMatrixArray()[2]*URAD;
-                xys[3] = atan(mat.GetMatrixArray()[3])*URAD;
-                xys[4] = beam.getElement(pos)->getS()+beam.getElement(pos)->getLength();
-                addPosition(xys[0],xys[1],xys[2],xys[3],xys[4]);
-                fx = xys[0];
-                fy = xys[2];
-                thx = xys[1];
-                thy = xys[3];
-        }
-}
-
-void H_BeamParticle::resetPath() {
-	double temp_x, temp_y, temp_s, temp_tx, temp_ty;
-
-	temp_x = (positions.front())[INDEX_X];
-	temp_tx = (positions.front())[INDEX_TX];
-	temp_y = (positions.front())[INDEX_Y];
-	temp_ty = (positions.front())[INDEX_TY];
-	temp_s = (positions.front())[INDEX_S];
-	positions.clear();
-	addPosition(temp_x,temp_tx,temp_y,temp_ty,temp_s);
-}
-
-const TVectorD * H_BeamParticle::getPosition(const int element_position) const {
- 	const int N = (element_position<0)?0:(( ((unsigned int) element_position)>positions.size()-1)?positions.size()-1:element_position);
- 	return &(*(positions.begin()+N));// same as "return &positions[N];", but more efficient
-}
Index: external/Hector/H_BeamParticle.h
===================================================================
--- external/Hector/H_BeamParticle.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,179 +1,0 @@
-#ifndef _H_BeamParticle_
-#define _H_BeamParticle_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_BeamParticle.h
-/// \brief Class aiming at simulating a particle in the beamline
-
-// from IP to RP, with emission of a photon of defined energy and Q.
-// Units : angles [rad], distances [m], energies [GeV], masses [GeV], c=[1].
-// !!! no comment statement at the end of a #define line !!!
-
-// c++ #includes
-#include <vector>
-
-// ROOT #includes
-#include "TMatrixD.h"
-#include "TVectorD.h"
-//#include "TPolyLine3D.h"
-#include "TRandom.h"
-
-// local #includes
-#include "H_Parameters.h"
-#include "H_AbstractBeamLine.h"
-#include "H_OpticalElement.h"
-
-using namespace std;
-
-// local defines
-#define LENGTH_VEC 5
-#define INDEX_X 0
-#define INDEX_TX 1
-#define INDEX_Y 2
-#define INDEX_TY 3
-#define INDEX_S 4
-// (x,theta_x,y,theta_y,s)
-
-/// Defines a particle from the beam and its transport through the beamline
-class H_BeamParticle {
-
-	public:
-		void init();
-		/// Constructors and Destructor
-		//@{
-		H_BeamParticle();
-		H_BeamParticle(const H_BeamParticle&);
-		H_BeamParticle(const double, const double);
-		H_BeamParticle& operator=(const H_BeamParticle&);
-		~H_BeamParticle() {delete stop_position; if(!stop_element) delete stop_element; positions.clear(); return; }
-		//@}
-		/// Smears the (x,y) coordinates of the particle [\f$ \mu m \f$]
-		void smearPos(const double dx=SX,const double dy=SY, TRandom* r=gRandom);
-		/// Smears the (x,y) angular coordinates of the particle [\f$ \mu rad \f$]
-		void smearAng(const double tx=STX, const double ty=STY, TRandom* r=gRandom);
-		/// Smears the Energy of the particle [GeV]
-		void smearE(const double erre=SBE, TRandom* r=gRandom);
-		/// Smears the longitudinal position of the particle [\f$ \mu m \f$]
-		void smearS(const double errs=SS, TRandom* r=gRandom);
-		/// Sets the energy [GeV].
-		void setE(const double);
-		/// Sets the particle 4-momentum \f$ P^\mu \f$
-		void set4Momentum(const double, const double, const double, const double);	
-		/// Clears H_BeamParticle::positions and sets the initial one.
-		void setPosition(const double , const double , const double , const double , const double );
-		/// Returns the particle mass [GeV]
-		double getM() const {return mp;};
-		/// Returns the particle charge [e]
-		double getQ() const {return qp;};
-		/// Returns the current x coordinate [\f$ \mu \f$m]
-		double getX() const {return fx;};
-		/// Returns the current y coordinate [\f$ \mu \f$m]
-		double getY() const {return fy;};
-		/// Returns the current s coordinate [m]
-		inline double getS() const {return fs;};
-		/// Returns the current \f$ \theta_x \f$ angular coordinate [\f$ \mu \f$rad]
-		inline double getTX() const {return thx;};
-		/// Returns the current \f$ \theta_y \f$ angular coordinate [\f$ \mu \f$rad]
-		inline double getTY() const {return thy;};
-		/// Returns the current particle energy [GeV]
-		inline double getE() const {return energy;};
-		/// Returns all the positions 
-		vector<TVectorD> getPositions() const {return positions;};
-		bool isPhysical() const {return isphysical;};
-		/// \brief Simulates the emission of a photon in a random direction
-		///
-	        /// For \f$ p_{1} \rightarrow p_{2} \gamma \f$, kinematics imposes that
-	        /// \f$ Q^{2} = E^{2}_{\gamma} -p^{2}_{1} -p^{2}_{2} + 2p_{1}p_{2} cos(\theta)  \f$ where \f$ \theta \f$ is the particle scattering angle and \f$ p_{i} = \|\vec{p_{i}}\| \f$. <BR>
-        	/// So, \f$ Q^{2}_{min} = E^{2}_{\gamma} - (p_{1}+p_{2})^{2} \f$ and \f$ Q^{2}_{max} = E^{2}_{\gamma} - (p_{1}-p_{2})^{2} \f$.<BR>
-	        /// As \f$ E^{2}_{\gamma} - (p_{1}-p_{2})^{2} \f$ could be numerically instable, we use here another form of this formula : <BR>
-        	/// \f$ Q^{2}_{max} = -2 * \big( \frac{M_{p} E_{\gamma}}{p_{1}+p_{2}} \big) \big[ 1 + \frac{E^{2}_{1} + E^{2}_{2} - M^{2}_{p} }{ E_{1} E_{2} + p_{1} p_{2}} \big]    \f$
-		//@{
-		void emitGamma(const double, const double, const double, const double);
-		void emitGamma(const double, const double);
-		//@}
-                /// uses Pythia to generate some inelastic pp->pX collision as background
-		void doInelastic();
-		/// \brief Propagates the particule across the beamline until the s coordinate is reached
-		///
-		/// Caution : "computePath" should be used before any "propagate" call <BR>
-		/// Caution : "stopped" is not included in "propagate" : please run it afterward if needed 
-		void propagate(const double ) ;
-		/// Propagates the particle accross the beamline until a given element
-		void propagate(const H_AbstractBeamLine *, const H_OpticalElement *);
-		/// Propagates the particle accross the beamline until a given element
-		void propagate(const H_AbstractBeamLine *, const string);
-		/// Propagates the particle until the end of the beamline
-		void propagate(const H_AbstractBeamLine *);
-		/// Returns the phase vector of the particle
-		const TMatrixD * getV() const;
-		/// Returns the current phase vector of the particle (in H_BeamParticle::positions)
-		const TVectorD * getPosition(const int ) const;
-		/// Prints the properties of the particle
-		void printProperties() const;
-		/// Prints the phase vector of the particle
-		void printV() const;
-		/// Returns the element where the particle has been stopped
-		const H_OpticalElement * getStoppingElement() const;
-		/// Checks if the particle has been stopped in any element of the beamline
-		bool stopped(const H_AbstractBeamLine *);
-		/// Returns the StopPosition vector
-		inline const TVectorD * getStopPosition() const { return stop_position; };
-		// returns (-1,-1,-1,-1,-1) if not stopped (and then hasstopped is false)
-		/// Shows all the vectors \f$ (x, \theta_x, y, \theta_y ,s) \f$ in H_BeamParticle::positions
-		void showPositions() const; 
-		/// Returns the particle path in the beamline
-		////TGraph * getPath(const int , const int ) const;
-		/// Draws the particle path in the beamline in 3D
-		////TPolyLine3D * getPath3D(const H_AbstractBeamLine *, const bool, const int, const int) const;
-		/// Computes the position of the particle at the end of each element of the beam, without non linear effects
-		void computePath(const H_AbstractBeamLine *);
-		/// Computes the position of the particle at the end of each element of the beam.
-		void computePath(const H_AbstractBeamLine *, const bool);
-		/// Computes the position of the particle at the end of each element of the beam.
-		void computePath(const H_AbstractBeamLine &, const bool);
-		/// Clears H_BeamParticle::positions but keeps the initial vector.
-		void resetPath();
-
-	private:
-		/// Particle mass [GeV]
-		double mp;
-		/// Particle charge [e]
-		double qp;
-		/// Longitudinal co-moving coordinate [m]
-		double fs;
-		/// Transverse (horizontal) coordinate [m]
-		double fx;
-		/// Transverse (vertical) coordinate [m]
-		double fy;
-		/// Direction of the 3-momentum in the horizontal plane [rad]
-		double thx;
-		/// Direction of the 3-momentum in the vertical plane [rad]
-		double thy;
-		/// Kinetic energy of the particle [GeV]
-		double energy;
-		/// True if the particle has stopped (i.e. : if the particle transverse position has been out of any optics element aperture). <BR> See H_BeamParticle::stopped method. <BR>Default = false.
-		bool hasstopped;
-		/// True if the particle has lost some (E,Q), i.e. if H_BeamParticle::emitGamma was used. Default = false.
-		bool hasemitted;
-		/// False if the particle has emitted a photon with impossible (E,Q). Default = true.
-		bool isphysical;
-		/// Vector (x,tx,y,ty,s) where the particle has stopped.
-		TVectorD * stop_position; 
-		/// Element of the beamline (H_OpticalElement) where the particle has stopped. 
-		H_OpticalElement * stop_element;
-		/// List of (x,tx,y,ty,s) vectors, after each optical element of the beam
-		vector<TVectorD> positions; // vector (x,tx,y,ty,s) after each optical element of the beam ([m],[rad],[m],[rad],[m])
-		/// Adds a new vector (x,tx,y,ty,s) at the end of H_BeamParticle::positions
-  		void addPosition(const double , const double , const double , const double , const double );
-};
-#endif
Index: external/Hector/H_CircularAperture.cc
===================================================================
--- external/Hector/H_CircularAperture.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,36 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_CircularAperture.cc
-/// \brief Defines the circular aperture of beamline elements.
-
-// C++ #includes
-#include <iostream>
-
-// C #includes
-#include <cmath> // needed for fabs and log
-
-// local #includes
-#include "H_CircularAperture.h"
-using namespace std;
-
-/// Circular apertures
-H_CircularAperture::H_CircularAperture(const float r, const float posx, const float posy) :H_EllipticAperture(r,r,posx,posy) { 
-        /// @param r is the radius of the circular shape
-        /// @param posx, posy are the (x,y) coordinates of the center of the circle
-	type= CIRCULAR; 
-}
-
-void H_CircularAperture::printProperties() const {
-        cout << "Aperture shape:" << getTypeString() << ", aperture radius : " << x1 << endl;
-        cout << " \t Center : " << fx << "," << fy << endl;
-        return;
-}
Index: external/Hector/H_CircularAperture.h
===================================================================
--- external/Hector/H_CircularAperture.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#ifndef _H_CircularAperture_
-#define _H_CircularAperture_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_CircularAperture.h
-/// \brief Defines the circular aperture of beamline elements.
-
-// local #includes
-#include "H_EllipticAperture.h"
-
-
-/// Circular apertures
-class H_CircularAperture: public H_EllipticAperture {
-
-	public:
-		/// Constructors and destructor
-		//@{
-		H_CircularAperture():H_EllipticAperture(0,0,0,0) {type = CIRCULAR; setApertureString();}
-		H_CircularAperture(const float, const float, const float);
-		~H_CircularAperture() {return;};
-		//@}
-		virtual void printProperties() const;
-};
-
-#endif
Index: external/Hector/H_Dipole.cc
===================================================================
--- external/Hector/H_Dipole.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,40 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Dipole.cc
-/// \brief Class aiming at simulating LHC beam dipoles
-
-//local includes
-#include "H_Dipole.h"
-
-void H_Dipole::init() {
-	// needed for call from R- and S-Dipoles constructor
-	// must be in public section
-		setTypeString();
-		if (fk !=0 ) setMatrix(0,MP,QP);
-	return;
-}
-
-void H_Dipole::printProperties() const {
-	cout << typestring;
-	cout << name;
-	cout<<"\t at s = "<< fs;
-	cout<<"\t length = "<< element_length;
-	cout<<"\t k0 = "<<fk;
-	cout<<endl;
-        if(element_aperture->getType()!=NONE) {
-        	cout <<"\t aperture type = " << element_aperture->getTypeString();
-                element_aperture->printProperties();
-	}
-
-	if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-	if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
-}
Index: external/Hector/H_Dipole.h
===================================================================
--- external/Hector/H_Dipole.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/// \file H_Dipole.h
-/// \brief Class aiming at simulating LHC beam dipoles.
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#ifndef _H_Dipole_
-#define _H_Dipole_
-
-#include "H_OpticalElement.h"
-
-/// Abstract class aiming at simulating dipoles.
-class H_Dipole : public H_OpticalElement {
-
-	public:
-		/// Constructors and destructor
-		//@{
-		H_Dipole():H_OpticalElement() {}
-		H_Dipole(const int dtype, const double s, const double k, const double l):H_OpticalElement(dtype,s,k,l){}
-		H_Dipole(const string nameE, const int dtype, const double s, const double k, const double l):H_OpticalElement(nameE,dtype,s,k,l){}
-	        virtual ~H_Dipole() {return;};
-		//@}
-		/// Prints the properties of the element
-        	virtual void printProperties() const;
-	        void init();
-
- 	protected:
-    		virtual void setTypeString() =0;
-	    	virtual void setMatrix(const float, const float, const float) const =0;
-    	
-};
-
-#endif
Index: external/Hector/H_Drift.cc
===================================================================
--- external/Hector/H_Drift.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Drift.cc
-/// \brief Class aiming at simulating LHC beam drift.
-
-// local includes
-#include "H_Drift.h"
-#include "H_TransportMatrices.h"
-
-void H_Drift::init() {
-	// must be in public section
-	setTypeString();
-	setMatrix(0,MP,QP);
-	return;
-}
-
-void H_Drift::printProperties() const {
-	cout << typestring << name;
-	cout << "\t\t at s = " << fs;
-	cout << "\t length = " << element_length;
-	cout<<endl;
-	if(element_aperture->getType()!=NONE) {
-		cout <<"\t aperture type = " << element_aperture->getTypeString();
-                element_aperture->printProperties();
-        }
-	if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-	if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
-}
-
-void H_Drift::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-		*element_mat = driftmat(element_length);
-	return ;
-}
Index: external/Hector/H_Drift.h
===================================================================
--- external/Hector/H_Drift.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifndef _H_Drift_
-#define _H_Drift_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Drift.h
-/// \brief Class aiming at simulating LHC beam drift.
-
-// local includes
-#include "H_OpticalElement.h"
-
-/// \brief Class aiming at simulating LHC beam drift. 
-class H_Drift : public H_OpticalElement {
-
-	public:
-	/// Constructors and destructor
-	//@{
-		H_Drift():H_OpticalElement(DRIFT,0.,0.,0.) {init();}
-        	H_Drift(const double s, const double l):H_OpticalElement(DRIFT,s,0.,l){init();}
-	        H_Drift(const string nameE, const double s, const double l):H_OpticalElement(nameE,DRIFT,s,0.,l){init();}
-	        ~H_Drift() { return; };
-	//@}
-        	virtual void printProperties() const;
-	        void init();
-
-	private:
-        	virtual void setTypeString() {typestring = DRIFTNAME;};
-	        virtual void setMatrix(const float, const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_EllipticAperture.cc
===================================================================
--- external/Hector/H_EllipticAperture.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_EllipticAperture.cc
-/// \brief Defines the elliptic aperture of beamline elements.
-
-// C++ #includes
-#include <iostream>
-
-// ROOT #includes
-//#include "TEllipse.h"
-
-// local #includes
-#include "H_Parameters.h"
-#include "H_Aperture.h"
-#include "H_EllipticAperture.h"
-using namespace std;
-
-H_EllipticAperture::H_EllipticAperture(const float x1, const float x2, const float posx, const float posy) :H_Aperture(ELLIPTIC,x1,x2,0,0,posx,posy) {
-        /// @param x1, x2 are the length and height of the elliptic shape
-        /// @param posx, posy are the (x,y) coordinates of the center of the ellipse
-}
-
-bool H_EllipticAperture::isInside(const float x, const float y) const {
-        /// @param x, y are the (x,y) coordinates of the proton
-	return (((x-fx)/x1)*((x-fx)/x1) + ((y-fy)/x2)*((y-fy)/x2) < 1);
-}
-
-void H_EllipticAperture::draw() const {
-/* 	Ellipse* te = new TEllipse(fx,fy,x1,x2);
-	te->SetFillStyle(3003);
-	te->SetLineColor(2);
-	te->SetFillColor(2);
-	te->Draw();
-	return;
-*/
-}
-
-void H_EllipticAperture::printProperties() const {
-	cout<< "Aperture shape:" << getTypeString() << ", ellipse axes : "<<x1<<", "<<x2<<endl;
-	cout << " \t Center : " << fx << "," << fy << endl;
-	return;
-}
Index: external/Hector/H_EllipticAperture.h
===================================================================
--- external/Hector/H_EllipticAperture.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#ifndef _H_EllipticAperture_
-#define _H_EllipticAperture_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_EllipticAperture.h
-/// \brief Defines the elliptic aperture of beamline elements.
-
-// local #includes
-#include "H_Aperture.h"
-
-/// Elliptic apertures
-class H_EllipticAperture: public H_Aperture {
-
-	public:
-		/// Constructors and destructors
-		//@{
-		H_EllipticAperture():H_Aperture(ELLIPTIC,0,0,0,0,0,0) {}
-		H_EllipticAperture(const float, const float, const float, const float);
-		~H_EllipticAperture() {return;};
-		//@}
-		/// Checks whether the point is inside the aperture or not
-		virtual bool isInside(const float, const float) const;
-		/// Draws the aperture shape.
-		virtual void draw() const;
-		virtual void printProperties() const;
-};
-
-#endif
Index: external/Hector/H_HorizontalKicker.cc
===================================================================
--- external/Hector/H_HorizontalKicker.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_HorizontalKicker.cc
-/// \brief Classes aiming at simulating horizontal kickers in beamline
-
-// fk [rad] for kickers !!!!
-
-// local #includes
-#include "H_HorizontalKicker.h"
-#include "H_TransportMatrices.h"
-
-int kickers_on = 0;
-
-void H_HorizontalKicker::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	extern int kickers_on;
-	if(kickers_on) {
-		*element_mat = hkickmat(element_length,fk,eloss,p_mass,p_charge);
-	} else {
-		*element_mat = driftmat(element_length);
-	}
-	return ;
-}
Index: external/Hector/H_HorizontalKicker.h
===================================================================
--- external/Hector/H_HorizontalKicker.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/// \file H_HorizontalKicker.h
-/// \brief Classes aiming at simulating horizontal kickers in beamline.
-///
-/// fk [rad] for kickers !!!!
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#ifndef _H_HorizontalKicker_
-#define _H_HorizontalKicker_
-
-// local #includes
-#include "H_Kicker.h"
-
-/// Horizontal kickers for the beamline.
-class H_HorizontalKicker : public H_Kicker {
-
-	public:
-	/// Constructors and destructor
-	//@{
-		H_HorizontalKicker():H_Kicker(HKICKER,0.,0.,0.) {init();}
-		H_HorizontalKicker(const double s, const double k, const double l) :H_Kicker(HKICKER,s,k,l){init();}
-		H_HorizontalKicker(const string nameE, const double s, const double k, const double l) :H_Kicker(nameE,HKICKER,s,k,l){init();}
-		~H_HorizontalKicker() {return;};
-	//@}
-	private:
-		virtual void setTypeString() {typestring=HKICKERNAME;};
-		virtual void setMatrix(const float, const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_HorizontalQuadrupole.cc
===================================================================
--- external/Hector/H_HorizontalQuadrupole.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_HorizontalQuadrupole.cc
-/// \brief Classes aiming at simulating horizontal kickers in beamline
-
-// local #includes
-#include "H_HorizontalQuadrupole.h"
-
-void H_HorizontalQuadrupole::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	if (fk>0)  { if(VERBOSE) cout<<"\t ERROR : k1 should be < 0 for H_HorizontalQuadrupole (" << name << ")!"<<endl; }
-		if (fk !=0 ) *element_mat = hquadmat(element_length,fk,eloss, p_mass, p_charge);
-		else  {
-			*element_mat = driftmat(element_length);
-			if(VERBOSE) cout<<"\t WARNING : k1= 0 ; drift-like quadrupole (" << name << ") !" << endl;
-   		}
-	return ;
-}
Index: external/Hector/H_HorizontalQuadrupole.h
===================================================================
--- external/Hector/H_HorizontalQuadrupole.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#ifndef _H_HorizontalQuadrupole_
-#define _H_HorizontalQuadrupole_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_HorizontalQuadrupole.h
-/// \brief Class describing horizontally focussing quadrupoles.
-
-// local #includes
-#include "H_Quadrupole.h"
-
-/// Horizontally focussing quadrupoles.
-class H_HorizontalQuadrupole : public H_Quadrupole {
-
-	public:
-	///     Constructors and destructor
-	//@{
-		H_HorizontalQuadrupole():H_Quadrupole(HQUADRUPOLE,0.,0.,0.) {init();}
-		H_HorizontalQuadrupole(const double s, const double k, const double l) : H_Quadrupole(HQUADRUPOLE,s,k,l){init();}
-		H_HorizontalQuadrupole(const string nameE, const double s, const double k, const double l) : H_Quadrupole(nameE,HQUADRUPOLE,s,k,l){init();}
-		~H_HorizontalQuadrupole() {return;};
-	//@}
-	private:
-		virtual void setTypeString() {typestring = HQUADRUPOLENAME;};
-		virtual void setMatrix(const float, const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_Kicker.cc
===================================================================
--- external/Hector/H_Kicker.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Kicker.cc
-/// \brief Classes aiming at simulating kickers in LHC beamline.
-
-// local #includes
-#include "H_OpticalElement.h"
-#include "H_Kicker.h"
-
-void H_Kicker::init() {
-	// needed for call from H- and V-Kickers constructor
-	// must be in public section
-		setTypeString();
-		if (fk !=0 ) {
-			setMatrix(0,MP,QP); 
-		}
-	return;
-}
-
-void H_Kicker::printProperties() const {
-	cout << typestring;
-	cout << name;
-	cout<<"\t at s = "<< fs;
-	cout<<"\t length = "<< element_length;
-	cout<<"\t k0 = "<<fk;
-	cout<<endl;
-	if(element_aperture->getType()!=NONE) {
-		cout <<"\t aperture type = " << element_aperture->getTypeString();
-                element_aperture->printProperties();
-        }
-
-	if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-	if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
-}
Index: external/Hector/H_Kicker.h
===================================================================
--- external/Hector/H_Kicker.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/// \file H_Kicker.h
-/// \brief Classes aiming at simulating kickers in LHC beamline.
-/// fk [rad] for kickers !!!!
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#ifndef _H_Kicker_
-#define _H_Kicker_
-
-// local #includes
-#include "H_OpticalElement.h"
-
-/// Abstract class aiming at simulating kickers in LHC beamline.
-class H_Kicker : public H_OpticalElement {
-
-public:
-	/// Constructors and destructor
-	//@{
-		H_Kicker():H_OpticalElement() {}
-		H_Kicker(const int dtype, const double s, const double k, const double l):H_OpticalElement(dtype,s,k,l){}
-		H_Kicker(const string nameE, const int dtype, const double s, const double k, const double l):H_OpticalElement(nameE,dtype,s,k,l){}
-		virtual ~H_Kicker() {return;};
-	//@}
-	/// prints the kicker properties
-		virtual void printProperties() const;
-		void init();
-
- 	protected:
-		virtual void setTypeString() =0;
-		virtual void setMatrix(const float, const float, const float) const =0;
-};
-
-#endif
Index: external/Hector/H_Marker.cc
===================================================================
--- external/Hector/H_Marker.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,38 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Marker.cc
-/// \brief Class defining a marker in the beamline (e.g. for interaction point)
-
-// local includes
-#include "H_Marker.h"
-#include "H_TransportMatrices.h"
-
-void H_Marker::init() {
-	// must be in public section
-	setTypeString();
-	setMatrix(0,MP,QP);
-	return;
-}
-
-void H_Marker::printProperties() const {
-	cout << typestring << name;
-	cout << "\t\t at s = " << fs << endl;
-	if(element_aperture->getType()!=NONE) {
-		cout <<"\t aperture type = " << element_aperture->getTypeString();
-                element_aperture->printProperties();
-        }
-}
-
-void H_Marker::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-		*element_mat = driftmat(0);
-	return ;
-}
Index: external/Hector/H_Marker.h
===================================================================
--- external/Hector/H_Marker.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifndef _H_Marker_
-#define _H_Marker_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Marker.h
-/// \brief Class defining a marker in the beamline (e.g. for interaction point)
-
-// local includes
-#include "H_OpticalElement.h"
-
-/// \brief Class defining a marker in the beamline (e.g. for interaction point)
-class H_Marker : public H_OpticalElement {
-
-	public:
-	/// Constructors and destructor
-	//@{
-		H_Marker():H_OpticalElement(MARKER,0.,0.,0.) {init();}
-        	H_Marker(const double s):H_OpticalElement(MARKER,s,0.,0.){init();}
-	        H_Marker(const string nameE, const double s):H_OpticalElement(nameE,MARKER,s,0.,0.){init();}
-	        ~H_Marker() { return; };
-	//@}
-        	virtual void printProperties() const;
-	        void init();
-
-	private:
-        	virtual void setTypeString() {typestring = MARKERNAME;};
-	        virtual void setMatrix(const float , const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_OpticalElement.cc
===================================================================
--- external/Hector/H_OpticalElement.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,169 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_OpticalElement.cc
-/// \brief Class aiming at describing any beam optical element.
-
-// c++ #includes
-#include <iostream>
-#include <string>
-
-// ROOT #includes
-//#include "TPaveLabel.h"
-
-// local #includes
-#include "H_TransportMatrices.h"
-#include "H_Aperture.h"
-#include "H_OpticalElement.h"
-using namespace std;
-
-/// called by the constructors
-void H_OpticalElement::init(const string nameE, const int typeE, const double s, const double k, const double l, H_Aperture* the_app) {
-	// this is called by the constructors
-	// must be in public section !
-	// xpos and ypos are vectors with n point. They define the aperture shape of the optical element.
-	name = nameE;
-	fs = s;
- 	fk = k;
-	xpos = 0;
-	ypos = 0;
-	txpos = 0;
-	typos = 0;
- 	element_length = l;
- 	type = typeE;
- 	element_mat = new TMatrix(MDIM,MDIM);
-	setAperture(the_app);
-	
-	if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-	if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length element ! (" << name << ") " << " at " << fs << endl; }
-	betax =0;
-	betay =0;
-}
-
-H_OpticalElement::H_OpticalElement() {
-	H_Aperture* the_app = new H_Aperture();
-	init("",DRIFT,0.,0.,0.1,the_app);
-}
-
-H_OpticalElement::H_OpticalElement(const string nameE, const int typeE, const double s, const double k, const double l) {
-	H_Aperture* the_app = new H_Aperture();
-	init(nameE,typeE,s,k,l,the_app);
-}
-
-H_OpticalElement::H_OpticalElement(const string nameE, const int typeE, const double s, const double k, const double l, H_Aperture* the_app) {
-	init(nameE,typeE,s,k,l,the_app);
-}
-
-H_OpticalElement::H_OpticalElement(const int typeE, const double s, const double k, const double l, H_Aperture* the_app) {
-	init("",typeE,s,k,l,the_app);
-}
-
-H_OpticalElement::H_OpticalElement(const int typeE, const double s, const double k, const double l) {
-	H_Aperture* the_app = new H_Aperture();
-	init("",typeE,s,k,l,the_app);
-}
-
-H_OpticalElement::H_OpticalElement(const H_OpticalElement& el) {
-	fs = el.fs;
-	element_length = el.element_length;
-	fk = el.fk;
-	xpos = el.xpos;
-	ypos = el.ypos;
-	txpos = el.txpos;
-	typos = el.typos;
-	betax = el.betax;
-	betay = el.betay;
-	type = el.type;
-	name = el.name;
-	typestring = el.typestring;
-	element_mat = new TMatrix(*(el.element_mat));
-	element_aperture = new H_Aperture(*(el.element_aperture));
-}
-
-H_OpticalElement& H_OpticalElement::operator=(const H_OpticalElement& el) {
-	if(this==&el) return *this;
-        fs = el.fs;
-        element_length = el.element_length;
-        fk = el.fk;
-        xpos = el.xpos;
-        ypos = el.ypos;
-		txpos = el.txpos;
-		typos = el.typos;
-        betax = el.betax;
-        betay = el.betay;
-        type = el.type;
-        name = el.name;
-        typestring = el.typestring;
-	delete element_mat;
-	delete element_aperture;
-        element_mat = new TMatrix(*(el.element_mat));
-        element_aperture = new H_Aperture(*(el.element_aperture));
-	return *this;
-}
-
-void H_OpticalElement::setAperture(H_Aperture * ap) {
-//	element_aperture = const_cast<H_Aperture*>(ap);
-	element_aperture = ap;
-	return;
-}
-
-void H_OpticalElement::printProperties() const {
-		cout << typestring;
-		cout << name;
-		cout <<"\t at s = " << fs;
-		cout <<"\t length = "<< element_length;
-		if(fk!=0) cout <<"\t strength = " << fk;
-		if(element_aperture->getType()!=NONE) { 
-			cout <<"\t aperture type = " << element_aperture->getTypeString();
-			element_aperture->printProperties();			
-		}
-	
-		cout<<endl;
-		if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-		if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< typestring << " !" << endl; }
-
- return;
-}
-
-void H_OpticalElement::showMatrix() const {
-		printMatrix(element_mat);
-	return;
-}
-
-void H_OpticalElement::drawAperture() const {
-	element_aperture->draw();
-	return;
-}
-
-TMatrix H_OpticalElement::getMatrix() const {
-	return *element_mat;
-}
-
-TMatrix H_OpticalElement::getMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	setMatrix(eloss,p_mass,p_charge);
-	return *element_mat;
-}
-
-void H_OpticalElement::draw(const float meight, const float height) const{
-/*	/// @param meight is the minimal extend of the graph
-	/// @param height is the maximal extend of the graph
-	float x1 = getS();
-	float x2 = getS() + getLength();
-	float y1 = meight;
-	float y2 = height;
-	TPaveLabel* cur_box = new TPaveLabel(x1,y1,x2,y2,"");
-	cur_box->SetBorderSize(1);
-	cur_box->SetFillStyle(1001);
-	cur_box->SetFillColor((int)getType());
-	cur_box->Draw();
-*/
-}
-
Index: external/Hector/H_OpticalElement.h
===================================================================
--- external/Hector/H_OpticalElement.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,215 +1,0 @@
-#ifndef _H_OpticalElement_
-#define _H_OpticalElement_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_OpticalElement.h
-/// \brief Class aiming at describing any beam optical element.
-///
-/// This is an abstract base class
-/// subclass must define setTypeString() and setMatrix() methods.
-/// Quadrupole, Dipole, Kickers and Drift inherit from this class.
-
-// c++ #includes
-#include <iostream>
-#include <string>
-
-// ROOT #includes
-#include "TMatrix.h"
-
-// local #includes
-#include "H_TransportMatrices.h"
-#include "H_Parameters.h"
-#include "H_Aperture.h"
-
-using namespace std;
-
-	// type #defines
-#define DRIFT        1
-#define RDIPOLE      2
-#define SDIPOLE      3
-#define VQUADRUPOLE  4
-#define HQUADRUPOLE  5
-#define VKICKER      6
-#define HKICKER      7
-#define RCOLLIMATOR  8
-#define ECOLLIMATOR  9
-#define CCOLLIMATOR 10
-#define RP          11
-#define IP          12
-#define MARKER      13
-
-	// typestring[30] #defines
-#define DRIFTNAME	"Drift        "
-#define RDIPOLENAME	"R-Dipole     "
-#define SDIPOLENAME	"S-Dipole     "
-#define VQUADRUPOLENAME	"V-Quadrupole "
-#define HQUADRUPOLENAME	"H-Quadrupole "
-#define VKICKERNAME     "V-Kicker     "
-#define HKICKERNAME     "H-Kicker     "
-#define RCOLLIMATORNAME "R-Collimator "
-#define ECOLLIMATORNAME "E-Collimator "
-#define CCOLLIMATORNAME "C-Collimator "
-#define RPNAME          "Roman Pot    "
-#define IPNAME          "IP           "
-#define MARKERNAME      "Marker       "
-
-/// Describes any beam optical element.
-class H_OpticalElement {
-
-	public:
-        ///     init method for constructors
-                void init(const string, const int , const double , const double , const double, H_Aperture*);
-		/// Constructors and destructor
-		//@{
-		H_OpticalElement(const string, const int, const double, const double, const double, H_Aperture*);
-		H_OpticalElement(const int, const double, const double, const double, H_Aperture*);
-		H_OpticalElement(const string, const int, const double, const double, const double);
-		H_OpticalElement(const int, const double, const double, const double);
-		H_OpticalElement();
-		H_OpticalElement(const H_OpticalElement&);
-	        virtual ~H_OpticalElement() {delete element_mat; delete element_aperture;};
-		//@}
-		///     Prints the element features
-	        virtual void printProperties() const ;
-		///     Shows the element transport matrix
-	        void showMatrix() const ;
-		///     Draws the aperture shape
-	        void drawAperture() const ;
-		///     Sets the aperture of the element
-		void setAperture(H_Aperture *);
-		///     Ordering operator acting on the s coordinate
-		inline bool operator>(const H_OpticalElement tocomp) const {if(fs>tocomp.getS()) { return true; } else { return false; }};
-		///     Ordering operator acting on the s coordinate
-		inline bool operator<(const H_OpticalElement tocomp) const {if(fs<tocomp.getS()) { return true; } else { return false; }};
-		/// 	Copy operator
-		H_OpticalElement& operator=(const H_OpticalElement&); 
-		///     Sets the element longitudinal (s), and horizontal (x) and vertical (y) coordinates.
-		//@{
-		inline void setS(const double new_s) {fs=new_s;};
-		inline void setX(const double new_pos) {
-		        /// @param new_pos in [m]
-	        	element_aperture->setPosition(new_pos*URAD,ypos);
-		        xpos = new_pos;
-		};
-		inline void setY(const double new_pos) {
-		        /// @param new_pos in [m]
-		        element_aperture->setPosition(xpos,new_pos*URAD);
-		        ypos = new_pos;
-		};
-		inline void setTX(const double new_ang) {
-			txpos = new_ang;
-		};
-		inline void setTY(const double new_ang) {
-			typos = new_ang;
-		}
-		//@}
-		///     Returns the element longitudinal (s), horizontal (x) and vertical (y) coordinates, and corresponding angles.
-		//@{
-	        inline double getS() const {return fs;};
-		inline double getX() const {return xpos;};
-		inline double getY() const {return ypos;};
-		inline double getTX() const {return txpos;};
-		inline double getTY() const {return typos;};
-		//@}
-		///     Returns the element length
-	        inline double getLength() const { return element_length; };
-		///     Returns the element magnetic strength
-	        inline double getK() const { return fk; };
-		///     Returns the element type, as (int)  or (string)
-		//@{
-	        inline int getType() const { return type; };
-		inline const string getTypeString() const { return typestring; };
-		//@}
-		///     Returns the element (string) name
-		inline const string getName() const { return name; };
-		///     Draws the element from min to max in the current pad
-		void draw(const float, const float) const;
-		///     Checks if the (x,y) coordinates are within the aperture acceptance
-		inline bool isInside(const double x, const double y) const { return (bool) element_aperture->isInside(x,y);};
-		///     Returns the element transport matrix
-		//@{
-		TMatrix getMatrix() const;
-		TMatrix getMatrix(const float, const float, const float) const;
-		//@}
-		///     Returns the element aperture
-		H_Aperture * getAperture() const {return element_aperture;};
-		///	Sets the beta functions
-		//@{
-		inline void setBetaX(const double beta) { betax = beta;};
-		inline void setBetaY(const double beta) { betay = beta;};
-		//@}
-		///	Returns the beta functions
-		//@{
-		inline double getBetaX() const {return betax;};
-		inline double getBetaY() const {return betay;};
-		//@}
-                ///     Sets the dispersion functions
-                //@{
-                inline void setDX(const double disp) { dx = disp;};
-                inline void setDY(const double disp) { dy = disp;};
-                //@}
-                ///     Returns the dispersion functions
-                //@{
-                inline double getDX() const {return dx;};
-                inline double getDY() const {return dy;};
-                //@}
-                //@}
-                ///     Sets the relative position functions (from MAD), relative to the beamline reference frame
-                //@{
-                inline void setRelX(const double rel_x) { relx = rel_x;};
-                inline void setRelY(const double rel_y) { rely = rel_y;};
-                //@}
-                ///     Returns the position functions (from MAD), relative to the beamline reference frame
-                //@{
-                inline double getRelX() const {return relx;};
-                inline double getRelY() const {return rely;};
-                //@}
-
-
-	protected:
-		/// Optical element coordinates : fs [m], xpos [m], ypos [m], txpos [rad], typos [rad].
-		//@{
-        	double fs, xpos, ypos, txpos, typos;
-		//@}
-		/// Optical element lenght.
-		double element_length;
-		/// Magnetic field strength.
-		double fk;
-		/// Beam \f$ \beta \f$ functions.
-		//@{
-		double betax, betay;
-		//@}
-		/// Beam dispersion in position 
-		//@{
-		double dx, dy;
-		//@}
-		/// Beam position, relative to the beam ideal path, from MAD
-		//@{
-		double relx, rely;
-		//@}
-		/// Optical element type (Dipole, drift, etc).
-     		int type;
-		/// Optical element name and type.
-		//@{
-		string name, typestring;
-		//@}
-		virtual void setTypeString() {return;};
-		/// Optical element transport matrix.
-	    	virtual void setMatrix(const float, const float, const float) const {return;};
-		/// Optical element transport matrix.
- 		TMatrix * element_mat;
-		/// Optical element aperture.
-	    	H_Aperture * element_aperture;
-};
-
-#endif
Index: external/Hector/H_Parameters.cc
===================================================================
--- external/Hector/H_Parameters.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,16 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-///\file H_Parameters.cc
-///\brief Class aiming at gathering all parameters that must be defined
-
-#include "H_Parameters.h"
- //Needed for the compilator of H_Parameters into an object (.o) file
Index: external/Hector/H_Parameters.h
===================================================================
--- external/Hector/H_Parameters.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,98 +1,0 @@
-#ifndef _Hector_parameters_
-#define _Hector_parameters_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Parameters.h
-/// \brief Class aiming at gathering all parameters that must be defined.
-///
-/// Units : angles [\f$ \mu \f$rad], distances [\f$ \mu \f$m], energies [GeV], c=[1].
-
-/* from physics and maths */
-   /// proton mass [GeV]
-const double MP=0.93827;
-   /// proton charge [e]
-const double QP=1;
-   /// pi
-#define PI 3.14159265359
-   /// conversion factor for \f$\mu\f$rad <-> rad
-#define URAD 1000000.
-   /// in thx = thx* / 3 <==> thx* = THX thx
-#define THX 3.86 
-   /// in dy = 10 thy*   <==> thy* = dy / THY
-#define THY 51.4       
-
-/* beam parameters */
-   /// beam nominal energy in GeV
-//#define BE  7000.
-const double BE=7000.;
-   /// beam energy divergence, in GeV
-#define SBE 0.79
-   /// beam nominal energy in TeV
-#define BETEV 7.
-   /// beam S @ IP
-#define PS 0.
-   /// beam X @ IP
-#define PX  -500.      
-   /// beam Y @ IP
-#define PY  0.      
-   /// beam longitudinal dispersion
-#define SS 0.
-   /// beam lateral width SX @ IP
-#define SX  16.63
-// #define SX  0.      
-   /// beam lateral width SY @ IP
-#define SY  16.63
-// #define SY 0.
-   /// beam transverse direction angle TX @ IP
-#define TX 0.
-   /// beam transverse direction angle TY @ IP
-#define TY 0.      
-   /// beam angular divergence STX @ IP
-//#define STX 0.
-#define STX 30.23      
-   /// beam angular divergence STY @ IP
-//#define STY 0.
-#define STY 30.23      
-   /// beam dispersion
-//#define D   120000.
-const double D=120000.;
-	/// half crossing angle at IP [\f$ \mu \f$RAD]
-#define CRANG 142.5 
-
-/* roman pots parameters */
-   /// granularity in X position
-#define GRANPOSX 5.
-   /// granularity in Y position
-#define GRANPOSY 5.
-   /// granularity in X angle
-#define GRANANGX 10.
-   /// granularity in Y angle
-#define GRANANGY 10.
-   /// Distance between rp's
-#define DISTRP 4000000.
-   /// RP resolution in X, for smearing
-#define RESX 10.
-   /// RP resolution in Y, for smearing
-#define RESY 10.
-   /// Radius of the hole in the RP
-#define RADIUS 1000.
-
-/* display parameters */
-   /// Verbose mode ?
-#define VERBOSE 0 
-
-/// include Pythia libraries ? (not included on some ROOT installations) 
-//#define _include_pythia_
-
-#endif
-
Index: external/Hector/H_Quadrupole.cc
===================================================================
--- external/Hector/H_Quadrupole.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Quadrupole.cc
-/// \brief Classes aiming at simulating LHC beam quadrupoles.
-
-#include "H_Quadrupole.h"
-
-void H_Quadrupole::init() {
-	// needed for call from H- and V-Quadrupoles constructor
-	// must be in public section
-		setTypeString();
-		setMatrix(0,MP,QP);
-	return;
-}
-
-void H_Quadrupole::printProperties() const{
-	cout << typestring;
-	cout << name;
-	cout << "\t at s = " << fs;
-	cout << "\t length = " << element_length;
-	cout << "\t k1 = " << fk;
-	cout<<endl;
-        if(element_aperture->getType()!=NONE) {
-        	cout <<"\t aperture type = " << element_aperture->getTypeString();
-                element_aperture->printProperties();
-	}
-
-	if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-	if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< typestring << " !" << endl; }
-}
Index: external/Hector/H_Quadrupole.h
===================================================================
--- external/Hector/H_Quadrupole.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#ifndef _H_Quadrupole_
-#define _H_Quadrupole_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_Quadrupole.h
-/// \brief Class describing quadrupoles.
-
-// local #includes
-#include "H_OpticalElement.h"
-
-/// Abstract class aiming at simulating LHC beam quadrupoles.
-class H_Quadrupole : public H_OpticalElement {
-
-	public:
-	///     Constructors and destructor
-	//@{
-		H_Quadrupole():H_OpticalElement() {}
-		H_Quadrupole(const int dtype, const double s, const double k, const double l) : H_OpticalElement(dtype,s,k,l) {}
-		H_Quadrupole(const string nameE, const int dtype, const double s, const double k, const double l) : H_OpticalElement(nameE,dtype,s,k,l) {}
-		virtual ~H_Quadrupole() {return;};
-	//@}	
-		virtual void printProperties() const;
-		void init();
-
- 	protected:
-		virtual void setTypeString() =0;
-		virtual void setMatrix(const float, const float, const float) const =0;
-	   	
-};
-
-#endif
Index: external/Hector/H_RecRPObject.cc
===================================================================
--- external/Hector/H_RecRPObject.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,353 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RecRPObject.cc
-/// \brief Classes aiming at reconstruction particle properties
-
-// C++ #includes
-#include <iostream>
-#include <iomanip>
-
-// ROOT #includes
-//#include "TGraph.h"
-//#include "TF1.h"
-//#include "TCanvas.h"
-
-// local #includes
-#include "H_RecRPObject.h"
-#include "H_RomanPot.h"
-#include "H_BeamParticle.h"
-using namespace std;
-
-H_RecRPObject::H_RecRPObject() {
-	x1 = 0.;
-	x2 = 0.;
-	y1 = 0.;
-	y2 = 0.;
-	s1 = 0.;
-	s2 = 0.;
-	corr1_TM = 0;
-	corr2_TM = 0;
-	corr1_AM = 0;
-	corr2_AM = 0;
-	thx = NOT_YET_COMPUTED;
-	thy = NOT_YET_COMPUTED;
-	x0  = NOT_YET_COMPUTED;
-	y0  = NOT_YET_COMPUTED;
-	energy = NOT_YET_COMPUTED;
-	virtuality = NOT_YET_COMPUTED;
-	matrp1 = new TMatrix(MDIM,MDIM);
-	matrp2 = new TMatrix(MDIM,MDIM);
-	thebeam = new H_AbstractBeamLine();
-}
-
-H_RecRPObject::H_RecRPObject(const float S1, const float S2, const H_AbstractBeamLine& beamline) {
-	x1 = 0;
-	x2 = 0;
-	y1 = 0;
-	y2 = 0;
-	s1 = S1;
-	s2 = S2;
-	thx = NOT_YET_COMPUTED;
-	thy = NOT_YET_COMPUTED;
-	x0  = NOT_YET_COMPUTED;
-	y0  = NOT_YET_COMPUTED;
-	energy = NOT_YET_COMPUTED;
-	virtuality = NOT_YET_COMPUTED;
-//	matrp1 = new TMatrix(MDIM,MDIM);
-//	matrp2 = new TMatrix(MDIM,MDIM);
-	thebeam = new H_AbstractBeamLine(beamline);
-	H_RomanPot * rp1 = new H_RomanPot("rp1",s1,0);
-	thebeam->add(rp1);
-	H_RomanPot * rp2 = new H_RomanPot("rp2",s2,0);
-	thebeam->add(rp2);
-	matrp1 = new TMatrix(*(thebeam->getPartialMatrix("rp1",0.,MP,QP)));
-	matrp2 = new TMatrix(*(thebeam->getPartialMatrix("rp2",0.,MP,QP)));
-
-	corr1_TM = getECorrectionFactor(0,TM);
-	corr2_TM = getECorrectionFactor(1,TM);
-	corr1_AM = getECorrectionFactor(0,AM);
-	corr2_AM = getECorrectionFactor(1,AM);
-//	cout << corr1_TM << " " << corr2_TM << endl;
-//	cout << corr1_AM << " " << corr2_AM << endl;
-}
-
-H_RecRPObject::H_RecRPObject(const H_RecRPObject& r) {
-	x1 = r.x1;
-	x2 = r.x2;
-	y1 = r.y1;
-	y2 = r.y2;
-	s1 = r.s1;
-	s2 = r.s2;
-	x0 = r.x0;
-	y0 = r.y0;
-	thx = r.thx;
-	thy = r.thy;
-	energy = r.energy;
-	virtuality = r.virtuality;
-	matrp1 = new TMatrix(*(r.matrp1));
-	matrp2 = new TMatrix(*(r.matrp2));
-	corr1_TM = r.corr1_TM;
-	corr2_TM = r.corr2_TM;
-	corr1_AM = r.corr1_AM;
-	corr2_AM = r.corr2_AM;
-	thebeam = new H_AbstractBeamLine(*(r.thebeam));
-}
-
-H_RecRPObject& H_RecRPObject::operator=(const H_RecRPObject& r) {
-	if(this==&r) return *this;
-	x1 = r.x1;
-	x2 = r.x2;
-	y1 = r.y1;
-	y2 = r.y2;
-	s1 = r.s1;
-	s2 = r.s2;
-	x0 = r.x0;
-	y0 = r.y0;
-	thx = r.thx;
-	thy = r.thy;
-	energy = r.energy;
-	virtuality = r.virtuality;
-	matrp1 = new TMatrix(*(r.matrp1));
-	matrp2 = new TMatrix(*(r.matrp2));
-	corr1_TM = r.corr1_TM;
-	corr2_TM = r.corr2_TM;
-	corr1_AM = r.corr1_AM;
-	corr2_AM = r.corr2_AM;
-	thebeam = new H_AbstractBeamLine(*(r.thebeam));
-	return *this;
-}
-
-float H_RecRPObject::getECorrectionFactor(const unsigned int facn, const unsigned int method) {
-/*
- * commented out because CMSSW does not want any TGraph/TCanvas/TFit
- *
- * to be fixed !
- * X.R. 07/05/2009
- *
-	float beta1 = ((thebeam->getPartialMatrix("rp1",0,MP,QP))->GetMatrixArray())[1*MDIM];
-	float beta2 = ((thebeam->getPartialMatrix("rp2",0,MP,QP))->GetMatrixArray())[1*MDIM];
-	float disp1 = ((thebeam->getPartialMatrix("rp1",0,MP,QP))->GetMatrixArray())[4*MDIM]*URAD;
-	float disp2 = ((thebeam->getPartialMatrix("rp2",0,MP,QP))->GetMatrixArray())[4*MDIM]*URAD;
-	const int n = 20; //using 20 points to get a good quadratic fit
-	float ee[n], rece[n];
-
-	for(int i = 0; i < n; i++) {
-		ee[i] = 10 + i*200./((float)n-1);
-		H_BeamParticle p1;
-		p1.emitGamma(ee[i],0.);
-		p1.computePath(thebeam,1);
-		p1.propagate(s1);
-		float x1 = p1.getX();
-		p1.propagate(s2);
-		float x2 = p1.getX();
-		switch (method) {
-			case TM: { rece[i] = -x1/disp1; }; break;
-			case AM: { rece[i] = -(beta2*x1-beta1*x2)/(beta2*disp1-beta1*disp2); }; break;
-			case PM: { rece[i] = -x1/disp1; cout<<"this method has not been implemented, using trivial reconstruction"<<endl; } break;
-			default: { rece[i] = -(beta2*x1-beta1*x2)/(beta2*disp1-beta1*disp2); }; break;
-		}
-		ee[i] = ee[i] - rece[i];
-	}
-	char mytitle[50];
-	sprintf(mytitle,"c_%d",method);
-//	TCanvas*c = new TCanvas();
-//	c->SetTitle(mytitle);
-	TGraph* g1 = new TGraph(n,rece,ee);
-	TF1* fit1 = new TF1("fit1","[0]*x + [1]*x*x",0,100);
-	g1->Fit("fit1","Q");
-	float xfact = fit1->GetParameter(facn);
-//	g1->Draw("APL");
-	delete g1;
-	delete fit1;
-
-	return xfact;
-*/
-        return 1.;
-}
-
-
-void H_RecRPObject::setPositions(const float X1, const float Y1, const float X2, const float Y2) {
-	thx = NOT_YET_COMPUTED;
-	thy = NOT_YET_COMPUTED;
-	x0  = NOT_YET_COMPUTED;
-	y0  = NOT_YET_COMPUTED;
-	energy = NOT_YET_COMPUTED;
-	virtuality = NOT_YET_COMPUTED;
-	x1 = X1;
-	x2 = X2;
-	y1 = Y1;
-	y2 = Y2;
-	
-	return;
-}
-
-void H_RecRPObject::printProperties() const {
-	cout << "Roman pot variables :" << endl;
-	cout << "\t pot 1 : (x,y,s) = (" << x1 << " , " << y1 << " , " << s1 << " )" << endl;
-	cout << "\t pot 2 : (x,y,s) = (" << x2 << " , " << y2 << " , " << s2 << " )" << endl;
-	cout << endl << "Reconstructed variables :" << endl;
-	cout << "\t IP : (x,y) = (" << x0 << " , " << y0 << ") and (theta_x, theta_y) = (" << thx << " , " << thy << " )" << endl;
-	if (energy==NOT_YET_COMPUTED) cout << "\t Energy not yet computed" << endl;
-	else cout << "\t Energy = " << energy << " GeV" << endl;	
-	if (virtuality==NOT_YET_COMPUTED) cout << "\t Virtuality not yet computed" << endl;
-	else cout << "\t Virtuality = " << virtuality << " GeV^2" << endl;
-	cout << endl;
-}
-
-float H_RecRPObject::getE() {
-	if(energy==NOT_YET_COMPUTED) {
-		cout<<"Please first compute energy using your favourite method"<<endl;
-		return NOT_YET_COMPUTED;
-	}
-	return energy;
-}
-
-float H_RecRPObject::getE(const unsigned int method) {
-	switch (method) {
-		case TM: {energy = computeE_TM();} break;
-		case AM: {energy = computeE_AM();} break;
-		case PM: {energy = computeE_PM();} break;
-		default: {energy = computeE_AM();} break;
-	};
-	return energy;
-}
-
-float H_RecRPObject::computeX0() {
-	if(energy==NOT_YET_COMPUTED) {
-		cout<<"Please first compute energy using your favourite method"<<endl;
-		return NOT_YET_COMPUTED;
-	}
-	float alpha1 = (matrp1->GetMatrixArray())[0];
-	float alpha2 = (matrp2->GetMatrixArray())[0];
-	float disp1 = (matrp1->GetMatrixArray())[4*MDIM]*URAD;
-	float disp2 = (matrp2->GetMatrixArray())[4*MDIM]*URAD;
-	x0 = (disp2*x1-disp1*x2)/(disp2*alpha1-disp1*alpha2);
-	return x0;
-}
-
-float H_RecRPObject::computeY0() {
-	if(energy==NOT_YET_COMPUTED) {
-		cout<<"Please first compute energy using your favourite method"<<endl;
-		return NOT_YET_COMPUTED;
-	}
-	float gamma1 = (matrp1->GetMatrixArray())[2*MDIM+2];
-	float gamma2 = (matrp2->GetMatrixArray())[2*MDIM+2];
-	float delta1 = (matrp1->GetMatrixArray())[3*MDIM+2];
-	float delta2 = (matrp2->GetMatrixArray())[3*MDIM+2];
-	y0 = (delta2*y1-delta1*y2)/(delta2*gamma1-delta1*gamma2);
-	return y0;
-}
-
-float H_RecRPObject::computeTX() {
-	if(energy==NOT_YET_COMPUTED) {
-	        cout<<"Please first compute energy using your favourite method"<<endl;
-	        return NOT_YET_COMPUTED;
-	} 
-	float beta1 = (matrp1->GetMatrixArray())[1*MDIM];
-	float beta2 = (matrp2->GetMatrixArray())[1*MDIM];
-	float disp1 = (matrp1->GetMatrixArray())[4*MDIM]*URAD;
-	float disp2 = (matrp2->GetMatrixArray())[4*MDIM]*URAD;
-	// computes thx (murad)
-	thx = (x1*disp2-x2*disp1)/(beta1*disp2-beta2*disp1);
-	return thx;
-}
-
-float H_RecRPObject::computeTY() {
-	if(energy==NOT_YET_COMPUTED) {
-		cout<<"Please first compute energy using your favourite method"<<endl;
-		return NOT_YET_COMPUTED;
-	}
-	float gamma1 = (matrp1->GetMatrixArray())[2*MDIM+2];
-	float gamma2 = (matrp2->GetMatrixArray())[2*MDIM+2];
-	float delta1 = (matrp1->GetMatrixArray())[3*MDIM+2];
-	float delta2 = (matrp2->GetMatrixArray())[3*MDIM+2];
-	// computes thy (murad)
-	thy = (y1*gamma2-y2*gamma1)/(delta1*gamma2-delta2*gamma1);
-	return thy;
-}
-
-float H_RecRPObject::computeE_TM() {
-	// computes the emitted particle energy, from the trivial method
-	float disp = ((thebeam->getPartialMatrix("rp1",0,MP,QP))->GetMatrixArray())[4*MDIM]*URAD;
-	energy = -x1/disp;
-	// corrects for nonlinear effects
-	energy = (1+corr1_TM)*energy + corr2_TM*energy*energy;
-	// sets the rp matrices at obtained energy
-	delete matrp1;
-	delete matrp2;
-	matrp1 = new TMatrix(*(thebeam->getPartialMatrix("rp1",energy,MP,QP)));
-	matrp2 = new TMatrix(*(thebeam->getPartialMatrix("rp2",energy,MP,QP)));
-	// returns ...
-	return energy;
-}
-
-float H_RecRPObject::computeE_AM() {
-	// computes the emitted particle energy, from the angle compensation method, iterative way
-	const int N = 10;
-	delete matrp1;
-	delete matrp2;
-	matrp1 = new TMatrix(*(thebeam->getPartialMatrix("rp1",0,MP,QP)));
-	float disp = (matrp1->GetMatrixArray())[4*MDIM]*URAD;
-	delete matrp1;
-	energy = -x1/disp;
-	matrp1 = new TMatrix(*(thebeam->getPartialMatrix("rp1",energy,MP,QP)));
-	matrp2 = new TMatrix(*(thebeam->getPartialMatrix("rp2",energy,MP,QP)));
-	float beta1 = (matrp1->GetMatrixArray())[1*MDIM];
-	float beta2 = (matrp2->GetMatrixArray())[1*MDIM];
-	float disp1 = (matrp1->GetMatrixArray())[4*MDIM]*URAD;
-	float disp2 = (matrp2->GetMatrixArray())[4*MDIM]*URAD;
-	for(int i = 0; i < N; i++) {
-		energy = -(beta2*x1-beta1*x2)/(beta2*disp1-beta1*disp2);
-		delete matrp1;
-		delete matrp2;
-		matrp1 = new TMatrix(*(thebeam->getPartialMatrix("rp1",energy,MP,QP)));
-		matrp2 = new TMatrix(*(thebeam->getPartialMatrix("rp2",energy,MP,QP)));
-		beta1 = (matrp1->GetMatrixArray())[1*MDIM];
-		beta2 = (matrp2->GetMatrixArray())[1*MDIM];
-		disp1 = (matrp1->GetMatrixArray())[4*MDIM]*URAD;
-		disp2 = (matrp2->GetMatrixArray())[4*MDIM]*URAD;
-	}
-	// returns ...
-	return energy;
-}
-
-float H_RecRPObject::computeE_PM() {
-	cout<<"Not yet implemented, nothing done"<<endl;
-	energy = NOT_YET_COMPUTED;
-	return energy;
-}
-
-float H_RecRPObject::computeQ2() {
-	// computes the emitted particle virtuality
-	// energy should be teconstructed first
-	if(energy==NOT_YET_COMPUTED) {
-		cout<<"Please first compute energy using your favourite method"<<endl;
-		return NOT_YET_COMPUTED;
-	} 
-	// getting parameters for reconstructed particle energy
-    float beta1 = (matrp1->GetMatrixArray())[1*MDIM];
-    float beta2 = (matrp2->GetMatrixArray())[1*MDIM];
-    float gamma1 = (matrp1->GetMatrixArray())[2*MDIM+2];
-    float gamma2 = (matrp2->GetMatrixArray())[2*MDIM+2];
-    float delta1 = (matrp1->GetMatrixArray())[3*MDIM+2];
-    float delta2 = (matrp2->GetMatrixArray())[3*MDIM+2];
-    float disp1 = (matrp1->GetMatrixArray())[4*MDIM]*URAD;
-    float disp2 = (matrp2->GetMatrixArray())[4*MDIM]*URAD;
-    // angles reconstruction
-    float rec_thx = (x1*disp2-x2*disp1)/(beta1*disp2-beta2*disp1)/URAD;
-    float rec_thy = (y1*gamma2-y2*gamma1)/(delta1*gamma2-delta2*gamma1)/URAD;
-	// QÂ² reconstruction
-    virtuality = BE*(BE-energy)*(rec_thx*rec_thx+rec_thy*rec_thy);
-	// returns ...
-	return virtuality;
-}
-
Index: external/Hector/H_RecRPObject.h
===================================================================
--- external/Hector/H_RecRPObject.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,109 +1,0 @@
-#ifndef _H_RecRPObject_
-#define _H_RecRPObject_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RecRPObject.h
-/// \brief Reconstructed information from objects detected by two roman pots 
-
-// local #includes
-#include "H_Parameters.h"
-#include "H_AbstractBeamLine.h"
-#include <math.h>
-using namespace std;
-
-#define NOT_YET_COMPUTED -666
-// trivial (TM), angle compensation (AM) and position compensation (PM) methods
-#define TM 1
-#define AM 2
-#define PM 3
-
-/// Reconstructed information from objects detected by two roman pots
-class H_RecRPObject {
-/// Uses (s1,x1,y1) and (s2,x2,y2) to compute the energy, the virtuality of the event, as well as the positions (x,y)  and angles (thx, thy) at IP.
-	public:
-		/// Constructors, destructor and operators
-		//@{
-		H_RecRPObject();
-		H_RecRPObject(const float, const float, const H_AbstractBeamLine& );
-		H_RecRPObject(const H_RecRPObject&);
-		H_RecRPObject& operator=(const H_RecRPObject&);
-		~H_RecRPObject() {delete matrp1; delete matrp2; delete thebeam; return;};
-		//@}
-
-		/// Getters 
-		//@{
-		inline float getX1() const {return x1; /*horizontal position at first roman pot, in \mu m */}
-		inline float getY1() const {return y1; /*vertical position at first roman pot, in \mu m */}
-		inline float getS1() const {return s1; /*longitudinal position of the first roman pot, in m, from IP*/}
-		inline float getX2() const {return x2; /*horizontal position at second RP in \mu m*/}
-		inline float getY2() const {return y2; /*vertical position at second RP in \mu m*/}
-		inline float getS2() const {return s2; /*longitudinal position of the second RP, in m, from IP*/}
-		inline float getTXRP() const {return URAD*atan((x2-x1)/((s2-s1)*URAD)); /* horizontal angle at first RP, in \mu rad*/ }
-		inline float getTYRP() const {return URAD*atan((y2-y1)/((s2-s1)*URAD)); /* vertical angle at first RP, in \mu rad*/ }
-		float getX0() {return (x0==NOT_YET_COMPUTED) ? computeX0():x0; /*reconstructed horizontal position at IP*/}
-		float getY0() {return (y0==NOT_YET_COMPUTED) ? computeY0():y0; /*reconstructed vertical position at IP*/}
-		float getTXIP() {return (thx==NOT_YET_COMPUTED) ? computeTX():thx; /*reconstructed horizontal angle at IP*/}
-		float getTYIP() {return (thy==NOT_YET_COMPUTED) ? computeTY():thy; /*reconstructed vertical angle at IP*/}
-		float getE(const unsigned int); /*returns the reconstructed energy*/
-		float getE(); /*returns the reconstructed energy if already computed*/ 
-		float getQ2() {return (virtuality==NOT_YET_COMPUTED) ? computeQ2():virtuality; /*returns the reconstructed virtuality*/}
-		//@}
-
-		// Sets the proton hit positions
-		void setPositions(const float, const float, const float, const float);
-		// Shows the variable content.
-		void printProperties() const;		
-	protected:
-		/// Measured particle coordinates at RP (X - horizontal and Y - vertical in [\f$ \mu \f$m], S -longitudinal in [m])
-		//@{
-		float x1, x2, y1, y2, s1, s2; 
-		//@}
-
-		/// Reconstructed positions and angles at IP in [\f$ \mu m\f$] and [\f$ \mu rad\f$] 
-		//@{
-		float x0, y0, thx, thy;
-		//@}
-	
-		/// Reconstructed energy and virtuality at IP in GeV and GeV\f$^2\f$ 
-		//@{
-		float energy, virtuality;
-		//@}
-	
-		float computeX0();
-		float computeY0();	
-		float computeTX();
-		float computeTY();
-		/// Energy reconstruction : trivial method
-		float computeE_TM();
-		/// Energy reconstruction : angle compensation method
-		float computeE_AM();
-		/// Energy reconstruction : position compensation method
-		float computeE_PM();
-		/// Virtuality reconstruction. Energy should be reconstructed before.
-		float computeQ2();
-		/// Calibrates the energy reconstruction with respect to the chromaticity of the transfer matrices
-		float getECorrectionFactor(const unsigned int, const unsigned int );
-		/// The beamline : 
-		H_AbstractBeamLine * thebeam;
-		/// The matrices
-		//@{
-		TMatrix * matrp1;
-		TMatrix * matrp2;
-		//@}
-		/// The correction factors
-		//@{
-		float corr1_TM, corr2_TM, corr1_AM, corr2_AM;
-		//@}
-};
-
-#endif
Index: external/Hector/H_RectEllipticAperture.cc
===================================================================
--- external/Hector/H_RectEllipticAperture.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RectEllipticAperture.cc
-/// \brief Defines the Rect-Elliptic aperture of beamline elements.
-
-// C++ #includes
-#include <iostream>
-
-// C #includes
-#include <cmath> // needed for fabs
-
-// ROOT #includes
-//#include "TEllipse.h"
-//#include "TPave.h"
-
-// local #includes
-#include "H_RectEllipticAperture.h"
-using namespace std;
-
-H_RectEllipticAperture::H_RectEllipticAperture(const float x1, const float x2, const float x3, const float x4, const float posx, const float posy) :H_Aperture(RECTELLIPSE,((x1==0)?x3:x1),((x2==0)?x4:x2),x3,x4,posx,posy) {
-	/// @param x1, x2, x3, x4 are the geometrical parameters of the rect-ellipse shape
-	/// @param posx, posy defines the (x,y) of the center of the shape
-	type= RECTELLIPSE;
-}
-
-void H_RectEllipticAperture::draw() const {
-/*	TEllipse* te = new TEllipse(fx,fy,x3,x4);
-	TPave* tp = new TPave(fx-x1,fy-x2,fx+x1,fy+x2,1);
-        te->SetLineColor(2);
-        te->SetFillColor(2);
-	te->SetFillStyle(3004);
-        te->Draw();
-        tp->SetLineColor(2);
-        tp->SetFillColor(2);
-	tp->SetFillStyle(3005);
-        tp->Draw();	
-	return;
-*/
-}
-
-bool H_RectEllipticAperture::isInside(const float x, const float y) const {
-	return((fabs(fx-x)<x1)&&(fabs(fy-y)<x2)&&(((x-fx)/x3)*((x-fx)/x3)+((y-fy)/x4)*((y-fy)/x4)<1));
-}
-
-void H_RectEllipticAperture::printProperties() const {
-	cout << "Aperture shape:" << getTypeString() << ", parameters " <<x1<<", "<<x2<<", "<<x3<<", "<<x4<< endl;
-	cout << " \t Center : "<<fx<<", "<<fy<<endl;
-	return;
-}
Index: external/Hector/H_RectEllipticAperture.h
===================================================================
--- external/Hector/H_RectEllipticAperture.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#ifndef _H_RectEllipticAperture_
-#define _H_RectEllipticAperture_
-
-/// \file H_RectEllipticAperture.h
-/// \brief Defines the Rect-Elliptic aperture of beamline elements.
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-// local #includes
-#include "H_Aperture.h"
-
-/// Rect-ellipse apertures
-class H_RectEllipticAperture: public H_Aperture {
-
-	public:
-		///     Constructors and Destructor
-		//@{
-		H_RectEllipticAperture():H_Aperture(RECTELLIPSE,0,0,0,0,0,0) {}
-		H_RectEllipticAperture(const float,const float,const float,const float, const float, const float);
-		~H_RectEllipticAperture() {return;};
-		//@}
-		virtual void printProperties() const;
-		/// Checks whether the point is inside the aperture or not
-		virtual bool isInside(const float, const float) const;
-		/// Draws the aperture shape.
-		virtual void draw() const;
-};
-
-#endif
Index: external/Hector/H_RectangularAperture.cc
===================================================================
--- external/Hector/H_RectangularAperture.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RectangularAperture.cc
-/// \brief Defines the rectangular aperture of beamline elements.
-
-// C++ #includes
-#include <iostream>
-
-// C #includes
-#include <cmath> // needed for fabs
-
-// ROOT #includes
-//#include "TPave.h"
-
-// local #includes
-#include "H_RectangularAperture.h"
-using namespace std;
-
-H_RectangularAperture::H_RectangularAperture(const float x1, const float x2, const float posx, const float posy) :H_Aperture(RECTANGULAR,x1,x2,0,0,posx,posy) {
-	/// @param x1, x2 are the length and height of the rectangular shape
-	/// @param posx, posy are the (x,y) coordinates of the center of the rectangular shape
-}
-
-bool H_RectangularAperture::isInside(const float x, const float y) const {
-	/// @param x, y are the (x,y) coordinates of the proton, in [m]
-	return (fabs(x-fx)<x1&&fabs(y-fy)<x2);
-}
-
-void H_RectangularAperture::draw() const {
-/*	TPave* tp = new TPave(fx-x1,fy-x2,fx+x1,fy+x2,1);
-	tp->SetFillStyle(3003);
-	tp->SetLineColor(2);
-	tp->SetFillColor(2);
-	tp->Draw();
-	return;
-*/
-}
-void H_RectangularAperture::printProperties() const {
-	cout << "Aperture shape:" << getTypeString() << ", rectangle Sides : "<<x1<<", "<<x2<<endl;
-	cout << " \t Center : " << fx << "," << fy << endl;
-	return;
-}
Index: external/Hector/H_RectangularAperture.h
===================================================================
--- external/Hector/H_RectangularAperture.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#ifndef _H_RectangularAperture_
-#define _H_RectangularAperture_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RectangularAperture.h
-/// \brief Defines the rectangular aperture of beamline elements.
-
-// local #includes
-#include "H_Aperture.h"
-
-/// Rectangular apertures
-class H_RectangularAperture : public H_Aperture {
-
-	public:
-		/// Constructors and destructor
-		//@{
-		H_RectangularAperture():H_Aperture(RECTANGULAR,0,0,0,0,0,0) {}
-		H_RectangularAperture(const float,const float,const float,const float);
-		~H_RectangularAperture() {return;};
-		//@}
-		/// Checks whether the point is inside the aperture or not 
-		virtual bool isInside(const float, const float) const;
-		/// Draws the aperture shape.
-		virtual void draw() const;
-		virtual void printProperties() const;
-};
-
-#endif
Index: external/Hector/H_RectangularCollimator.cc
===================================================================
--- external/Hector/H_RectangularCollimator.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RectangularCollimator.cc
-/// \brief R-Collimators for the LHC beamline.
-
-// local #includes
-#include "H_RectangularCollimator.h"
-#include "H_TransportMatrices.h"
-
-void H_RectangularCollimator::init() {
-	// must be in public section
-		setTypeString();
-		setMatrix(0,MP,QP);
-	return;
-}
-
-H_RectangularCollimator::H_RectangularCollimator(const double s, const double l) :H_OpticalElement(RCOLLIMATOR,s,0.,l){
-		init();
-	return;
-}
-
-H_RectangularCollimator::H_RectangularCollimator(const string nameE, const double s, const double l) :H_OpticalElement(nameE,RCOLLIMATOR,s,0.,l){
-		init();
-	return;
-}
-
-void H_RectangularCollimator::printProperties() const {
-	cout << typestring << name;
-	cout << "\t\t at s = " << fs;
-	cout << "\t length = " << element_length;
-	cout<<endl;
-	if(element_aperture->getType()!=NONE) {
-        	cout <<"\t aperture type = " << element_aperture->getTypeString();
-                	element_aperture->printProperties();
-	}
-
-	if(element_length<0)  { if(VERBOSE) cout<<"\t ERROR : Interpenetration of elements !"<<endl; }
-	if(element_length==0) { if(VERBOSE) cout<<"\t WARNING : 0-length "<< name << " !" << endl; }
-}
-
-void H_RectangularCollimator::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	//	cout<<"\t WARNING : H_RectangularCollimator matrices not yet implemented ! " << endl;
-		*element_mat = driftmat(element_length);
-	return ;
-}
Index: external/Hector/H_RectangularCollimator.h
===================================================================
--- external/Hector/H_RectangularCollimator.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#ifndef _H_RectangularCollimator_
-#define _H_RectangularCollimator_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RectangularCollimator.h
-/// \brief Class describing Rectangular Collimators
-
-// local #includes
-#include "H_OpticalElement.h"
-
-/// R-Collimators for the LHC beamline.
-class H_RectangularCollimator : public H_OpticalElement {
-
-	public:
-	/// Constructors and destructor
-	//@{
-		H_RectangularCollimator():H_OpticalElement(RCOLLIMATOR,0.,0.,0.) {init();}
-		H_RectangularCollimator(const double, const double );
-		H_RectangularCollimator(const string, const double, const double );
-		~H_RectangularCollimator() { return; };
-	//@}
-		virtual void printProperties() const;
-		void init();
-
-	private:
-	 	virtual void setTypeString() {typestring=RCOLLIMATORNAME;};
-		virtual void setMatrix(const float, const float, const float) const ;
-
-};
-
-#endif
Index: external/Hector/H_RectangularDipole.cc
===================================================================
--- external/Hector/H_RectangularDipole.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,25 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RectangularDipole.cc
-/// \brief Classes aiming at simulating LHC beam rectangular dipoles
-
-#include "H_RectangularDipole.h"
-#include "H_TransportMatrices.h"
-
-void H_RectangularDipole::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	if (fk !=0 ) *element_mat = rdipmat(element_length,fk,eloss,p_mass,p_charge);
-	else  {
-		*element_mat = driftmat(element_length);
-		if(VERBOSE) cout<<"\t WARNING : k0= 0, drift-like dipole (" << name << ") !" << endl;
-	}
-	return ;
-}
Index: external/Hector/H_RectangularDipole.h
===================================================================
--- external/Hector/H_RectangularDipole.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#ifndef _H_RectangularDipole_
-#define _H_RectangularDipole_
-
-/// \file H_RectangularDipole.h
-/// \brief Classes aiming at simulating LHC beam rectangular dipoles.
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#include "H_Dipole.h"
-
-/// Rectangle dipoles.
-class H_RectangularDipole : public H_Dipole {
-
-	public:
-		/// constructor
-		//@{
-		H_RectangularDipole():H_Dipole(RDIPOLE,0.,0.,0.) {init();}
-        	H_RectangularDipole(const double s, const double k, const double l) :H_Dipole(RDIPOLE,s,k,l){init();}
-	        H_RectangularDipole(const string nameE, const double s, const double k, const double l) :H_Dipole(nameE,RDIPOLE,s,k,l){init();}
-        	~H_RectangularDipole() {return;};
-		//@}
-	private:
-	        virtual void setTypeString() { typestring = RDIPOLENAME;};
-        	virtual void setMatrix(const float, const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_RomanPot.cc
===================================================================
--- external/Hector/H_RomanPot.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_RomanPot.cc
-/// \brief Roman pot class
-
-// local #includes
-#include "H_RomanPot.h"
-#include "H_RectangularAperture.h"
-#include "H_TransportMatrices.h"
-
-void H_RomanPot::init() {
-	// must be in public section
-		setTypeString();
-		setMatrix(0,MP,QP);
-	return;
-}
-
-H_RomanPot::H_RomanPot(const double s, const double app) :H_OpticalElement(RP,s,0.,RP_LENGTH){
-		init();
-		H_RectangularAperture* rapp = new H_RectangularAperture(app,RP_HEIGHT,0,0);
-		setAperture(rapp);
-}
-
-H_RomanPot::H_RomanPot(const string nameE, const double s, const double app) :H_OpticalElement(nameE,RP,s,0.,RP_LENGTH){
-		init();
-		H_RectangularAperture* rapp = new H_RectangularAperture(app,RP_HEIGHT,0,0);
-		setAperture(rapp);
-}
-
-void H_RomanPot::printProperties() const {
-		cout << typestring << name;
-		cout << "\t\t at s = " << fs;
-                if(element_aperture->getType()!=NONE) {
-                        cout <<"\t aperture type = " << element_aperture->getTypeString();
-                        element_aperture->printProperties();
-                }
-
-		cout<<endl;
-}
-
-void H_RomanPot::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-		*element_mat = driftmat(0);
-	return ;
-}
Index: external/Hector/H_RomanPot.h
===================================================================
--- external/Hector/H_RomanPot.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#ifndef _H_RomanPot_
-#define _H_RomanPot_
-
-/// \file H_RomanPot.h
-/// \brief Roman pot class
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-// local #includes
-#include "H_OpticalElement.h"
-
-#define RP_LENGTH 0.0001
-#define RP_HEIGHT 10000
-/// Roman pot as an optics element.
-class H_RomanPot : public H_OpticalElement {
-
-	public:
-	///     Constructors and destructor
-	//@{
-		H_RomanPot():H_OpticalElement(RP,0.,0.,RP_LENGTH) {init();}
-		H_RomanPot(const string, const double, const double);
-		H_RomanPot(const double, const double);
-		~H_RomanPot() { return; };
-	//@}
-		virtual void printProperties() const;
-		void init();
-
-	private:
-		virtual void setTypeString() {typestring=RPNAME;};
-		virtual void setMatrix(const float, const float, const float) const;
-
-};
-
-#endif
Index: external/Hector/H_SectorDipole.cc
===================================================================
--- external/Hector/H_SectorDipole.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,25 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_SectorDipole.cc
-/// \brief Classes aiming at simulating sector dipoles
-
-#include "H_SectorDipole.h"
-#include "H_TransportMatrices.h"
-
-void H_SectorDipole::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	if (fk !=0 ) *element_mat = sdipmat(element_length,fk,eloss,p_mass,p_charge);
-	else  {
-		*element_mat = driftmat(element_length);
-		if(VERBOSE) cout<<"\t WARNING : k0= 0, drift-like dipole (" << name << ") !" << endl;
-   		}
-	return ;
-}
Index: external/Hector/H_SectorDipole.h
===================================================================
--- external/Hector/H_SectorDipole.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,36 +1,0 @@
-/// \file H_SectorDipole.h
-/// \brief Classes aiming at simulating sector dipoles.
-
-#ifndef _H_SectorDipole_
-#define _H_SectorDipole_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#include "H_Dipole.h"
-
-/// Sector dipoles.
-class H_SectorDipole : public H_Dipole {
-
-	public:
-		/// Constructors and destructor
-		//@{
-		H_SectorDipole():H_Dipole(SDIPOLE,0.,0.,0.) {init();}
-		H_SectorDipole(const double s, const double k, const double l) :H_Dipole(SDIPOLE,s,k,l){init();}
-		H_SectorDipole(const string nameE, const double s, const double k, const double l) :H_Dipole(nameE,SDIPOLE,s,k,l){init();}
-		~H_SectorDipole() {return;};
-		//@}
-	private:
-		virtual void setTypeString() { typestring = SDIPOLENAME;};
-		virtual void setMatrix(const float ,const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_TransportMatrices.cc
===================================================================
--- external/Hector/H_TransportMatrices.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,295 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_TransportMatrices.cc
-/// \brief Includes the implementation of every transport matrix.
-
-// c++ #includes
-#include <iostream>
-
-// C #includes
-#include <cmath>
-
-// local #includes
-#include "H_Parameters.h"
-#include "H_TransportMatrices.h"
-using namespace std;
-
-bool relative_energy = 1;
-
-// caution : do not change particle mass, not implemented yet.
-
-extern double omega(const double k, const double l) {
-		// [l] = [m] and [k] = [1/mï¿œ] for quadrupoles
-		// [omega] = [1]
-	return sqrt(fabs(k))*l;
-}
-
-extern double radius(const double k) {
-		// [k] = [1/mï¿œ] for quadrupoles
-		// [k] = [1/m]  for dipoles
-		// [radius(k)] = [m]
-	if(k==0 && VERBOSE) cout<<"ERROR : Dipole has no effect : results will be corrupted"<<endl; 
-	// this is protected by the "if(k==0) -> driftmat" in every matrix below (ex vquatmat)
-	return (k==0) ? 1 : 1/k;
-}
-
-extern void printMatrix(TMatrix * TMat) {
-	char temp[20];
-	float * el = new float[MDIM*MDIM];
-	el = (TMat->GetMatrixArray());
-
-	cout << endl << "\t";
-	for(int i=0;i<MDIM*MDIM;i++) {
-		if (el[i]<0)
-  			 {sprintf(temp,"%.5e",el[i]);}
-		else if (el[i]>0)
-   			 {sprintf(temp," %.5e",el[i]);}
-   		else {sprintf(temp,"       0    ");}
-   		
-		cout << temp << " ";
-		if((i+1)%MDIM == 0) { cout << endl << "\t"; }
-	}
-	cout << endl;
-}
-
-extern TMatrix vquadmat(const float l, const float k, const float eloss = 0., const float p_mass=MP, const float p_charge=QP) {
-		// the length l is in [m]
-		// the strength k is in [1/mï¿œ] for quadrupoles
-		// eloss in [GeV]
-		// ke is the modified field with respect to the eloss
-                //  k = e/p * dB/dx with p = mv (and m = MP)
-                //  k -> ke = k * p/ (p - dp) <- chromacity
-                //  ke -> ke * p_charge / QP <- if not a proton
-                //  ke = 0 if charge = 0, whatever the mass
-                
-	const double p0 = sqrt( (BE-MP)*(BE+MP) );
-	const double E  = BE - eloss;
-	const double p  = sqrt( (E-p_mass)*(E+p_mass) );
-	const float ke = (p_charge==0) ? 0 : k* p0/p  *p_charge/QP;
-	if (ke==0) {
-		TMatrix drift(driftmat(l));		
-		return drift;
-	}
-	// else... : 
-	float om = omega(ke,l);
-	float * mat = new float[MDIM*MDIM];
-	float tmat[MDIM*MDIM] =  {cosh(om),sqrt(ke)*sinh(om),0.,0., 0.,0.,
-                           (1/sqrt(ke))*sinh(om),cosh(om),0.,0., 0.,0.,
-                           0.,0.,cos(om),-sqrt(ke)*sin(om), 0.,0.,
-                           0.,0.,(1/sqrt(ke))*sin(om),cos(om), 0.,0.,
-                           0., 0., 0., 0., 1., 0.,
-			   0., 0., 0., 0., 0., 1.
-	};
-	for (int i=0; i<MDIM*MDIM; i++) {mat[i] = tmat[i];}
-	TMatrix TMat(MDIM,MDIM,mat);
-	delete [] mat;
-    return TMat;
-}
-
-extern TMatrix hquadmat(const float l, const float k, const float eloss = 0., const float p_mass=MP, const float p_charge=QP) {
-		// the length l is in [m]
-		// the strength k is in [1/mï¿œ] for quadrupoles
-		// ke is the modified field with respect to the eloss
-                //  k = e/p * dB/dx with p = mv (and m = MP)
-                //  k -> ke = k * p/ (p- dp) <- chromacity
-                //  ke -> ke *p_charge/QP <- if not a proton
-        const double p0 = sqrt( (BE-MP)*(BE+MP) );
-        const double E  = BE - eloss;
-        const double p  = sqrt( (E-p_mass)*(E+p_mass) );
-        const float ke = (p_charge==0) ? 0 : fabs(k* p0/p)  *p_charge/QP;
-
-        if (ke==0) {
-		TMatrix drift(driftmat(l));
-		return drift;
-	}
-	float om = omega(ke,l);
-	float * mat = new float[MDIM*MDIM];
-	float tmat[MDIM*MDIM] =  {cos(om),-sqrt(ke)*sin(om),0.,0., 0., 0.,
-                           (1/sqrt(ke))*sin(om),cos(om),0.,0., 0., 0.,
-                           0.,0.,cosh(om),sqrt(ke)*sinh(om), 0., 0., 
-                           0.,0.,(1/sqrt(ke))*sinh(om),cosh(om), 0., 0.,
-                    	    0., 0., 0., 0., 1., 0.,
-                           0., 0., 0., 0., 0., 1. 
-	};
-	for(int i=0;i<MDIM*MDIM;i++) { mat[i] = tmat[i]; }
-	TMatrix TMat(MDIM,MDIM,mat);
-	delete [] mat;
-    return TMat;
-}
-
-extern TMatrix rdipmat(const float l, const float k, const float eloss = 0., const float p_mass=MP, const float p_charge=QP) {
-		// the length l is in [m]
-		// the strength k is in [1/m] for dipoles
-		// ke is the modified field with respect to the eloss
-                //  k = e/p * dB/dx with p = mv (and m = MP)
-                //  k -> ke = k * p/ (p- dp) <- chromacity
-                //  ke -> ke * q_mass/QP <- if not a proton
-
-        const double p0 = sqrt( (BE-MP)*(BE+MP) );
-        const double E  = BE - eloss;
-        const double p  = sqrt( (E-p_mass)*(E+p_mass) );
-        const float ke = (p_charge==0) ? 0 : k* p0/p  *p_charge/QP;
- 
-        if (ke==0) {
- 		TMatrix drift(driftmat(l));
-		return drift;
-	}
-	float r = radius(ke);
-	float * mat = new float[MDIM*MDIM];
-	float * efmat = new float[MDIM*MDIM];
-	double simp = r*2*sin(l/(2*r))*sin(l/(2*r))/BE;
-	double psy = ke*l/2.;
-	float tefmat[MDIM*MDIM] = {1., (float)(tan(psy)*ke), 0., 0., 0., 0.,
-	                            0., 1., 0., 0., 0., 0.,
-	                            0., 0., 1., (float)(-tan(psy)*ke), 0., 0.,
-	                            0., 0., 0., 1., 0., 0.,
-	                            0., 0., 0., 0., 1., 0.,
-	                            0., 0., 0., 0., 0., 1. };
- 
-	float tmat[MDIM*MDIM] =  {cos(l/r),(-1/r)*sin(l/r),0.,0., 0., 0.,
-	             	           r*sin(l/r),cos(l/r),0.,0., 0., 0.,
-   		           	           0.,0.,1.,0., 0., 0.,
-   	            	           0.,0.,l,1., 0., 0., 
-   	                        (float)simp, (float)(sin(l/r)/BE), 0., 0., 1., 0.,
-   	                        0., 0., 0., 0., 0., 1. };
-	for(int i=0;i<MDIM*MDIM;i++) { 
-		mat[i] = tmat[i];
-	    efmat[i] = tefmat[i];	
-	}
-	TMatrix TMat(MDIM,MDIM,mat);
-	TMatrix TEfmat(MDIM,MDIM,efmat);
-    if(relative_energy) {
-        TMat *= TEfmat;
-        TEfmat *= TMat;
-    }
-
-//	if(VERBOSE) cout<<"\t WARNING : RDipoles not implemented and replaced by SDipoles" << endl;
-	delete [] mat;
-	delete [] efmat;
-    if(relative_energy) {
-        return TEfmat;
-    } else {
-        return TMat;
-    }
-}
-
-extern TMatrix sdipmat(const float l, const float k, const float eloss = 0., const float p_mass=MP, const float p_charge=QP) {
-		// the length l is in [m]
-		// the strength k is in [1/m] for dipoles
-		// ke is the modified field with respect to the eloss
-                //  k = e/p * dB/dx with p = mv (and m = MP)
-                //  k -> ke = k * p/ (p- dp) <- chromacity
-                //  ke -> ke * q_mass/QP <- if not a proton
-                
-        const double p0 = sqrt( (BE-MP)*(BE+MP) );
-        const double E  = BE - eloss;
-        const double p  = sqrt( (E-p_mass)*(E+p_mass) );
-        const float ke = (p_charge==0) ? 0 : k* p0/p  *p_charge/QP;
-
-        if (ke==0) {
-		TMatrix drift(driftmat(l));
-		return drift;
-	}
-	extern bool relative_energy;
-	float r = radius(ke);
-  	float * mat = new float[MDIM*MDIM];
-
-	float simp = 2*r*sin(l/(2*r))*sin(l/(2*r))/BE;
-	float tmat[MDIM*MDIM] =  {cos(l/r),(-1/r)*sin(l/r),0.,0., 0., 0.,
-		                      r*sin(l/r),cos(l/r),0.,0., 0., 0.,
-			                  0.,0.,1.,0., 0., 0.,
-			                  0.,0.,l,1., 0., 0.,
-			                  simp, (float)(sin(l/r)/BE), 0., 0., 1., 0.,
-			                  0., 0., 0., 0., 0., 1.
-				           };
-	if(!relative_energy) {
-		tmat[24] = 0;
-		tmat[25] = 0;
-	} 
-
-	for(int i=0;i<MDIM*MDIM;i++) { mat[i] = tmat[i]; }
-	TMatrix TMat(MDIM,MDIM,mat);
-	delete [] mat;
-    return TMat;
-}
-
-extern TMatrix driftmat(const float l) {
-		// the length l is in [m]
-	float * mat = new float[MDIM*MDIM];
-	float tmat[MDIM*MDIM] =  {1.,0.,0.,0.,0.,0.,
-                           l ,1.,0.,0.,0.,0.,
-                           0.,0.,1.,0.,0.,0.,
-                           0.,0.,l ,1.,0.,0.,
-                           0.,0.,0.,0.,1.,0.,
-                           0., 0., 0., 0., 0., 1. 
-	};
-	for(int i=0;i<MDIM*MDIM;i++) { mat[i] = tmat[i]; }
-	TMatrix TMat(MDIM,MDIM,mat);
-	delete [] mat;
-	return TMat;
-}
-
-
-extern TMatrix hkickmat(const float l, const float k, const float eloss =0., const float p_mass=MP, const float p_charge=QP) {
-                // the length l is in [m]
-                // the strength k is in [rad]
-        const double p0 = sqrt( (BE-MP)*(BE+MP) );
-        const double E  = BE - eloss;
-        const double p  = sqrt( (E-p_mass)*(E+p_mass) );
-        const float ke = (p_charge==0) ? 0 : -k* p0/p  *p_charge/QP;
-
-        if (ke==0) {
-		TMatrix drift(driftmat(l));
-		return drift;
-	}
-	float * mat = new float[MDIM*MDIM];
-	float tmat[MDIM*MDIM] =  {1.,0.,0.,0.,0.,0.,
-                           l ,1.,0.,0.,0.,0.,
-                           0.,0.,1.,0.,0.,0.,
-                           0.,0.,l ,1.,0.,0.,
-                           0.,0.,0.,0.,1.,0.,
-                           (float)(l*tan(ke)/2.),ke, 0., 0., 0., 1. 
-	};
-
-	for(int i=0;i<MDIM*MDIM;i++) { mat[i] = tmat[i]; }
-	TMatrix TMat(MDIM,MDIM,mat);
-	delete [] mat;
-	return TMat;
-}
-
-extern TMatrix vkickmat(const float l, const float k, const float eloss=0., const float p_mass=MP, const float p_charge=QP) {
-                // the length l is in [m]
-                // the strength k is in [rad]
-        const double p0 = sqrt( (BE-MP)*(BE+MP) );
-        const double E  = BE - eloss;
-        const double p  = sqrt( (E-p_mass)*(E+p_mass) );
-        const float ke = (p_charge==0) ? 0 : -k* p0/p  *p_charge/QP;
-
-        if (ke==0) {
-		TMatrix drift(driftmat(l));
-		return drift;
-	}
-	float * mat = new float[MDIM*MDIM];
-	float tmat[MDIM*MDIM] =  {1.,0.,0.,0.,0.,0.,
-                           l ,1.,0.,0.,0.,0.,
-                           0.,0.,1.,0.,0.,0.,
-                           0.,0.,l ,1.,0.,0.,
-                           0.,0.,0.,0.,1.,0.,
-                           0.,0.,(float)(l*tan(ke)/2.),ke, 0., 1. 
-	};
-
-	for(int i=0;i<MDIM*MDIM;i++) { mat[i] = tmat[i]; }
-	TMatrix TMat(MDIM,MDIM,mat);
-	delete [] mat;
-	return TMat;
-}
-
Index: external/Hector/H_TransportMatrices.h
===================================================================
--- external/Hector/H_TransportMatrices.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,212 +1,0 @@
-#ifndef _H_TransportMatrices_
-#define _H_TransportMatrices_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/** \file H_TransportMatrices.h
- * \brief Contains the matrices defining the propagation of the beam.
- * 
- * The matrices should have the following units :
- *	\f$
- *	\mathbf{M} =
- *	\left(
- *	\begin{array}{cccccc}
- *	    1 & 1/m & 1 & 1/m & GeV/m & 1 \\
- *	    m & 1 & m & 1 & GeV & 1 \\
- *	    1 & 1/m & 1 & 1/m & GeV/m & 1\\
- *	    m & 1 & m & 1 & GeV & 1 \\
- *	  m/GeV & 1/GeV & m/GeV & 1/GeV & 1 & 1\\
- *	    1 & 1 & 1 & 1 & 1  & 1 \\	
- *	\end{array}
- *	\right)
- *	\f$
- *
- *	Note : convention is transposed compared to ref : x0.M = x1
- * 	instead of x1 = M.x0 so the matrices should be transposed.
- */
-
-// ROOT #includes
-#include "TMatrix.h"
-using namespace std;
-
-	/// transport matrix dimension
-#define MDIM 6
-
-/// \f$ \omega(k,l) = l \sqrt{|k|} \f$ is needed for the quadrupole matrices
-extern double omega(const double , const double );
-
-/// \f$ r(k) \f$ is needed for the dipole matrices
-extern double radius(const double );
-
-/// Prints the matrix
-extern void printMatrix(TMatrix * );
-
-/// \brief Returns the matrix for a vertically focussing quadrupole (H_VerticalQuadrupole)
-
-/*! \f$
- \mathbf{M} =
- \left(
- \begin{array}{cccccc}
- \cosh(\omega) & \sqrt{k}\sinh(\omega) & 0 & 0 & 0 & 0\\
- (1/\sqrt{k})sinh(\omega) & \cosh(\omega) & 0 & 0 & 0 &0\\
- 0 & 0 & \cos(\omega) & -\sqrt{k}sin(\omega) & 0 &0\\
- 0 & 0 & (1/\sqrt{k})*sin(\omega) & \cos(\omega) & 0 &0\\
- 0 & 0 & 0 & 0 & 1 &0\\
- 0 & 0 & 0 & 0 & 0 &1 \\
- \end{array}
- \right)
- \f$
-
- assuming \f$ k =  k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$ and \f$ \omega(k,l) = l \sqrt{|k|} \f$
-*/
-
-extern TMatrix vquadmat(const float , const float , const float , const float , const float);
-
-/// \brief Returns the matrix for a horizontally focussing quadrupole (H_HorizontalQuadrupole)
-
-/*! \f$
- \mathbf{M} =
- \left(
- \begin{array}{cccccc}
- \cos(\omega) & -\sqrt{k}\sin(\omega) & 0 & 0 & 0 & 0\\
- (1/\sqrt{k})sin(\omega) & \cos(\omega) & 0 & 0 & 0 & 0\\
- 0 & 0 & \cosh(\omega) & \sqrt{k}sinh(\omega) & 0 & 0\\
- 0 & 0 & (1/\sqrt{k})sinh(\omega) & \cosh(\omega) & 0 & 0\\
- 0 & 0 & 0 & 0 & 1 & 0\\
- 0 & 0 & 0 & 0 & 0 & 1 \\
- \end{array}
- \right)
- \f$
-
- assuming \f$ k =  k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$ and \f$ \omega(k,l) = l \sqrt{|k|} \f$
-*/
-extern TMatrix hquadmat(const float , const float , const float , const float , const float);
-
-/// \brief Returns the matrix for a rectangle dipole (H_RectangularDipole)
-
-/*! \f$
- \mathbf{M} =
- \left(
- \begin{array}{cccccc}
- \cos(l/r) & \frac{-1}{r} \sin(l/r) & 0 & 0 & 0 & 0\\
- r \sin(l/r) & \cos(l/r) & 0 & 0 & 0 & 0\\
- 0 & 0 & 1 & 0 & 0 &0\\
- 0 & 0 & l & 1 & 0 &0\\
- 2r \sin^2(l/2r)/BE & \sin(l/r)/BE & 0 & 0 & 1 &0\\
- 0 & 0 & 0 & 0 & 0 & 1\\
- \end{array}
- \right)
- \f$
-
- assuming \f$ 1/r = k =  k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$ and \f$ BE = 7000 GeV \f$.
-
-Attention : numerical sensitivity with \f$ r*(1-\cos(l/r))/BE\f$. \\
-Using \f$ 2\sin^2(x/2) = 1-\cos(x)\f$ instead (see the variable called "simp")
-*/
-extern TMatrix rdipmat(const float, const float , const float , const float , const float);
-
-/// \brief Returns the matrix for a sector dipole (H_SectorDipole)
-
-/*! The matrix is different if the bending is on or off.
- 
- \f$
- \mathbf{M_{bending-off}} =
- \left(
- \begin{array}{cccccc}
- \cos(l/r) & \frac{-1}{r} \sin(l/r) & 0 & 0 & 0 & 0\\
- r \sin(l/r) & \cos(l/r) & 0 & 0 & 0 & 0\\
- 0 & 0 & 1 & 0 & 0 & 0\\
- 0 & 0 & l & 1 & 0 & 0\\
- 0 & 0 & 0 & 0 & 1 & 0\\
- 0 & 0 & 0 & 0 & 0 & 1\\
- \end{array}
- \right)
- \f$
-
- \f$
- \mathbf{M_{bending-on}} =
- \left( 
- \begin{array}{cccccc} 
- \cos(l/r) & \frac{-1}{r} \sin(l/r) & 0 & 0 & 0 & 0\\
- r \sin(l/r) & \cos(l/r) & 0 & 0 & 0 & 0\\
- 0 & 0 & 1 & 0 & 0 &0\\ 
- 0 & 0 & l & 1 & 0 &0\\ 
- 2r \sin^2(l/2r)/BE & \sin(l/r)/BE & 0 & 0 & 1 & 0\\ 
- 0 & 0 & 0 & 0 & 0 & 1\\
- \end{array} 
- \right) 
- \f$ 
- 
- assuming \f$ 1/r = k =  k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$
-
-*/
-extern TMatrix sdipmat(const float, const float , const float , const float , const float );
-
-/// \brief Returns the matrix for a drift (H_Drift)
-
-/*! \f$
- \mathbf{M} =
- \left(
- \begin{array}{cccccc}
- 1 & 0 & 0 & 0 & 0 & 0\\
- l & 1 & 0 & 0 & 0 & 0\\
- 0 & 0 & 1 & 0 & 0 & 0\\
- 0 & 0 & l & 1 & 0 & 0\\
- 0 & 0 & 0 & 0 & 1 & 0\\
- 0 & 0 & 0 & 0 & 0 & 1\\
- \end{array}
- \right)
- \f$
-*/
-extern TMatrix driftmat(const float );
-
-/// \brief Returns the matrix for a horizontal kicker (H_HorizontalKicker)
-/*! \f$
- \mathbf{M} =
- \left(
- \begin{array}{cccccc}
- 1 & 0 & 0 & 0 & 0 & 0\\
- l & 1 & 0 & 0 & 0 & 0 \\
- 0 & 0 & 1 & 0 & 0 & 0\\
- 0 & 0 & l & 1 & 0 & 0\\
- 0 & 0 & 0 & 0 & 1 & 0\\
- l \tan(k) /2 & k & 0 & 0 & 0 & 1\\
- \end{array}
- \right) 
- \f$
- 
- assuming \f$ k =  k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$
-*/
-extern TMatrix hkickmat(const float, const float , const float , const float, const float);
-
-/// \brief Returns the matrix for a vertical kicker (H_VerticalKicker)
-/*! \f$
- \mathbf{M} =
- \left(
- \begin{array}{cccccc}
- 1 & 0 & 0 & 0 & 0 & 0\\
- l & 1 & 0 & 0 & 0 & 0 \\
- 0 & 0 & 1 & 0 & 0 & 0\\
- 0 & 0 & l & 1 & 0 & 0\\
- 0 & 0 & 0 & 0 & 1 & 0\\
- 0 & 0 & l \tan(k) /2 & k & 0 & 1\\
- \end{array}
- \right) 
- \f$
-
- assuming \f$ k =  k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$
-*/
-extern TMatrix vkickmat(const float, const float , const float , const float , const float);
-
-
-
-#endif
Index: external/Hector/H_VerticalKicker.cc
===================================================================
--- external/Hector/H_VerticalKicker.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_VerticalKicker.cc
-/// \brief Classes aiming at simulating vertical kickers in the beamline
-
-// fk [rad] for kickers !!!!
-
-// local #includes
-#include "H_VerticalKicker.h"
-#include "H_TransportMatrices.h"
-
-void H_VerticalKicker::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	extern int kickers_on;
-	if(kickers_on) {
-		*element_mat = vkickmat(element_length,fk,eloss,p_mass,p_charge);
-	} else{
-		*element_mat = driftmat(element_length);
-	}
-	return ;
-}
Index: external/Hector/H_VerticalKicker.h
===================================================================
--- external/Hector/H_VerticalKicker.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,40 +1,0 @@
-#ifndef _H_VerticalKicker_
-#define _H_VerticalKicker_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_VerticalKicker.h
-/// \brief Classes aiming at simulating vertical kickers in the beamline.
-///
-/// fk [rad] for kickers !!!!
-
-
-// local #includes
-#include "H_Kicker.h"
-
-/// Vertical kickers for the beamline.
-class H_VerticalKicker : public H_Kicker {
-
-	public:
-	/// Constructors and destructor
-	//@{
-		H_VerticalKicker():H_Kicker(VKICKER,0.,0.,0.) {init();}
-		H_VerticalKicker(const double s, const double k, const double l) :H_Kicker(VKICKER,s,k,l){init();}
-		H_VerticalKicker(const string nameE, const double s, const double k, const double l) :H_Kicker(nameE,VKICKER,s,k,l){init();}
-		~H_VerticalKicker() {return;};
-	//@}
-	private:
-		virtual void setTypeString() {typestring=VKICKERNAME;};
-		virtual void setMatrix(const float, const float, const float) const ;
-};
-
-#endif
Index: external/Hector/H_VerticalQuadrupole.cc
===================================================================
--- external/Hector/H_VerticalQuadrupole.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,26 +1,0 @@
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_VerticalQuadrupole.cc
-/// \brief Vertically focussing quadrupoles
-
-// local #includes
-#include "H_VerticalQuadrupole.h"
-
-void H_VerticalQuadrupole::setMatrix(const float eloss, const float p_mass, const float p_charge) const {
-	if (fk<0)  { if(VERBOSE) cout<<"\t ERROR : k1 should be > 0 for H_VerticalQuadrupole (" << name << ")!"<<endl; }
-		if (fk !=0 ) *element_mat = vquadmat(element_length,fk,eloss, p_mass,p_charge);
-		else  {
-			*element_mat = driftmat(element_length);
-			if(VERBOSE) cout<<"\t WARNING : k1= 0, drift-like quadrupole (" << name << ") !" << endl;
-   		}
-	return ;
-}
Index: external/Hector/H_VerticalQuadrupole.h
===================================================================
--- external/Hector/H_VerticalQuadrupole.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,37 +1,0 @@
-#ifndef _H_VerticalQuadrupole_
-#define _H_VerticalQuadrupole_
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-/// \file H_VerticalQuadrupole.h
-/// \brief Vertically focussing quadrupoles.
-
-// local #includes
-#include "H_Quadrupole.h"
-
-/// Vertically focussing quadrupoles.
-class H_VerticalQuadrupole : public H_Quadrupole {
-
-	public:
-	///     Constructors and destructor
-	//@{
-		H_VerticalQuadrupole():H_Quadrupole(VQUADRUPOLE,0.,0.,0.) {init();}
-		H_VerticalQuadrupole(const double s, const double k, const double l):H_Quadrupole(VQUADRUPOLE,s,k,l) {init();}
-		H_VerticalQuadrupole(string nameE, const double s, const double k, const double l):H_Quadrupole(nameE,VQUADRUPOLE,s,k,l) {init();}
-		~H_VerticalQuadrupole() {return;};
-	//@}
-	private:
-		virtual void setTypeString() {typestring = VQUADRUPOLENAME;} ;
-		virtual void setMatrix(const float, const float, const float) const;
-};
-
-#endif
Index: external/PUPPI/AUTHORS
===================================================================
--- external/PUPPI/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,2 +1,0 @@
-PUPPI software has been developped by Phil Harris.
-
Index: external/PUPPI/AlgoObj.hh
===================================================================
--- external/PUPPI/AlgoObj.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#ifndef ALGOOBJ_HH
-#define ALGOOBJ_HH
-#include <vector>
-
-class AlgoSubObj
-{
-public:
-  int    metricId;
-  bool   useCharged;
-  bool   applyLowPUCorr;
-  int    combId;
-  double coneSize;
-  double rmsPtMin;
-  double rmsScaleFactor;
-};
-class AlgoObj 
-{
-public:
-      AlgoObj():
-	etaMin(0), etaMax(0), 
-	ptMin(0),minNeutralPt(0),minNeutralPtSlope(0),
-	rmsEtaSF(0),medEtaSF(0),etaMaxExtrap(0)
-    {}
-    ~AlgoObj(){}
-  
-    float etaMin;
-    float etaMax;
-    float ptMin;
-    double minNeutralPt;
-    double minNeutralPtSlope;
-    double rmsEtaSF;
-    double medEtaSF;
-    double etaMaxExtrap;  
-    std::vector<AlgoSubObj> subAlgos; 
-};
-#endif
Index: external/PUPPI/CMakeLists.txt
===================================================================
--- external/PUPPI/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,5 +1,0 @@
-include_directories(${CMAKE_SOURCE_DIR}/external)
-
-file(GLOB sources *.cc)
-
-add_library(PUPPI OBJECT ${sources})
Index: external/PUPPI/COPYING
===================================================================
--- external/PUPPI/COPYING	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,674 +1,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Index: external/PUPPI/LICENSE
===================================================================
--- external/PUPPI/LICENSE	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,30 +1,0 @@
-PUPPI Licensing
-============================================
-
-This file attempts to include all licenses that apply within PUPPI (this program) source tree, 
-in particular any that are supposed to be exposed to the end user for credit requirements for instance. 
-
-PUPPI is a new method for pileup mitigation by implementing âpileup per particle identificationâ
-
-Copyright (C) <2015-2016> <European Organization for Nuclear Research (CERN), Switzerland >
-
-The list of the contributors to the development of PUPPI is given in the AUTHORS file.
-
-PUPPI General
------------------------------------------
-
-This program (PUPPI) 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 (see COPYING file). If not, 
-see <http://www.gnu.org/licenses/>.
-
Index: external/PUPPI/NOTICE
===================================================================
--- external/PUPPI/NOTICE	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,16 +1,0 @@
-PUPPI - Copyright (C) <2015-2016> < European Organization for Nuclear Research (CERN), Switzerland >
-	
-List of the contributors to the development of PUPPI: see AUTHORS file.
-Description and complete License: see LICENSE file.
-	
-This program (PUPPI) 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 (see COPYING file).  If not, 
-see <http://www.gnu.org/licenses/>.
Index: external/PUPPI/PuppiAlgo.cc
===================================================================
--- external/PUPPI/PuppiAlgo.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,187 +1,0 @@
-#include "PuppiAlgo.hh"
-#include "Math/QuantFuncMathCore.h"
-#include "Math/SpecFuncMathCore.h"
-#include "Math/ProbFunc.h"
-#include "TMath.h"
-
-PuppiAlgo::PuppiAlgo(AlgoObj &iAlgo) { 
-  fEtaMin             = iAlgo.etaMin;
-  fEtaMax             = iAlgo.etaMax;
-  fPtMin              = iAlgo.ptMin;
-  fNeutralPtMin       = iAlgo.minNeutralPt;
-  fNeutralPtSlope     = iAlgo.minNeutralPtSlope;
-  fRMSEtaSF           = iAlgo.rmsEtaSF;
-  fMedEtaSF           = iAlgo.medEtaSF;
-  fEtaMaxExtrap       = iAlgo.etaMaxExtrap;
-  std::vector<AlgoSubObj> lAlgos = iAlgo.subAlgos;
-  fNAlgos = lAlgos.size();
-  //std::cout << "==> "  << fEtaMin << " - " << fEtaMax << " - " << fPtMin  << " - " << fNeutralPtMin  << " - " << fNeutralPtSlope  << " - " << fRMSEtaSF  << " - " << std::endl;
-  for(unsigned int i0 = 0; i0 < lAlgos.size(); i0++)  { 
-    int    pAlgoId      = lAlgos[i0].metricId;
-    bool   pCharged     = lAlgos[i0].useCharged;
-    bool   pWeight0     = lAlgos[i0].applyLowPUCorr;
-    int    pComb        = lAlgos[i0].combId;
-    double pConeSize    = lAlgos[i0].coneSize;
-    double pRMSPtMin    = lAlgos[i0].rmsPtMin;
-    double pRMSSF       = lAlgos[i0].rmsScaleFactor;
-    //std::cout << "Algo==> " << i0 << " - " << pAlgoId << " - " << pCharged << " - " << pWeight0 << " - " << pComb << " - " << pConeSize << " - " << pRMSPtMin << " - " << std::endl;
-    fAlgoId        .push_back(pAlgoId);
-    fCharged       .push_back(pCharged);
-    fAdjust        .push_back(pWeight0);
-    fCombId        .push_back(pComb);
-    fConeSize      .push_back(pConeSize);
-    fRMSPtMin      .push_back(pRMSPtMin);
-    fRMSScaleFactor.push_back(pRMSSF);
-    double pRMS  = 0; 
-    double pMed  = 0; 
-    double pMean = 0;
-    int    pNCount = 0; 
-    fRMS   .push_back(pRMS);
-    fMedian.push_back(pMed);
-    fMean  .push_back(pMean);
-    fNCount.push_back(pNCount);
-    /*
-      tmprms .clear();
-      tmpmed .clear();
-      for (unsigned int j0 = 0; j0 < fEtaMin.size(); j0++){
-      tmprms.push_back(pRMS);
-      tmpmed.push_back(pMed);
-      }
-      fRMS_perEta.push_back(tmprms);
-      fMedian_perEta.push_back(tmpmed);
-    */
-  }
-}
-PuppiAlgo::~PuppiAlgo() { 
-  fPups  .clear();
-  fPupsPV.clear();
-}
-void PuppiAlgo::reset() { 
-  fPups  .clear();
-  fPupsPV.clear();
-  for(unsigned int i0 = 0; i0 < fNAlgos; i0++) { 
-    fMedian[i0] =  0; 
-    fRMS   [i0] =  0;
-    fMean  [i0] =  0;
-    fNCount[i0] =  0;
-  }
-}
-void PuppiAlgo::add(const fastjet::PseudoJet &iParticle,const double &iVal,const unsigned int iAlgo) { 
-  if(iParticle.pt() < fRMSPtMin[iAlgo]) return;
-  if(fCharged[iAlgo] && fabs(iParticle.user_index())  < 1) return;
-  if(fCharged[iAlgo] && (fabs(iParticle.user_index()) >=1 && fabs(iParticle.user_index()) <=2)) fPupsPV.push_back(iVal);
-  if(fCharged[iAlgo] && fabs(iParticle.user_index()) < 3) return;
-  fPups.push_back(iVal);
-  fNCount[iAlgo]++;
-  /* eta extrap (cmssw version)
-     if ((std::abs(iParticle.eta()) < fEtaMaxExtrap) && (std::abs(puppi_register) >= 3)){
-        fPups.push_back(iVal);
-        // fPupsPV.push_back(iVal);        
-        fNCount[iAlgo]++;
-	}
-    // for the low PU case, correction.  for checking that the PU-only median will be below the PV particles
-    if(std::abs(iParticle.eta()) < fEtaMaxExtrap && (std::abs(puppi_register) >=1 && std::abs(puppi_register) <=2)) fPupsPV.push_back(iVal);
-  */
-}
-void PuppiAlgo::computeMedRMS(const unsigned int &iAlgo,const double &iPVFrac) { 
-  if(iAlgo >= fNAlgos   ) return;
-  if(fNCount[iAlgo] == 0) return;
-  int lNBefore = 0; 
-  for(unsigned int i0 = 0; i0 < iAlgo; i0++) lNBefore += fNCount[i0];
-  std::sort(fPups.begin()+lNBefore,fPups.begin()+lNBefore+fNCount[iAlgo]);
-  int lNum0 = 0;
-  for(int i0 = lNBefore; i0 < lNBefore+fNCount[iAlgo]; i0++) { 
-    if(fPups[i0] == 0) lNum0 = i0-lNBefore; 
-  }
-  //lNum0 = 0; 
-  int lNHalfway = lNBefore + lNum0 + int( double( fNCount[iAlgo]-lNum0 )*0.50);
-  fMedian[iAlgo] = fPups[lNHalfway];
-  double lMed = fMedian[iAlgo];  //Just to make the readability easier
-
-  int lNRMS = 0; 
-  for(int i0 = lNBefore; i0 < lNBefore+fNCount[iAlgo]; i0++) {
-    fMean[iAlgo] += fPups[i0];
-    if(fPups[i0] == 0) continue;
-    if(fAdjust[iAlgo] && fPups[i0] > lMed) continue;
-    lNRMS++;
-    fRMS [iAlgo] += (fPups[i0]-lMed)*(fPups[i0]-lMed);
-  }
-  fMean[iAlgo]/=fNCount[iAlgo];
-  if(lNRMS > 0) fRMS [iAlgo]/=lNRMS;
-  if(fRMS[iAlgo] == 0) fRMS[iAlgo] = 1e-5;
-
-  fRMS [iAlgo] = sqrt(fRMS[iAlgo]);
-  fRMS [iAlgo] *= fRMSScaleFactor[iAlgo];
-  if(fAdjust[iAlgo]){ 
-    //Adjust the p-value to correspond to the median
-    std::sort(fPupsPV.begin(),fPupsPV.end());
-    int lNPV = 0; 
-    for(unsigned int i0 = 0; i0 < fPupsPV.size(); i0++) if(fPupsPV[i0] <= lMed ) lNPV++;
-    double lAdjust = double(lNPV)/double(lNPV+0.5*fNCount[iAlgo]);
-    if(lAdjust > 0) {
-      fMedian[iAlgo] -= sqrt(ROOT::Math::chisquared_quantile(lAdjust,1.)*fRMS[iAlgo]);
-      fRMS[iAlgo]    -= sqrt(ROOT::Math::chisquared_quantile(lAdjust,1.)*fRMS[iAlgo]);
-    }        
-  }
-  /* eta extrapolated version
-  for (unsigned int j0 = 0; j0 < fEtaMin.size(); j0++){
-    fRMS_perEta[iAlgo][j0]    = fRMS[iAlgo]*fRMSEtaSF[j0];
-    fMedian_perEta[iAlgo][j0] = fMedian[iAlgo]*fMedEtaSF[j0];
-  }    
-  */
-}
-//This code is probably a bit confusing
-double PuppiAlgo::compute(std::vector<double> &iVals,double iChi2) { 
-  if(fAlgoId[0] == -1) return 1;
-  double lVal  = 0.;
-  double lPVal = 1.;
-  int    lNDOF = 0; 
-  for(unsigned int i0 = 0; i0 < fNAlgos; i0++) { 
-    if(fNCount[i0] == 0) return 1.;   //in the NoPU case return 1.
-    if(fCombId[i0] == 1 && i0 > 0) {  //Compute the previous p-value so that p-values can be multiplieed
-      double pPVal = ROOT::Math::chisquared_cdf(lVal,lNDOF);
-      lPVal *= pPVal;
-      lNDOF = 0; 
-      lVal  = 0; 
-    }
-    double pVal = iVals[i0];
-    //Special Check for any algo with log(0) 
-    if(fAlgoId[i0] == 0 && iVals[i0] == 0) pVal = fMedian[i0];
-    if(fAlgoId[i0] == 3 && iVals[i0] == 0) pVal = fMedian[i0];
-    if(fAlgoId[i0] == 5 && iVals[i0] == 0) pVal = fMedian[i0];
-    lVal += (pVal-fMedian[i0])*(fabs(pVal-fMedian[i0]))/fRMS[i0]/fRMS[i0];
-    lNDOF++;
-    if(i0 == 0 && iChi2 != 0) lNDOF++;      //Add external Chi2 to first element
-    if(i0 == 0 && iChi2 != 0) lVal+=iChi2;  //Add external Chi2 to first element
-  }
-  //Top it off with the last calc
-  lPVal *= ROOT::Math::chisquared_cdf(lVal,lNDOF);
-  return lPVal;
-}
-double PuppiAlgo::neutralPt(int iNPV) { 
-  return fNeutralPtMin + iNPV * fNeutralPtSlope;
-}
-int PuppiAlgo::numAlgos() { 
-  return fNAlgos;
-}
-double PuppiAlgo::ptMin() { 
-  return fPtMin;
-}
-double PuppiAlgo::etaMin() { 
-  return fEtaMin;
-}
-double PuppiAlgo::etaMax() { 
-  return fEtaMax;
-}
-int PuppiAlgo::algoId(const unsigned int &iAlgo) { 
-  assert(iAlgo < fNAlgos);
-  return fAlgoId[iAlgo];
-}
-bool PuppiAlgo::isCharged(const unsigned int &iAlgo) { 
-  assert(iAlgo < fNAlgos);
-  return fCharged[iAlgo];
-}
-double PuppiAlgo::coneSize(const unsigned int &iAlgo) { 
-  assert(iAlgo < fNAlgos);
-  return fConeSize[iAlgo];
-}
Index: external/PUPPI/PuppiAlgo.hh
===================================================================
--- external/PUPPI/PuppiAlgo.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,48 +1,0 @@
-#include "fastjet/PseudoJet.hh"
-#include "AlgoObj.hh"
-#include <vector>
-
-class PuppiAlgo{ 
-public:
-  PuppiAlgo(AlgoObj &iAlgoObj);
-  ~PuppiAlgo();
-  //Computing Mean and RMS
-  void   reset();
-  void   add(const fastjet::PseudoJet &iParticle,const double &iVal,const unsigned int iAlgo);
-  void   computeMedRMS(const unsigned int &iAlgo,const double &iPVFrac);
-  //Get the Weight
-  double compute(std::vector<double> &iVals,double iChi2);
-  //Helpers
-  double ptMin();
-  double etaMin();
-  double etaMax();
-  int    numAlgos ();
-  int    algoId   (const unsigned int &iAlgo);
-  bool   isCharged(const unsigned int &iAlgo);
-  double coneSize (const unsigned int &iAlgo);
-  double neutralPt(int iNPV);
-
-private:  
-  unsigned int   fNAlgos;
-  float  fEtaMax;
-  float  fEtaMin;
-  float  fPtMin ;
-  double fNeutralPtMin;
-  double fNeutralPtSlope;
-  double fRMSEtaSF;
-  double fMedEtaSF;
-  double fEtaMaxExtrap;
-  std::vector<float>  fPups;
-  std::vector<float>  fPupsPV;
-  std::vector<int>    fAlgoId;
-  std::vector<bool>   fCharged;
-  std::vector<bool>   fAdjust;
-  std::vector<int>    fCombId;
-  std::vector<double> fConeSize;
-  std::vector<double> fRMSPtMin;
-  std::vector<double> fRMSScaleFactor;
-  std::vector<double> fRMS;
-  std::vector<double> fMedian;
-  std::vector<double> fMean;
-  std::vector<int>    fNCount;
-};
Index: external/PUPPI/PuppiContainer.cc
===================================================================
--- external/PUPPI/PuppiContainer.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,195 +1,0 @@
-#include "PuppiContainer.hh"
-#include "fastjet/Selector.hh"
-#include "Math/ProbFunc.h"
-#include "TMath.h"
-#include <iostream>
-#include <math.h>
-
-PuppiContainer::PuppiContainer(bool iApplyCHS, bool iUseExp,double iPuppiWeightCut,std::vector<AlgoObj> &iAlgos) { 
-  fApplyCHS        = iApplyCHS;
-  fUseExp          = iUseExp;
-  fPuppiWeightCut  = iPuppiWeightCut;
-  fNAlgos = iAlgos.size();
-  for(unsigned int i0 = 0; i0 < iAlgos.size(); i0++) { 
-    PuppiAlgo pPuppiConfig(iAlgos[i0]);
-    fPuppiAlgo.push_back(pPuppiConfig);
-  }
-}
-
-void PuppiContainer::initialize(const std::vector<RecoObj> &iRecoObjects) { 
-  //Clear everything
-  fRecoParticles.resize(0);
-  fPFParticles  .resize(0);
-  fChargedPV    .resize(0);
-  fPupParticles .resize(0);
-  fWeights      .resize(0);
-  fVals.resize(0);
-  //fChargedNoPV.resize(0);
-  //Link to the RecoObjects
-  fPVFrac = 0.; 
-  fNPV    = 1.;
-  fRecoParticles = iRecoObjects;
-  for (unsigned int i = 0; i < fRecoParticles.size(); i++){
-    fastjet::PseudoJet curPseudoJet;
-    curPseudoJet.reset_PtYPhiM(fRecoParticles[i].pt,fRecoParticles[i].eta,fRecoParticles[i].phi,fRecoParticles[i].m);
-    if(fRecoParticles[i].id == 0 or  fRecoParticles[i].charge == 0)  curPseudoJet.set_user_index(0); // zero is neutral hadron
-    if(fRecoParticles[i].id == 1 and fRecoParticles[i].charge != 0) curPseudoJet.set_user_index(fRecoParticles[i].charge); // from PV use the                             
-    if(fRecoParticles[i].id == 2 and fRecoParticles[i].charge != 0) curPseudoJet.set_user_index(fRecoParticles[i].charge+5); // from NPV use the charge as key +5 as key           // fill vector of pseudojets for internal references
-    fPFParticles.push_back(curPseudoJet);
-    //Take Charged particles associated to PV
-    if(fabs(fRecoParticles[i].id) == 1) fChargedPV.push_back(curPseudoJet);
-    if(fabs(fRecoParticles[i].id) >= 1 ) fPVFrac+=1.;
-    if(fNPV < fRecoParticles[i].vtxId) fNPV = fRecoParticles[i].vtxId;
-  }
-  //if(fNPV < 10) fNPV = 80.;
-  if(fPVFrac != 0) { fPVFrac = double(fChargedPV.size())/fPVFrac;}
-  else { fPVFrac = 0;}
-}
-PuppiContainer::~PuppiContainer(){}
-
-double PuppiContainer::goodVar(fastjet::PseudoJet &iPart,std::vector<fastjet::PseudoJet> &iParts, int iOpt,double iRCone) {
-  double lPup = 0;
-  lPup = var_within_R(iOpt,iParts,iPart,iRCone);
-  return lPup;
-}
-double PuppiContainer::var_within_R(int iId, const vector<fastjet::PseudoJet> & particles, const fastjet::PseudoJet& centre, double R){
-  if(iId == -1) return 1;
-  fastjet::Selector sel = fastjet::SelectorCircle(R);
-  sel.set_reference(centre);
-  vector<fastjet::PseudoJet> near_particles = sel(particles);
-  double var = 0;
-  //double lSumPt = 0;
-  //if(iId == 1) for(unsigned int i=0; i<near_particles.size(); i++) lSumPt += near_particles[i].pt();
-  for(unsigned int i=0; i<near_particles.size(); i++){
-    double pDEta = near_particles[i].eta()-centre.eta();
-    double pDPhi = fabs(near_particles[i].phi()-centre.phi());
-    if(pDPhi > 2.*3.14159265-pDPhi) pDPhi =  2.*3.14159265-pDPhi;
-    double pDR2 = pDEta*pDEta+pDPhi*pDPhi;
-    if(std::abs(pDR2)  <  0.0001) continue;
-    if(iId == 0) var += (near_particles[i].pt()/pDR2);
-    if(iId == 1) var += near_particles[i].pt();
-    if(iId == 2) var += (1./pDR2);
-    if(iId == 3) var += (1./pDR2);
-    if(iId == 4) var += near_particles[i].pt();  
-    if(iId == 5) var += (near_particles[i].pt()*(near_particles[i].pt()/pDR2));
-  }
-  if(iId == 1) var += centre.pt(); //Sum in a cone
-  if(iId == 0 && var != 0) var = log(var);
-  if(iId == 3 && var != 0) var = log(var);
-  if(iId == 5 && var != 0) var = log(var);
-  return var;
-}
-//In fact takes the median not the average
-void PuppiContainer::getRMSAvg(int iOpt,std::vector<fastjet::PseudoJet> &iConstits,std::vector<fastjet::PseudoJet> &iParticles,std::vector<fastjet::PseudoJet> &iChargedParticles) { 
-  for(unsigned int i0 = 0; i0 < iConstits.size(); i0++ ) { 
-    double pVal = -1;
-    //Calculate the Puppi Algo to use
-    int  pPupId   = getPuppiId(iConstits[i0].pt(),iConstits[i0].eta());
-    if(fPuppiAlgo[pPupId].numAlgos() <= iOpt) pPupId = -1;
-    if(pPupId == -1) {fVals.push_back(-1); continue;}
-    //Get the Puppi Sub Algo (given iteration)
-    int  pAlgo    = fPuppiAlgo[pPupId].algoId   (iOpt); 
-    bool pCharged = fPuppiAlgo[pPupId].isCharged(iOpt);
-    double pCone  = fPuppiAlgo[pPupId].coneSize (iOpt);
-    //Compute the Puppi Metric 
-    if(!pCharged) pVal = goodVar(iConstits[i0],iParticles       ,pAlgo,pCone);
-    if( pCharged) pVal = goodVar(iConstits[i0],iChargedParticles,pAlgo,pCone);
-    fVals.push_back(pVal);
-    if(std::isnan(pVal) || std::isinf(pVal)) cerr << "====> Value is Nan " << pVal << " == " << iConstits[i0].pt() << " -- " << iConstits[i0].eta() << endl;
-    if(std::isnan(pVal) || std::isinf(pVal)) continue;
-    fPuppiAlgo[pPupId].add(iConstits[i0],pVal,iOpt);
-    /*   eta extrapolation code
-        for(int i1 = 0; i1 < fNAlgos; i1++){
-            pAlgo    = fPuppiAlgo[i1].algoId   (iOpt);
-            pCharged = fPuppiAlgo[i1].isCharged(iOpt);
-            pCone    = fPuppiAlgo[i1].coneSize (iOpt);
-            double curVal = -1;
-            if(!pCharged) curVal = goodVar(iConstits[i0],iParticles       ,pAlgo,pCone);
-            if( pCharged) curVal = goodVar(iConstits[i0],iChargedParticles,pAlgo,pCone);
-            //std::cout << "i1 = " << i1 << ", curVal = " << curVal << ", eta = " << iConstits[i0].eta() << ", pupID = " << pPupId << std::endl;                                
-            fPuppiAlgo[i1].add(iConstits[i0],curVal,iOpt);
-        }
-    */
-  }
-  for(int i0 = 0; i0 < fNAlgos; i0++) fPuppiAlgo[i0].computeMedRMS(iOpt,fPVFrac);
-}
-int    PuppiContainer::getPuppiId(const float &iPt,const float &iEta) { 
-  int lId = -1; 
-  for(int i0 = 0; i0 < fNAlgos; i0++) { 
-    if(fabs(iEta) < fPuppiAlgo[i0].etaMin()) continue;
-    if(fabs(iEta) > fPuppiAlgo[i0].etaMax()) continue;
-    if(iPt        < fPuppiAlgo[i0].ptMin())  continue;
-    lId = i0; 
-    break;
-  }
-  return lId;
-}
-double PuppiContainer::getChi2FromdZ(double iDZ) { 
-  //We need to obtain prob of PU + (1-Prob of LV)
-  // Prob(LV) = Gaus(dZ,sigma) where sigma = 1.5mm  (its really more like 1mm)
-  //double lProbLV = ROOT::Math::normal_cdf_c(fabs(iDZ),0.2)*2.; //*2 is to do it double sided
-  //Take iDZ to be corrected by sigma already
-  double lProbLV = ROOT::Math::normal_cdf_c(fabs(iDZ),1.)*2.; //*2 is to do it double sided
-  double lProbPU = 1-lProbLV;
-  if(lProbPU <= 0) lProbPU = 1e-16;   //Quick Trick to through out infs
-  if(lProbPU >= 0) lProbPU = 1-1e-16; //Ditto
-  double lChi2PU = TMath::ChisquareQuantile(lProbPU,1);
-  lChi2PU*=lChi2PU;
-  return lChi2PU;
-}
-const std::vector<double> PuppiContainer::puppiWeights() {
-  fPupParticles .resize(0);
-  fWeights      .resize(0);
-  fVals         .resize(0);
-  for(int i0 = 0; i0 < fNAlgos; i0++) fPuppiAlgo[i0].reset();
-
-    int lNMaxAlgo = 1;
-  for(int i0 = 0; i0 < fNAlgos; i0++) lNMaxAlgo = TMath::Max(fPuppiAlgo[i0].numAlgos(),lNMaxAlgo);
-  //Run through all compute mean and RMS
-  int lNParticles    = fRecoParticles.size();
-  for(int i0 = 0; i0 < lNMaxAlgo; i0++) { 
-    getRMSAvg(i0,fPFParticles,fPFParticles,fChargedPV);
-  }
-  std::vector<double> pVals;
-  for(int i0 = 0; i0 < lNParticles; i0++) {
-    //Refresh
-    pVals.clear();
-    double pWeight = 1;
-    //Get the Puppi Id and if ill defined move on
-    int  pPupId   = getPuppiId(fRecoParticles[i0].pt,fRecoParticles[i0].eta);
-    if(pPupId == -1) {
-     fWeights .push_back(pWeight);
-     continue;
-   }
-    // fill the p-values
-    double pChi2   = 0;
-    if(fUseExp){ 
-      //Compute an Experimental Puppi Weight with delta Z info (very simple example)
-      pChi2 = getChi2FromdZ(fRecoParticles[i0].dZ);
-      //Now make sure Neutrals are not set
-      if(fRecoParticles[i0].pfType > 3) pChi2 = 0;
-    }
-    //Fill and compute the PuppiWeight
-    int lNAlgos = fPuppiAlgo[pPupId].numAlgos();
-    for(int i1 = 0; i1 < lNAlgos; i1++) pVals.push_back(fVals[lNParticles*i1+i0]);
-    pWeight = fPuppiAlgo[pPupId].compute(pVals,pChi2);
-    //Apply the CHS weights
-    if(fRecoParticles[i0].id == 1 && fApplyCHS ) pWeight = 1;
-    if(fRecoParticles[i0].id == 2 && fApplyCHS ) pWeight = 0;
-    //Basic Weight Checks
-    if(std::isnan(pWeight)) std::cerr << "====> Weight is nan  : pt " << fRecoParticles[i0].pt << " -- eta : " << fRecoParticles[i0].eta << " -- Value" << fVals[i0] << " -- id :  " << fRecoParticles[i0].id << " --  NAlgos: " << lNAlgos << std::endl;
-    //Basic Cuts      
-    if(pWeight                         < fPuppiWeightCut) pWeight = 0;  //==> Elminate the low Weight stuff
-    if(pWeight*fPFParticles[i0].pt()   < fPuppiAlgo[pPupId].neutralPt(fNPV) && fRecoParticles[i0].id == 0 ) pWeight = 0;  //threshold cut on the neutral Pt
-    fWeights .push_back(pWeight);
-    //Now get rid of the thrown out weights for the particle collection
-    if(pWeight == 0) continue;
-      //Produce
-    fastjet::PseudoJet curjet( pWeight*fPFParticles[i0].px(), pWeight*fPFParticles[i0].py(), pWeight*fPFParticles[i0].pz(), pWeight*fPFParticles[i0].e());
-    curjet.set_user_index(i0);//fRecoParticles[i0].id);
-    fPupParticles.push_back(curjet);
-  }
-  return fWeights;
-}
-
-
Index: external/PUPPI/PuppiContainer.hh
===================================================================
--- external/PUPPI/PuppiContainer.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#include "PuppiAlgo.hh"
-#include "RecoObj2.hh"
-#include "fastjet/PseudoJet.hh"
-#include <vector>
-
-using namespace std;
-
-class PuppiContainer{
-public:
-    //PuppiContainer(const edm::ParameterSet &iConfig);
-    PuppiContainer(const std::string &iConfig);
-    PuppiContainer(bool iApplyCHS, bool iUseExp,double iPuppiWeightCut,std::vector<AlgoObj> &iAlgos);
-    ~PuppiContainer(); 
-    void initialize(const std::vector<RecoObj> &iRecoObjects);
-    std::vector<fastjet::PseudoJet> pfParticles(){ return fPFParticles; }    
-    std::vector<fastjet::PseudoJet> pvParticles(){ return fChargedPV; }        
-    const std::vector<double> puppiWeights();
-    std::vector<fastjet::PseudoJet> puppiParticles() { return fPupParticles;}
-
-protected:
-    double  goodVar      (fastjet::PseudoJet &iPart,std::vector<fastjet::PseudoJet> &iParts, int iOpt,double iRCone);
-    void    getRMSAvg    (int iOpt,std::vector<fastjet::PseudoJet> &iConstits,std::vector<fastjet::PseudoJet> &iParticles,std::vector<fastjet::PseudoJet> &iChargeParticles);
-    double  getChi2FromdZ(double iDZ);
-    int     getPuppiId   (const float &iPt,const float &iEta);
-    double  var_within_R (int iId, const std::vector<fastjet::PseudoJet> & particles, const fastjet::PseudoJet& centre, double R);  
-    
-    std::vector<RecoObj>  fRecoParticles;
-    std::vector<fastjet::PseudoJet> fPFParticles;
-    std::vector<fastjet::PseudoJet> fChargedPV;
-    std::vector<fastjet::PseudoJet> fPupParticles;
-    std::vector<double>    fWeights;
-    std::vector<double>    fVals;
-    bool   fApplyCHS;
-    bool   fUseExp;
-    double fNeutralMinPt;
-    double fNeutralSlope;
-    double fPuppiWeightCut;
-    int    fNAlgos;
-    int    fNPV;
-    double fPVFrac;
-    std::vector<PuppiAlgo> fPuppiAlgo;
-};
-
-
Index: external/PUPPI/RecoObj.hh
===================================================================
--- external/PUPPI/RecoObj.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifndef BACONANA_DATAFORMATS_RECOOBJ_HH
-#define BACONANA_DATAFORMATS_RECOOBJ_HH
-
-class RecoObj 
-{
-public:
-      RecoObj():
-	pt(0), eta(0), phi(0), m(0),
-	pfType(-1),vtxId(-1),
-	trkChi2(0),vtxChi2(0),
-	id(0),time(0),depth(0)
-    {}
-    ~RecoObj(){}
-    
-    float         pt, eta, phi, m;  // kinematics
-    int           pfType;
-    int           vtxId;               // Vertex Id from Vertex Collection
-    float         trkChi2;             // Track Chi2
-    float         vtxChi2;             // Vertex Chi2
-    int           id;
-    float         time,depth;    // Usefule Info
-    float         expProb;
-    float         expChi2PU;
-    float         expChi2;
-    float         dZ;
-    float         d0;
-};
-#endif
-
-// Only need 4-vector and ID
-// id = 0:   neutral
-// id = 1; charged from PV
-// id = 2; charged not from PV
Index: external/PUPPI/RecoObj2.hh
===================================================================
--- external/PUPPI/RecoObj2.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,34 +1,0 @@
-#ifndef RECOOBJ_HH
-#define RECOOBJ_HH
-
-class RecoObj 
-{
-public:
-      RecoObj():
-	pt(0), eta(0), phi(0), m(0),
-	pfType(-1),vtxId(-1),
-	trkChi2(0),vtxChi2(0),
-	id(0),time(0),depth(0)
-    {}
-    ~RecoObj(){}
-    
-    float         pt, eta, phi, m;  // kinematics
-    int           pfType;
-    int           vtxId;               // Vertex Id from Vertex Collection
-    float         trkChi2;             // Track Chi2
-    float         vtxChi2;             // Vertex Chi2
-    int           id;
-    float         time,depth;    // Usefule Info
-    float         expProb;
-    float         expChi2PU;
-    float         expChi2;
-    float         dZ;
-    float         d0;
-    int           charge;
-};
-#endif
-
-// Only need 4-vector and ID
-// id = 0:   neutral
-// id = 1; charged from PV
-// id = 2; charged not from PV
Index: external/PUPPI/puppiAlgoBin.hh
===================================================================
--- external/PUPPI/puppiAlgoBin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,125 +1,0 @@
-#ifndef PUPPIALGOBIN_HH
-#define PUPPIALGOBIN_HH
-
-#include <iostream>
-#include <vector>
-#include <cmath>
-
-//...................... class to identify the puppi Algorithm parameters to be used                                                                                                       
-class puppiAlgoBin {
-
- public :
-
-  puppiAlgoBin(){
-
-    fEtaMin_   = 0.;
-    fEtaMax_   = 0.;
-    fPtMin_    = 0.;
-    fConeSize_ = 0.;
-    fRMSPtMin_ = 0.;
-    fRMSScaleFactor_ = 1.0;
-    fNeutralMinE_    = 0.;
-    fNeutralPtSlope_ = 0.;
-    fApplyCHS_   = true;
-    fUseCharged_ = false ;
-    fApplyLowPUCorr_ = false;
-    fMetricId_ = 0;
-    fRMS_      = 0.;
-    fMean_     = 0.;
-    fMedian_   = 0.;
-  };
-
-  puppiAlgoBin(const float & etaMin,         const float & etaMax, const float & ptMin, const float & coneSize, const float & RMSPtMin,
-               const float & RMSScaleFactor, const float & neutralMinE, const float & neutralPtSlope,	                                     
-               const bool  & applyCHS,       const bool & useCharged, const bool & applyLowPUCorr, const int & metricId):
-    fEtaMin_(etaMin),
-    fEtaMax_(etaMax),
-    fPtMin_(ptMin),
-    fConeSize_(coneSize),
-    fRMSPtMin_(RMSPtMin),
-    fRMSScaleFactor_(RMSScaleFactor),
-    fNeutralMinE_(neutralMinE),
-    fNeutralPtSlope_(neutralPtSlope),
-    fApplyCHS_(applyCHS),
-    fUseCharged_(useCharged),
-    fApplyLowPUCorr_(applyLowPUCorr),
-    fMetricId_(metricId)
-  {
-    fRMS_    = 0.;
-    fMean_   = 0.;
-    fMedian_ = 0.;
-
-  };
-
-  virtual ~puppiAlgoBin(){};
-
-  bool operator == (const puppiAlgoBin & algo2) const {
-    if( fEtaMin_ == algo2.fEtaMin_ and 
-        fEtaMax_ == algo2.fEtaMax_ and 
-        fApplyCHS_ == algo2.fApplyCHS_ and 
-        fUseCharged_ == algo2.fUseCharged_ and 
-        fApplyLowPUCorr_ == algo2.fApplyLowPUCorr_ and 
-        fMetricId_ == algo2.fMetricId_ and 
-        fPtMin_ == algo2.fPtMin_ and 
-        fConeSize_ == algo2.fConeSize_ and 
-        fRMSPtMin_ == algo2.fRMSPtMin_ and 
-        fRMSScaleFactor_ == algo2.fRMSScaleFactor_ and 
-        fNeutralMinE_ == algo2.fNeutralMinE_ and 
-        fNeutralPtSlope_ == algo2.fNeutralPtSlope_ ) return true;
-    else return false;
-  };
-
-  void setPuppiParticles(const std::vector<puppiParticle> & puppiParticles){ // set the particles used by the current algorithm                                             
-    fPuppiParticlesPU_.clear();
-    fPuppiParticlesPV_.clear();
-    fPuppiParticlesNULL_.clear();
-  
-    for(size_t iPart = 0; iPart < puppiParticles.size(); iPart++){ // loop on the puppiParticles                            
-      if(puppiParticles.at(iPart).fPval_ == -999){ // default PVal
-        fPuppiParticlesNULL_.push_back(puppiParticles.at(iPart));        
-        continue ; 
-      }
-                                                 
-      if(puppiParticles.at(iPart).fPt_ <  fRMSPtMin_){  // should be discarded in the RMS computation
-        fPuppiParticlesNULL_.push_back(puppiParticles.at(iPart)); 
-        continue ; 
-      }
-     
-      if(puppiParticles.at(iPart).fPt_ < fPtMin_){ // under the chosen pt cut
-        fPuppiParticlesNULL_.push_back(puppiParticles.at(iPart)); 
-        continue ; 
-      }
-
-      // zero are neutral particle, 1 LV charged, 2PU      
-      if(fUseCharged_ && (fabs(puppiParticles.at(iPart).fParticleId_) >=0 && fabs(puppiParticles.at(iPart).fParticleId_) <=1)) fPuppiParticlesPV_.push_back(puppiParticles.at(iPart));
-      if(fUseCharged_ && fabs(puppiParticles.at(iPart).fParticleId_) < 2) continue;
-      fPuppiParticlesPU_.push_back(puppiParticles.at(iPart));
-    }
-  };
-
-  float fEtaMin_;
-  float fEtaMax_;
-  float fPtMin_ ;
-  float fConeSize_;
-  float fRMSPtMin_;
-  float fRMSScaleFactor_;
-  float fNeutralMinE_;
-  float fNeutralPtSlope_;
-
-  bool  fApplyCHS_;
-  bool  fUseCharged_;
-  bool  fApplyLowPUCorr_;
-
-  int   fMetricId_;
-
-  float fRMS_;
-  float fMean_;
-  float fMedian_;
-
-  std::vector<puppiParticle> fPuppiParticlesPU_;
-  std::vector<puppiParticle> fPuppiParticlesPV_;
-  std::vector<puppiParticle> fPuppiParticlesNULL_;
-
-};
-
-#endif
Index: external/PUPPI/puppiCleanContainer.cc
===================================================================
--- external/PUPPI/puppiCleanContainer.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,471 +1,0 @@
-#include "puppiCleanContainer.hh"
-#include "Math/SpecFuncMathCore.h"
-#include "Math/ProbFunc.h"
-#include "TH2F.h"
-#include "fastjet/Selector.hh"
-
-#include <algorithm>
-
-#include "TMath.h"
-#include "Math/QuantFuncMathCore.h"
-#include "Math/SpecFuncMathCore.h"
-#include "Math/ProbFunc.h"
-
-using namespace std;
-
-// ------------- Constructor
-puppiCleanContainer::puppiCleanContainer(std::vector<RecoObj> inParticles, 
-                                         std::vector<puppiAlgoBin> puppiAlgo,
-                                         float minPuppiWeight,
-                                         bool  fUseExp){
-
-    // take the input particles
-    fRecoParticles_.clear();
-    fRecoParticles_ = inParticles;
-
-    // puppi algo 
-    puppiAlgo_.clear();
-    puppiAlgo_ = puppiAlgo; 
-
-    // min puppi weight
-    fMinPuppiWeight_ = minPuppiWeight;
-
-    //Clear everything
-    fPFParticles_.clear();
-    fPFchsParticles_.clear();
-    fChargedPV_.clear();
-    fChargedNoPV_.clear();
-    fPuppiWeights_.clear();
-
-    fNPV_    = 1 ;
-    fPVFrac_ = 0.;
-    fUseExp_ = fUseExp;
-
-    //Link to the RecoObjects --> loop on the input particles
-    for (unsigned int i = 0; i < fRecoParticles_.size(); i++){
-        fastjet::PseudoJet curPseudoJet;
-        curPseudoJet.reset_PtYPhiM (fRecoParticles_[i].pt,fRecoParticles_[i].eta,fRecoParticles_[i].phi,fRecoParticles_[i].m);
-        curPseudoJet.set_user_index(fRecoParticles_[i].id);  
-        // fill vector of pseudojets for internal references
-        fPFParticles_.push_back(curPseudoJet);
-        if(fRecoParticles_[i].id <= 1) fPFchsParticles_.push_back(curPseudoJet);    //Remove Charged particles associated to other vertex
-        if(fRecoParticles_[i].id == 1) fChargedPV_.push_back(curPseudoJet);         //Take Charged particles associated to PV
-        if(fRecoParticles_[i].id == 2) fChargedNoPV_.push_back(curPseudoJet);
-        if(fRecoParticles_[i].id >= 0) fPVFrac_++ ;
-	if(fNPV_ < fRecoParticles_[i].vtxId) fNPV_ = fRecoParticles_[i].vtxId;
-
-    }
-
-    fPVFrac_ = double(fChargedPV_.size())/fPVFrac_;
-}
-
-// ------------- De-Constructor
-puppiCleanContainer::~puppiCleanContainer(){}
-
-// main function to compute puppi Event
-std::vector<fastjet::PseudoJet> puppiCleanContainer::puppiEvent(){
-
-    // output particles
-    std::vector<fastjet::PseudoJet> particles;
-    particles.clear();
-
-    std::vector<int> pPupId ; 
-    std::vector<puppiParticle> partTmp ; // temp puppi particle vector; make a clone of the same particle for all the algo in which it is contained
-  
-    // calculate puppi metric, RMS and mean value for all the algorithms
-    for(size_t iPuppiAlgo = 0; iPuppiAlgo < puppiAlgo_.size(); iPuppiAlgo++){
-      getRMSAvg(iPuppiAlgo,fPFParticles_,fChargedPV_); // give all the particles in the event and the charged one
-    }
-  
-    int npart = 0;  
-
-    // Loop on all the incoming particles
-    for(size_t iPart = 0; iPart < fPFParticles_.size(); iPart++) {
-
-      float pWeight = 1; // default weight
-      pPupId.clear();
-      pPupId = getPuppiId(fPFParticles_[iPart].pt(),fPFParticles_[iPart].eta(),puppiAlgo_); // take into account only algo eta
-
-      //////////////////////////////////////////      
-      // acceptance check of the puppi algorithm
-      //////////////////////////////////////////      
-
-      if(pPupId.empty()) { // out acceptance... no algorithm found
-        fPuppiWeights_.push_back(pWeight); // take the particle as it is
-        fastjet::PseudoJet curjet(pWeight*fPFParticles_[iPart].px(),pWeight*fPFParticles_[iPart].py(),pWeight*fPFParticles_[iPart].pz(),pWeight*fPFParticles_[iPart].e());    
-        curjet.set_user_index(fPFParticles_[iPart].user_index());                                                                                                      
-        particles.push_back(curjet); // fill the output collection                                                                                                            
-	continue; //go to the next particle
-      }
-      
-      ///////////////      
-      //  PT check //
-      ///////////////      
-      for(size_t iAlgo = 0; iAlgo < pPupId.size(); iAlgo++){ // loop on all the available algo for that region       
-	if(fPFParticles_.at(iPart).pt() < puppiAlgo_.at(pPupId.at(iAlgo)).fPtMin_){ // low momentum particles should be cut by puppi method
-	pWeight = 0; // if this particle is under the pT threshold of one the algorithm, put the weight as zero      
-	break;
-	}
-      }
-
-      if(pWeight == 0){ 
-        fPuppiWeights_.push_back(0); // puppi weight is zero
-        continue;
-      }
- 
-      /////////////////////////////////////      
-      // fill the p-values for Z-vertex //
-      /////////////////////////////////////      
-
-      double pChi2 = 0;   
-      if(fUseExp_){ // use vertex-z resolution
-       //Compute an Experimental Puppi Weight with delta Z info (very simple example)
-       if(iPart <= fRecoParticles_.size() and fRecoParticles_[iPart].id == fPFParticles_.at(iPart).user_index()){
-	pChi2 = getChi2FromdZ(fRecoParticles_[iPart].dZ); // get the probability fiven the dZ of the particle wrt the leading vertex
-        if(fRecoParticles_[iPart].pfType > 3) pChi2 = 0; // not use this info for neutrals
-       }
-      }
-      
-
-      /////////////////////////////////////      
-      // found  the particle in all the algorithm
-      /////////////////////////////////////      
-      partTmp.clear();
-      for(size_t iAlgo = 0; iAlgo < pPupId.size(); iAlgo++){ // loop on all the algo found
-
-       int found = 0;  //  found index
-       if(fabs(fPFParticles_[iPart].user_index()) <= 1 and puppiAlgo_.at(pPupId.at(iAlgo)).fUseCharged_){ // charged or neutral from PV
-	 for(size_t puppiIt = 0 ; puppiIt < puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesPV_.size(); puppiIt++){ // Loop on PV particles
-	   if(puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesPV_.at(puppiIt).fPosition_ == int(iPart)){
-	    partTmp.push_back(puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesPV_.at(puppiIt));  // take the puppi particle
-            found = 1 ;
-            break;
-	  }
-	}
-       }
-       else if ((fabs(fPFParticles_[iPart].user_index()) <= 1 and !puppiAlgo_.at(pPupId.at(iAlgo)).fUseCharged_) or fabs(fPFParticles_[iPart].user_index()) >= 2){
-	for(size_t puppiIt = 0; puppiIt < puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesPU_.size(); puppiIt++){
-          if(puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesPU_.at(puppiIt).fPosition_ == int(iPart)){
-            partTmp.push_back(puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesPU_.at(puppiIt));
-            found = 1;
-            break;
-	  }
-	}
-       }
-      
-      /////////////////////////////////////      
-       // means that is inside the NULL vector for some reasons
-      /////////////////////////////////////      
-
-       if(found == 0){
-	for(size_t puppiIt = 0; puppiIt < puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesNULL_.size(); puppiIt++){
-          if(puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesNULL_.at(puppiIt).fPosition_ == int(iPart)){
-            partTmp.push_back(puppiAlgo_.at(pPupId.at(iAlgo)).fPuppiParticlesNULL_.at(puppiIt));
-            found = 1 ;
-            break;
-	  }
-	}
-       }
-      }
-
-      if(partTmp.size() != pPupId.size()){ // not found the particle in one of the algorithms 
-        pWeight = 1 ;
-	fPuppiWeights_.push_back(pWeight);
-        fastjet::PseudoJet curjet( pWeight*fPFParticles_[iPart].px(), pWeight*fPFParticles_[iPart].py(), pWeight*fPFParticles_[iPart].pz(), pWeight*fPFParticles_[iPart].e());    
-        curjet.set_user_index(fPFParticles_[iPart].user_index());                                                                                                      
-        particles.push_back(curjet); // by default is one, so 4V is not chaged                                                                                                
-        continue;
-      }
-      
-      /////////////////////////////////////      
-      //Check the Pval  
-      /////////////////////////////////////      
-
-      bool badPVal = false ;
-      for(size_t iPuppi = 0; iPuppi < partTmp.size() ; iPuppi++){
-	if(partTmp.at(iPuppi).fPval_ == -999){ // if the default is found as PVal, leave the particle as it is in the output
-	 pWeight = 1 ;
-         badPVal = true ;
-	}
-      }
-
-      if(badPVal){
- 	 fPuppiWeights_.push_back(pWeight);
-         fastjet::PseudoJet curjet( pWeight*fPFParticles_[iPart].px(), pWeight*fPFParticles_[iPart].py(), pWeight*fPFParticles_[iPart].pz(), pWeight*fPFParticles_[iPart].e());    
-         curjet.set_user_index(fPFParticles_[iPart].user_index());                                                                                                      
-         particles.push_back(curjet);                                                                                                                                                
-         continue;
-	
-      }
-
-      
-      // compute combining the weight for all the algorithm
-      pWeight = compute(pChi2,partTmp,puppiAlgo_,pPupId);      
-      
-      //Basic Weight Checks
-      if( std::isinf(pWeight) || std::isnan(pWeight)){
-	//std::cerr << "====> Weight is nan : pt " << fPFParticles_[iPart].pt() << " -- eta : " << fPFParticles_[iPart].eta() << " -- id : " << fPFParticles_[iPart].user_index() << std::endl;
-	pWeight = 1; // set the default to avoid problems
-      }
-
-      //Basic Cuts
-      if(pWeight < fMinPuppiWeight_) pWeight = 0; //==> Elminate the low Weight stuff
-      
-      //threshold cut on the neutral Pt
-      for(size_t iPuppi = 0; iPuppi < pPupId.size(); iPuppi++){
-        if(fPFParticles_[iPart].user_index() == 1 && puppiAlgo_.at(pPupId.at(iPuppi)).fApplyCHS_ ) pWeight = 1; // charged from LV 
-        if(fPFParticles_[iPart].user_index() == 2 && puppiAlgo_.at(pPupId.at(iPuppi)).fApplyCHS_ ) pWeight = 0; // charged from PU
-	if(pWeight*fPFParticles_[iPart].pt() < getNeutralPtCut(puppiAlgo_.at(pPupId.at(iPuppi)).fNeutralMinE_,puppiAlgo_.at(pPupId.at(iPuppi)).fNeutralPtSlope_,fNPV_) && fPFParticles_[iPart].user_index() == 0 ) // if don't pass one of the algo neutral pt condition the particle is cut
-       pWeight = 0; 
-      }
-
-      fPuppiWeights_.push_back(pWeight); // push back the weight
-
-      //Now get rid of the thrown out weights for the particle collection
-      if(pWeight == 0) continue; // if zero don't fill the particle in the output
-      npart++;
-
-      //Produce
-      fastjet::PseudoJet curjet( pWeight*fPFParticles_[iPart].px(), pWeight*fPFParticles_[iPart].py(), pWeight*fPFParticles_[iPart].pz(), pWeight*fPFParticles_[iPart].e());           
-      curjet.set_user_index(iPart);                                                                                                                            
-      particles.push_back(curjet);
-      
-    }
-    
-    return particles;
-      
-}
-
-// compute puppi metric, RMS and median for PU particle for each algo
-void puppiCleanContainer::getRMSAvg(const int & iPuppiAlgo, std::vector<fastjet::PseudoJet> & particlesAll, std::vector<fastjet::PseudoJet> &chargedPV) { 
-
-  std::vector<puppiParticle> puppiParticles; // puppi particles to be set for a specific algo
-  puppiParticles.clear();
-
-  // Loop on all the particles of the event  
-    
-  for(size_t iPart = 0; iPart < particlesAll.size(); iPart++ ) { 
-
-    float pVal    = -999;
-    bool  pPupId  = isGoodPuppiId(particlesAll[iPart].pt(),particlesAll[iPart].eta(),puppiAlgo_.at(iPuppiAlgo)); // get the puppi id algo asaf of eta and phi of the particle
-    // does not exsist and algorithm for this particle, store -999 as pVal
-    if(pPupId == false) continue;
-    // apply CHS in puppi metric computation -> use only LV hadrons to compute the metric for each particle
-    if(puppiAlgo_.at(iPuppiAlgo).fUseCharged_)  
-       pVal = goodVar(particlesAll[iPart], chargedPV,    puppiAlgo_.at(iPuppiAlgo).fMetricId_,puppiAlgo_.at(iPuppiAlgo).fConeSize_);
-    else if(!puppiAlgo_.at(iPuppiAlgo).fUseCharged_) 
-       pVal = goodVar(particlesAll[iPart], particlesAll, puppiAlgo_.at(iPuppiAlgo).fMetricId_,puppiAlgo_.at(iPuppiAlgo).fConeSize_);
-
-    // fill the value
-    if(std::isnan(pVal) || std::isinf(pVal)) std::cout << "====>  Value is Nan " << pVal << " == " << particlesAll[iPart].pt() << " -- " << particlesAll[iPart].eta() << std::endl;
-    if(std::isnan(pVal) || std::isinf(pVal)) continue;
-    
-    puppiParticles.push_back(puppiParticle(particlesAll.at(iPart).pt(),particlesAll.at(iPart).eta(),pVal,particlesAll.at(iPart).user_index(),iPart));
-  }
-  
-  // set the puppi particles for the algorithm
-  puppiAlgo_.at(iPuppiAlgo).setPuppiParticles(puppiParticles);
-  // compute RMS, median and mean value  
-  computeMedRMS(iPuppiAlgo);
-  
-}
-
-
-float puppiCleanContainer::goodVar(const fastjet::PseudoJet & particle, const std::vector<fastjet::PseudoJet> & particleAll, const int & pPupId, const float & coneSize) {
-  float lPup = 0;
-  lPup = var_within_R(pPupId,particleAll,particle,coneSize);
-  return lPup;
-}
-
-float puppiCleanContainer::var_within_R(const int & pPupId, const vector<fastjet::PseudoJet> & particles, const fastjet::PseudoJet& centre, const float & R){
-
-  if(pPupId == -1) return 1;
-  fastjet::Selector sel = fastjet::SelectorCircle(R);
-  sel.set_reference(centre);
-  std::vector<fastjet::PseudoJet> near_particles = sel(particles);
-  float var = 0;
-
-  for(size_t iPart = 0; iPart < near_particles.size(); iPart++){
-
-    double pDEta = near_particles[iPart].eta()-centre.eta();
-    double pDPhi = fabs(near_particles[iPart].phi()-centre.phi());
-    if(pDPhi > 2.*3.14159265-pDPhi) pDPhi = 2.*3.14159265-pDPhi;
-    double pDR = sqrt(pDEta*pDEta+pDPhi*pDPhi);
-
-    if(pDR < 0.0001) continue;
-    if(pDR == 0)    continue;
-
-    if(pPupId == 0) var += (near_particles[iPart].pt()/(pDR*pDR));
-    if(pPupId == 1) var += near_particles[iPart].pt();
-    if(pPupId == 2) var += (1./pDR)*(1./pDR);
-    if(pPupId == 3) var += (1./pDR)*(1./pDR);
-    if(pPupId == 4) var += near_particles[iPart].pt();
-    if(pPupId == 5) var += (near_particles[iPart].pt()/pDR)*(near_particles[iPart].pt()/pDR);
-  }
-
-  if(pPupId == 0 && var != 0) var = log(var);
-  if(pPupId == 3 && var != 0) var = log(var);
-  if(pPupId == 5 && var != 0) var = log(var);
-  return var;
- 
-}
-
-
-float puppiCleanContainer::pt_within_R(const std::vector<fastjet::PseudoJet> & particles, const fastjet::PseudoJet & centre, const float & R){
-
-  fastjet::Selector sel = fastjet::SelectorCircle(R);
-  sel.set_reference(centre);
-  std::vector<fastjet::PseudoJet> near_particles = sel(particles);
-  double answer = 0.0;
-  for(size_t iPart = 0; iPart<near_particles.size(); iPart++){
-    answer += near_particles[iPart].pt();
-  }
-
-  return answer;
-}
-
-fastjet::PseudoJet puppiCleanContainer::flow_within_R(const vector<fastjet::PseudoJet> & particles, const fastjet::PseudoJet& centre, const float & R){
-
-  fastjet::Selector sel = fastjet::SelectorCircle(R);
-  sel.set_reference(centre);
-  std::vector<fastjet::PseudoJet> near_particles = sel(particles);
-  fastjet::PseudoJet flow;
-  for(unsigned int i=0; i<near_particles.size(); i++){
-    flow += near_particles[i];
-  }
-  return flow;
-
-}
-
-// compute median, mean value and RMS for puppi
-void puppiCleanContainer::computeMedRMS(const int & puppiAlgo) {
-
-  if(puppiAlgo > int(puppiAlgo_.size())  ) return;
-  if(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.size() == 0) return;
-
-  // sort in pVal increasing order
-  std::sort(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.begin(),puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.end(),puppiValSort());
-
-  // if apply correction
-  float lCorr = 1.;
-  if(puppiAlgo_.at(puppiAlgo).fApplyLowPUCorr_) lCorr *= 1.-fPVFrac_;
-
-  // count the position of the last particle with pval zero coming from PU
-  int lNum0 = 0;
-  for(size_t i0 = 0; i0 < puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.size(); i0++) {
-    if(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_[i0].fPval_ == 0) lNum0 = i0;
-  }
-
-  // take the median value on PU particles
-  int lNHalfway = lNum0 + int(float(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.size()-lNum0)*0.50*lCorr);
-  puppiAlgo_.at(puppiAlgo).fMedian_ = puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.at(lNHalfway).fPval_;
-  float lMed = puppiAlgo_.at(puppiAlgo).fMedian_; //Just to make the readability easier
-
-  // take the RMS
-  int lNRMS = 0;
-  for(size_t i0 = 0; i0 < puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.size(); i0++) {
-    puppiAlgo_.at(puppiAlgo).fMean_ += puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.at(i0).fPval_;
-    if(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.at(i0).fPval_ == 0) continue;
-    if(!puppiAlgo_.at(puppiAlgo).fUseCharged_ && puppiAlgo_.at(puppiAlgo).fApplyLowPUCorr_ && puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.at(i0).fPval_ > lMed) continue;
-    lNRMS++;
-    puppiAlgo_.at(puppiAlgo).fRMS_ += (puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.at(i0).fPval_-lMed)*( puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.at(i0).fPval_-lMed);
-  }
-
-  puppiAlgo_.at(puppiAlgo).fMean_ /= puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.size();
-  if(lNRMS > 0) puppiAlgo_.at(puppiAlgo).fRMS_/=lNRMS;
-  if(puppiAlgo_.at(puppiAlgo).fRMS_ == 0) puppiAlgo_.at(puppiAlgo).fRMS_ = 1e-5;
-  puppiAlgo_.at(puppiAlgo).fRMS_  = sqrt(puppiAlgo_.at(puppiAlgo).fRMS_);
-  puppiAlgo_.at(puppiAlgo).fRMS_ *= puppiAlgo_.at(puppiAlgo).fRMSScaleFactor_;
-
-  if(!puppiAlgo_.at(puppiAlgo).fApplyLowPUCorr_) return;
-
-  //Adjust the p-value to correspond to the median
-  std::sort(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPV_.begin(),puppiAlgo_.at(puppiAlgo).fPuppiParticlesPV_.end(),puppiValSort());
-  int lNPV = 0; 
-  for(size_t i0 = 0; i0 < puppiAlgo_.at(puppiAlgo).fPuppiParticlesPV_.size(); i0++){ 
-    if(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPV_[i0].fPval_ <= lMed ) lNPV++;
-  }
-
-  // it helps in puppi the median value close to the mean one when a lot of pval 0 are present
-  float lAdjust = 1.5*float(lNPV)/float(puppiAlgo_.at(puppiAlgo).fPuppiParticlesPV_.size()+puppiAlgo_.at(puppiAlgo).fPuppiParticlesPU_.size());
-  if(lAdjust > 0) puppiAlgo_.at(puppiAlgo).fMedian_ -= sqrt(ROOT::Math::chisquared_quantile(lAdjust,1.)*puppiAlgo_.at(puppiAlgo).fRMS_);
-
-}
-
-float puppiCleanContainer::getNeutralPtCut(const float & fNeutralMinE, const float & fNeutralPtSlope, const int & fNPV) {
-  return fNeutralMinE + fNPV * fNeutralPtSlope;
-}
-
-// take the type of algorithm : return a vector since more than one algo can be defined for the same eta region
-std::vector<int> puppiCleanContainer::getPuppiId(const float & pt, const float & eta, const std::vector<puppiAlgoBin> & puppiAlgos){
-  std::vector<int> PuppiId ;
-  for(size_t iPuppiAlgo = 0; iPuppiAlgo < puppiAlgos.size() ; iPuppiAlgo++){
-    if(fabs(eta) <= puppiAlgos[iPuppiAlgo].fEtaMin_) continue;
-    if(fabs(eta) > puppiAlgos[iPuppiAlgo].fEtaMax_) continue;
-    PuppiId.push_back(int(iPuppiAlgo));
-  }
-  return PuppiId;  
-}
-
-//check if a particle is good for an Algo definition
-bool puppiCleanContainer::isGoodPuppiId(const float & pt, const float & eta, const puppiAlgoBin & puppiAlgo){
-  if(fabs(eta) <= puppiAlgo.fEtaMin_) return false;
-  if(fabs(eta) > puppiAlgo.fEtaMax_) return false;
-  return true;
-
-}
-
-
-
-// ----------------------
-float puppiCleanContainer::compute(const float & chi2, const std::vector<puppiParticle> & particles, const std::vector<puppiAlgoBin> & puppiAlgos, const std::vector<int> & pPupId) {
-
-  if(particles.size() != pPupId.size() ) return 0; // default check
-
-  float lVal  = 0.;
-  float lPVal = 1.;
-  int   lNDOF = 0;
-
-  for( size_t iAlgo = 0; iAlgo < pPupId.size(); iAlgo++){
-
-    if(puppiAlgos.at(pPupId.at(iAlgo)).fPuppiParticlesPU_.size() + puppiAlgos.at(pPupId.at(iAlgo)).fPuppiParticlesPV_.size()  == 0) return 1; 
-
-    if(iAlgo > 0 ){
-      float pPVal = ROOT::Math::chisquared_cdf(lVal,lNDOF); // take a chi2 value since the should be multiplied (multiply weight and not summing chi2)
-      lPVal *= pPVal;
-      lNDOF  = 0;
-      lVal   = 0; 
-    }
-
-    if(puppiAlgos.at(pPupId.at(iAlgo)).fMetricId_ == -1) continue;
-
-    float pVal = particles.at(iAlgo).fPval_ ;
-
-    if(puppiAlgos.at(pPupId.at(iAlgo)).fMetricId_ == 0 && pVal == 0) pVal = puppiAlgos.at(pPupId.at(iAlgo)).fMedian_;
-    if(puppiAlgos.at(pPupId.at(iAlgo)).fMetricId_ == 3 && pVal == 0) pVal = puppiAlgos.at(pPupId.at(iAlgo)).fMedian_;
-    if(puppiAlgos.at(pPupId.at(iAlgo)).fMetricId_ == 5 && pVal == 0) pVal = puppiAlgos.at(pPupId.at(iAlgo)).fMedian_;
-    
-    lVal += (pVal-puppiAlgos.at(pPupId.at(iAlgo)).fMedian_)*(fabs(pVal-puppiAlgos.at(pPupId.at(iAlgo)).fMedian_))/puppiAlgos.at(pPupId.at(iAlgo)).fRMS_/puppiAlgos.at(pPupId.at(iAlgo)).fRMS_;
-    lNDOF++;
-    if(chi2 != 0) lNDOF++; 
-    if(chi2 != 0) lVal+=chi2; //Add external Chi2 to first element
-  }
-
-  lPVal *= ROOT::Math::chisquared_cdf(lVal,lNDOF);
-  return lPVal;
-
-}
-
-float puppiCleanContainer::getChi2FromdZ(float iDZ) {
-   //We need to obtain prob of PU + (1-Prob of LV)
-   // Prob(LV) = Gaus(dZ,sigma) where sigma = 1.5mm (its really more like 1mm)
-   //double lProbLV = ROOT::Math::normal_cdf_c(fabs(iDZ),0.2)*2.; //*2 is to do it double sided
-   //Take iDZ to be corrected by sigma already
-   double lProbLV = ROOT::Math::normal_cdf_c(fabs(iDZ),1.)*2.; //*2 is to do it double sided
-   double lProbPU = 1-lProbLV;
-   if(lProbPU <= 0) lProbPU = 1e-16; //Quick Trick to through out infs
-   if(lProbPU >= 0) lProbPU = 1-1e-16; //Ditto
-   double lChi2PU = TMath::ChisquareQuantile(lProbPU,1);
-   lChi2PU*=lChi2PU;
-   return lChi2PU;
-}
Index: external/PUPPI/puppiCleanContainer.hh
===================================================================
--- external/PUPPI/puppiCleanContainer.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,82 +1,0 @@
-#ifndef PUPPICLEANCONTAINER_HH
-#define PUPPICLEANCONTAINER_HH
-
-
-#include "PUPPI/RecoObj.hh"
-#include "PUPPI/puppiParticle.hh"
-#include "PUPPI/puppiAlgoBin.hh"
-
-#include "fastjet/PseudoJet.hh"
-#include <algorithm>
-
-using namespace std;
-
-//......................
-
-class puppiCleanContainer{
-
- public:
-
-  // basic constructor which takes input particles as RecoObj, the tracker eta extension and other two boolean info
-  puppiCleanContainer(std::vector<RecoObj> inParticles,    // incoming particles of the event
-                      std::vector<puppiAlgoBin> puppiAlgo, // vector with the definition of the puppi algorithm in different eta region (one for each eta) 
-                      float minPuppiWeight  = 0.01,        // min puppi weight cut
-                      bool  useExp = false                 // useDz vertex probability
-  ); 
-
-  ~puppiCleanContainer(); 
-
-  // ----- get methods
-
-  // get all the PF particles
-  std::vector<fastjet::PseudoJet> pfParticles()  { return  fPFParticles_; }    
-  // get all the PF charged from PV
-  std::vector<fastjet::PseudoJet> pvParticles()  { return  fChargedPV_; }        
-  // get all the PF charged from PU
-  std::vector<fastjet::PseudoJet> puParticles()  { return  fChargedNoPV_; }    
-  // get CHS particle collection
-  std::vector<fastjet::PseudoJet> pfchsParticles(){ return fPFchsParticles_; }    
-  // get puppi weight for all particles 
-  std::vector<float> getPuppiWeights() { return fPuppiWeights_; };
-
-  // process puppi
-  std::vector<fastjet::PseudoJet> puppiEvent();
- 
- protected:
-
-   void    getRMSAvg(const int &, std::vector<fastjet::PseudoJet> &, std::vector<fastjet::PseudoJet> &);        
-   float   goodVar  (const fastjet::PseudoJet &, const std::vector<fastjet::PseudoJet> &, const int &, const float &);    
-   void    computeMedRMS(const int &);  
-   float   compute(const float &, const std::vector<puppiParticle> &, const std::vector<puppiAlgoBin> &, const std::vector<int> &);
-
-   // some get functions
-   float getNeutralPtCut(const float&, const float&, const int&);
-   std::vector<int> getPuppiId(const float &, const float &, const std::vector<puppiAlgoBin> &);
-   bool  isGoodPuppiId(const float &, const float &, const puppiAlgoBin &);
-   float getChi2FromdZ(float);
-   // other functions
-   float  var_within_R(const int &, const vector<fastjet::PseudoJet> &, const fastjet::PseudoJet &, const float &);
-   float  pt_within_R(const std::vector<fastjet::PseudoJet> &, const fastjet::PseudoJet &, const float &);
-   fastjet::PseudoJet flow_within_R(const vector<fastjet::PseudoJet> &, const fastjet::PseudoJet &, const float &);
-   
-  
- private:    
- 
-  std::vector<RecoObj>            fRecoParticles_;
-  std::vector<fastjet::PseudoJet> fPFParticles_;
-  std::vector<fastjet::PseudoJet> fPFchsParticles_;    
-  std::vector<fastjet::PseudoJet> fChargedPV_;
-  std::vector<fastjet::PseudoJet> fChargedNoPV_;
-
-  std::vector<puppiAlgoBin> puppiAlgo_;
-  std::vector<float> fPuppiWeights_;
-
-  float  fMinPuppiWeight_;
-  float  fPVFrac_;
-
-  int    fNPV_;  
-  bool   fUseExp_ ;
-    
-};
-
-#endif
Index: external/PUPPI/puppiParticle.hh
===================================================================
--- external/PUPPI/puppiParticle.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,76 +1,0 @@
-#ifndef PUPPIPARTICLE_HH
-#define PUPPIPARTICLE_HH
-
-#include <functional>
-#include <algorithm>
-
-
-//............ class to keep track of particles used in the puppi code storing pt,eta,metric value, id (LV,PU) and position in the orignal vector of particles 
-class puppiParticle {
-
- public:
-
-  puppiParticle(){
-    fPt_         = 0.;
-    fEta_        = 0.;
-    fPval_       = 1.;
-    fParticleId_ = -1;
-    fPosition_   = -1; 
-  }; 
-
-  puppiParticle(const float & pt, const float & eta, const float & pval, const int & particleId, const int & position):
-    fPt_(pt),
-    fEta_(eta),
-    fPval_(pval),
-    fParticleId_(particleId),
-    fPosition_(position)
-  {};
-
-  puppiParticle(const puppiParticle & particle) {
-    fPt_         = particle.fPt_;
-    fEta_        = particle.fEta_;
-    fPval_       = particle.fPval_;
-    fParticleId_ = particle.fParticleId_;
-    fPosition_   = particle.fPosition_;
-
-  }
-
-  virtual ~puppiParticle(){};
-
-  // sort asaf of pt
-  bool operator < (const puppiParticle & particle2) const {
-    if(fPt_ < particle2.fPt_) return true;
-    else return false;
-  }; 
-
-
-  // oper operator =
-  bool operator == (const puppiParticle & particle2) const {
-    if( fPt_ == particle2.fPt_     and fEta_ == particle2.fEta_ and 
-        fPval_ == particle2.fPval_ and fParticleId_ == particle2.fParticleId_ and 
-        fPosition_ == particle2.fPosition_) return true;
-    else return false ;
-  };
-
-  float fPt_;         // pt of the candidate                                                                                                                                              
-  float fEta_;        // eta of the candidate                                                                                                                                             
-  float fPval_;       // metric value                                                                                                                                                     
-  int   fParticleId_; // particle id means user_index                                                                                                                                     
-  int   fPosition_;   // position in the original particle vector                                                                                                                        
-
-};
-
-class puppiValSort : public std::binary_function<int,int,bool> {
- public:
-
-  puppiValSort(){};
-
-  ~puppiValSort(){};
-
-  bool operator() (const puppiParticle & x, const puppiParticle & y){
-    if(x.fPval_ < y.fPval_ ) return true;
-    return false;
-  }
-};
-
-#endif
Index: external/TrackCovariance/AUTHORS
===================================================================
--- external/TrackCovariance/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,1 +1,0 @@
-Franco Bedeschi
Index: external/TrackCovariance/AcceptanceClx.cc
===================================================================
--- external/TrackCovariance/AcceptanceClx.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,331 +1,0 @@
-#include <TVector3.h>
-#include "AcceptanceClx.h"
-//
-// Pt splitting routine
-//
-void AcceptanceClx::VecInsert(Int_t i, Float_t x, TVectorF& Vec)
-{
-	// Insert a new element x in location i+1 of vector Vec
-	//
-	Int_t N = Vec.GetNrows();	// Get vector nitial size
-	Vec.ResizeTo(N + 1);		// Increase size
-	for (Int_t j = N - 1; j > i; j--)Vec(j + 1) = Vec(j);	// Shift all elements above i
-	Vec(i+1) = x;
-}
-//
-void AcceptanceClx::SplitPt(Int_t i, TVectorF &AccPt)
-{
-	Int_t Nrows = fAcc.GetNrows();
-	Int_t Ncols = fAcc.GetNcols();
-	TMatrixF AccMod(Nrows + 1, Ncols); // Size output matrix
-	for (Int_t ith = 0; ith < Ncols; ith++)
-	{
-		AccMod(i + 1, ith) = AccPt(ith);
-		for (Int_t ipt = 0; ipt <= i; ipt++) AccMod(ipt, ith) = fAcc(ipt, ith);
-		for (Int_t ipt = i + 1; ipt < Nrows; ipt++) AccMod(ipt + 1, ith) = fAcc(ipt, ith);
-	}
-	//
-	fAcc.ResizeTo(Nrows + 1, Ncols);
-	fAcc = AccMod;
-}
-//
-// Theta splitting routine
-void AcceptanceClx::SplitTh(Int_t i, TVectorF &AccTh)
-{
-	Int_t Nrows = fAcc.GetNrows();
-	Int_t Ncols = fAcc.GetNcols();
-	TMatrixF AccMod(Nrows, Ncols + 1); // Size output matrix
-	for (Int_t ipt = 0; ipt < Nrows; ipt++)
-	{
-		AccMod(ipt, i + 1) = AccTh(ipt);
-		for (Int_t ith = 0; ith <= i; ith++) AccMod(ipt, ith) = fAcc(ipt, ith);
-		for (Int_t ith = i + 1; ith < Ncols; ith++) AccMod(ipt, ith + 1) = fAcc(ipt, ith);
-	}
-	//
-	fAcc.ResizeTo(Nrows, Ncols + 1);
-	fAcc = AccMod;
-}
-//
-// Constructors
-//
-AcceptanceClx::AcceptanceClx(TString InFile)
-{
-	ReadAcceptance(InFile);
-}
-//
-AcceptanceClx::AcceptanceClx(SolGeom* InGeo)
-{
-	// Initializations
-	//
-	//cout << "Entered constructor of AccpeptanceClx" << endl;
-	// Setup grid
-	// Start grid parameters
-	//
-	// Pt nodes
-	const Int_t NpPtInp = 5;
-	Float_t PtInit[NpPtInp] = { 0., 1., 10., 100., 250. };
-	TVectorF Pta(NpPtInp, PtInit);
-	Int_t NpPt = Pta.GetNrows();	// Nr. of starting pt points
-	// Theta nodes
-	const Int_t NpThInp = 15;
-	Float_t ThInit[NpThInp] = { 0.,5.,10.,20.,30.,40.,50.,90.,
-	130.,140.,150.,160.,170.,175., 180. };
-	TVectorF Tha(NpThInp, ThInit);
-	Int_t NpTh = Tha.GetNrows();	// Nr. of starting theta points
-	//cout << "AcceptanceClv:: Pta and Tha arrays defined" << endl;
-	//
-	// Grid splitting parameters
-	Float_t dPtMin = 0.2;		// Grid Pt resolution (GeV)
-	Float_t dThMin = 2.0;		// Grid Theta resolution (degrees)
-	Float_t dAmin  = 1.0;		// Minimum # hits step
-	//
-	fAcc.ResizeTo(NpPt, NpTh);
-	//
-	//
-	// Event loop: fill matrix starting nodes
-	//
-	TVector3 xv(0., 0., 0.);
-	for (Int_t ipt = 0; ipt < NpPt; ipt++)	// Scan pt bins
-	{
-		// Momentum in GeV
-		Double_t pt = Pta(ipt);
-		//
-		for (Int_t ith = 0; ith < NpTh; ith++)	// Scan theta bins
-		{
-			//
-			// Theta in from degrees to radians
-			Double_t th = TMath::Pi() * Tha(ith) / 180.;
-			Double_t pz = pt / TMath::Tan(th);
-			TVector3 tp(pt, 0., pz);
-			//
-			// Get number of measurement hits
-			//
-			SolTrack* gTrk = new SolTrack(xv, tp, InGeo);	// Generated track
-			Int_t Mhits = gTrk->nmHit();			// Nr. Measurement hits
-			fAcc(ipt, ith) = (Float_t)Mhits;
-		}
-	}
-	//
-	// Scan nodes and split if needed
-	//
-	Int_t Nsplits = 1;		// Number of split per iteration
-	Int_t Ncycles = 0;		// Number of iterations
-	Int_t MaxSplits = 200;		// Maximum number of splits
-	Int_t NsplitCnt = 0;
-	//
-	while (Nsplits > 0)
-	{
-		Nsplits = 0;
-		// Scan nodes
-		for (Int_t ipt = 0; ipt < NpPt - 1; ipt++)	// Scan pt bins
-		{
-			for (Int_t ith = 0; ith < NpTh - 1; ith++)	// Scan theta bins
-			{
-				Float_t dAp = TMath::Abs(fAcc(ipt + 1, ith) - fAcc(ipt, ith));
-				Float_t dPt = TMath::Abs(Pta(ipt + 1) - Pta(ipt));
-				//
-				// Pt split
-				if (dPt > dPtMin && dAp > dAmin && Nsplits < MaxSplits) {
-					NsplitCnt++;	// Total splits counter
-					Nsplits++;	// Increase splits/cycle
-					NpPt++;		// Increase #pt points 
-					Float_t newPt = 0.5 * (Pta(ipt + 1) + Pta(ipt));
-					VecInsert(ipt, newPt, Pta);
-					TVectorF AccPt(NpTh);
-					for (Int_t i = 0; i < NpTh; i++)
-					{
-						Double_t pt = newPt;
-						Double_t th = TMath::Pi() * Tha[i] / 180.;
-						Double_t pz = pt / TMath::Tan(th);
-						TVector3 tp(pt, 0., pz);
-						SolTrack* gTrk = new SolTrack(xv, tp, InGeo);	// Generated track
-						Int_t Mhits = gTrk->nmHit();			// Nr. Measurement hits
-						AccPt(i) = (Float_t)Mhits;
-					}
-					SplitPt(ipt, AccPt);
-					// Completed Pt split
-				}
-				//
-				Float_t dAt = TMath::Abs(fAcc(ipt, ith + 1) - fAcc(ipt, ith));
-				Float_t dTh = TMath::Abs(Tha(ith + 1) - Tha(ith));
-				//
-				// Theta split
-				if (dTh > dThMin && dAt > dAmin && Nsplits < MaxSplits) {
-					//cout << "Th(" << ith << ") = " << Tha(ith) << ", dAt = " << dAt << endl;
-					NsplitCnt++;	// Total splits counter
-					Nsplits++;	// Increase splits
-					NpTh++;		// Increase #pt points 
-					Float_t newTh = 0.5 * (Tha(ith + 1) + Tha(ith));
-					VecInsert(ith, newTh, Tha);
-					TVectorF AccTh(NpPt);
-					for (Int_t i = 0; i < NpPt; i++)
-					{
-						Double_t pt = Pta(i);
-						Double_t th = TMath::Pi() * newTh / 180.;
-						Double_t pz = pt / TMath::Tan(th);
-						TVector3 tp(pt, 0., pz);
-						SolTrack* gTrk = new SolTrack(xv, tp, InGeo);	// Generated track
-						Int_t Mhits = gTrk->nmHit();			// Nr. Measurement hits
-						AccTh(i) = (Float_t)Mhits;
-					}
-					SplitTh(ith, AccTh);
-					// Theta splits completed
-				}
-			}  // End loop on theta nodes
-		}  // End loop on pt nodes
-		Ncycles++;
-	}			// End loop on iteration
-	//
-	std::cout<<"AcceptanceClx:: Acceptance generation completed after "<<Ncycles<<" cycles"
-		<<" and a total number of "<<NsplitCnt<< " splits"<<std::endl;
-	//
-	// Store final variables and parameters
-	//
-	fNPtNodes = NpPt;
-	Int_t PtCk = Pta.GetNrows();
-	if (PtCk != NpPt)
-		std::cout << "AcceptanceClx:: Error in grid generation NpPt=" << NpPt << ", Pta size= " << PtCk << std::endl;
-	fPtArray.ResizeTo(NpPt);
-	fPtArray = Pta;	// Array of Pt nodes
-	//
-	fNThNodes = NpTh;
-	Int_t ThCk = Tha.GetNrows();
-	if (ThCk != NpTh)
-		std::cout << "AcceptanceClx:: Error in grid generation NpTh=" << NpTh << ", Tha size= " << ThCk << std::endl;
-	fThArray.ResizeTo(NpTh);
-	fThArray = Tha;	// Array of Theta nodes
-	//
-		std::cout << "AcceptanceClx:: Acceptance encoding with " << fNPtNodes
-		<<" pt nodes and "<< fNThNodes <<" theta nodes"<< std::endl;
-	Int_t Nrows = fAcc.GetNrows();
-	Int_t Ncols = fAcc.GetNcols();
-}
-
-// Destructor
-AcceptanceClx::~AcceptanceClx()
-{
-	fNPtNodes = 0;
-	fNThNodes = 0;
-	fAcc.Clear();
-	fPtArray.Clear();
-	fThArray.Clear();
-}
-//
-void AcceptanceClx::WriteAcceptance(TFile *fout)
-{
-	//
-	// Write out data
-	TTree* tree = new TTree("treeAcc", "Acceptance tree");
-	TMatrixF* pntMatF = &fAcc;
-	TVectorF* pntVecP = &fPtArray;
-	TVectorF* pntVecT = &fThArray;
-	tree->Branch("AcceptanceMatrix", "TMatrixF", &pntMatF, 64000, 0);
-	tree->Branch("AcceptancePtVec",  "TVectorF", &pntVecP, 64000, 0);
-	tree->Branch("AcceptanceThVec",  "TVectorF", &pntVecT, 64000, 0);
-	tree->Fill();
-	fout->Write();
-}
-//
-void AcceptanceClx::WriteAcceptance(TString OutFile)
-{
-	//
-	// Write out data
-	TFile* fout = new TFile(OutFile,"RECREATE");
-	WriteAcceptance(fout);
-	fout->Close();
-	delete fout;
-}
-//
-void AcceptanceClx::ReadAcceptance(TString InFile)
-{
-	//
-	// Read in data
-	TFile* f = new TFile(InFile, "READ");
-	//
-	// Import TTree
-	TTree* T = (TTree*)f->Get("treeAcc");
-	//
-	// Get matrix
-	TMatrixF* pAcc = new TMatrixF();
-	T->SetBranchAddress("AcceptanceMatrix", &pAcc);
-	T->GetEntry(0);
-	//
-	fNPtNodes = pAcc->GetNrows();
-	fNThNodes = pAcc->GetNcols();
-	fAcc.ResizeTo(fNPtNodes, fNThNodes);
-	fAcc = *pAcc;
-	//
-	// Get Pt grid
-	TVectorF* pPtArray = new TVectorF();
-	T->SetBranchAddress("AcceptancePtVec", &pPtArray);
-	T->GetEntry(0);
-	fPtArray.ResizeTo(fNPtNodes);
-	fPtArray = *pPtArray;
-	//
-	// Get Theta array
-	TVectorF* pThArray = new TVectorF();
-	T->SetBranchAddress("AcceptanceThVec", &pThArray);
-	T->GetEntry(0);
-	fThArray.ResizeTo(fNThNodes);
-	fThArray = *pThArray;
-	//
-	std::cout << "AcceptanceClx::Read complete: Npt= " << fNPtNodes << ", Nth= " << fNThNodes << std::endl;
-	//
-	f->Close();
-	delete f;
-}
-//
-Double_t AcceptanceClx::HitNumber(Double_t pt, Double_t theta)
-{
-	//
-	// Protect against values out of range
-	Float_t eps = 1.0e-4;
-	Float_t pt0 = (Float_t)pt;
-	if (pt0 <= fPtArray(0)) pt0 = fPtArray(0) + eps;
-	else if (pt0 >= fPtArray(fNPtNodes-1)) pt0 = fPtArray(fNPtNodes-1) - eps;
-	Float_t th0 = (Float_t)theta;
-	if (th0 <= fThArray(0)) th0 = fThArray(0) + eps;
-	else if (th0 >= fThArray(fNThNodes - 1)) th0 = fThArray(fNThNodes - 1) - eps;
-	//
-	// Find cell
-	Float_t* parray = fPtArray.GetMatrixArray();
-	Int_t ip = TMath::BinarySearch(fNPtNodes, parray, pt0);
-	Float_t* tarray = fThArray.GetMatrixArray();
-	Int_t it = TMath::BinarySearch(fNThNodes, tarray, th0);
-	//
-	if (ip<0 || ip >fNPtNodes - 2)
-	{
-		std::cout << "Search error: (ip, pt) = (" << ip << ", " << pt << "), pt0 = " << pt0 << std::endl;
-		std::cout << "Search error: pt nodes = " << fNPtNodes 
-			<< " , last value = " << fPtArray(fNPtNodes - 1) << std::endl;
-	}
-	if (it<0 || ip >fNThNodes - 2)
-	{
-		std::cout << "Search error: (it, th) = (" << it << ", " << theta << "), th0 = " << th0 << std::endl;
-		std::cout << "Search error: th nodes = " << fNThNodes
-			<< " , last value = " << fThArray(fNThNodes - 1) << std::endl;
-	}
-	//
-	// Bilinear interpolation
-	//
-	Double_t spt = (pt0 - fPtArray(ip)) / (fPtArray(ip + 1) - fPtArray(ip));
-	Double_t sth = (th0 - fThArray(it)) / (fThArray(it + 1) - fThArray(it));
-	Double_t A11 = fAcc(ip, it);
-	Double_t A12 = fAcc(ip, it+1);
-	Double_t A21 = fAcc(ip+1, it);
-	Double_t A22 = fAcc(ip+1, it+1);
-	Double_t A = A11 * (1 - spt) * (1 - sth) + A12 * (1 - spt) * sth +
-		A21 * spt * (1 - sth) + A22 * spt * sth;
-	//
-	return A;
-}
-//
-Double_t AcceptanceClx::HitNum(Double_t *x, Double_t *p) // Theta in degrees
-{
-	Double_t pt = x[0];
-	Double_t th = x[1];
-	//
-	return HitNumber(pt, th);
-}
-//
-
Index: external/TrackCovariance/AcceptanceClx.h
===================================================================
--- external/TrackCovariance/AcceptanceClx.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,60 +1,0 @@
-//
-#ifndef G__ACCEPTANCECLX_H
-#define G__ACCEPTANCECLX_H
-//
-#include <TMath.h>
-#include <TVectorF.h>
-#include <TMatrixF.h>
-#include <TString.h>
-#include <TFile.h>
-#include <TTree.h>
-#include <TF2.h>
-#include <iostream>
-#include <vector>
-#include "SolGeom.h"
-#include "SolTrack.h"
-//
-// Class to create geometry for solenoid geometry
-
-class AcceptanceClx {
-	//
-	// Class to handle storing and retieving of tracking acceptance
-	//
-private:
-	TMatrixF fAcc;		// Acceptance matrix
-	Int_t fNPtNodes;	// Numer of Pt nodes 
-	TVectorF fPtArray;	// Array of Pt nodes
-	Int_t fNThNodes;	// Numer of Theta nodes 
-	TVectorF fThArray;	// Array of Theta nodes		(Theta in degrees)
-	//
-	// Service routines
-	void VecInsert(Int_t i, Float_t x, TVectorF& Vec);
-	void SplitPt(Int_t i, TVectorF &AccPt);	
-	void SplitTh(Int_t i, TVectorF &AccTh);
-public:
-	//
-	// Constructors
-	AcceptanceClx(SolGeom *InGeo);				// Initialize arrays from geometry
-	AcceptanceClx(TString InFile);				// Initialize from acceptance file
-	// Destructor
-	~AcceptanceClx();
-	//
-	// Accessors
-	TMatrixF* GetAccMatrix() { return &fAcc; }
-	Int_t GetNrPt() { return fNPtNodes; }
-	Int_t GetNrTh() { return fNThNodes; }
-	
-	TVectorF* GetPtArray() { return &fPtArray; }
-	TVectorF* GetThArray() { return &fThArray; }
-	//
-	// Read and write
-	void ReadAcceptance(TString InFile);	// Stand alone usage
-	void WriteAcceptance(TString OutFile);	// Stand alone usage
-	void WriteAcceptance(TFile *OutFile);
-	//
-	// Function returning interpolated number of hit measurement layers
-	Double_t HitNumber(Double_t pt, Double_t Theta);	// Theta in degrees
-	Double_t HitNum(Double_t *x, Double_t *p);
-};
-
-#endif
Index: external/TrackCovariance/CMakeLists.txt
===================================================================
--- external/TrackCovariance/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,5 +1,0 @@
-include_directories(${CMAKE_SOURCE_DIR}/external)
-
-file(GLOB sources *.cc)
-
-add_library(TrackCovariance OBJECT ${sources})
Index: external/TrackCovariance/ObsTrk.cc
===================================================================
--- external/TrackCovariance/ObsTrk.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,168 +1,0 @@
-#include <TMath.h>
-#include <TVector3.h>
-#include <TMatrixD.h>
-#include <TMatrixDSym.h>
-#include <TDecompChol.h>
-#include <TRandom.h>
-#include <iostream>
-#include "SolGeom.h"
-#include "SolGridCov.h"
-#include "ObsTrk.h"
-//
-// Constructors
-//
-// x(3) track origin, p(3) track momentum at origin, Q charge, B ma gnetic field in Tesla
-ObsTrk::ObsTrk(TVector3 x, TVector3 p, Double_t Q, SolGridCov *GC, SolGeom *G)
-{
-	fB = G->B();
-	SetB(fB);
-	fG = G;
-	fGC = GC;
-	fGenX = x;
-	fGenP = p;
-	fGenQ = Q;
-	fGenPar.ResizeTo(5);
-	fGenParMm.ResizeTo(5);
-	fGenParACTS.ResizeTo(6);
-	fGenParILC.ResizeTo(5);
-	fObsPar.ResizeTo(5);
-	fObsParMm.ResizeTo(5);
-	fObsParACTS.ResizeTo(6);
-	fObsParILC.ResizeTo(5);
-	fCov.ResizeTo(5, 5);
-	fCovMm.ResizeTo(5, 5);
-	fCovACTS.ResizeTo(6, 6);
-	fCovILC.ResizeTo(5, 5);
-	fGenPar = XPtoPar(x,p,Q);
-	fGenParMm = ParToMm(fGenPar);
-	fGenParACTS = ParToACTS(fGenPar);
-	fGenParILC = ParToILC(fGenPar);
-	//
-	fObsPar = GenToObsPar(fGenPar);
-	fObsParMm = ParToMm(fObsPar);
-	fObsParACTS = ParToACTS(fObsPar);
-	fObsParILC = ParToILC(fObsPar);
-	fObsX = ParToX(fObsPar);
-	fObsP = ParToP(fObsPar);
-	fObsQ = ParToQ(fObsPar);
-	fCovMm = CovToMm(fCov);
-	fCovACTS = CovToACTS(fObsPar, fCov);
-	fCovILC = CovToILC(fCov);
-}
-//
-// x[3] track origin, p[3] track momentum at origin, Q charge, B magnetic field in Tesla
-ObsTrk::ObsTrk(Double_t *x, Double_t *p, Double_t Q, SolGridCov* GC, SolGeom *G)
-{
-	fB = G->B();
-	SetB(fB);
-	fG = G;
-	fGC = GC;
-	fGenX.SetXYZ(x[0],x[1],x[2]);
-	fGenP.SetXYZ(p[0],p[1],p[2]);
-	fGenQ = Q;
-	fGenPar.ResizeTo(5);
-	fGenParMm.ResizeTo(5);
-	fGenParACTS.ResizeTo(6);
-	fGenParILC.ResizeTo(5);
-	fObsPar.ResizeTo(5);
-	fObsParMm.ResizeTo(5);
-	fObsParACTS.ResizeTo(6);
-	fObsParILC.ResizeTo(5);
-	fCov.ResizeTo(5, 5);
-	fCovMm.ResizeTo(5, 5);
-	fCovACTS.ResizeTo(6, 6);
-	fCovILC.ResizeTo(5, 5);
-	fGenPar = XPtoPar(fGenX, fGenP, Q);
-	fGenParMm = ParToMm(fGenPar);
-	fGenParACTS = ParToACTS(fGenPar);
-	fGenParILC = ParToILC(fGenPar);
-	//
-	fObsPar = GenToObsPar(fGenPar);
-	fObsParMm = ParToMm(fObsPar);
-	fObsParACTS = ParToACTS(fObsPar);
-	fObsParILC = ParToILC(fObsPar);
-	fObsX = ParToX(fObsPar);
-	fObsP = ParToP(fObsPar);
-	fObsQ = ParToQ(fObsPar);
-	fCovMm = CovToMm(fCov);
-	fCovACTS = CovToACTS(fObsPar, fCov);
-	fCovILC = CovToILC(fCov);
-}
-//
-// Destructor
-ObsTrk::~ObsTrk()
-{
-	fGenX.Clear();
-	fGenP.Clear();
-	fGenPar.Clear();
-	fGenParMm.Clear();
-	fGenParACTS.Clear();
-	fGenParILC.Clear();
-	fObsX.Clear();
-	fObsP.Clear();
-	fObsPar.Clear();
-	fObsParMm.Clear();
-	fObsParACTS.Clear();
-	fObsParILC.Clear();
-	fCov.Clear();
-	fCovMm.Clear();
-	fCovACTS.Clear();
-	fCovILC.Clear();
-}
-//
-TVectorD ObsTrk::GenToObsPar(TVectorD gPar)
-{
-	//
-	// Check ranges
-	Double_t minPt = fGC->GetMinPt();
-	//if (pt < minPt) std::cout << "Warning ObsTrk::GenToObsPar: pt " << pt << " is below grid range of " << minPt << std::endl;
-	Double_t maxPt = fGC->GetMaxPt();
-	//if (pt > maxPt) std::cout << "Warning ObsTrk::GenToObsPar: pt " << pt << " is above grid range of " << maxPt << std::endl;
-	Double_t minAn = fGC->GetMinAng();
-	//if (angd < minAn) std::cout << "Warning ObsTrk::GenToObsPar: angle " << angd
-	//	<< " is below grid range of " << minAn << std::endl;
-	Double_t maxAn = fGC->GetMaxAng();
-	//if (angd > maxAn) std::cout << "Warning ObsTrk::GenToObsPar: angle " << angd
-	//	<< " is above grid range of " << maxAn << std::endl;
-	//
-	TMatrixDSym Cov(5);
-	//
-	// Check if track origin is inside beampipe and betwen the first disks
-	//
-	Double_t Rin = fG->GetRmin();
-	Double_t ZinPos = fG->GetZminPos();
-	Double_t ZinNeg = fG->GetZminNeg();
-	Bool_t inside = TrkUtil::IsInside(fGenX, Rin, ZinNeg, ZinPos); // Check if in inner box
-	SolTrack* trk = new SolTrack(fGenX, fGenP, fG);
-	Double_t Xfirst, Yfirst, Zfirst;
-	Int_t iLay = trk->FirstHit(Xfirst, Yfirst, Zfirst);
-	fXfirst = TVector3(Xfirst, Yfirst, Zfirst);
-  //std::cout<<"obs trk: "<<Xfirst<<","<<Yfirst<<","<<Zfirst<<std::endl;
-
-	if (inside)
-	{
-		//std::cout<<"ObsTrk:: inside: x= "<<fGenX(0)<<", y= "<<fGenX(1)
-                //                        <<", z= "<<fGenX(2)<<std::endl;
-		// Observed track parameters
-		Double_t pt = fGenP.Pt();
-		Double_t angd = fGenP.Theta() * 180. / TMath::Pi();
-		Cov = fGC->GetCov(pt, angd);				// Track covariance
-	}
-	else
-	{
-		//std::cout<<"ObsTrk:: outside: x= "<<fGenX(0)<<", y= "<<fGenX(1)
-                //                         <<", z= "<<fGenX(2)<<std::endl;
-		Bool_t Res = kTRUE; Bool_t MS = kTRUE;
-		trk->CovCalc(Res, MS);					// Calculate covariance matrix
-		Cov = trk->Cov();
-	}					// Track covariance
-	delete trk;
-	//
-	fCov = Cov;
-	//
-	// Now do Choleski decomposition and random number extraction, with appropriate stabilization
-	//
-	TVectorD oPar = TrkUtil::CovSmear(gPar, Cov);
-	//
-	return oPar;
-}
Index: external/TrackCovariance/ObsTrk.h
===================================================================
--- external/TrackCovariance/ObsTrk.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,97 +1,0 @@
-//
-#ifndef G__OBSTRK_H
-#define G__OBSTRK_H
-#include <TVector3.h>
-#include <TVectorD.h>
-#include <TMatrixDSym.h>
-#include <TDecompChol.h>
-#include "SolGeom.h"
-#include "TrkUtil.h"
-#include "SolGridCov.h"
-//
-// Class to handle smearing of generated charged particle tracks
-//
-// Author: F. Bedeschi
-//         INFN - Sezione di Pisa, Italy
-//
-class ObsTrk: public TrkUtil
-{
-	//
-	// Class to handle simulation of tracking resolution
-	// Prefix Obs marks variables after resolution smearing
-	// Prefix Gen marks variables before resolution smearing
-	//
-private:	
-	Double_t fB;					// Solenoid magnetic field
-	SolGridCov* fGC;				// Covariance matrix grid
-	SolGeom*    fG;					// Tracker geometry
-	Double_t fGenQ;					// Generated track charge
-	Double_t fObsQ;					// Observed  track charge
-	TVector3 fGenX;					// Generated track origin (x,y,z)
-	TVector3 fObsX;					// Observed  track origin (x,y,z) @ track min. approach 
-	TVector3 fGenP;					// Generated track momentum at track origin
-	TVector3 fObsP;					// Observed  track momentum @ track minimum approach
-	TVectorD fGenPar;				// Generated helix track parameters (D, phi0, C, z0, cot(th)) in meters
-	TVectorD fGenParMm;				// Generated helix track parameters (D, phi0, C, z0, cot(th)) in mm
-	TVectorD fGenParACTS;			// Generated helix track parameters (D, z0, phi0, th, q/p, time
-	TVectorD fGenParILC;			// Generated helix track parameters (w, phi0, d0, z0, tan(lambda))
-	TVectorD fObsPar;				// Observed  helix track parameters (D, phi0, C, z0, cot(th)) in meters
-	TVectorD fObsParMm;				// Observed  helix track parameters (D, phi0, C, z0, cot(th)) in mm
-	TVectorD fObsParACTS;			// Observed  helix track parameters (D, z0, phi0, th, q/p, time
-	TVectorD fObsParILC;			// Observed  helix track parameters (d0, phi0, w, z0, tan(lambda))
-	TMatrixDSym fCov;				// Interpolated covariance of track in meters
-	TMatrixDSym fCovMm;				// Interpolated covariance of track parameters in mm
-	TMatrixDSym fCovACTS;			// Covariance of track parameters in ACTS format
-									// (D, z0, phi0, theta, q/p, time)
-	TMatrixDSym fCovILC;			// Covariance of track parameters in ILC format
-									// (d0, phi0, w, z0, tan(lambda))
-	TVector3 fXfirst;			// x,y,z of first track hit
-	//
-	// Service routines
-	//
-	TVectorD GenToObsPar(TVectorD gPar);
-	//
-public:
-	//
-	// Constructors
-	// x(3) track origin, p(3) track momentum at origin, Q charge, B magnetic field in Tesla
-	ObsTrk(TVector3 x, TVector3 p, Double_t Q, SolGridCov *GC, SolGeom *G);	// Initialize and generate smeared 
-	ObsTrk(Double_t *x, Double_t *p, Double_t Q, SolGridCov* GC, SolGeom *G);	// Initialize and generate smeared track
-	// Destructor
-	~ObsTrk();
-	//
-	// Accessors
-	//
-	// Generator level:
-	// X, P, Q
-	Double_t GetGenQ()	{ return fGenQ; }
-	TVector3 GetGenX()	{ return fGenX; }
-	TVector3 GetGenP()	{ return fGenP; }
-	// D, phi0, C, z0, cot(th)
-	TVectorD GetGenPar()	{ return fGenPar; }		// in meters
-	TVectorD GetGenParMm()	{ return fGenParMm; }		// in mm
-	// D, z0, phi0, theta, q/p, time
-	TVectorD GetGenParACTS()	{ return fGenParACTS; }
-	// d0, phi0, w, z0, tan(lambda)
-	TVectorD GetGenParILC()	{ return fGenParILC; }
-	// Observed level X, P, Q
-	Double_t GetObsQ()	{ return fObsQ; }
-	TVector3 GetObsX()	{ return fObsX; }
-	TVector3 GetObsP()	{ return fObsP; }
-	// D, phi0, C, z0, cot(th)
-	TVectorD GetObsPar()	{ return fObsPar; }		// in meters
-	TVectorD GetObsParMm()	{ return fObsParMm; }	// In mm
-	// D, z0, phi0, theta, q/p, time
-	TVectorD GetObsParACTS()	{ return fObsParACTS; }
-	// d0, phi0, w, z0, tan(lambda)
-	TVectorD GetObsParILC()	{ return fObsParILC; }
-	// Covariances
-	TMatrixDSym GetCov()	{ return fCov; }	// in meters
-	TMatrixDSym GetCovMm()	{ return fCov; }	// in mm
-	TMatrixDSym GetCovACTS(){ return fCovACTS; }
-	TMatrixDSym GetCovILC() { return fCovILC; }
-	// First hit
-	TVector3 GetFirstHit()  { return fXfirst; }
-};
-
-#endif
Index: external/TrackCovariance/SolGeom.cc
===================================================================
--- external/TrackCovariance/SolGeom.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,129 +1,0 @@
-#include <iostream>
-#include <sstream>
-
-#include <TString.h>
-
-#include "SolGeom.h"
-#include "SolTrack.h"
-
-using namespace std;
-
-SolGeom::SolGeom()
-{
-  //
-  // Magnetic field
-  //
-  fB = 2.0;
-  //
-  // Create arrays
-  //
-  ftyLay = new Int_t[fNlMax];     // Layer type 1 = R (barrel) or 2 = z (forward/backward)
-  fLyLabl = new TString[fNlMax];  // Layer label
-  fxMin = new Double_t[fNlMax];   // Minimum dimension z for barrel  or R for forward
-  fxMax = new Double_t[fNlMax];   // Maximum dimension z for barrel  or R for forward
-  frPos = new Double_t[fNlMax];   // R/z location of layer
-  fthLay = new Double_t[fNlMax];  // Thickness (meters)
-  frlLay = new Double_t[fNlMax];  // Radiation length (meters)
-  fnmLay = new Int_t[fNlMax];     // Number of measurements in layers (1D or 2D)
-  fstLayU = new Double_t[fNlMax]; // Stereo angle (rad) - 0(pi/2) = axial(z) layer - Upper side
-  fstLayL = new Double_t[fNlMax]; // Stereo angle (rad) - 0(pi/2) = axial(z) layer - Lower side
-  fsgLayU = new Double_t[fNlMax]; // Resolution Upper side (meters) - 0 = no measurement
-  fsgLayL = new Double_t[fNlMax]; // Resolution Lower side (meters) - 0 = no measurement
-  fflLay = new Bool_t[fNlMax];    // measurement flag = T, scattering only = F
-  //
-  // Load geometry info in SolGeom.h
-  //
-  fNlay = 0; // Actual number of layers
-  fBlay = 0; // Nr. of barrel layers
-  fFlay = 0; // Nr. of forward/backward layers
-  fNm = 0;   // Nr. of measuring layers
-}
-
-void SolGeom::Read(const char *data)
-{
-  Int_t tyLay;
-  string LyLabl;
-  Double_t xMin;
-  Double_t xMax;
-  Double_t rPos;
-  Double_t thLay;
-  Double_t rlLay;
-  Int_t nmLay;
-  Double_t stLayU;
-  Double_t stLayL;
-  Double_t sgLayU;
-  Double_t sgLayL;
-  Int_t flLay;
-
-  stringstream data_stream(data);
-  string line;
-
-  fNlay = 0;
-  while(getline(data_stream, line))
-  {
-    stringstream line_stream(line);
-
-    line_stream >> tyLay >> LyLabl >> xMin >> xMax >> rPos >> thLay >> rlLay >> nmLay >> stLayU >> stLayL >> sgLayU >> sgLayL >> flLay;
-
-    if(line_stream.fail()) continue;
-
-    ftyLay[fNlay] = tyLay;
-    fLyLabl[fNlay] = LyLabl;
-    fxMin[fNlay] = xMin;
-    fxMax[fNlay] = xMax;
-    frPos[fNlay] = rPos;
-    fthLay[fNlay] = thLay;
-    frlLay[fNlay] = rlLay;
-    fnmLay[fNlay] = nmLay;
-    fstLayU[fNlay] = stLayU;
-    fstLayL[fNlay] = stLayL;
-    fsgLayU[fNlay] = sgLayU;
-    fsgLayL[fNlay] = sgLayL;
-    fflLay[fNlay] = flLay;
-
-    fNlay++;
-    if (tyLay == 1) fBlay++;
-    if (tyLay == 2) fFlay++;
-    if (flLay == 1) fNm++;
-  }
-//
-// Define inner box for fast tracking
-//
-    SetMinBoundaries();
-}
-
-SolGeom::~SolGeom()
-{
-  delete[] ftyLay;
-  delete[] fxMin;
-  delete[] fxMax;
-  delete[] frPos;
-  delete[] fthLay;
-  delete[] frlLay;
-  delete[] fnmLay;
-  delete[] fstLayU;
-  delete[] fstLayL;
-  delete[] fsgLayU;
-  delete[] fsgLayL;
-  delete[] fflLay;
-}
-
-//
-// Get inner boundaries of cylindrical box for fast simulation
-//
-void SolGeom::SetMinBoundaries()
-{
-	// Get radius of first barrel layer
-	fRmin = 1000000.0;
-	fZminPos = 1000000.0;
-	fZminNeg = -1000000.0;
-	for (Int_t i = 0; i < fNlay; i++){
-		if (ftyLay[i] == 1) {				// Cylinders
-			if (frPos[i] < fRmin) fRmin = frPos[i];
-		}
-		if (ftyLay[i] == 2) {				// Disks
-			if (frPos[i] > 0.0 && frPos[i] < fZminPos) fZminPos = frPos[i];	// Positive direction
-			if (frPos[i] < 0.0 && frPos[i] > fZminNeg) fZminNeg = frPos[i];	// Negative direction
-		}
-	}
-}
Index: external/TrackCovariance/SolGeom.h
===================================================================
--- external/TrackCovariance/SolGeom.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#ifndef G__SOLGEOM_H
-#define G__SOLGEOM_H
-
-#include <Rtypes.h>
-#include <TString.h>
-
-// Class to create geometry for solenoid geometry
-// Simplified implementations with cylindrical and disk layers
-//
-// Author: F. Bedeschi, INFN - Pisa
-
-class SolGeom{
-  //
-  // Units are m
-  //
-private:
-  const Int_t fNlMax = 200; // Maximum number of layers
-
-  // B field
-  Double_t fB; // B field in Tesla
-
-  // Barrel layer properties
-  Int_t fNlay;       // Total number of layers
-  Int_t fBlay;       // Number of barrel layers
-  Int_t fFlay;       // Number of forward/backward layers
-  Int_t fNm;         // Nr. measurement layers
-  Int_t *ftyLay;     // Layer type 1 = R (barrel) or 2 = z (forward/backward)
-  TString *fLyLabl;  // Layer label
-  // Barrel: PIPE, VTXLOW, VTXHIGH, DCHCANI, DCH, DCHCANO, BSILWRP, MAG, BPRESH
-  // Fw/Bw: VTXDSK, DCHWALL, FSILWRP, FRAD, FPRESH
-  Double_t *fxMin;   // Minimum dimension z for barrel  or R for forward
-  Double_t *fxMax;   // Maximum dimension z for barrel  or R for forward
-  Double_t *frPos;   // R/z location of layer
-  Double_t *fthLay;  // Thickness (meters)
-  Double_t *frlLay;  // Radiation length (meters)
-  Int_t    *fnmLay;  // Number of measurements in layers (1D or 2D)
-  Double_t *fstLayU; // Stereo angle (rad) - 0(pi/2) = axial(z) layer - Upper side
-  Double_t *fstLayL; // Stereo angle (rad) - 0(pi/2) = axial(z) layer - Lower side
-  Double_t *fsgLayU; // Resolution Upper side (meters) - 0 = no measurement
-  Double_t *fsgLayL; // Resolution Lower side (meters) - 0 = no measurement
-  Bool_t   *fflLay;  // measurement flag = T, scattering only = F
-//
-//
-  Double_t fRmin;	// Radius of first barrel layer
-  Double_t fZminPos;	// Z of first disk in positive direction
-  Double_t fZminNeg;	// Z of first disk in negative direction
-  void SetMinBoundaries();	// define inner box for fast simulation
-
-public:
-  SolGeom();
-  ~SolGeom();
-
-  void Read(const char *data);
-
-  Double_t B()                     { return fB; }
-  Int_t    Nl()                    { return fNlay; }
-  Int_t    Nm()                    { return fNm; }
-  Int_t    NBl()                   { return fBlay; }
-  TString  lLabl(Int_t nlayer)     { return fLyLabl[nlayer]; }
-  Int_t    lTyp(Int_t nlayer)      { return ftyLay[nlayer]; }
-  Double_t lxMin(Int_t nlayer)     { return fxMin[nlayer]; }
-  Double_t lxMax(Int_t nlayer)     { return fxMax[nlayer]; }
-  Double_t lPos(Int_t nlayer)      { return frPos[nlayer]; }
-  Double_t lTh(Int_t nlayer)       { return fthLay[nlayer]; }
-  Double_t lX0(Int_t nlayer)       { return frlLay[nlayer]; }
-  Int_t    lND(Int_t nlayer)       { return fnmLay[nlayer]; }
-  Double_t lStU(Int_t nlayer)      { return fstLayU[nlayer]; }
-  Double_t lStL(Int_t nlayer)      { return fstLayL[nlayer]; }
-  Double_t lSgU(Int_t nlayer)      { return fsgLayU[nlayer]; }
-  Double_t lSgL(Int_t nlayer)      { return fsgLayL[nlayer]; }
-  Bool_t   isMeasure(Int_t nlayer) { return fflLay[nlayer]; }
-  //
-  // Define cylindrical box to use for fast simulation
-  //
-  Double_t GetRmin() { return fRmin; }
-  Double_t GetZminPos() { return fZminPos; }
-  Double_t GetZminNeg() { return fZminNeg; }
-};
-
-#endif
Index: external/TrackCovariance/SolGridCov.cc
===================================================================
--- external/TrackCovariance/SolGridCov.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,226 +1,0 @@
-#include <iostream>
-
-#include <TMath.h>
-#include <TVectorD.h>
-#include <TVector3.h>
-#include <TMatrixDSym.h>
-#include <TDecompChol.h>
-#include <TMatrixDSymEigen.h>
-
-#include "SolGridCov.h"
-#include "SolGeom.h"
-#include "SolTrack.h"
-
-using namespace std;
-
-SolGridCov::SolGridCov()
-{
-  // Define pt-polar angle grid
-  fNpt = 22;
-  fPta.ResizeTo(fNpt);
-  Double_t p[] = { 0.1, 0.2, 0.5, 0.7, 1., 2., 3., 4., 6., 8., 10., 15.,
-                   20., 25., 30., 40., 50., 60., 80., 100., 150., 200. };
-  for (Int_t ip = 0; ip < fNpt; ip++) fPta(ip) = p[ip];
-
-  fNang = 13;
-  fAnga.ResizeTo(fNang);
-  Double_t a[] = { 10., 15., 20., 25., 30., 35., 40., 45., 50., 60., 70., 80., 90. };
-  for (Int_t ia = 0; ia < fNang; ia++) fAnga(ia) = a[ia];
-  fCov = new TMatrixDSym[fNpt * fNang];
-  for (Int_t ip = 0; ip < fNpt; ip++)
-  {
-    for (Int_t ia = 0; ia < fNang; ia++) fCov[ip * fNang + ia].ResizeTo(5, 5);
-  }
-}
-
-SolGridCov::~SolGridCov()
-{
-  delete[] fCov;
-  delete fAcc;
-}
-
-void SolGridCov::Calc(SolGeom *G)
-{
-  TVectorD pta = fPta;
-  TVectorD anga = fAnga;
-  Bool_t Res = kTRUE; Bool_t MS = kTRUE; // Resolution and multiple scattering flags
-  for (Int_t ip = 0; ip < fNpt; ip++) // Loop on pt grid
-  {
-    Int_t ipt = TMath::Nint(10 * pta(ip));
-    for (Int_t ia = 0; ia < fNang; ia++) // Loop on angle grid
-    {
-      Double_t th = TMath::Pi() * (anga(ia)) / 180.;
-      Double_t x[3], p[3];
-      x[0] = 0; x[1] = 0; x[2] = 0; // Set origin
-      p[0] = pta(ip); p[1] = 0; p[2] = pta(ip) / TMath::Tan(th);
-      //
-      SolTrack *tr = new SolTrack(x, p, G); // Initialize track
-      tr->CovCalc(Res, MS); // Calculate covariance
-      fCov[ip * fNang + ia] = tr->Cov(); // Get covariance
-    }
-  }
-
-// Now make acceptance
-fAcc = new AcceptanceClx(G);
-}
-
-
-//
-Bool_t SolGridCov::IsAccepted(Double_t pt, Double_t Theta)
-{
-	//
-	// pt in GeV, Theta in degrees
-	//
-	Bool_t Accept = kFALSE;
-	if (fAcc->HitNumber(pt, Theta) >= fNminHits)Accept = kTRUE;
-	//
-	return Accept;
-}
-//
-Bool_t SolGridCov::IsAccepted(Double_t *p)
-{
-	//
-	// pt in GeV, Theta in degrees
-	//
-	Bool_t Accept = kFALSE;
-	Double_t pt = TMath::Sqrt(p[0] * p[0] + p[1] * p[1]);
-	Double_t th = 180. * TMath::ATan2(pt, p[2])/TMath::Pi();
-	if (fAcc->HitNumber(pt,th) >= fNminHits)Accept = kTRUE;
-	//
-	return Accept;
-}
-//
-Bool_t SolGridCov::IsAccepted(TVector3 p)
-{
-	//
-	// pt in GeV, Theta in degrees
-	//
-	Bool_t Accept = kFALSE;
-	Double_t pt = p.Pt();
-	Double_t th = 180.*TMath::ACos(p.CosTheta())/TMath::Pi();
-	if (fAcc->HitNumber(pt,th) >= fNminHits)Accept = kTRUE;
-	//
-	return Accept;
-}
-//
-// Detailed acceptance check
-//
-Bool_t SolGridCov::IsAccepted(TVector3 x, TVector3 p, SolGeom* G)
-{
-	Bool_t Accept = kFALSE;
-	//
-	// Check if track origin is inside beampipe and betwen the first disks
-	//
-	Double_t Rin = G->GetRmin();
-	Double_t ZinPos = G->GetZminPos();
-	Double_t ZinNeg = G->GetZminNeg();
-	Bool_t inside = TrkUtil::IsInside(x, Rin, ZinNeg, ZinPos); // Check if in inner box
-	if (inside) Accept = IsAccepted(p);
-	else
-	{
-		SolTrack* trk = new SolTrack(x, p, G);
-		if (trk->nmHit() >= fNminHits)Accept = kTRUE;
-		delete trk;
-	}
-	//
-	return Accept;
-}
-
-//
-// Find bin in grid
-Int_t SolGridCov::GetMinIndex(Double_t xval, Int_t N, TVectorD x)
-{
-  Int_t min = -1; // default for xval below the lower limit
-  if (xval < x(0))return min;
-  if (xval>x(N - 1)){ min = N; return min; }
-  for (Int_t i = 0; i < N; i++) if (xval>x(i))min = i;
-  return min;
-}
-// Force positive definitness in normalized matrix
-TMatrixDSym SolGridCov::MakePosDef(TMatrixDSym NormMat)
-{
-  // Input: symmetric matrix with 1's on diagonal
-  // Output: positive definite matrix with 1's on diagonal
-
-  // Default return value
-  TMatrixDSym rMatN = NormMat;
-  // Check the diagonal
-  Bool_t Check = kFALSE;
-  Int_t Size = NormMat.GetNcols();
-  for (Int_t i = 0; i < Size; i++)if (TMath::Abs(NormMat(i, i) - 1.0)>1.0E-15)Check = kTRUE;
-  if (Check)
-  {
-    cout << "SolGridCov::MakePosDef: input matrix doesn ot have 1 on diagonal. Abort." << endl;
-    return rMatN;
-  }
-  // Diagonalize matrix
-  TMatrixDSymEigen Eign(NormMat);
-  TMatrixD U = Eign.GetEigenVectors();
-  TVectorD lambda = Eign.GetEigenValues();
-  // Reset negative eigenvalues to small positive value
-  TMatrixDSym D(Size); D.Zero(); Double_t eps = 1.0e-13;
-  for (Int_t i = 0; i < Size; i++)
-  {
-    D(i, i) = lambda(i);
-    if (lambda(i) <= 0) D(i, i) = eps;
-  }
-  // Rebuild matrix
-  TMatrixD Ut(TMatrixD::kTransposed, U);
-  TMatrixD rMat = (U*D)*Ut;       // Now it is positive defite
-  // Restore all ones on diagonal
-  for (Int_t i1 = 0; i1 < Size; i1++)
-  {
-    Double_t rn1 = TMath::Sqrt(rMat(i1, i1));
-    for (Int_t i2 = 0; i2 <= i1; i2++)
-    {
-      Double_t rn2 = TMath::Sqrt(rMat(i2, i2));
-      rMatN(i1, i2) = 0.5*(rMat(i1, i2) + rMat(i2, i1)) / (rn1*rn2);
-      rMatN(i2, i1) = rMatN(i1, i2);
-    }
-  }
-  return rMatN;
-}
-// Interpolate covariance matrix: Bi-linear interpolation
-TMatrixDSym SolGridCov::GetCov(Double_t pt, Double_t ang)
-{
-  // pt in GeV and ang in degrees
-  Int_t minPt = GetMinIndex(pt, fNpt, fPta);
-  if (minPt == -1)minPt = 0;
-  if (minPt == fNpt - 1)minPt = fNpt - 2;
-  Double_t dpt = fPta(minPt + 1) - fPta(minPt);
-  // Put ang in 0-90 range
-  ang = TMath::Abs(ang);
-  while (ang > 90.)ang -= 90.;  // Needs to be fixed
-  Int_t minAng = GetMinIndex(ang, fNang, fAnga);
-  if (minAng == -1)minAng = 0;
-  if (minAng == fNang - 1)minAng = fNang - 2;
-  Double_t dang = fAnga(minAng + 1) - fAnga(minAng);
-  //
-  Double_t tpt = (pt - fPta(minPt)) / dpt;
-  Double_t tang = (ang - fAnga(minAng)) / dang;
-  //
-  TMatrixDSym C11 = fCov[minPt * fNang + minAng];
-  TMatrixDSym C12 = fCov[minPt * fNang + minAng + 1];
-  TMatrixDSym C21 = fCov[(minPt + 1) * fNang + minAng];
-  TMatrixDSym C22 = fCov[(minPt + 1) * fNang + minAng + 1];
-  TMatrixDSym Cv = ((1-tpt) * (1-tang)) * C11 +
-                   ((1-tpt) *    tang ) * C12 +
-                   (   tpt  * (1-tang)) * C21 +
-                   (   tpt  *    tang ) * C22;
-  // Check for positive definiteness
-  TMatrixDSym CvN = Cv;
-  TMatrixDSym DCvInv(5); DCvInv.Zero();
-  for (Int_t id = 0; id < 5; id++) DCvInv(id, id) = 1.0 / TMath::Sqrt(Cv(id, id));
-  CvN.Similarity(DCvInv); // Normalize diagonal to 1
-  TDecompChol Chl(CvN);
-  if (!Chl.Decompose())
-  {
-    std::cout << "SolGridCov::GetCov: Interpolated matrix not positive definite. Recovering ...." << std::endl;
-    TMatrixDSym rCv = MakePosDef(CvN); CvN = rCv;
-    TMatrixDSym DCv(5); DCv.Zero();
-    for (Int_t id = 0; id < 5; id++) DCv(id, id) = TMath::Sqrt(Cv(id, id));
-    Cv = CvN.Similarity(DCv); // Normalize diagonal to 1
-  }
-
-  return Cv;
-}
Index: external/TrackCovariance/SolGridCov.h
===================================================================
--- external/TrackCovariance/SolGridCov.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#ifndef G__SOLGRIDCOV_H
-#define G__SOLGRIDCOV_H
-
-#include <TVectorD.h>
-#include <TMatrixDSym.h>
-#include "AcceptanceClx.h"
-
-class SolGeom;
-
-// Class to create geometry for solenoid geometry
-
-class SolGridCov{
-  // Class to handle storing and retrieving/interpolation of covariance matrices
-private:
-  Int_t fNpt;        // Number of pt points in grid
-  TVectorD fPta;     // Array of pt points in GeV
-  Int_t fNang;       // Number of angle points in grid
-  TVectorD fAnga;    // Array of angle points in degrees
-  TMatrixDSym *fCov; // Pointers to grid of covariance matrices
-  AcceptanceClx *fAcc;		// Pointer to acceptance class
-  Int_t fNminHits;		// Minimum number of hits to accept track
-  // Service routines
-  Int_t GetMinIndex(Double_t xval, Int_t N, TVectorD x); // Find bin
-  TMatrixDSym MakePosDef(TMatrixDSym NormMat); // Force positive definitness
-public:
-  SolGridCov();
-  ~SolGridCov();
-
-  void Calc(SolGeom *G);
-
-  // Covariance interpolation
-  Double_t GetMinPt()  { return fPta(0); }
-  Double_t GetMaxPt()  { return fPta(fNpt - 1); }
-  Double_t GetMinAng() { return fAnga(0); }
-  Double_t GetMaxAng() { return fAnga(fNang - 1); }
-  TMatrixDSym GetCov(Double_t pt, Double_t ang);
-
-  	// Acceptance related methods
-	AcceptanceClx* AccPnt() { return fAcc; };			// Return Acceptance class pointer
-	void SetMinHits(Int_t MinHits) { fNminHits = MinHits; };	// Set minimum number of hits to accept (default = 6)
-	Int_t GetMinHits() { return fNminHits; };
-	Bool_t IsAccepted(Double_t pt, Double_t Theta);			// From pt (GeV) and theta (degrees)
-	Bool_t IsAccepted(Double_t *p);					// From momentum components (GeV)
-	Bool_t IsAccepted(TVector3 p);					// As above in Vector3 format
-	Bool_t IsAccepted(TVector3 x, TVector3 p, SolGeom *G);		// As above checking track origin
-
-};
-
-#endif
Index: external/TrackCovariance/SolTrack.cc
===================================================================
--- external/TrackCovariance/SolTrack.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,683 +1,0 @@
-
-#include "SolGeom.h"
-#include "SolTrack.h"
-#include <TString.h>
-#include <TMath.h>
-#include <TMatrixD.h>
-#include <TMatrixDSym.h>
-#include <TDecompChol.h>
-#include <TMatrixDSymEigen.h>
-#include <TGraph.h>
-#include <iostream>
-//
-// Constructors
-SolTrack::SolTrack(Double_t *x, Double_t *p, SolGeom *G)
-{
-	// Set B field
-	fG = G;					// Store geometry
-	Double_t B = G->B();
-	SetB(B);
-	// Store momentum and position
-	fp[0] = p[0]; fp[1] = p[1]; fp[2] = p[2];
-	fx[0] = x[0]; fx[1] = x[1]; fx[2] = x[2];
-	// Get generated parameters
-	TVector3 xv(fx);
-	TVector3 pv(fp);
-	Double_t Charge = 1.0;						// Don't worry about charge for now
-	TVectorD gPar = XPtoPar(xv, pv, Charge);
-	// Store parameters
-	fpar[0] = gPar(0);
-	fpar[1] = gPar(1);
-	fpar[2] = gPar(2);
-	fpar[3] = gPar(3);
-	fpar[4] = gPar(4);
-	//cout << "SolTrack:: C = " << C << ", fpar[2] = " << fpar[2] << endl;
-	//
-	// Init covariances
-	//
-	fCov.ResizeTo(5, 5);
-}
-SolTrack::SolTrack(TVector3 x, TVector3 p, SolGeom* G)
-{
-	// set B field
-	fG = G;					// Store geometry
-	Double_t B = G->B();
-	SetB(B);
-	// Store momentum
-	fp[0] = p(0); fp[1] = p(1); fp[2] = p(2);
-	fx[0] = x(0); fx[1] = x(1); fx[2] = x(2);
-	// Get generated parameters
-	Double_t Charge = 1.0;						// Don't worry about charge for now
-	TVectorD gPar = XPtoPar(x, p, Charge);
-	// Store parameters
-	fpar[0] = gPar(0);
-	fpar[1] = gPar(1);
-	fpar[2] = gPar(2);
-	fpar[3] = gPar(3);
-	fpar[4] = gPar(4);
-	//cout << "SolTrack:: C = " << C << ", fpar[2] = " << fpar[2] << endl;
-	//
-	// Init covariances
-	//
-	fCov.ResizeTo(5, 5);
-}
-//
-SolTrack::SolTrack(Double_t D, Double_t phi0, Double_t C, Double_t z0, Double_t ct, SolGeom *G)
-{
-	fG = G;
-	Double_t B = G->B();
-	SetB(B);
-	// Store parameters
-	fpar[0] = D;
-	fpar[1] = phi0;
-	fpar[2] = C;
-	fpar[3] = z0;
-	fpar[4] = ct;
-	// Store momentum
-	Double_t pt = B * TrkUtil::cSpeed() / TMath::Abs(2 * C);
-	Double_t px = pt*TMath::Cos(phi0);
-	Double_t py = pt*TMath::Sin(phi0);
-	Double_t pz = pt*ct;
-	//
-	fp[0] = px; fp[1] = py; fp[2] = pz;
-	fx[0] = -D*TMath::Sin(phi0); fx[1] = D*TMath::Cos(phi0);  fx[2] = z0;
-	//
-	// Init covariances
-	//
-	fCov.ResizeTo(5, 5);
-}
-// Destructor
-SolTrack::~SolTrack()
-{
-	fCov.Clear();
-}
-//
-// Calculate intersection with given layer
-Bool_t SolTrack::HitLayer(Int_t il, Double_t &R, Double_t &phi, Double_t &zz)
-{
-	Double_t Di = D();
-	Double_t phi0i = phi0();
-	Double_t Ci = C();
-	Double_t z0i = z0();
-	Double_t cti = ct();
-	//
-	R = 0; phi = 0; zz = 0;
-	Bool_t val = kFALSE;
-	Double_t Rmin = TMath::Sqrt(fx[0] * fx[0] + fx[1] * fx[1]); // Smallest track radius
-	if (Rmin < TMath::Abs(Di)) return val;
-	//
-	Double_t ArgzMin = Ci * TMath::Sqrt((Rmin * Rmin - Di * Di) / (1 + 2 * Ci * Di));
-	Double_t stMin = TMath::ASin(ArgzMin) / Ci;					// Arc length at track origin
-	//
-	if (fG->lTyp(il) == 1)			// Cylinder: layer at constant R
-	{
-		R = fG->lPos(il);
-		Double_t argph = (Ci*R + (1 + Ci*Di)*Di / R) / (1. + 2.*Ci*Di);
-		if (TMath::Abs(argph) < 1.0 && R > Rmin)
-		{
-			Double_t argz = Ci*TMath::Sqrt((R*R - Di*Di) / (1 + 2 * Ci*Di));
-			if (TMath::Abs(argz) < 1.0)
-			{
-				zz = z0i + cti*TMath::ASin(argz) / Ci;
-				if (zz > fG->lxMin(il) && zz < fG->lxMax(il))
-				{
-					phi = phi0i + TMath::ASin(argph);
-					val = kTRUE;
-				}
-			}
-		}
-	}
-	else if (fG->lTyp(il) == 2)		// disk: layer at constant z
-	{
-		zz = fG->lPos(il);
-		Double_t st = (zz - z0i) / cti;
-		if (TMath::Abs(Ci * st) < 1.0 && st > stMin)
-		{
-			R = TMath::Sqrt(Di * Di + (1. + 2. * Ci * Di) * pow(TMath::Sin(Ci * st), 2) / (Ci * Ci));
-			if (R > fG->lxMin(il) && R < fG->lxMax(il))
-			{
-				Double_t arg1 = (Ci*R + (1 + Ci*Di)*Di / R) / (1. + 2.*Ci*Di);
-				if (TMath::Abs(arg1) < 1.0)
-				{
-					phi = phi0i + TMath::ASin(arg1);
-					val = kTRUE;
-				}
-			}
-		}
-	}
-	//
-	return val;
-}
-//
-// # of layers hit
-Int_t SolTrack::nHit()
-{
-	Int_t kh = 0;
-	Double_t R; Double_t phi; Double_t zz;
-	for (Int_t i = 0; i < fG->Nl(); i++)
-	if (HitLayer(i, R, phi, zz))kh++;
-	//
-	return kh;
-}
-//
-// # of measurement layers hit
-Int_t SolTrack::nmHit()
-{
-	Int_t kmh = 0;
-	Double_t R; Double_t phi; Double_t zz;
-	for (Int_t i = 0; i < fG->Nl(); i++)
-	if (HitLayer(i, R, phi, zz))if (fG->isMeasure(i))kmh++;
-	//
-	return kmh;
-}
-//
-// List of layers hit with intersections
-Int_t SolTrack::HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh)
-{
-	//
-	// Return lists of hits associated to a track including all scattering layers.
-	// Return value is the total number of measurement hits
-	// kmh = total number of measurement layers hit for given type
-	// ihh = pointer to layer number
-	// rhh = radius of hit
-	// zhh = z of hit
-	//
-	// ***** NB: double layers with stereo on lower layer not included
-	//
-	Int_t kh = 0;	// Number of layers hit
-	Int_t kmh = 0;  // Number of measurement layers of given type
-	for (Int_t i = 0; i < fG->Nl(); i++)
-	{
-		Double_t R; Double_t phi; Double_t zz;
-		if (HitLayer(i, R, phi, zz))
-		{
-			zhh[kh] = zz;
-			rhh[kh] = R;
-			ihh[kh] = i;
-			if (fG->isMeasure(i))kmh++;
-			kh++;
-		}
-	}
-	//
-	return kmh;
-}
-//
-// List of XYZ measurements without any error
-Int_t SolTrack::HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh)
-{
-	//
-	// Return lists of hits associated to a track for all measurement layers.
-	// Return value is the total number of measurement hits
-	// kmh = total number of measurement layers hit for given type
-	// ihh = pointer to layer number
-	// Xh, Yh, Zh = X, Y, Z of hit - No measurement error - No multiple scattering
-	//
-	//
-	Int_t kmh = 0;  // Number of measurement layers hit
-	for (Int_t i = 0; i < fG->Nl(); i++)
-	{
-		Double_t R; Double_t phi; Double_t zz;
-		if (HitLayer(i, R, phi, zz)) // Only barrel type layers
-		{
-			if (fG->isMeasure(i))
-			{
-				ihh[kmh] = i;
-				Xh[kmh] = R*cos(phi);
-				Yh[kmh] = R*sin(phi);
-				Zh[kmh] = zz;
-				kmh++;
-			}
-		}
-	}
-	//
-	return kmh;
-}
-//
-Int_t SolTrack::FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst)
-{
-	Int_t iFirst = -1;
-	Int_t iFirstLay = -1;	// Default return with no hits
-	Xfirst = 0.;
-	Yfirst = 0.;
-	Zfirst = 0.;
-	Int_t Nmh = nmHit();	// # measurement hits
-	if(Nmh > 0){
-		Int_t    *ih = new Int_t   [Nmh];
-		Double_t *Xh = new Double_t[Nmh];
-		Double_t *Yh = new Double_t[Nmh];
-		Double_t *Zh = new Double_t[Nmh];
-		Double_t *dh = new Double_t[Nmh];
-		//
-		Int_t n = HitListXYZ(ih, Xh, Yh, Zh);
-		//
-		for(Int_t i=0; i<Nmh; i++){
-			Double_t rr = TMath::Sqrt(Xh[i]*Xh[i]+Yh[i]*Yh[i]);	// Hit radius
-			dh[i] = TMath::ASin(C() * TMath::Sqrt((rr * rr - D() * D()) / (1. + 2 * C() * D()))) / C();	// Arc length traveled
-		}
-		//
-		Int_t *hord = new Int_t[Nmh];			// hit order by increasing arc length
-		TMath::Sort(Nmh, dh, hord, kFALSE);		// Order by increasing arc length
-		iFirst = hord[0];				// First hit pointer
-		Xfirst = Xh[iFirst];
-		Yfirst = Yh[iFirst];
-		Zfirst = Zh[iFirst];
-		iFirstLay = ih[iFirst];
-		//
-		// Clean
-		delete [] ih;
-		delete [] Xh;
-		delete [] Yh;
-		delete [] Zh;
-		delete [] dh;
-		delete [] hord;
-	}
-//
-	return 	iFirstLay;	// Return first hit layer number
-}
-//
-// Track plot
-//
-TGraph *SolTrack::TrkPlot()
-{
-	//
-	// Fill list of layers hit
-	//
-	Int_t Nhit = nHit();					// Total number of layers hit
-	//cout << "Nhit = " << Nhit << endl;
-	Double_t *zh = new Double_t[Nhit];		// z of hit
-	Double_t *rh = new Double_t[Nhit];		// r of hit
-	Int_t    *ih = new Int_t   [Nhit];		// true index of layer
-	Int_t kmh;								// Number of measurement layers hit
-	//
-	kmh = HitList(ih, rh, zh);				// hit layer list
-	//for (Int_t j = 0; j < Nhit; j++) cout << "r = " << rh[j] << ", z = " << zh[j] << endl;
-	Double_t *dh = new Double_t[Nhit];		// Hit distance from origin
-	for(Int_t i=0; i<Nhit; i++)dh[i] = TMath::ASin(C() * TMath::Sqrt((rh[i] * rh[i] - D() * D()) / (1. + 2 * C() * D()))) / C();	// Arc length traveled;
-	//
-	Int_t *hord = new Int_t[Nhit];
-	TMath::Sort(Nhit, dh, hord, kFALSE);		// Order by increasing phase
-	Double_t *z = new Double_t[Nhit];		// z of ordered hit
-	Double_t *r = new Double_t[Nhit];		// r of ordered hit
-	for (Int_t i = 0; i < Nhit; i++)
-	{
-		z[i] = zh[hord[i]];
-		r[i] = rh[hord[i]];
-	}
-	//cout << "After ordering" << endl;
-	//for (Int_t j = 0; j < Nhit; j++) cout << "r = " << rh[j] << ", z = " << zh[j] << endl;
-	TGraph *gr = new TGraph(Nhit, z, r);	// graph intersection with layers
-	gr->SetMarkerStyle(kCircle);
-	gr->SetMarkerColor(kMagenta);
-	gr->SetMarkerSize(1);
-	gr->SetLineColor(kMagenta);
-	//
-	// clean up
-	//
-	delete[] zh;
-	delete[] rh;
-	delete[] ih;
-	delete[] hord;
-	return gr;
-}
-//
-// Covariance matrix estimation
-//
-void SolTrack::CovCalc(Bool_t Res, Bool_t MS)
-{
-	//
-	//
-	// Input flags:
-	//				Res = .TRUE. turn on resolution effects/Use standard resolutions
-	//					  .FALSE. set all resolutions to 0
-	//				MS  = .TRUE. include Multiple Scattering
-	//
-	// Assumptions:
-	// 1. Measurement layers can do one or two measurements
-	// 2. On disks at constant z:
-	//		- Upper side measurement is phi
-	//		- Lower side measurement is R
-	//
-	// Fill list of layers hit
-	//
-	Int_t ntry = 0;
-	Int_t ntrymax = 0;
-	Int_t Nhit = nHit();				// Total number of layers hit
-	Double_t *zhh = new Double_t[Nhit];		// z of hit
-	Double_t *rhh = new Double_t[Nhit];		// r of hit
-	Double_t *dhh = new Double_t[Nhit];		// distance of hit from origin
-	Int_t    *ihh = new Int_t[Nhit];		// true index of layer
-	Int_t kmh;					// Number of measurement layers hit
-	//
-	kmh = HitList(ihh, rhh, zhh);			// hit layer list
-	Int_t mTot = 0;					// Total number of measurements
-	for (Int_t i = 0; i < Nhit; i++)
-	{
-		Double_t rr = rhh[i];
-		dhh[i] = TMath::ASin(C() * TMath::Sqrt((rr * rr - D() * D()) / (1. + 2 * C() * D()))) / C();	// Arc length traveled
-		if (fG->isMeasure(ihh[i])) mTot += fG->lND(ihh[i]);	// Count number of measurements
-	}
-	//
-	// Order hit list by increasing arc length
-	//
-	Int_t    *hord = new Int_t[Nhit];		// hit order by increasing distance from origin
-	TMath::Sort(Nhit, dhh, hord, kFALSE);		// Order by increasing distance from origin
-	Double_t *zh = new Double_t[Nhit];		// d-ordered z of hit
-	Double_t *rh = new Double_t[Nhit];		// d-ordered r of hit
-	Int_t    *ih = new Int_t[Nhit];			// d-ordered true index of layer
-	for (Int_t i = 0; i < Nhit; i++)
-	{
-		Int_t il = hord[i];					// Hit layer numbering
-		zh[i] = zhh[il];
-		rh[i] = rhh[il];
-		ih[i] = ihh[il];
-	}
-	//
-	// Store interdistances and multiple scattering angles
-	//
-	Double_t sn2t = 1.0 / (1.0 + ct()*ct());			//sin^2 theta of track
-	Double_t cs2t = 1.0 - sn2t;						//cos^2 theta
-	Double_t snt = TMath::Sqrt(sn2t);				// sin theta
-	Double_t cst = TMath::Sqrt(cs2t);				// cos theta
-	Double_t px0 = pt() * TMath::Cos(phi0());		// Momentum at minimum approach
-	Double_t py0 = pt() * TMath::Sin(phi0());
-	Double_t pz0 = pt() * ct();
-	//
-	TMatrixDSym dik(Nhit);	dik.Zero();		// Distances between layers
-	Double_t *thms = new Double_t[Nhit];		// Scattering angles/plane
-	Double_t* cs = new Double_t[Nhit];		// Cosine of angle with normal in transverse plane
-	//
-	for (Int_t ii = 0; ii < Nhit; ii++)		// Hit layer loop
-	{
-		Int_t i = ih[ii];					// Get true layer number
-		Int_t il = hord[ii];					// Unordered layer
-		Double_t B = C()*TMath::Sqrt((rh[ii] * rh[ii] - D()*D()) / (1 + 2 * C()*D()));
-		//
-		Double_t pxi = px0*(1-2*B*B)-2*py0*B*TMath::Sqrt(1-B*B);		// Momentum at scattering layer
-		Double_t pyi = py0*(1-2*B*B)+2*px0*B*TMath::Sqrt(1-B*B);
-		Double_t pzi = pz0;
-		Double_t ArgRp = (rh[ii]*C() + (1 + C() * D())*D() / rh[ii]) / (1 + 2 * C()*D());
-		//
-		Double_t phi = phi0() + TMath::ASin(ArgRp);
-		Double_t nx = TMath::Cos(phi);		// Barrel layer normal
-		Double_t ny = TMath::Sin(phi);
-		Double_t nz = 0.0;
-		cs[ii] = TMath::Abs((pxi * nx + pyi * ny) / pt());
-		//
-		if (fG->lTyp(i) == 2)			// this is Z layer
-		{
-			nx = 0.0;
-			ny = 0.0;
-			nz = 1.0;
-		}
-		Double_t corr = TMath::Abs(pxi*nx + pyi * ny + pzi * nz) / p();
-		Double_t Rlf = fG->lTh(i) / (corr*fG->lX0(i));					// Rad. length fraction
-		thms[ii] = 0.0136*TMath::Sqrt(Rlf)*(1.0 + 0.038*TMath::Log(Rlf)) / p();		// MS angle
-		if (!MS)thms[ii] = 0;
-		//
-		for (Int_t kk = 0; kk < ii; kk++)	// Fill distances between layers
-		{
-			Int_t kl = hord[kk];		// Unordered layer
-			dik(ii, kk) = TMath::Abs(dhh[il] - dhh[kl])/snt;
-			dik(kk, ii) = dik(ii, kk);
-		}
-	}
-	//
-	// Fill measurement covariance
-	//
-	TVectorD tPar(5,fpar);
-	//
-	TMatrixDSym Sm(mTot); Sm.Zero();	// Measurement covariance
-	TMatrixD Rm(mTot, 5);			// Derivative matrix
-	Int_t im = 0;						// Initialize number of measurement counter
-	//
-	// Fill derivatives and error matrix with MS
-	//
-	for (Int_t ii = 0; ii < Nhit; ii++)
-	{
-		Int_t i = ih[ii];				// True layer number
-		Int_t ityp  = fG->lTyp(i);			// Layer type Barrel or Z
-		Int_t nmeai = fG->lND(i);			// # measurements in layer
-
-		if (fG->isMeasure(i))
-		{
-			Double_t Ri = rh[ii];
-			Double_t zi = zh[ii];
-			//
-			for (Int_t nmi = 0; nmi < nmeai; nmi++)
-			{
-				Double_t stri = 0;						// Stereo angle
-				Double_t sig = 0;						// Layer resolution
-				// Constant R derivatives
-				TVectorD dRphi(5); dRphi.Zero();		// R-phi derivatives @ const. R
-				TVectorD dRz(5); dRz.Zero();			// z     derivatives @ const. R
-				//
-				if (nmi + 1 == 1)		// Upper layer measurements
-				{
-					stri = fG->lStU(i);	// Stereo angle
-					Double_t csa = TMath::Cos(stri);
-					Double_t ssa = TMath::Sin(stri);
-					//
-					sig = fG->lSgU(i);	// Resolution
-					if (ityp == 1)		// Barrel type layer (Measure R-phi, stereo or z at const. R)
-					{
-						//
-						// Exact solution
-						dRphi = derRphi_R(tPar, Ri);
-						dRz   = derZ_R   (tPar, Ri);
-						//
-						Rm(im, 0) = csa * dRphi(0) - ssa * dRz(0);	// D derivative
-						Rm(im, 1) = csa * dRphi(1) - ssa * dRz(1);	// phi0 derivative
-						Rm(im, 2) = csa * dRphi(2) - ssa * dRz(2);	// C derivative
-						Rm(im, 3) = csa * dRphi(3) - ssa * dRz(3);	// z0 derivative
-						Rm(im, 4) = csa * dRphi(4) - ssa * dRz(4);	// cot(theta) derivative
-					}
-					if (ityp == 2)		// Z type layer (Measure R-phi at const. Z)
-					{
-						TVectorD dRphz(5); dRphz.Zero();		// R-phi derivatives @ const. z
-						dRphz = derRphi_Z(tPar, zi);
-						//
-						Rm(im, 0) = dRphz(0);					// D derivative
-						Rm(im, 1) = dRphz(1);					// phi0 derivative
-						Rm(im, 2) = dRphz(2);					// C derivative
-						Rm(im, 3) = dRphz(3);					// z0 derivative
-						Rm(im, 4) = dRphz(4);					// cot(theta) derivative
-					}
-				}
-				if (nmi + 1 == 2)			// Lower layer measurements
-				{
-					stri = fG->lStL(i);		// Stereo angle
-					Double_t csa = TMath::Cos(stri);
-					Double_t ssa = TMath::Sin(stri);
-					sig = fG->lSgL(i);		// Resolution
-					if (ityp == 1)			// Barrel type layer (measure R-phi, stereo or z at const. R)
-					{
-						//
-						// Exact solution
-						dRphi = derRphi_R(tPar, Ri);
-						dRz   = derZ_R   (tPar, Ri);
-						//
-						Rm(im, 0) = csa * dRphi(0) - ssa * dRz(0);	// D derivative
-						Rm(im, 1) = csa * dRphi(1) - ssa * dRz(1);	// phi0 derivative
-						Rm(im, 2) = csa * dRphi(2) - ssa * dRz(2);	// C derivative
-						Rm(im, 3) = csa * dRphi(3) - ssa * dRz(3);	// z0 derivative
-						Rm(im, 4) = csa * dRphi(4) - ssa * dRz(4);	// cot(theta) derivative
-					}
-					if (ityp == 2)			// Z type layer (Measure R at const. z)
-					{
-						TVectorD dRRz(5); dRRz.Zero();			// R     derivatives @ const. z
-						dRRz = derR_Z(tPar, zi);
-						//
-						Rm(im, 0) = dRRz(0);					// D derivative
-						Rm(im, 1) = dRRz(1);					// phi0 derivative
-						Rm(im, 2) = dRRz(2);					// C derivative
-						Rm(im, 3) = dRRz(3);					// z0 derivative
-						Rm(im, 4) = dRRz(4);					// cot(theta) derivative
-					}
-				}
-				// Derivative calculation completed
-				//
-				// Now calculate measurement error matrix
-				//
-				Int_t km = 0;
-				Double_t CosMin = TMath::Sin(TMath::Pi() / 9.);	// Protect for derivative explosion
-				for (Int_t kk = 0; kk <= ii; kk++)
-				{
-					Int_t k = ih[kk];				// True layer number
-					Int_t ktyp = fG->lTyp(k);			// Layer type Barrel or disk
-					Int_t nmeak = fG->lND(k);			// # measurements in layer
-					if (fG->isMeasure(k))
-					{
-						for (Int_t nmk = 0; nmk < nmeak; nmk++)
-						{
-							Double_t strk = 0;
-							if (nmk + 1 == 1) strk = fG->lStU(k);	// Stereo angle upper
-							if (nmk + 1 == 2) strk = fG->lStL(k);	// Stereo angle lower
-							//if (im == km && Res) Sm(im, km) += sig*sig;	// Detector resolution on diagonal
-							if (im == km && Res) {
-								Double_t sg = sig;
-								if(TMath::Abs(strk) < TMath::Pi()/6. && cs[kk] < CosMin)
-								TMath::Min(1000.*sig,sg = sig/pow(cs[kk],4));
-								Sm(im, km) += sg * sg;	// Detector resolution on diagonal
-							}
-							//
-							// Loop on all layers below for MS contributions
-							for (Int_t jj = 0; jj < kk; jj++)
-							{
-								Double_t di = dik(ii, jj);
-								Double_t dk = dik(kk, jj);
-								Double_t ms = thms[jj];
-								Double_t msk = ms; Double_t msi = ms;
-								if (ityp == 1) msi = ms / snt;			// Barrel
-								else if (ityp == 2) msi = ms / cst;		// Disk
-								if (ktyp == 1) msk = ms / snt;			// Barrel
-								else if (ktyp == 2) msk = ms / cst;		// Disk
-								Double_t ci = TMath::Abs(TMath::Cos(stri)); Double_t si = TMath::Abs(TMath::Sin(stri));
-								Double_t ck = TMath::Abs(TMath::Cos(strk)); Double_t sk = TMath::Abs(TMath::Sin(strk));
-								Sm(im, km) += di*dk*(ci*ck*ms*ms + si*sk*msi*msk);	// Ms contribution
-							}
-							//
-							Sm(km, im) = Sm(im, km);
-							km++;
-						}
-					}
-				}
-				im++; mTot = im;
-			}
-		}
-	}
-	Sm.ResizeTo(mTot, mTot);
-	TMatrixDSym SmTemp = Sm;
-	Rm.ResizeTo(mTot, 5);
-	//
-	//**********************************************************************
-	// Calculate covariance from derivatives and measurement error matrix  *
-	//**********************************************************************
-	//
-	TMatrixDSym DSmInv(mTot); DSmInv.Zero();
-	for (Int_t id = 0; id < mTot; id++) DSmInv(id, id) = 1.0 / TMath::Sqrt(Sm(id, id));
-	TMatrixDSym SmN = Sm.Similarity(DSmInv);	// Normalize diagonal to 1
-	//
-	// Protected matrix inversions
-	//
-	TDecompChol Chl(SmN,1.e-12);
-	TMatrixDSym SmNinv = SmN;
-	if (Chl.Decompose())
-	{
-		Bool_t OK;
-		SmNinv = Chl.Invert(OK);
-	}
-	else
-	{
-		std::cout << "SolTrack::CovCalc: Error matrix not positive definite. Recovering ...." << std::endl;
-		//cout << "pt = " << pt() << endl;
-		if (ntry < ntrymax)
-		{
-			SmNinv.Print();
-			ntry++;
-		}
-		//
-		TMatrixDSym rSmN = MakePosDef(SmN); SmN = rSmN;
-		TDecompChol rChl(SmN);
-		SmNinv = SmN;
-		Bool_t OK = rChl.Decompose();
-		SmNinv    = rChl.Invert(OK);
-	}
-	Sm = SmNinv.Similarity(DSmInv);			// Error matrix inverted
-	TMatrixDSym H = Sm.SimilarityT(Rm);		// Calculate half Hessian
-	const Int_t Npar = 5;
-	TMatrixDSym DHinv(Npar); DHinv.Zero();
-	for (Int_t i = 0; i < Npar; i++)DHinv(i, i) = 1.0 / TMath::Sqrt(H(i, i));
-	TMatrixDSym Hnrm = H.Similarity(DHinv);
-	// Invert and restore
-	Hnrm.Invert();
-	fCov = Hnrm.Similarity(DHinv);
-	//
-	// debug
-	//
-	if(TMath::IsNaN(fCov(0,0)))
-	{
-		std::cout<<"SolTrack::CovCalc: NaN found in covariance matrix"<<std::endl;
-	}
-	//
-	// Lots of cleanup to do
-	delete[] zhh;
-	delete[] rhh;
-	delete[] dhh;
-	delete[] ihh;
-	delete[] hord;
-	delete[] zh;
-	delete[] rh;
-	delete[] ih;
-	delete[] cs;
-	delete[] thms;
-}
-//
-// Force positive definitness in normalized matrix
-TMatrixDSym SolTrack::MakePosDef(TMatrixDSym NormMat)
-{
-	//
-	// Input: symmetric matrix with 1's on diagonal
-	// Output: positive definite matrix with 1's on diagonal
-	//
-	// Default return value
-	TMatrixDSym rMatN = NormMat;
-	// Check the diagonal
-	Bool_t Check = kFALSE;
-	Int_t Size = NormMat.GetNcols();
-	for (Int_t i = 0; i < Size; i++)if (TMath::Abs(NormMat(i, i) - 1.0)>1.0E-15)Check = kTRUE;
-	if (Check)
-	{
-		std::cout << "SolTrack::MakePosDef: input matrix doesn ot have 1 on diagonal. Abort." << std::endl;
-		return rMatN;
-	}
-	//
-	// Diagonalize matrix
-	TMatrixDSymEigen Eign(NormMat);
-	TMatrixD U = Eign.GetEigenVectors();
-	TVectorD lambda = Eign.GetEigenValues();
-	//cout << "Eigenvalues:"; lambda.Print();
-	//cout << "Input matrix: "; NormMat.Print();
-	// Reset negative eigenvalues to small positive value
-	TMatrixDSym D(Size); D.Zero(); Double_t eps = 1.0e-13;
-	for (Int_t i = 0; i < Size; i++)
-	{
-		D(i, i) = lambda(i);
-		if (lambda(i) <= 0) D(i, i) = eps;
-	}
-	 //Rebuild matrix
-	TMatrixD Ut(TMatrixD::kTransposed, U);
-	TMatrixD rMat = (U*D)*Ut;				// Now it is positive defite
-	// Restore all ones on diagonal
-	for (Int_t i1 = 0; i1 < Size; i1++)
-	{
-		Double_t rn1 = TMath::Sqrt(rMat(i1, i1));
-		for (Int_t i2 = 0; i2 <= i1; i2++)
-		{
-			Double_t rn2 = TMath::Sqrt(rMat(i2, i2));
-			rMatN(i1, i2) = 0.5*(rMat(i1, i2) + rMat(i2, i1)) / (rn1*rn2);
-			rMatN(i2, i1) = rMatN(i1, i2);
-		}
-	}
-	//cout << "Rebuilt matrix: "; rMatN.Print();
-	return rMatN;
-}
Index: external/TrackCovariance/SolTrack.h
===================================================================
--- external/TrackCovariance/SolTrack.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,84 +1,0 @@
-//
-#ifndef G__SOLTRK_H
-#define G__SOLTRK_H
-//
-#include <TMath.h>
-#include <TVector3.h>
-#include <TMatrixDSym.h>
-#include "SolGeom.h"
-#include "TrkUtil.h"
-#include <TGraph.h>
-//
-//
-// Class to store track information
-// Assumes that the geometry has been initialized
-//
-class SolTrack: public TrkUtil
-{
-	// 
-	// Track handling class
-	// Assume tracks originate from (0,0) for the time being
-	//
-private:
-	Int_t fNl;	// Actual number of layers
-	SolGeom *fG;	// Geometry
-	Double_t fp[3];	// px, py, pz momentum 
-	Double_t fx[3];	//  x,  y,  z track origin 
-	Double_t fpar[5];	// D, phi0, C, z0, cot(theta)
-	//
-	TMatrixDSym fCov;		// Full covariance matrix
-	//
-	//
-public:
-	//
-	// Constructors
-	SolTrack(Double_t *x, Double_t *p, SolGeom *G);
-	SolTrack(TVector3 x, TVector3 p, SolGeom* G);
-	SolTrack(Double_t D, Double_t phi0, Double_t C, Double_t z0, Double_t ct, SolGeom *G);
-	// Destructor
-	~SolTrack();
-	// Accessors
-	// Position (at minimum approach)
-	Double_t x() { return fx[0]; }
-	Double_t y() { return fx[1]; }
-	Double_t z() { return fx[2]; }
-	// Momentum  (at minimum approach)
-	Double_t px() { return fp[0]; }
-	Double_t py() { return fp[1]; }
-	Double_t pz() { return fp[2]; }
-	Double_t pt() { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1]); }
-	Double_t p()  { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1] + fp[2] * fp[2]); }
-	// Track parameters
-	Double_t D()    { return fpar[0]; }
-	Double_t phi0() { return fpar[1]; }
-	Double_t C()    { return fpar[2]; }
-	Double_t z0()   { return fpar[3]; }
-	Double_t ct()   { return fpar[4]; }
-	// Covariance
-	TMatrixDSym Cov()		{ return fCov; }
-	// Track parameter covariance calculation
-	void CovCalc(Bool_t Res, Bool_t MS);
-	// Parameter errors
-	Double_t s_D()    { return TMath::Sqrt(fCov(0, 0)); }
-	Double_t s_phi0() { return TMath::Sqrt(fCov(1, 1)); }
-	Double_t s_C()    { return TMath::Sqrt(fCov(2, 2)); }
-	Double_t s_pt()   { return 2 * s_C()*pt() / (0.2998*fG->B()); }	// Dpt/pt
-	Double_t s_z0()   { return TMath::Sqrt(fCov(3, 3)); }
-	Double_t s_ct()   { return TMath::Sqrt(fCov(4, 4)); }
-	//
-	// Track hit management
-	Int_t nHit();
-	Int_t nmHit();
-	Bool_t HitLayer(Int_t Layer, Double_t &R, Double_t &phi, Double_t &zz);
-	Int_t HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh);
-	Int_t HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh);
-	Int_t FirstHit(Double_t &Xfirst, Double_t &Yfirst, Double_t &Zfirst);	// First hit position
-	//
-	// Track graph
-	TGraph *TrkPlot();	// Graph with R-z plot of track trajectory
-	//
-	// Make normalized matrix positive definite
-	TMatrixDSym MakePosDef(TMatrixDSym NormMat);
-};
-//
-#endif
Index: external/TrackCovariance/TrkUtil.cc
===================================================================
--- external/TrackCovariance/TrkUtil.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,885 +1,0 @@
-#include "TrkUtil.h"
-#include <iostream>
-#include <algorithm>
-#include <TSpline.h>
-#include <TDecompChol.h>
-
-// Constructor
-TrkUtil::TrkUtil(Double_t Bz)
-{
-	fBz = Bz;
-	fGasSel = 0;				// Default is He-Isobuthane (90-10)
-	fRmin = 0.0;				// Lower		DCH radius
-	fRmax = 0.0;				// Higher	DCH radius
-	fZmin = 0.0;				// Lower		DCH z
-	fZmax = 0.0;				// Higher	DCH z
-}
-TrkUtil::TrkUtil()
-{
-	fBz = 0.0;
-	fGasSel = 0;				// Default is He-Isobuthane (90-10)
-	fRmin = 0.0;				// Lower		DCH radius
-	fRmax = 0.0;				// Higher	DCH radius
-	fZmin = 0.0;				// Lower		DCH z
-	fZmax = 0.0;				// Higher	DCH z
-}
-//
-// Destructor
-TrkUtil::~TrkUtil()
-{
-	fBz = 0.0;
-	fGasSel = 0;				// Default is He-Isobuthane (90-10)
-	fRmin = 0.0;				// Lower		DCH radius
-	fRmax = 0.0;				// Higher	DCH radius
-	fZmin = 0.0;				// Lower		DCH z
-	fZmax = 0.0;				// Higher	DCH z
-}
-//
-// Distance between two lines
-//
-void TrkUtil::LineDistance(TVector3 x0, TVector3 y0, TVector3 dirx, TVector3 diry, Double_t &sx, Double_t &sy, Double_t &distance)
-{
-	TMatrixDSym M(2);
-	M(0,0) = dirx.Mag2();
-	M(1,1) = diry.Mag2();
-	M(0,1) = -dirx.Dot(diry);
-	M(1,0) = M(0,1);
-	M.Invert();
-	TVectorD c(2);
-	c(0) = dirx.Dot(y0-x0);
-	c(1) = diry.Dot(x0-y0);
-	TVectorD st = M*c;
-	//
-	// Fill output
-	sx = st(0);
-	sy = st(1);
-	//
-	TVector3 x = x0+sx*dirx;
-	TVector3 y = y0+sy*diry;
-	TVector3 d = x-y;
-	distance = d.Mag();
-}
-//
-// Covariance smearing
-//
-TVectorD TrkUtil::CovSmear(TVectorD x, TMatrixDSym C)
-{
-	//
-	// Check arrays
-	//
-	// Consistency of dimensions
-	Int_t Nvec = x.GetNrows();
-	Int_t Nmat = C.GetNrows();
-	if (Nvec != Nmat || Nvec == 0)
-	{
-		std::cout << "TrkUtil::CovSmear: vector/matrix mismatch. Aborting." << std::endl;
-		exit(EXIT_FAILURE);
-	}
-	// Positive diagonal elements
-	for (Int_t i = 0; i < Nvec; i++)
-	{
-		if (C(i, i) <= 0.0)
-		{
-			std::cout << "TrkUtil::CovSmear: covariance matrix has negative diagonal elements. Aborting." << std::endl;
-			exit(EXIT_FAILURE);
-		}
-	}
-	//
-	// Do a Choleski decomposition and random number extraction, with appropriate stabilization
-	//
-	TMatrixDSym CvN = C;
-	TMatrixDSym DCv(Nvec); DCv.Zero();
-	TMatrixDSym DCvInv(Nvec); DCvInv.Zero();
-	for (Int_t id = 0; id < Nvec; id++)
-	{
-		Double_t dVal = TMath::Sqrt(C(id, id));
-		DCv(id, id) = dVal;
-		DCvInv(id, id) = 1.0 / dVal;
-	}
-	CvN.Similarity(DCvInv);			// Normalize diagonal to 1
-	TDecompChol Chl(CvN);
-	Bool_t OK = Chl.Decompose();		// Choleski decomposition of normalized matrix
-	if (!OK)
-	{
-		std::cout << "TrkUtil::CovSmear: covariance matrix is not positive definite. Aborting." << std::endl;
-		exit(EXIT_FAILURE);
-	}
-	TMatrixD U = Chl.GetU();			// Get Upper triangular matrix
-	TMatrixD Ut(TMatrixD::kTransposed, U); // Transposed of U (lower triangular)
-	TVectorD r(Nvec);
-	for (Int_t i = 0; i < Nvec; i++)r(i) = gRandom->Gaus(0.0, 1.0);		// Array of normal random numbers
-	TVectorD xOut = x + DCv * (Ut * r);	// Observed parameter vector
-	//
-	return xOut;
-}
-//
-// Helix parameters from position and momentum
-// static
-TVectorD TrkUtil::XPtoPar(TVector3 x, TVector3 p, Double_t Q, Double_t Bz)
-{
-	//
-	TVectorD Par(5);
-	// Transverse parameters
-	Double_t a = -Q * Bz * cSpeed();			// Units are Tesla, GeV and meters
-	Double_t pt = p.Pt();
-	Double_t C = a / (2 * pt);			// Half curvature
-	//std::cout << "ObsTrk::XPtoPar: fB = " << fB << ", a = " << a << ", pt = " << pt << ", C = " << C << std::endl;
-	Double_t r2 = x(0) * x(0) + x(1) * x(1);
-	Double_t cross = x(0) * p(1) - x(1) * p(0);
-	Double_t T = TMath::Sqrt(pt * pt - 2 * a * cross + a * a * r2);
-	Double_t phi0 = TMath::ATan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T);	// Phi0
-	Double_t D;							// Impact parameter D
-	if (pt < 10.0) D = (T - pt) / a;
-	else D = (-2 * cross + a * r2) / (T + pt);
-	//
-	Par(0) = D;		// Store D
-	Par(1) = phi0;	// Store phi0
-	Par(2) = C;		// Store C
-	//Longitudinal parameters
-	Double_t B = C * TMath::Sqrt(TMath::Max(r2 - D * D, 0.0) / (1 + 2 * C * D));
-	Double_t st = TMath::ASin(B) / C;
-	Double_t ct = p(2) / pt;
-	Double_t z0;
-	Double_t dot = x(0) * p(0) + x(1) * p(1);
-	if (dot > 0.0) z0 = x(2) - ct * st;
-	else z0 = x(2) + ct * st;
-	//
-	Par(3) = z0;		// Store z0
-	Par(4) = ct;		// Store cot(theta)
-	//
-	return Par;
-}
-// non-static
-TVectorD TrkUtil::XPtoPar(TVector3 x, TVector3 p, Double_t Q)
-{
-	//
-	TVectorD Par(5);
-	Double_t Bz = fBz;
-	Par = XPtoPar(x, p, Q, Bz);
-	//
-	return Par;
-}
-//
-TVector3 TrkUtil::ParToX(TVectorD Par)
-{
-	Double_t D = Par(0);
-	Double_t phi0 = Par(1);
-	Double_t z0 = Par(3);
-	//
-	TVector3 Xval;
-	Xval(0) = -D * sin(phi0);
-	Xval(1) = D * cos(phi0);
-	Xval(2) = z0;
-	//
-	return Xval;
-}
-//
-TVector3 TrkUtil::ParToP(TVectorD Par)
-{
-	if (fBz == 0.0)std::cout << "TrkUtil::ParToP: Warning Bz not set" << std::endl;
-	//
-	return ParToP(Par, fBz);
-}
-//
-TVector3 TrkUtil::ParToP(TVectorD Par, Double_t Bz)
-{
-	Double_t C = Par(2);
-	Double_t phi0 = Par(1);
-	Double_t ct = Par(4);
-	//
-	TVector3 Pval;
-	Double_t pt = Bz * cSpeed() / TMath::Abs(2 * C);
-	Pval(0) = pt * cos(phi0);
-	Pval(1) = pt * sin(phi0);
-	Pval(2) = pt * ct;
-	//
-	return Pval;
-}
-//
-Double_t TrkUtil::ParToQ(TVectorD Par)
-{
-	return TMath::Sign(1.0, -Par(2));
-}
-
-//
-// Parameter conversion to ACTS format
-TVectorD TrkUtil::ParToACTS(TVectorD Par)
-{
-	TVectorD pACTS(6);	// Return vector
-	//
-	Double_t b = -cSpeed() * fBz / 2.;
-	pACTS(0) = 1000 * Par(0);		// D from m to mm
-	pACTS(1) = 1000 * Par(3);	// z0 from m to mm
-	pACTS(2) = Par(1);			// Phi0 is unchanged
-	pACTS(3) = atan2(1.0, Par(4));		// Theta in [0, pi] range
-	pACTS(4) = Par(2) / (b * sqrt(1 + Par(4) * Par(4)));		// q/p in GeV
-	pACTS(5) = 0.0;				// Time: currently undefined
-	//
-	return pACTS;
-}
-// Covariance conversion to ACTS format
-TMatrixDSym TrkUtil::CovToACTS(TVectorD Par, TMatrixDSym Cov)
-{
-	TMatrixDSym cACTS(6); cACTS.Zero();
-	Double_t b = -cSpeed() * fBz / 2.;
-	//
-	// Fill derivative matrix
-	TMatrixD A(5, 5);	A.Zero();
-	Double_t ct = Par(4);	// cot(theta)
-	Double_t C = Par(2);		// half curvature
-	A(0, 0) = 1000.;		// D-D	conversion to mm
-	A(1, 2) = 1.0;		// phi0-phi0
-	A(2, 4) = 1.0 / (sqrt(1.0 + ct * ct) * b);	// q/p-C
-	A(3, 1) = 1000.;		// z0-z0 conversion to mm
-	A(4, 3) = -1.0 / (1.0 + ct * ct); // theta - cot(theta)
-	A(4, 4) = -C * ct / (b * pow(1.0 + ct * ct, 3.0 / 2.0)); // q/p-cot(theta)
-	//
-	TMatrixDSym Cv = Cov;
-	TMatrixD At(5, 5);
-	At.Transpose(A);
-	Cv.Similarity(At);
-	TMatrixDSub(cACTS, 0, 4, 0, 4) = Cv;
-	cACTS(5, 5) = 0.1;	// Currently undefined: set to arbitrary value to avoid crashes
-	//
-	return cACTS;
-}
-//
-// Parameter conversion to ILC format
-TVectorD TrkUtil::ParToILC(TVectorD Par)
-{
-	TVectorD pILC(5);	// Return vector
-	//
-	pILC(0) = Par(0) * 1.0e3;			// d0 in mm
-	pILC(1) = Par(1);				// phi0 is unchanged
-	pILC(2) = -2 * Par(2) * 1.0e-3;	// w in mm^-1
-	pILC(3) = Par(3) * 1.0e3;			// z0 in mm
-	pILC(4) = Par(4);				// tan(lambda) = cot(theta)
-	//
-	return pILC;
-}
-// Covariance conversion to ILC format
-TMatrixDSym TrkUtil::CovToILC(TMatrixDSym Cov)
-{
-	TMatrixDSym cILC(5); cILC.Zero();
-	//
-	// Fill derivative matrix
-	TMatrixD A(5, 5);	A.Zero();
-	//
-	A(0, 0) = 1.0e3;		// D-d0 in mm
-	A(1, 1) = 1.0;			// phi0-phi0
-	A(2, 2) = -2.0e-3;		// w-C
-	A(3, 3) = 1.0e3;		// z0-z0 conversion to mm
-	A(4, 4) = 1.0;			// tan(lambda) - cot(theta)
-	//
-	TMatrixDSym Cv = Cov;
-	TMatrixD At(5, 5);
-	At.Transpose(A);
-	Cv.Similarity(At);
-	cILC = Cv;
-	//
-	return cILC;
-}
-//
-// Conversion from meters to mm
-TVectorD TrkUtil::ParToMm(TVectorD Par)				// Parameter conversion
-{
-	TVectorD Pmm(5);					// Return vector
-	//
-	Pmm(0) = Par(0) * 1.0e3;			// d0 in mm
-	Pmm(1) = Par(1);					// phi0 is unchanged
-	Pmm(2) = Par(2) * 1.0e-3;			// C in mm^-1
-	Pmm(3) = Par(3) * 1.0e3;			// z0 in mm
-	Pmm(4) = Par(4);					// tan(lambda) = cot(theta) unchanged
-	//
-	return Pmm;
-}
-TMatrixDSym TrkUtil::CovToMm(TMatrixDSym Cov)		// Covariance conversion
-{
-	TMatrixDSym Cmm(5); Cmm.Zero();
-	//
-	// Fill derivative matrix
-	TMatrixD A(5, 5);	A.Zero();
-	//
-	A(0, 0) = 1.0e3;		// D-d0 in mm
-	A(1, 1) = 1.0;			// phi0-phi0
-	A(2, 2) = 1.0e-3;		// C-C
-	A(3, 3) = 1.0e3;		// z0-z0 conversion to mm
-	A(4, 4) = 1.0;			// lambda - cot(theta)
-	//
-	TMatrixDSym Cv = Cov;
-	TMatrixD At(5, 5);
-	At.Transpose(A);
-	Cv.Similarity(At);
-	Cmm = Cv;
-	//
-	return Cmm;
-}//
-// Regularized symmetric matrix inversion
-//
-TMatrixDSym TrkUtil::RegInv(TMatrixDSym& Min)
-{
-	TMatrixDSym M = Min;				// Decouple from input
-	Int_t N = M.GetNrows();			// Matrix size
-	TMatrixDSym D(N); D.Zero();		// Normaliztion matrix
-	TMatrixDSym R(N);				// Normarized matrix
-	TMatrixDSym Rinv(N);				// Inverse of R
-	TMatrixDSym Minv(N);				// Inverse of M
-	//
-	// Check for 0's and normalize
-	for (Int_t i = 0; i < N; i++)
-	{
-		if (M(i, i) != 0.0) D(i, i) = 1. / TMath::Sqrt(TMath::Abs(M(i, i)));
-		else D(i, i) = 1.0;
-	}
-	R = M.Similarity(D);
-	//
-	// Recursive algorithms stops when N = 2
-	//
-	//****************
-	// case N = 2  ***
-	//****************
-	if (N == 2)
-	{
-		Double_t det = R(0, 0) * R(1, 1) - R(0, 1) * R(1, 0);
-		if (det == 0)
-		{
-			std::cout << "VertexFit::RegInv: null determinant for N = 2" << std::endl;
-			Rinv.Zero();	// Return null matrix
-		}
-		else
-		{
-			// invert matrix 
-			Rinv(0, 0) = R(1, 1);
-			Rinv(0, 1) = -R(0, 1);
-			Rinv(1, 0) = Rinv(0, 1);
-			Rinv(1, 1) = R(0, 0);
-			Rinv *= 1. / det;
-		}
-	}
-	//****************
-	// case N > 2  ***
-	//****************
-	else
-	{
-		// Break up matrix
-		TMatrixDSym Q = R.GetSub(0, N - 2, 0, N - 2);	// Upper left 
-		TVectorD p(N - 1);
-		for (Int_t i = 0; i < N - 1; i++)p(i) = R(N - 1, i);
-		Double_t q = R(N - 1, N - 1);
-		//Invert pieces and re-assemble
-		TMatrixDSym Ainv(N - 1);
-		TMatrixDSym A(N - 1);
-		if (TMath::Abs(q) > 1.0e-15)
-		{
-			// Case |q| > 0
-			Ainv.Rank1Update(p, -1.0 / q);
-			Ainv += Q;
-			A = RegInv(Ainv);		// Recursive call
-			TMatrixDSub(Rinv, 0, N - 2, 0, N - 2) = A;
-			//
-			TVectorD b = (-1.0 / q) * (A * p);
-			for (Int_t i = 0; i < N - 1; i++)
-			{
-				Rinv(N - 1, i) = b(i);
-				Rinv(i, N - 1) = b(i);
-			}
-			//
-			Double_t pdotb = 0.;
-			for (Int_t i = 0; i < N - 1; i++)pdotb += p(i) * b(i);
-			Double_t c = (1.0 - pdotb) / q;
-			Rinv(N - 1, N - 1) = c;
-		}
-		else
-		{
-			// case q = 0
-			TMatrixDSym Qinv = RegInv(Q);		// Recursive call
-			Double_t a = Qinv.Similarity(p);
-			Double_t c = -1.0 / a;
-			Rinv(N - 1, N - 1) = c;
-			//
-			TVectorD b = (1.0 / a) * (Qinv * p);
-			for (Int_t i = 0; i < N - 1; i++)
-			{
-				Rinv(N - 1, i) = b(i);
-				Rinv(i, N - 1) = b(i);
-			}
-			//
-			A.Rank1Update(p, -1 / a);
-			A += Q;
-			A.Similarity(Qinv);
-			TMatrixDSub(Rinv, 0, N - 2, 0, N - 2) = A;
-		}
-	}
-	Minv = Rinv.Similarity(D);
-	return Minv;
-}
-//
-// Track tracjectory
-//
-TVector3 TrkUtil::Xtrack(TVectorD par, Double_t s)
-{
-	//
-	// unpack parameters
-	Double_t D = par(0);
-	Double_t p0 = par(1);
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	Double_t x = -D * TMath::Sin(p0) + (TMath::Sin(s + p0) - TMath::Sin(p0)) / (2 * C);
-	Double_t y =  D * TMath::Cos(p0) - (TMath::Cos(s + p0) - TMath::Cos(p0)) / (2 * C);	
-	Double_t z = z0 + ct * s / (2 * C);
-	//
-	TVector3 Xt(x, y, z);
-	return Xt;
-}
-//
-// Track derivatives
-//
-// Constant radius
-// R-Phi
-TVectorD TrkUtil::derRphi_R(TVectorD par, Double_t R)
-{
-	TVectorD dRphi(5);	// return vector
-	//
-	// unpack parameters
-	Double_t D = par(0);
-	Double_t C = par(2);
-	//
-	Double_t s = 2 * TMath::ASin(C * TMath::Sqrt((R * R - D * D)/(1 + 2 * C * D)));
-	TVector3 X = Xtrack(par, s);		// Intersection point
-	TVector3 v(-X.y()/R, X.x()/R, 0.);	// measurement direction
-	TMatrixD derX = derXdPar(par, s);	// dX/dp
-	TVectorD derXs = derXds(par, s);	// dX/ds
-	TVectorD ders = dsdPar_R(par, R);	// ds/dp	
-	//
-	for (Int_t i = 0; i < 5; i++)
-	{
-		dRphi(i) = 0.;
-		for (Int_t j = 0; j < 3; j++)
-		{
-			dRphi(i) += v(j) * (derX(j, i) + derXs(j) * ders(i));
-		}
-	}
-	//
-	return dRphi;
-}
-// z
-TVectorD TrkUtil::derZ_R(TVectorD par, Double_t R)
-{
-
-	TVectorD dZ(5);	// return vector
-	//
-	// unpack parameters
-	Double_t D = par(0);
-	Double_t C = par(2);
-	//
-	Double_t s = 2 * TMath::ASin(C * TMath::Sqrt((R * R - D * D)/(1 + 2 * C * D))); // phase
-	TVector3 v(0., 0., 1.);				// measurement direction
-	TMatrixD derX = derXdPar(par, s);	// dX/dp
-	TVectorD derXs = derXds(par, s);	// dX/ds
-	TVectorD ders = dsdPar_R(par, R);	// ds/dp	
-	//
-	for (Int_t i = 0; i < 5; i++)
-	{
-		dZ(i) = 0.;
-		for (Int_t j = 0; j < 3; j++)
-		{
-			dZ(i) += v(j) * (derX(j, i) + derXs(j) * ders(i));
-		}
-	}
-	//
-	return dZ;
-}
-//
-// constant z
-// R-Phi
-TVectorD TrkUtil::derRphi_Z(TVectorD par, Double_t z)
-{
-	TVectorD dRphi(5);	// return vector
-	//
-	// unpack parameters
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	Double_t s = 2 * C * (z - z0) / ct;
-	TVector3 X = Xtrack(par, s);			// Intersection point
-	TVector3 v(-X.y() / X.Pt(), X.x() / X.Pt(), 0.);	// measurement direction
-	TMatrixD derX = derXdPar(par, s);		// dX/dp
-	TVectorD derXs = derXds(par, s);		// dX/ds
-	TVectorD ders = dsdPar_z(par, z);		// ds/dp	
-	//
-	for (Int_t i = 0; i < 5; i++)
-	{
-		dRphi(i) = 0.;
-		for (Int_t j = 0; j < 3; j++)
-		{
-			dRphi(i) += v(j) * (derX(j, i) + derXs(j) * ders(i));
-		}
-	}
-	//
-	return dRphi;
-
-}
-// R
-TVectorD TrkUtil::derR_Z(TVectorD par, Double_t z)
-{
-	TVectorD dR(5);	// return vector
-	//
-	// unpack parameters
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	Double_t s = 2 * C * (z - z0) / ct;
-	TVector3 X = Xtrack(par, s);			// Intersection point
-	TVector3 v(X.x() / X.Pt(), X.y() / X.Pt(), 0.);	// measurement direction
-	TMatrixD derX = derXdPar(par, s);		// dX/dp
-	TVectorD derXs = derXds(par, s);		// dX/ds
-	TVectorD ders = dsdPar_z(par, z);	// ds/dp	
-	//
-	for (Int_t i = 0; i < 5; i++)
-	{
-		dR(i) = 0.;
-		for (Int_t j = 0; j < 3; j++)
-		{
-			dR(i) += v(j) * (derX(j, i) + derXs(j) * ders(i));
-		}
-	}
-	//
-	return dR;
-
-}
-//
-// derivatives of track trajectory
-//
-// dX/dPar
-TMatrixD TrkUtil::derXdPar(TVectorD par, Double_t s)
-{
-	TMatrixD dxdp(3, 5);	// return matrix
-	//
-	// unpack parameters
-	Double_t D = par(0);
-	Double_t p0 = par(1);
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	// derivatives
-	// dx/dD
-	dxdp(0, 0) = -TMath::Sin(p0);
-	dxdp(1, 0) =  TMath::Cos(p0);
-	dxdp(2, 0) = 0.;
-	// dx/dphi0
-	dxdp(0, 1) = -D * TMath::Cos(p0) + (TMath::Cos(s + p0) - TMath::Cos(p0)) / (2 * C);
-	dxdp(1, 1) = -D * TMath::Sin(p0) + (TMath::Sin(s + p0) - TMath::Sin(p0)) / (2 * C);
-	dxdp(2, 1) = 0;
-	// dx/dC
-	dxdp(0, 2) = -(TMath::Sin(s + p0) - TMath::Sin(p0)) / (2 * C * C);
-	dxdp(1, 2) =  (TMath::Cos(s + p0) - TMath::Cos(p0)) / (2 * C * C);
-	dxdp(2, 2) = -ct * s / (2 * C * C);
-	// dx/dz0
-	dxdp(0, 3) = 0;
-	dxdp(1, 3) = 0;
-	dxdp(2, 3) = 1.;
-	// dx/dCtg
-	dxdp(0, 4) = 0;
-	dxdp(1, 4) = 0;
-	dxdp(2, 4) = s / (2 * C);
-	//
-	return dxdp;
-}
-//
-// dX/ds
-//
-TVectorD TrkUtil::derXds(TVectorD par, Double_t s)
-{
-	TVectorD dxds(3);	// return vector
-	//
-	// unpack parameters
-	Double_t p0 = par(1);
-	Double_t C = par(2);
-	Double_t ct = par(4);
-	//
-	// dX/ds
-	dxds(0) = TMath::Cos(s + p0) / (2 * C);
-	dxds(1) = TMath::Sin(s + p0) / (2 * C);
-	dxds(2) = ct / (2 * C);
-	//
-	return dxds;
-}
-//
-// derivative of trajectory phase s
-//Constant R
-TVectorD TrkUtil::dsdPar_R(TVectorD par, Double_t R)
-{
-	TVectorD dsdp(5);	// return vector
-	//
-	// unpack parameters
-	Double_t D = par(0);
-	Double_t p0 = par(1);
-	Double_t C = par(2);
-	//
-	// derivatives
-	Double_t opCD = 1. + 2 * C * D;
-	Double_t A = C*TMath::Sqrt((R*R-D*D)/opCD);
-	Double_t sqA0 = TMath::Sqrt(1. - A * A);
-	Double_t dMin = 0.01;
-	Double_t sqA = TMath::Max(dMin, sqA0);	// Protect against divergence
-	//
-	dsdp(0) = -2 * C * C * (D * (1. + C * D) + C * R * R) / (A * sqA * opCD * opCD);
-	dsdp(1) = 0;
-	dsdp(2) = 2 * A * (1 + C * D) / (C * sqA * opCD);
-	dsdp(3) = 0;
-	dsdp(4) = 0;
-	//
-	return dsdp;
-}
-// Constant z
-TVectorD TrkUtil::dsdPar_z(TVectorD par, Double_t z)
-{
-	TVectorD dsdp(5);	// return vector
-	//
-	// unpack parameters
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	// derivatives
-	//
-	dsdp(0) = 0;
-	dsdp(1) = 0;
-	dsdp(2) = 2*(z-z0)/ct;
-	dsdp(3) = -2*C/ct;
-	dsdp(4) = -2*C*(z-z0)/(ct*ct);
-	//
-	return dsdp;
-}
-//
-// Setup chamber volume
-void TrkUtil::SetDchBoundaries(Double_t Rmin, Double_t Rmax, Double_t Zmin, Double_t Zmax)
-{
-	fRmin = Rmin;				// Lower		DCH radius
-	fRmax = Rmax;				// Higher	DCH radius
-	fZmin = Zmin;				// Lower		DCH z
-	fZmax = Zmax;				// Higher	DCH z
-}
-//
-// Get Trakck length inside DCH volume
-Double_t TrkUtil::TrkLen(TVectorD Par)
-{
-	Double_t tLength = 0.0;
-	// Check if geometry is initialized
-	if (fZmin == 0.0 && fZmax == 0.0)
-	{
-		// No geometry set so send a warning and return 0
-		std::cout << "TrkUtil::TrkLen() called without a DCH volume defined" << std::endl;
-	}
-	else
-	{
-		//******************************************************************
-		// Determine the track length inside the chamber   ****
-		//******************************************************************
-		//
-		// Track pararameters
-		Double_t D = Par(0);		// Transverse impact parameter
-		Double_t phi0 = Par(1);		// Transverse direction at minimum approach
-		Double_t C = Par(2);		// Half curvature
-		Double_t z0 = Par(3);		// Z at minimum approach
-		Double_t ct = Par(4);		// cot(theta)
-		//std::cout << "TrkUtil:: parameters: D= " << D << ", phi0= " << phi0
-		//	<< ", C= " << C << ", z0= " << z0 << ", ct= " << ct << std::endl;
-		//
-		// Track length per unit phase change 
-		Double_t Scale = sqrt(1.0 + ct * ct) / (2.0 * TMath::Abs(C));
-		//
-		// Find intersections with chamber boundaries
-		//
-		Double_t phRin = 0.0;			// phase of inner cylinder 
-		Double_t phRin2 = 0.0;			// phase of inner cylinder intersection (2nd branch)
-		Double_t phRhi = 0.0;			// phase of outer cylinder intersection
-		Double_t phZmn = 0.0;			// phase of left wall intersection
-		Double_t phZmx = 0.0;			// phase of right wall intersection
-		//  ... with inner cylinder
-		Double_t Rtop = TMath::Abs((1.0 + C * D) / C);
-
-		if (Rtop > fRmin && TMath::Abs(D) < fRmin) // *** don't treat large D tracks for the moment ***
-		{
-			Double_t ph = 2 * asin(C * sqrt((fRmin * fRmin - D * D) / (1.0 + 2.0 * C * D)));
-			Double_t z = z0 + ct * ph / (2.0 * C);
-
-			//std::cout << "Rin intersection: ph = " << ph<<", z= "<<z << std::endl;
-
-			if (z < fZmax && z > fZmin)	phRin = TMath::Abs(ph);	// Intersection inside chamber volume	
-			//
-			// Include second branch of loopers
-			Double_t Pi = 3.14159265358979323846;
-			Double_t ph2 = 2 * Pi - TMath::Abs(ph);
-			if (ph < 0)ph2 = -ph2;
-			z = z0 + ct * ph2 / (2.0 * C);
-			if (z < fZmax && z > fZmin)	phRin2 = TMath::Abs(ph2);	// Intersection inside chamber volume
-		}
-		//  ... with outer cylinder
-		if (Rtop > fRmax && TMath::Abs(D) < fRmax) // *** don't treat large D tracks for the moment ***
-		{
-			Double_t ph = 2 * asin(C * sqrt((fRmax * fRmax - D * D) / (1.0 + 2.0 * C * D)));
-			Double_t z = z0 + ct * ph / (2.0 * C);
-			if (z < fZmax && z > fZmin)	phRhi = TMath::Abs(ph);	// Intersection inside chamber volume	
-		}
-		//  ... with left wall
-		Double_t Zdir = (fZmin - z0) / ct;
-		if (Zdir > 0.0)
-		{
-			Double_t ph = 2.0 * C * Zdir;
-			Double_t Rint = sqrt(D * D + (1.0 + 2.0 * C * D) * pow(sin(ph / 2), 2) / (C * C));
-			if (Rint < fRmax && Rint > fRmin)	phZmn = TMath::Abs(ph);	// Intersection inside chamber volume	
-		}
-		//  ... with right wall
-		Zdir = (fZmax - z0) / ct;
-		if (Zdir > 0.0)
-		{
-			Double_t ph = 2.0 * C * Zdir;
-			Double_t Rint = sqrt(D * D + (1.0 + 2.0 * C * D) * pow(sin(ph / 2), 2) / (C * C));
-			if (Rint < fRmax && Rint > fRmin)	phZmx = TMath::Abs(ph);	// Intersection inside chamber volume	
-		}
-		//
-		// Order phases and keep the lowest two non-zero ones
-		//
-		const Int_t Nint = 5;
-		Double_t dPhase = 0.0;	// Phase difference between two close intersections
-		Double_t ph_arr[Nint] = { phRin, phRin2, phRhi, phZmn, phZmx };
-		std::sort(ph_arr, ph_arr + Nint);
-		Int_t iPos = -1;		// First element > 0
-		for (Int_t i = 0; i < Nint; i++)
-		{
-			if (ph_arr[i] <= 0.0) iPos = i;
-		}
-
-		if (iPos < Nint - 2)
-		{
-			dPhase = ph_arr[iPos + 2] - ph_arr[iPos + 1];
-			tLength = dPhase * Scale;
-		}
-	}
-	return tLength;
-}
-//
-// Return number of ionization clusters
-Bool_t TrkUtil::IonClusters(Double_t& Ncl, Double_t mass, TVectorD Par)
-{
-	//
-	// Units are meters/Tesla/GeV
-	//
-	Ncl = 0.0;
-	Bool_t Signal = kFALSE;
-	Double_t tLen = 0;
-	// Check if geometry is initialized
-	if (fZmin == 0.0 && fZmax == 0.0)
-	{
-		// No geometry set so send a warning and return 0
-		std::cout << "TrkUtil::IonClusters() called without a volume defined" << std::endl;
-	}
-	else tLen = TrkLen(Par);
-
-	//******************************************************************
-	// Now get the number of clusters                       ****
-	//******************************************************************
-	//
-	Double_t muClu = 0.0;	// mean number of clusters
-	Double_t bg = 0.0;		// beta*gamma
-	Ncl = 0.0;
-	if (tLen > 0.0)
-	{
-		Signal = kTRUE;
-		//
-		// Find beta*gamma
-		if (fBz == 0.0)
-		{
-			Signal = kFALSE;
-			std::cout << "TrkUtil::IonClusters: Please set Bz!!!" << std::endl;
-		}
-		else
-		{
-			TVector3 p = ParToP(Par);
-			bg = p.Mag() / mass;
-			muClu = Nclusters(bg) * tLen;				// Avg. number of clusters
-
-			Ncl = gRandom->PoissonD(muClu);			// Actual number of clusters
-		}
-
-	}
-	//
-	return Signal;
-}
-//
-//
-Double_t TrkUtil::Nclusters(Double_t begam)
-{
-	Int_t Opt = fGasSel;
-	Double_t Nclu = Nclusters(begam, Opt);
-	//
-	return Nclu;
-}
-//
-Double_t TrkUtil::Nclusters(Double_t begam, Int_t Opt) {
-	//
-	// Opt = 0: He 90 - Isobutane 10
-	//     = 1: pure He
-	//     = 2: Argon 50 - Ethane 50
-	//     = 3: pure Argon
-	//
-	//
-	const Int_t Npt = 18;
-	Double_t bg[Npt] = { 0.5, 0.8, 1., 2., 3., 4., 5., 8., 10.,
-	12., 15., 20., 50., 100., 200., 500., 1000., 10000. };
-	//
-	// He 90 - Isobutane 10
-	Double_t ncl_He_Iso[Npt] = { 42.94, 23.6,18.97,12.98,12.2,12.13,
-	12.24,12.73,13.03,13.29,13.63,14.08,15.56,16.43,16.8,16.95,16.98, 16.98 };
-	//
-	// pure He
-	Double_t ncl_He[Npt] = { 11.79,6.5,5.23,3.59,3.38,3.37,3.4,3.54,3.63,
-				3.7,3.8,3.92,4.33,4.61,4.78,4.87,4.89, 4.89 };
-	//
-	// Argon 50 - Ethane 50
-	Double_t ncl_Ar_Eth[Npt] = { 130.04,71.55,57.56,39.44,37.08,36.9,
-	37.25,38.76,39.68,40.49,41.53,42.91,46.8,48.09,48.59,48.85,48.93,48.93 };
-	//
-	// pure Argon
-	Double_t ncl_Ar[Npt] = { 88.69,48.93,39.41,27.09,25.51,25.43,25.69,
-	26.78,27.44,28.02,28.77,29.78,32.67,33.75,34.24,34.57,34.68, 34.68 };
-	//
-	Double_t ncl[Npt];
-	switch (Opt)
-	{
-	case 0: std::copy(ncl_He_Iso, ncl_He_Iso + Npt, ncl);	// He-Isobutane
-		break;
-	case 1: std::copy(ncl_He, ncl_He + Npt, ncl);		// pure He
-		break;
-	case 2: std::copy(ncl_Ar_Eth, ncl_Ar_Eth + Npt, ncl);	// Argon - Ethane
-		break;
-	case 3: std::copy(ncl_Ar, ncl_Ar + Npt, ncl);		// pure Argon
-		break;
-	}
-	//
-	Double_t interp = 0.0;
-	TSpline3* sp3 = new TSpline3("sp3", bg, ncl, Npt);
-	if (begam > bg[0] && begam < bg[Npt - 1]) interp = sp3->Eval(begam);
-	return 100 * interp;
-}
-//
-Double_t TrkUtil::funcNcl(Double_t* xp, Double_t* par) {
-	Double_t bg = xp[0];
-	return Nclusters(bg);
-}
-//
-void TrkUtil::SetGasMix(Int_t Opt)
-{
-	if (Opt < 0 || Opt > 3)
-	{
-		std::cout << "TrkUtil::SetGasMix Gas option not allowed. No action."
-			<< std::endl;
-	}
-	else fGasSel = Opt;
-}
Index: external/TrackCovariance/TrkUtil.h
===================================================================
--- external/TrackCovariance/TrkUtil.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,116 +1,0 @@
-//
-#ifndef G__TRKUTIL_H
-#define G__TRKUTIL_H
-//
-#include <TVector3.h>
-#include <TVectorD.h>
-#include <TMatrixDSym.h>
-#include <TRandom.h>
-#include <TMath.h>
-//
-//
-// Class test
-
-class TrkUtil {
-	//
-	//
-protected:
-	Double_t fBz;							// Solenoid magnetic field
-	//
-	Int_t fGasSel;							// Gas selection: 0: He-Iso, 1: He, 2:Ar-Eth, 3: Ar
-	Double_t fRmin;							// Lower		DCH radius
-	Double_t fRmax;							// Higher	DCH radius
-	Double_t fZmin;							// Lower		DCH z
-	Double_t fZmax;							// Higher	DCH z
-	//
-	// Service routines
-	//
-	void SetB(Double_t Bz) { fBz = Bz; }
-	TVectorD XPtoPar(TVector3 x, TVector3 p, Double_t Q);
-	TVector3 ParToP(TVectorD Par);
-	TMatrixDSym RegInv(TMatrixDSym& Min);
-	//
-	// Track trajectory derivatives
-	TMatrixD derXdPar(TVectorD par, Double_t s);	// derivatives of position wrt parameters
-	TVectorD derXds(TVectorD par, Double_t s);		// derivatives of position wrt phase
-	TVectorD dsdPar_R(TVectorD par, Double_t R);	// derivatives of phase at constant R
-	TVectorD dsdPar_z(TVectorD par, Double_t z);	// derivatives of phase at constant z
-	//
-	// Conversion to ACTS parametrization
-	//
-	TVectorD ParToACTS(TVectorD Par);		// Parameter conversion
-	TMatrixDSym CovToACTS(TVectorD Par, TMatrixDSym Cov);	// Covariance conversion
-	//
-	// Conversion to ILC parametrization
-	//
-	TVectorD ParToILC(TVectorD Par);		// Parameter conversion
-	TMatrixDSym CovToILC(TMatrixDSym Cov);	// Covariance conversion
-	//
-
-public:
-	//
-	// Constructors
-	TrkUtil();
-	TrkUtil(Double_t Bz);
-	// Destructor
-	~TrkUtil();
-	//
-	// Overload methods to allow call without instantiating class
-	//
-	static Double_t cSpeed()
-	{
-		Double_t c = 2.99792458e8;	// speed of light m/sec
-		//return TMath::C()*1.0e-9;	// Incompatible with root5
-		return c*1.0e-9; 			// Reduced speed of light	
-	}
-	//
-	// Service routines
-	//
-	static TVectorD XPtoPar(TVector3 x, TVector3 p, Double_t Q, Double_t Bz);
-	static TVector3 ParToX(TVectorD Par);			// position of minimum distance from z axis
-	static TVector3 ParToP(TVectorD Par, Double_t Bz);	// Get Momentum from track parameters
-	static Double_t ParToQ(TVectorD Par);			// Get track charge
-	static void LineDistance(TVector3 x0, TVector3 y0, TVector3 dirx, TVector3 diry, Double_t &sx, Double_t &sy, Double_t &distance);
-	//
-	// Track trajectory
-	//
-	static TVector3 Xtrack(TVectorD par, Double_t s);	// Parametric track trajectory
-	TVectorD derRphi_R(TVectorD par, Double_t R);		// Derivatives of R-phi at constant R
-	TVectorD derZ_R(TVectorD par, Double_t R);		// Derivatives of z at constant R
-	TVectorD derRphi_Z(TVectorD par, Double_t z);		// Derivatives of R-phi at constant z
-	TVectorD derR_Z(TVectorD par, Double_t z);		// Derivatives of R at constant z
-	//
-	// Smear with given covariance matrix
-	//
-	static TVectorD CovSmear(TVectorD x, TMatrixDSym C);
-	//
-	// Conversion from meters to mm
-	//
-	static TVectorD ParToMm(TVectorD Par);			// Parameter conversion
-	static TMatrixDSym CovToMm(TMatrixDSym Cov);		// Covariance conversion
-	//
-	// Inside cylindrical volume
-	//
-	static Bool_t IsInside(TVector3 x, Double_t Rout, Double_t Zmin, Double_t Zmax)
-	{
-		Bool_t Is = kFALSE;
-		if (x.Pt() <= Rout && x.z() >= Zmin && x.z() <= Zmax)Is = kTRUE;
-		return Is;
-	}
-	//
-	// Cluster counting in gas
-	//
-	void SetBfield(Double_t Bz) { fBz = Bz; }
-	// Define gas volume (units = meters) 
-	void SetDchBoundaries(Double_t Rmin, Double_t Rmax, Double_t Zmin, Double_t Zmax);
-	// Gas mixture selection
-	void SetGasMix(Int_t Opt);
-	// Get number of ionization clusters
-	Bool_t IonClusters(Double_t &Ncl, Double_t mass, TVectorD Par);
-	Double_t Nclusters(Double_t bgam);	// mean clusters/meter vs beta*gamma
-	static Double_t Nclusters(Double_t bgam, Int_t Opt);	// mean clusters/meter vs beta*gamma
-	Double_t funcNcl(Double_t *xp, Double_t *par);
-	Double_t TrkLen(TVectorD Par);					// Track length inside chamber
-};
-
-#endif
Index: external/TrackCovariance/VertexFit.cc
===================================================================
--- external/TrackCovariance/VertexFit.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,494 +1,0 @@
-/*
-Vertex fitting code
-*/
-#include <TMath.h>
-#include <TVectorD.h>
-#include <TVector3.h>
-#include <TMatrixD.h>
-#include <TMatrixDSym.h>
-#include <TMatrixDSymEigen.h>
-#include "VertexFit.h"
-//
-// Constructors
-//
-//
-// Empty construction (to be used when adding tracks later with AddTrk() )
-VertexFit::VertexFit()
-{
-	fNtr = 0;
-	fRstart = -1.0;
-	fVtxDone = kFALSE;
-	fVtxCst = kFALSE;
-	fxCst.ResizeTo(3);
-	fCovCst.ResizeTo(3, 3);
-	fCovCstInv.ResizeTo(3, 3);
-	fXv.ResizeTo(3);
-	fcovXv.ResizeTo(3, 3);
-}
-//
-// Build from list of parameters and covariances
-VertexFit::VertexFit(Int_t Ntr, TVectorD** trkPar, TMatrixDSym** trkCov)
-{
-	fNtr = Ntr;
-	fRstart = -1.0;
-	fVtxDone = kFALSE;
-	fVtxCst = kFALSE;
-	fxCst.ResizeTo(3);
-	fCovCst.ResizeTo(3, 3);
-	fCovCstInv.ResizeTo(3, 3);
-	fXv.ResizeTo(3);
-	fcovXv.ResizeTo(3, 3);
-	//
-	for (Int_t i = 0; i < fNtr; i++)
-	{
-		fPar.push_back(new TVectorD(*trkPar[i]));
-		fParNew.push_back(new TVectorD(*trkPar[i]));
-		fCov.push_back(new TMatrixDSym(*trkCov[i]));
-		fCovNew.push_back(new TMatrixDSym(*trkCov[i]));
-	}
-	fChi2List.ResizeTo(fNtr);
-	//
-}
-//
-// Build from ObsTrk list of tracks
-VertexFit::VertexFit(Int_t Ntr, ObsTrk** track)
-{
-	fNtr = Ntr;
-	fRstart = -1.0;
-	fVtxDone = kFALSE;
-	fVtxCst = kFALSE;
-	fxCst.ResizeTo(3);
-	fCovCst.ResizeTo(3, 3);
-	fCovCstInv.ResizeTo(3, 3);
-	fXv.ResizeTo(3);
-	fcovXv.ResizeTo(3, 3);
-	//
-	fChi2List.ResizeTo(fNtr);
-	for (Int_t i = 0; i < fNtr; i++)
-	{
-		fPar.push_back(new TVectorD(track[i]->GetObsPar()));
-		fParNew.push_back(new TVectorD(track[i]->GetObsPar()));
-		fCov.push_back(new TMatrixDSym(track[i]->GetCov()));
-		fCovNew.push_back(new TMatrixDSym(track[i]->GetCov()));
-	}
-}
-//
-// Destructor
-//
-void VertexFit::ResetWrkArrays()
-{
-	Int_t N = (Int_t)fdi.size();
-	if(N > 0){
-		for (Int_t i = 0; i < N; i++)
-		{
-			if (fx0i[i])  { fx0i[i]->Clear();	delete fx0i[i]; }
-			if (fai[i])   { fai[i]->Clear();	delete fai[i]; }
-			if (fdi[i])   { fdi[i]->Clear();	delete fdi[i]; }
-			if (fAti[i])  { fAti[i]->Clear();	delete fAti[i]; }
-			if (fDi[i])   { fDi[i]->Clear();	delete fDi[i]; }
-			if (fWi[i])   { fWi[i]->Clear();	delete fWi[i]; }
-			if (fWinvi[i]){ fWinvi[i]->Clear();     delete fWinvi[i]; }
-		}
-		fa2i.clear();
-		fx0i.clear();
-		fai.clear();
-		fdi.clear();
-		fAti.clear();
-		fDi.clear();
-		fWi.clear();
-		fWinvi.clear();
-	}
-}
-VertexFit::~VertexFit()
-{	
-	fxCst.Clear();		
-	fCovCst.Clear();
-	fCovCstInv.Clear();
-	fXv.Clear();		
-	fcovXv.Clear();		
-	fChi2List.Clear();
-	//
-	for (Int_t i = 0; i < fNtr; i++)
-	{
-		fPar[i]->Clear();		delete fPar[i];
-		fParNew[i]->Clear();	delete fParNew[i];
-		fCov[i]->Clear();		delete fCov[i];
-		fCovNew[i]->Clear();	delete fCovNew[i];
-	}	
-	fPar.clear();
-	fParNew.clear();
-	fCov.clear();
-	fCovNew.clear();		
-	//
-	ResetWrkArrays();
-	ffi.clear();	
-	fNtr = 0;
-}
-//
-//
-//
-TVectorD VertexFit::Fill_x0(TVectorD par)
-{
-	//
-	// Calculate track 3D position at R = |D| (minimum approach to z-axis)
-	//
-	TVectorD x0(3);
-	//
-	// Decode input arrays
-	//
-	Double_t D = par(0);
-	Double_t p0 = par(1);
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	x0(0) = -D * TMath::Sin(p0);
-	x0(1) = D * TMath::Cos(p0);
-	x0(2) = z0;
-	//
-	return x0;
-}
-//
-TVectorD VertexFit::Fill_x(TVectorD par, Double_t phi)
-{
-	//
-	// Calculate track 3D position for a given phase, phi
-	//
-	TVectorD x(3);
-	//
-	// Decode input arrays
-	//
-	Double_t D = par(0);
-	Double_t p0 = par(1);
-	Double_t C = par(2);
-	Double_t z0 = par(3);
-	Double_t ct = par(4);
-	//
-	TVectorD x0 = Fill_x0(par);
-	x(0) = x0(0) + (TMath::Sin(phi + p0) - TMath::Sin(p0)) / (2 * C);
-	x(1) = x0(1) - (TMath::Cos(phi + p0) - TMath::Cos(p0)) / (2 * C);
-	x(2) = x0(2) + ct * phi / (2 * C);
-	//
-	return x;
-}
-//
-void VertexFit::UpdateTrkArrays(Int_t i)
-{
-	//
-	// Get track parameters, covariance and phase
-	Double_t fs = ffi[i];			// Get phase
-	TVectorD par = *fParNew[i];
-	TMatrixDSym Cov = *fCov[i];
-	//
-	// Fill all track related work arrays arrays
-	TMatrixD A = derXdPar(par, fs);		// A = dx/da = derivatives wrt track parameters
-	TMatrixDSym Winv = Cov;				
-	Winv.Similarity(A);			// W^-1 = A*C*A'
-
-	TMatrixD At(TMatrixD::kTransposed, A);		// A transposed
-	fAti.push_back(new TMatrixD(At));		// Store A'
-	fWinvi.push_back(new TMatrixDSym(Winv));	// Store W^-1 matrix
-	//
-	TVectorD xs = Fill_x(par, fs);
-	fx0i.push_back(new TVectorD(xs));			// Start helix position
-	// 
-	TVectorD di = A * (par - *fPar[i]);			// x-shift
-	fdi.push_back(new TVectorD(di));			// Store x-shift	
-	//
-	TMatrixDSym W = RegInv(Winv);				// W = (A*C*A')^-1
-	fWi.push_back(new TMatrixDSym(W));			// Store W matrix
-	//
-	TVectorD a = derXds(par, fs);				// a = dx/ds = derivatives wrt phase
-	fai.push_back(new TVectorD(a));				// Store a
-	//
-	Double_t a2 = W.Similarity(a);
-	fa2i.push_back(a2);							// Store a2
-	//
-	// Build D matrix
-	TMatrixDSym B(3);
-	B.Rank1Update(a, -1. / a2);
-	B.Similarity(W);
-	TMatrixDSym Ds = W + B;						// D matrix
-	fDi.push_back(new TMatrixDSym(Ds));			// Store D matrix
-}
-//
-void VertexFit::VtxFitNoSteer()
-{
-	//
-	// Initialize
-	//
-	std::vector<TVectorD*> x0i;				// Tracks at ma
-	std::vector<TVectorD*> ni;				// Track derivative wrt phase
-	std::vector<TMatrixDSym*> Ci;				// Position error matrix at fixed phase
-	std::vector<TVectorD*> wi;				// Ci*ni
-	std::vector<Double_t> s_in;				// Starting phase
-	//
-	// 
-	//
-	// Track loop
-	for (Int_t i = 0; i < fNtr; i++)
-	{
-		TVectorD par = *fPar[i];
-		TMatrixDSym Cov = *fCov[i];
-		Double_t s = 0.;
-		// Case when starting radius is provided
-		if(fRstart > TMath::Abs(par(0))){
-			s = 2.*TMath::ASin(par(2)*TMath::Sqrt((fRstart*fRstart-par(0)*par(0))/(1.+2.*par(2)*par(0))));
-		}
-		//
-		x0i.push_back(new TVectorD(Fill_x(par, s)));
-		ni.push_back(new TVectorD(derXds(par, s)));
-		TMatrixD A = derXdPar(par, s);
-		Ci.push_back(new TMatrixDSym(Cov.Similarity(A)));
-		TMatrixDSym Cinv = RegInv(*Ci[i]);
-		wi.push_back(new TVectorD(Cinv * (*ni[i])));
-		s_in.push_back(s);
-	}
-	//std::cout << "Vtx init completed. fNtr = "<<fNtr << std::endl;
-	//
-	// Get fit vertex
-	//
-	TMatrixDSym D(3); D.Zero();
-	TVectorD Dx(3); Dx.Zero();
-	for (Int_t i = 0; i < fNtr; i++)
-	{
-		TMatrixDSym Cinv = RegInv(*Ci[i]);
-		TMatrixDSym W(3);
-		W.Rank1Update(*wi[i], 1. / Ci[i]->Similarity(*wi[i]));
-		TMatrixDSym Dd = Cinv - W;
-		D += Dd;
-		Dx += Dd * (*x0i[i]);
-	}
-	if(fVtxCst){
-		D  += fCovCstInv;
-		Dx += fCovCstInv*fxCst;
-	}
-	fXv = RegInv(D) * Dx;
-	//std::cout << "Fast vertex (x, y, z) = "<<fXv(0)<<", "<<fXv(1)<<", "<<fXv(2) << std::endl;
-	//
-	// Get fit phases
-	//
-	for (Int_t i = 0; i < fNtr; i++){
-		Double_t si = Dot(*wi[i], fXv - (*x0i[i])) / Ci[i]->Similarity(*wi[i]);
-		ffi.push_back(si+s_in[i]);
-		//TVectorD xvi = Fill_x(*fPar[i],si);
-		//std::cout << "Fast vertex "<<i<<": xvi = "<<xvi(0)<<", "<<xvi(1)<<", "<<xvi(2) 
-		//	<<", si = "<<si<< std::endl;
-	}
-	//
-	// Cleanup
-	for (Int_t i = 0; i < fNtr; i++)
-	{
-		x0i[i]->Clear();	delete x0i[i];
-		ni[i]->Clear();		delete ni[i];
-		Ci[i]->Clear();		delete Ci[i];
-		wi[i]->Clear();		delete wi[i];
-	}
-	x0i.clear();;
-	ni.clear();
-	Ci.clear(); 
-	wi.clear();
-	s_in.clear();
-}
-//
-void  VertexFit::VertexFitter()
-{
-	//std::cout << "VertexFitter: just in" << std::endl;
-	if (fNtr < 2 && !fVtxCst){
-		std::cout << "VertexFit::VertexFitter - Method called with less than 2 tracks - Aborting " << std::endl;
-		std::exit(1);
-	}
-	//
-	// Vertex fit
-	//
-	// Initial variable definitions
-	TVectorD x(3);
-	TMatrixDSym covX(3);
-	Double_t Chi2 = 0;
-	//
-	VtxFitNoSteer();	// Fast vertex finder on first pass (set ffi and fXv)
-	TVectorD x0 = fXv;
-	//
-	// Iteration properties
-	//
-	Int_t Ntry = 0;
-	Int_t TryMax = 100;
-	Double_t eps = 1.0e-9; // vertex stability
-	Double_t epsi = 1000.;
-	//
-	// Iteration loop
-	while (epsi > eps && Ntry < TryMax)		// Iterate until found vertex is stable
-	{
-		// Initialize arrays
-		x.Zero();
-		TVectorD cterm(3); TMatrixDSym H(3); TMatrixDSym DW1D(3);
-		covX.Zero();		// Reset vertex covariance
-		cterm.Zero();		// Reset constant term
-		H.Zero();		// Reset H matrix
-		DW1D.Zero();
-		//
-		// Reset work arrays
-		//
-		ResetWrkArrays();
-		//
-		// Start loop on tracks
-		//
-		for (Int_t i = 0; i < fNtr; i++)
-		{
-			// Get track helix parameters and their covariance matrix
-			TVectorD par = *fPar[i];
-			TMatrixDSym Cov = *fCov[i];
-			//
-			// Update track related arrays
-			//
-			UpdateTrkArrays(i);
-			TMatrixDSym Ds = *fDi[i];
-			TMatrixDSym Winv = *fWinvi[i];
-			TMatrixDSym DsW1Ds = Winv.Similarity(Ds);	// Service matrix to calculate covX
-			//
-			// Update global arrays
-			DW1D += DsW1Ds;
-			// Update hessian
-			H += Ds;
-			// update constant term
-			TVectorD xs = *fx0i[i] - *fdi[i];
-			//TVectorD xx0 = *fx0i[i];
-			
-			//std::cout << "Iter. " << Ntry << ", trk " << i << ", xs= "
-			//	<< xs(0) << ", " << xs(1) << ", " << xs(2)<<
-			//	", ph0= "<<par(1)<< std::endl;
-			
-			cterm += Ds * xs;
-		}				// End loop on tracks
-		// Some additions in case of external constraints
-		if (fVtxCst) {
-			H += fCovCstInv;
-			cterm += fCovCstInv * fxCst;
-			DW1D += fCovCstInv;
-		}
-		//
-		// update vertex position
-		TMatrixDSym H1 = RegInv(H);
-		x = H1 * cterm;
-		//
-		// Update vertex covariance
-		covX = DW1D.Similarity(H1);
-		//
-		// Update phases and chi^2
-		Chi2 = 0.0;
-		for (Int_t i = 0; i < fNtr; i++)
-		{
-			TVectorD lambda = (*fDi[i]) * (*fx0i[i] - x - *fdi[i]);
-			TMatrixDSym Wm1 = *fWinvi[i];
-			fChi2List(i) = Wm1.Similarity(lambda);
-			if(fChi2List(i) < 0.0){
-				//std::cout<<"# "<<i<<", Chi2= "<<fChi2List(i)<<", Wm1:"<<std::endl; Wm1.Print();
-				//std::cout<<"Lambda= "<<std::endl; lambda.Print();
-			}
-			Chi2 += fChi2List(i);
-			TVectorD a = *fai[i];
-			TVectorD b = (*fWi[i]) * (x - *fx0i[i] + *fdi[i]);
-			ffi[i] += Dot(a, b) / fa2i[i];
-			TVectorD newPar = *fPar[i] - ((*fCov[i]) * (*fAti[i])) * lambda;
-			fParNew[i] = new TVectorD(newPar);
-		}
-		// Add external constraint to Chi2
-		if (fVtxCst) Chi2 += fCovCstInv.Similarity(x - fxCst);
-		//
-		TVectorD dx = x - x0;
-		x0 = x;
-		// update vertex stability
-		TMatrixDSym Hess = RegInv(covX);
-		epsi = Hess.Similarity(dx);
-		Ntry++;
-		//
-		// Store result
-		//
-		fXv = x;			// Vertex position
-		fcovXv = covX;		// Vertex covariance
-		fChi2 = Chi2;		// Vertex fit Chi2
-		//std::cout << "Found vertex " << fXv(0) << ", " << fXv(1) << ", " << fXv(2) << std::endl;
-	}		// end of iteration loop
-	//
-	fVtxDone = kTRUE;		// Set fit completion flag
-	//fRstart = TMath::Sqrt(fXv(0)*fXv(0) + fXv(1)*fXv(1));	// Store fit 
-	//std::cout << "Found vertex " << fXv(0) << ", " << fXv(1) << ", " << fXv(2) 
-	//	<< ", after "<<Ntry<<" iterations"<<std::endl;
-	//
-}
-//
-// Return fit vertex
-TVectorD VertexFit::GetVtx()
-{
-	if (!fVtxDone) VertexFitter();
-	return fXv;
-}
-//
-// Return fit vertex covariance
-TMatrixDSym VertexFit::GetVtxCov()
-{
-	if (!fVtxDone) VertexFitter();
-	return fcovXv;
-}
-//
-// Return fit vertex chi2
-Double_t VertexFit::GetVtxChi2()
-{
-	if (!fVtxDone) VertexFitter();
-	return fChi2;
-}
-//
-// Return array of chi2 contributions from each track
-TVectorD VertexFit::GetVtxChi2List()
-{
-	if (!fVtxDone) VertexFitter();
-	return fChi2List;
-}
-//
-// Handle tracks/constraints
-void VertexFit::AddVtxConstraint(TVectorD xv, TMatrixDSym cov)	// Add gaussian vertex constraint
-{
-	//std::cout << "VertexFit::AddVtxConstraint: Not implemented yet" << std::endl;
-	fVtxCst = kTRUE;				// Vertex constraint flag
-	fxCst = xv;						// Constraint value
-	fCovCst = cov;					// Constraint covariance
-	fCovCstInv = cov;
-	fCovCstInv.Invert();				// Its inverse
-	//
-	// Set starting vertex as external constraint
-	fXv = fxCst;
-	fcovXv = fCovCst;
-}
-//
-// Adding tracks one by one
-void VertexFit::AddTrk(TVectorD *par, TMatrixDSym *Cov)			// Add track to input list
-{
-	fNtr++;
-	fChi2List.ResizeTo(fNtr);	// Resize chi2 array
-	fPar.push_back(par);			// add new track
-	fCov.push_back(Cov);
-	fParNew.push_back(par);			// add new track
-	fCovNew.push_back(Cov);
-	//
-	// Reset previous vertex temp arrays
-	ResetWrkArrays();
-	ffi.clear();
-	fVtxDone = kFALSE;			// Reset vertex done flag
-}
-//
-// Removing tracks one by one
-void VertexFit::RemoveTrk(Int_t iTrk)	// Remove iTrk track
-{
-	fNtr--;
-	fChi2List.Clear();
-	fChi2List.ResizeTo(fNtr);		// Resize chi2 array
-	fPar.erase(fPar.begin() + iTrk);		// Remove track
-	fCov.erase(fCov.begin() + iTrk);
-	fParNew.erase(fParNew.begin() + iTrk);		// Remove track
-	fCovNew.erase(fCovNew.begin() + iTrk);
-	//
-	// Reset previous vertex temp arrays
-	ResetWrkArrays();
-	ffi.clear();
-	fVtxDone = kFALSE;			// Reset vertex done flag
-}
Index: external/TrackCovariance/VertexFit.h
===================================================================
--- external/TrackCovariance/VertexFit.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,91 +1,0 @@
-//
-#ifndef G__VERTEXFIT_H
-#define G__VERTEXFIT_H
-//
-#include <TMath.h>
-#include <TVectorD.h>
-#include <TMatrixDSym.h>
-#include "TrkUtil.h"
-#include "ObsTrk.h"
-#include <vector>
-#include <iostream>
-//
-// Class for vertex fitting
-
-class VertexFit: public TrkUtil
-{
-	//
-	// Vertex fitting with track parameters steering
-	// Author: F. Bedeschi, INFN-Pisa, Italy
-	// February 10, 2021
-	//
-private:
-	//
-	// Inputs
-	Int_t fNtr;							// Number of tracks
-	std::vector<TVectorD*> fPar;		// Input parameter array
-	std::vector<TVectorD*> fParNew;		// Updated parameter array
-	std::vector<TMatrixDSym*> fCov;		// Input parameter covariances
-	std::vector<TMatrixDSym*> fCovNew;	// Updated parameter covariances
-	// Constraints
-	Bool_t fVtxCst;					// Vertex constraint flag
-	TVectorD fxCst;					// Constraint value
-	TMatrixDSym fCovCst;			// Constraint 
-	TMatrixDSym fCovCstInv;			// Inverse of constraint covariance
-	//
-	// Results
-	Bool_t fVtxDone;			// Flag vertex fit completed
-	Double_t fRstart;			// Starting value of vertex radius (0 = none)
-	TVectorD fXv;				// Found vertex
-	TMatrixDSym fcovXv;			// Vertex covariance
-	Double_t fChi2;				// Vertex fit Chi2
-	TVectorD fChi2List;			// List of Chi2 contributions
-	//
-	// Work arrays
-	std::vector<Double_t> ffi;				// Fit phases
-	std::vector<TVectorD*> fx0i;			// Track expansion points
-	std::vector<TVectorD*> fai;				// dx/dphi
-	std::vector<TVectorD*> fdi;				// x-shift
-	std::vector<Double_t> fa2i;				// a'Wa
-	std::vector<TMatrixD*> fAti;			// A transposed
-	std::vector<TMatrixDSym*> fDi;			// W-WBW
-	std::vector<TMatrixDSym*> fWi;			// (ACA')^-1
-	std::vector<TMatrixDSym*> fWinvi;		// ACA'
-	//
-	// Service routines
-	void ResetWrkArrays();							// Clear work arrays
-	//Double_t StartRadius();							// Starting vertex radius determination
-	//Double_t FastRv(TVectorD p1, TVectorD p2);		// Fast vertex radius determination
-	//TMatrixDSym RegInv(TMatrixDSym& Smat0);		// Regularized 3D matrix inversion 
-	//TMatrixD Fill_A(TVectorD par, Double_t phi);	// Derivative of track position wrt track parameters
-	//TVectorD Fill_a(TVectorD par, Double_t phi);	// Derivative of track position wrt track phase
-	TVectorD Fill_x0(TVectorD par);					// Track position at dma to z-axis
-	TVectorD Fill_x(TVectorD par, Double_t phi);	// Track position at given phase
-	void UpdateTrkArrays(Int_t i);					// Fill track realted arrays
-	void VtxFitNoSteer();							// Vertex fitter routine w/o parameter steering
-	void VertexFitter();							// Vertex fitter routine w/  parameter steering
-public:
-	//
-	// Constructors
-	VertexFit();										// Initialize waiting for tracks
-	VertexFit(Int_t Ntr, ObsTrk** tracks);			// Initialize with ObsTrk tracks
-	VertexFit(Int_t Ntr, TVectorD** trkPar, TMatrixDSym** trkCov);	// Initialize with parameters and covariances
-	// Destructor
-	~VertexFit();
-	//
-	// Accessors also trigger calculations when needed
-	Int_t GetNtrk() { return fNtr; };
-	TVectorD GetVtx();
-	TMatrixDSym GetVtxCov();
-	Double_t GetVtxChi2();
-	TVectorD GetVtxChi2List();
-	//
-	// Handle tracks/constraints
-	void AddVtxConstraint(TVectorD xv, TMatrixDSym cov);	// Add gaussian vertex constraint
-	void AddTrk(TVectorD *par, TMatrixDSym *Cov);		// Add track to input list
-	void RemoveTrk(Int_t iTrk);				// Remove iTrk track
-	void SetStartR(Double_t R) { fRstart = R; };		// Set starting radius
-	//
-};
-
-#endif
Index: external/fastjet/AUTHORS
===================================================================
--- external/fastjet/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/AUTHORS	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -10,7 +10,7 @@
 ----------------------------------------------------------------------
 
-Many people have provided bug reports, suggestions for development,
-documentation and in some cases explicit code for plugin
-algorithms. We would in particular like to thank
+Many people have provided bug reports, suggestions for development and
+in some cases explicit code for plugin algorithms. We would in
+particular like to thank
 
 Vanya Belyaev
@@ -32,8 +32,6 @@
 Hartmut Stadie
 Mark Sutton
-Jesse Thaler
 Chris Vermilion
 Markus Wobisch 
-Christopher Young
 
 ----------------------------------------------------------------------
Index: external/fastjet/ActiveAreaSpec.hh
===================================================================
--- external/fastjet/ActiveAreaSpec.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ActiveAreaSpec.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ActiveAreaSpec.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ActiveAreaSpec.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/AreaDefinition.cc
===================================================================
--- external/fastjet/AreaDefinition.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/AreaDefinition.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: AreaDefinition.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/AreaDefinition.hh"
@@ -70,7 +68,7 @@
     break;
   default:
-    ostr << "Error: unrecognized area_type in AreaDefinition::description():" 
+    cerr << "Error: unrecognized area_type in AreaDefinition::description():" 
          << area_type() << endl;
-    throw Error(ostr.str());
+    exit(-1);
   }
   return ostr.str();
Index: external/fastjet/AreaDefinition.hh
===================================================================
--- external/fastjet/AreaDefinition.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/AreaDefinition.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: AreaDefinition.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: AreaDefinition.hh 2687 2011-11-14 11:17:51Z soyez $
 //
-// Copyright (c) 2006-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2006-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/BasicRandom.cc
===================================================================
--- external/fastjet/BasicRandom.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/BasicRandom.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,23 +1,14 @@
-//FJSTARTHEADER
-// $Id: BasicRandom.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// simple random number generator class taken from nlojet++.
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//  Copyright (C) 2002 Zoltan Nagy
 //
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet is free software; you can redistribute it and/or modify
+//  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 2 of the License, or
 //  (at your option) any later version.
 //
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet is distributed in the hope that it will be useful,
+//  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
@@ -25,7 +16,7 @@
 //
 //  You should have received a copy of the GNU General Public License
-//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//ENDHEADER
 
 //   nlo includes
Index: external/fastjet/CMakeLists.txt
===================================================================
--- external/fastjet/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,5 +1,0 @@
-include_directories(BEFORE ${CMAKE_SOURCE_DIR}/external)
-
-file(GLOB sources *.cc plugins/*/*.cc contribs/*/*.cc tools/*.cc)
-
-add_library(fastjet OBJECT ${sources})
Index: external/fastjet/COPYING
===================================================================
--- external/fastjet/COPYING	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/COPYING	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,12 +1,9 @@
-FastJet 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 2 of the License (GPLv2), or
-(at your option) any later version. A copy of the GPLv2 is to be found
-at the end of this file.
-
-FastJet includes a significant body of third-party code, for example
-for third party plugin algorithms and for computational geometry
-methods. These too are usually released under the GPL or permissive
-licenses. Details are given below on a case-by-case basis.
+FastJet is released under the terms of the GNU General Public License
+v2 (GPLv2). FastJet includes a significant body of third-party code,
+for example for third party plugin algorithms and for computational
+geometry methods. These too are usually released under the GPL or
+permissive licenses. Details are given below on a case-by-case basis.
+
+A copy of the GPLv2 is to be found at the end of this file.
 
 While the GPL license grants you considerable freedom, please bear in
Index: external/fastjet/CircularRange.hh
===================================================================
--- external/fastjet/CircularRange.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/CircularRange.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CircularRange.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: CircularRange.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -35,5 +33,4 @@
 #include "fastjet/RangeDefinition.hh"
 #include "fastjet/Error.hh"
-#include "fastjet/internal/deprecated.hh"
 
 // for backwards compatibility: one should now use SelectorCircle,
@@ -51,9 +48,7 @@
 public:
   /// constructor
-  FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
   CircularRange() {_set_invalid_rapphi();}
   
   /// initialise CircularRange with a jet
-  FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
   CircularRange(const fastjet::PseudoJet & jet, double distance) {
                 _distance = distance;
@@ -63,5 +58,4 @@
 
   /// initialise CircularRange with a (rap,phi) point
-  FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
   CircularRange(double rap, double phi, double distance) {
                 _distance = distance;
@@ -71,5 +65,4 @@
 
   /// initialise CircularRange with just the radius parameter
-  FASTJET_DEPRECATED_MSG("CircularRange is deprecated since FastJet 3.0. Use SelectorCircle instead")
   CircularRange(double distance) {
                 _set_invalid_rapphi();
@@ -81,5 +74,5 @@
   
   /// return description of range
-  virtual inline std::string description() const FASTJET_OVERRIDE {
+  virtual inline std::string description() const {
     std::ostringstream ostr;
     ostr << "CircularRange: within distance "<< _distance << " of given jet or point." ;
@@ -88,8 +81,8 @@
   /// returns true since this range is localizable (i.e. set_position
   /// does something meaningful)
-  virtual inline bool is_localizable() const FASTJET_OVERRIDE { return true; }
+  virtual inline bool is_localizable() const { return true; }
   
   /// return bool according to whether (rap,phi) is in range
-  virtual inline bool is_in_range(double rap, double phi) const FASTJET_OVERRIDE {
+  virtual inline bool is_in_range(double rap, double phi) const {
      if (! _rapphi_are_valid()) {
        throw Error("Circular range used without a center having being defined (use set_position())");
@@ -103,5 +96,5 @@
 
   /// return the minimal and maximal rapidity of this range
-  virtual inline void get_rap_limits(double & rapmin, double & rapmax) const FASTJET_OVERRIDE {
+  virtual inline void get_rap_limits(double & rapmin, double & rapmax) const {
      rapmin = _rapjet - _distance;
      rapmax = _rapjet + _distance; }
Index: external/fastjet/ClosestPair2D.cc
===================================================================
--- external/fastjet/ClosestPair2D.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClosestPair2D.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClosestPair2D.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/internal/ClosestPair2D.hh"
@@ -38,4 +36,5 @@
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
 
+const unsigned int huge_unsigned = 4294967295U;
 const unsigned int twopow31      = 2147483648U;
 
@@ -145,5 +144,5 @@
 
     // and create the search tree
-    _trees[ishift] = SharedPtr<Tree>(new Tree(shuffles, max_size));
+    _trees[ishift] = auto_ptr<Tree>(new Tree(shuffles, max_size));
 
     // now we look for the closest-pair candidates on this tree
@@ -174,5 +173,5 @@
     mindists2[i] = _points[i].neighbour_dist2;}
   
-  _heap = SharedPtr<MinHeap>(new MinHeap(mindists2, max_size));
+  _heap = auto_ptr<MinHeap>(new MinHeap(mindists2, max_size));
 }
 
@@ -184,9 +183,5 @@
   ID2 = _ID(_points[ID1].neighbour);
   distance2 = _points[ID1].neighbour_dist2;
-  // we make the swap explicitly in the std namespace to avoid
-  // potential conflict with the fastjet::swap introduced by
-  // SharedPtr.
-  // This is only an issue because we are in the fastjet namespace
-  if (ID1 > ID2) std::swap(ID1,ID2);
+  if (ID1 > ID2) swap(ID1,ID2);
 }
 
Index: external/fastjet/ClusterSequence.cc
===================================================================
--- external/fastjet/ClusterSequence.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/Error.hh"
@@ -34,10 +32,4 @@
 #include "fastjet/ClusterSequenceStructure.hh"
 #include "fastjet/version.hh" // stores the current version number
-#include "fastjet/internal/LazyTiling9Alt.hh"
-#include "fastjet/internal/LazyTiling9.hh"
-#include "fastjet/internal/LazyTiling25.hh"
-#ifndef __FJCORE__
-#include "fastjet/internal/LazyTiling9SeparateGhosts.hh"
-#endif  // __FJCORE__
 #include<iostream>
 #include<sstream>
@@ -152,6 +144,6 @@
   // set the pointer in the wrapper to this object to NULL to say that
   // we're going out of scope
-  if (_structure_shared_ptr){
-    ClusterSequenceStructure* csi = dynamic_cast<ClusterSequenceStructure*>(_structure_shared_ptr.get()); 
+  if (_structure_shared_ptr()){
+    ClusterSequenceStructure* csi = dynamic_cast<ClusterSequenceStructure*>(_structure_shared_ptr()); 
     // normally the csi is purely internal so it really should not be
     // NULL i.e assert should be OK
@@ -195,5 +187,5 @@
 //DEP //----------------------------------------------------------------------
 //DEP void ClusterSequence::_initialise_and_run (
-//DEP 				  const double R,
+//DEP 				  const double & R,
 //DEP 				  const Strategy & strategy,
 //DEP 				  const bool & writeout_combinations) {
@@ -254,10 +246,10 @@
       // in a similar way.
       if (_Rparam > pi) {
-        // choose a value that ensures that back-to-back particles will
-        // always recombine 
-        //_R2 = 4.0000000000001;
-        _R2 = 2 * ( 3.0 + cos(_Rparam) );
+	// choose a value that ensures that back-to-back particles will
+	// always recombine 
+	//_R2 = 4.0000000000001;
+	_R2 = 2 * ( 3.0 + cos(_Rparam) );
       } else {
-        _R2    = 2 * ( 1.0 - cos(_Rparam) );
+	_R2    = 2 * ( 1.0 - cos(_Rparam) );
       }
       _invR2 = 1.0/_R2;
@@ -281,10 +273,4 @@
   //             ./fastjet_timing_plugins -kt -nhardest 30 -repeat 50000 -strategy -3 -R 0.5 -nev 1  <  ../../data/Pythia-PtMin1000-LHC-1000ev.dat
   if (_strategy == Best) {
-    _strategy = _best_strategy();
-#ifdef DROP_CGAL
-    // fall back strategy for large N when CGAL is missing
-    if (_strategy == NlnN) _strategy = N2MHTLazy25;
-#endif  // DROP_CGAL
-  } else if (_strategy == BestFJ30) {
     int N = _jets.size();
     //if (N <= 55*max(0.5,min(1.0,_Rparam))) {// old empirical scaling with R
@@ -338,5 +324,5 @@
   // run the code containing the selected strategy
   // 
-  // We order the strategies starting from the ones used by the Best
+  // We order the strategies stqrting from the ones used by the Best
   // strategy in the order of increasing N, then the remaining ones
   // again in the order of increasing N.
@@ -348,40 +334,4 @@
   } else if (_strategy == N2MinHeapTiled) {
     this->_minheap_faster_tiled_N2_cluster();
-  } else if (_strategy == N2MHTLazy9Alt) {
-    // attempt to use an external tiling routine -- it manipulates
-    // the CS history via the plugin mechanism
-    _plugin_activated = true;
-    LazyTiling9Alt tiling(*this);
-    tiling.run();
-    _plugin_activated = false;
-
-  } else if (_strategy == N2MHTLazy25) {
-    // attempt to use an external tiling routine -- it manipulates
-    // the CS history via the plugin mechanism
-    _plugin_activated = true;
-    LazyTiling25 tiling(*this);
-    tiling.run();
-    _plugin_activated = false;
-
-  } else if (_strategy == N2MHTLazy9) {
-    // attempt to use an external tiling routine -- it manipulates
-    // the CS history via the plugin mechanism
-    _plugin_activated = true;
-    LazyTiling9 tiling(*this);
-    tiling.run();
-    _plugin_activated = false;
-
-  } else if (_strategy == N2MHTLazy9AntiKtSeparateGhosts) {
-#ifndef __FJCORE__
-    // attempt to use an external tiling routine -- it manipulates
-    // the CS history via the plugin mechanism
-    _plugin_activated = true;
-    LazyTiling9SeparateGhosts tiling(*this);
-    tiling.run();
-    _plugin_activated = false;
-#else 
-    throw Error("N2MHTLazy9AntiKtSeparateGhosts strategy not supported with FJCORE");
-#endif  // __FJCORE__
-
   } else if (_strategy == NlnN) {
     this->_delaunay_cluster();
@@ -409,5 +359,5 @@
 // these needs to be defined outside the class definition.
 bool ClusterSequence::_first_time = true;
-LimitedWarning ClusterSequence::_exclusive_warnings;
+int ClusterSequence::_n_exclusive_warnings = 0;
 
 
@@ -435,9 +385,9 @@
   (*ostr) << "#     A software package for jet finding and analysis at colliders      \n";
   (*ostr) << "#                           http://fastjet.fr                           \n"; 
-  (*ostr) << "#	                                                                      \n";
+  (*ostr) << "#                                                                       \n";
   (*ostr) << "# Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package\n";
   (*ostr) << "# for scientific work and optionally PLB641(2006)57 [hep-ph/0512210].   \n";
-  (*ostr) << "#                                                                       \n";
-  (*ostr) << "# FastJet is provided without warranty under the GNU GPL v2 or higher.  \n";
+  (*ostr) << "#								      	   \n";
+  (*ostr) << "# FastJet is provided without warranty under the terms of the GNU GPLv2.\n";
   (*ostr) << "# It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code";
 #ifndef DROP_CGAL
@@ -523,4 +473,6 @@
 
 //----------------------------------------------------------------------
+// Return the component corresponding to the specified index.
+// taken from CLHEP
 string ClusterSequence::strategy_string (Strategy strategy_in)  const {
   string strategy;
@@ -540,12 +492,4 @@
   case N2PoorTiled:
     strategy = "N2PoorTiled"; break;
-  case N2MHTLazy9:
-    strategy = "N2MHTLazy9"; break;
-  case N2MHTLazy9Alt:
-    strategy = "N2MHTLazy9Alt"; break;
-  case N2MHTLazy25:
-    strategy = "N2MHTLazy25"; break;
-  case N2MHTLazy9AntiKtSeparateGhosts:
-    strategy = "N2MHTLazy9AntiKtSeparateGhosts"; break;
   case N3Dumb:
     strategy = "N3Dumb"; break;
@@ -584,151 +528,4 @@
     } else {return 1.0;}
   } else {throw Error("Unrecognised jet algorithm");}
-}
-
-//----------------------------------------------------------------------
-// returns a suggestion for the best strategy to use on event
-// multiplicity, algorithm, R, etc.
-//
-// Some of the work to establish the best strategy is collected in
-// issue-tracker/2014-07-auto-strategy-selection;
-// transition_fit_v2.fit indicates the results of the fits that we're
-// using here. (Automatically generated by transition_fit_v2.gp).
-//
-// The transition to NlnN is always present, and it is the the
-// caller's responsibility to drop back down to N2MHTLazy25 if NlnN
-// isn't available.
-//
-// This routine should be called only if the jet alg is one of kt,
-// antikt, cam or genkt.
-Strategy ClusterSequence::_best_strategy() const {
-  int N = _jets.size();
-  // define bounded R, always above 0.1, because we don't trust any
-  // of our parametrizations below R = 0.1
-  double bounded_R = max(_Rparam, 0.1);
-
-  // the very first test thing is a quick hard-coded test to decide
-  // if we immediately opt for N2Plain
-  if (N <= 30 || N <= 39.0/(bounded_R + 0.6)) {
-    return N2Plain;
-  } 
-  
-  // Define objects that describe our various boundaries. A prefix N_
-  // indicates that boundary is for N, while L_ means it's for log(N).
-  //
-  // Hopefully having them static will ensure minimal overhead
-  // in creating them; collecting them in one place should
-  // help with updates?
-  //
-  const static _Parabola N_Tiled_to_MHT_lowR             (-45.4947,54.3528,44.6283);
-  const static _Parabola L_MHT_to_MHTLazy9_lowR          (0.677807,-1.05006,10.6994);
-  const static _Parabola L_MHTLazy9_to_MHTLazy25_akt_lowR(0.169967,-0.512589,12.1572);
-  const static _Parabola L_MHTLazy9_to_MHTLazy25_kt_lowR (0.16237,-0.484612,12.3373);
-  const static _Parabola L_MHTLazy9_to_MHTLazy25_cam_lowR = L_MHTLazy9_to_MHTLazy25_kt_lowR;
-  const static _Parabola L_MHTLazy25_to_NlnN_akt_lowR    (0.0472051,-0.22043,15.9196);
-  const static _Parabola L_MHTLazy25_to_NlnN_kt_lowR     (0.118609,-0.326811,14.8287);
-  const static _Parabola L_MHTLazy25_to_NlnN_cam_lowR    (0.10119,-0.295748,14.3924);
-
-  const static _Line     L_Tiled_to_MHTLazy9_medR         (-1.31304,7.29621);
-  const static _Parabola L_MHTLazy9_to_MHTLazy25_akt_medR = L_MHTLazy9_to_MHTLazy25_akt_lowR;
-  const static _Parabola L_MHTLazy9_to_MHTLazy25_kt_medR  = L_MHTLazy9_to_MHTLazy25_kt_lowR;
-  const static _Parabola L_MHTLazy9_to_MHTLazy25_cam_medR = L_MHTLazy9_to_MHTLazy25_cam_lowR;
-  const static _Parabola L_MHTLazy25_to_NlnN_akt_medR     = L_MHTLazy25_to_NlnN_akt_lowR;
-  const static _Parabola L_MHTLazy25_to_NlnN_kt_medR      = L_MHTLazy25_to_NlnN_kt_lowR;
-  const static _Parabola L_MHTLazy25_to_NlnN_cam_medR     = L_MHTLazy25_to_NlnN_cam_lowR;
-
-  const static double    N_Plain_to_MHTLazy9_largeR         = 75;
-  const static double    N_MHTLazy9_to_MHTLazy25_akt_largeR = 700;
-  const static double    N_MHTLazy9_to_MHTLazy25_kt_largeR  = 1000;
-  const static double    N_MHTLazy9_to_MHTLazy25_cam_largeR = 1000;
-  const static double    N_MHTLazy25_to_NlnN_akt_largeR     = 100000;
-  const static double    N_MHTLazy25_to_NlnN_kt_largeR      = 40000;
-  const static double    N_MHTLazy25_to_NlnN_cam_largeR     = 15000;
-
-  // We have timing studies only for kt, cam and antikt; for other
-  // algorithms we set the local jet_algorithm variable to the one of
-  // kt,cam,antikt that we think will be closest in behaviour to the
-  // other alg.
-  JetAlgorithm jet_algorithm;
-  if (_jet_algorithm == genkt_algorithm) {
-    // for genkt, then we set the local jet_algorithm variable (used
-    // only for strategy choice) to be either kt or antikt, depending on
-    // the p value.
-    double p   = jet_def().extra_param();
-    if (p < 0.0) jet_algorithm = antikt_algorithm;
-    else         jet_algorithm =     kt_algorithm;
-  } else if (_jet_algorithm == cambridge_for_passive_algorithm) {
-    // we assume (but haven't tested) that using the kt-alg timing
-    // transitions should be adequate for cambridge_for_passive_algorithm
-    jet_algorithm = kt_algorithm;
-  } else {
-    jet_algorithm = _jet_algorithm;
-  }
-
-  if (bounded_R < 0.65) {
-    // low R case
-    if          (N    < N_Tiled_to_MHT_lowR(bounded_R))              return N2Tiled;
-    double logN = log(double(N));
-    if          (logN < L_MHT_to_MHTLazy9_lowR(bounded_R))           return N2MinHeapTiled;
-    else {
-      if (jet_algorithm == antikt_algorithm){
-        if      (logN < L_MHTLazy9_to_MHTLazy25_akt_lowR(bounded_R)) return N2MHTLazy9;
-        else if (logN < L_MHTLazy25_to_NlnN_akt_lowR(bounded_R))     return N2MHTLazy25;
-        else                                                         return NlnN;
-      } else if (jet_algorithm == kt_algorithm){
-        if      (logN < L_MHTLazy9_to_MHTLazy25_kt_lowR(bounded_R))  return N2MHTLazy9;
-        else if (logN < L_MHTLazy25_to_NlnN_kt_lowR(bounded_R))      return N2MHTLazy25;
-        else                                                         return NlnN;
-      } else if (jet_algorithm == cambridge_algorithm)  {
-        if      (logN < L_MHTLazy9_to_MHTLazy25_cam_lowR(bounded_R)) return N2MHTLazy9;
-        else if (logN < L_MHTLazy25_to_NlnN_cam_lowR(bounded_R))     return N2MHTLazy25;
-        else                                                         return NlnNCam;
-      }
-    }
-  } else if (bounded_R < 0.5*pi) {
-    // medium R case
-    double logN = log(double(N));
-    if      (logN < L_Tiled_to_MHTLazy9_medR(bounded_R))             return N2Tiled;
-    else {
-      if (jet_algorithm == antikt_algorithm){
-        if      (logN < L_MHTLazy9_to_MHTLazy25_akt_medR(bounded_R)) return N2MHTLazy9;
-        else if (logN < L_MHTLazy25_to_NlnN_akt_medR(bounded_R))     return N2MHTLazy25;
-        else                                                         return NlnN;
-      } else if (jet_algorithm == kt_algorithm){
-        if      (logN < L_MHTLazy9_to_MHTLazy25_kt_medR(bounded_R))  return N2MHTLazy9;
-        else if (logN < L_MHTLazy25_to_NlnN_kt_medR(bounded_R))      return N2MHTLazy25;
-        else                                                         return NlnN;
-      } else if (jet_algorithm == cambridge_algorithm)  {
-        if      (logN < L_MHTLazy9_to_MHTLazy25_cam_medR(bounded_R)) return N2MHTLazy9;
-        else if (logN < L_MHTLazy25_to_NlnN_cam_medR(bounded_R))     return N2MHTLazy25;
-        else                                                         return NlnNCam;
-      }
-    }
-  } else {
-    // large R case (R > pi/2)
-    if      (N    < N_Plain_to_MHTLazy9_largeR)                      return N2Plain;
-    else {
-      if (jet_algorithm == antikt_algorithm){
-        if      (N < N_MHTLazy9_to_MHTLazy25_akt_largeR)             return N2MHTLazy9;
-        else if (N < N_MHTLazy25_to_NlnN_akt_largeR)                 return N2MHTLazy25;
-        else                                                         return NlnN;
-      } else if (jet_algorithm == kt_algorithm){
-        if      (N < N_MHTLazy9_to_MHTLazy25_kt_largeR)              return N2MHTLazy9;
-        else if (N < N_MHTLazy25_to_NlnN_kt_largeR)                  return N2MHTLazy25;
-        else                                                         return NlnN;
-      } else if (jet_algorithm == cambridge_algorithm)  {
-        if      (N < N_MHTLazy9_to_MHTLazy25_cam_largeR)             return N2MHTLazy9;
-        else if (N < N_MHTLazy25_to_NlnN_cam_largeR)                 return N2MHTLazy25;
-        else                                                         return NlnNCam;
-      }
-    }
-  }
-  
-  //bool code_should_never_reach_here = false;
-  //assert(code_should_never_reach_here);
-
-  assert(0 && "Code should never reach here");
-
-  return N2MHTLazy9;
-
 }
 
@@ -778,13 +575,4 @@
 
 
-ClusterSequence & ClusterSequence::operator=(const ClusterSequence & cs) {
-  // self assignment is trivial
-  if (&cs != this) {
-    _deletes_self_when_unused = false;
-    transfer_from_sequence(cs);
-  }
-  return *this;
-}
-
 //----------------------------------------------------------------------
 // transfer the sequence contained in other_seq into our own;
@@ -827,5 +615,5 @@
 
   // clean up existing structure
-  if (_structure_shared_ptr) {
+  if (_structure_shared_ptr()) {
     // If there are jets associated with an old version of the CS and
     // a new one, keeping track of when to delete the CS becomes more
@@ -835,5 +623,5 @@
     // anything that is currently associated with the cluster sequence
     // should be told that its cluster sequence no longer exists
-    ClusterSequenceStructure* csi = dynamic_cast<ClusterSequenceStructure*>(_structure_shared_ptr.get()); 
+    ClusterSequenceStructure* csi = dynamic_cast<ClusterSequenceStructure*>(_structure_shared_ptr()); 
     assert(csi != NULL);
     csi->set_associated_cs(NULL);
@@ -874,5 +662,5 @@
 //----------------------------------------------------------------------
 // return all inclusive jets with pt > ptmin
-vector<PseudoJet> ClusterSequence::inclusive_jets (const double ptmin) const{
+vector<PseudoJet> ClusterSequence::inclusive_jets (const double & ptmin) const{
   double dcut = ptmin*ptmin;
   int i = _history.size() - 1; // last jet
@@ -926,5 +714,5 @@
 // return the number of exclusive jets that would have been obtained
 // running the algorithm in exclusive mode with the given dcut
-int ClusterSequence::n_exclusive_jets (const double dcut) const {
+int ClusterSequence::n_exclusive_jets (const double & dcut) const {
 
   // first locate the point where clustering would have stopped (i.e. the
@@ -945,5 +733,5 @@
 // return all exclusive jets that would have been obtained running
 // the algorithm in exclusive mode with the given dcut
-vector<PseudoJet> ClusterSequence::exclusive_jets (const double dcut) const {
+vector<PseudoJet> ClusterSequence::exclusive_jets (const double & dcut) const {
   int njets = n_exclusive_jets(dcut);
   return exclusive_jets(njets);
@@ -954,5 +742,5 @@
 // return the jets obtained by clustering the event to n jets.
 // Throw an error if there are fewer than n particles.
-vector<PseudoJet> ClusterSequence::exclusive_jets (const int njets) const {
+vector<PseudoJet> ClusterSequence::exclusive_jets (const int & njets) const {
 
   // make sure the user does not ask for more than jets than there
@@ -971,9 +759,9 @@
 // return the jets obtained by clustering the event to n jets.
 // If there are fewer than n particles, simply return all particles
-vector<PseudoJet> ClusterSequence::exclusive_jets_up_to (const int njets) const {
+vector<PseudoJet> ClusterSequence::exclusive_jets_up_to (const int & njets) const {
 
   // provide a warning when extracting exclusive jets for algorithms 
   // that does not support it explicitly.
-  // Native algorithm that support it are: kt, ee_kt, Cambridge/Aachen, 
+  // Native algorithm that support it are: kt, ee_kt, cambridge, 
   //   genkt and ee_genkt (both with p>=0)
   // For plugins, we check Plugin::exclusive_sequence_meaningful()
@@ -985,6 +773,8 @@
        (_jet_def.extra_param() <0)) &&
       ((_jet_def.jet_algorithm() != plugin_algorithm) ||
-       (!_jet_def.plugin()->exclusive_sequence_meaningful()))) {
-    _exclusive_warnings.warn("dcut and exclusive jets for jet-finders other than kt, C/A or genkt with p>=0 should be interpreted with care.");
+       (!_jet_def.plugin()->exclusive_sequence_meaningful())) &&
+      (_n_exclusive_warnings < 5)) {
+    _n_exclusive_warnings++;
+    cerr << "FastJet WARNING: dcut and exclusive jets for jet-finders other than kt should be interpreted with care." << endl;
   }
 
@@ -1039,5 +829,5 @@
 /// return the dmin corresponding to the recombination that went from
 /// n+1 to n jets
-double ClusterSequence::exclusive_dmerge (const int njets) const {
+double ClusterSequence::exclusive_dmerge (const int & njets) const {
   assert(njets >= 0);
   if (njets >= _initial_n) {return 0.0;}
@@ -1051,5 +841,5 @@
 /// exclusive_dmerge, except in cases where the dmin do not increase
 /// monotonically.
-double ClusterSequence::exclusive_dmerge_max (const int njets) const {
+double ClusterSequence::exclusive_dmerge_max (const int & njets) const {
   assert(njets >= 0);
   if (njets >= _initial_n) {return 0.0;}
@@ -1063,5 +853,5 @@
 /// the algorithm with the given dcut.
 std::vector<PseudoJet> ClusterSequence::exclusive_subjets 
-   (const PseudoJet & jet, const double dcut) const {
+   (const PseudoJet & jet, const double & dcut) const {
 
   set<const history_element*> subhist;
@@ -1086,5 +876,5 @@
 /// exclusive_subjets.size()
 int ClusterSequence::n_exclusive_subjets(const PseudoJet & jet, 
-                        const double dcut) const {
+                        const double & dcut) const {
   set<const history_element*> subhist;
   // get the set of history elements that correspond to subjets at
@@ -1391,5 +1181,5 @@
 // //----------------------------------------------------------------------
 // // print out all inclusive jets with pt > ptmin
-// void ClusterSequence::print_jets (const double ptmin) const{
+// void ClusterSequence::print_jets (const double & ptmin) const{
 //     vector<PseudoJet> jets = sorted_by_pt(inclusive_jets(ptmin));
 // 
@@ -1467,8 +1257,7 @@
 // initialise the history in a standard way
 void ClusterSequence::_add_step_to_history (
-               //NO_LONGER_USED: const int step_number,
-               const int parent1, 
-	       const int parent2, const int jetp_index,
-	       const double dij) {
+	       const int & step_number, const int & parent1, 
+	       const int & parent2, const int & jetp_index,
+	       const double & dij) {
 
   history_element element;
@@ -1482,26 +1271,9 @@
 
   int local_step = _history.size()-1;
-  //#ifndef __NO_ASSERTS__
-  //assert(local_step == step_number);
-  //#endif
-
-  // sanity check: make sure the particles have not already been recombined
-  //
-  // Note that good practice would make this an assert (since this is
-  // a serious internal issue). However, we decided to throw an
-  // InternalError so that the end user can decide to catch it and
-  // retry the clustering with a different strategy.
+  assert(local_step == step_number);
 
   assert(parent1 >= 0);
-  if (_history[parent1].child != Invalid){
-    throw InternalError("trying to recomine an object that has previsously been recombined");
-  }
   _history[parent1].child = local_step;
-  if (parent2 >= 0) {
-    if (_history[parent2].child != Invalid){
-      throw InternalError("trying to recomine an object that has previsously been recombined");
-    }
-    _history[parent2].child = local_step;
-  }
+  if (parent2 >= 0) {_history[parent2].child = local_step;}
 
   // get cross-referencing right from PseudoJets
@@ -1657,6 +1429,6 @@
 /// of the recombined jet, newjet_k.
 void ClusterSequence::_do_ij_recombination_step(
-                               const int jet_i, const int jet_j, 
-			       const double dij, 
+                               const int & jet_i, const int & jet_j, 
+			       const double & dij, 
 			       int & newjet_k) {
 
@@ -1684,10 +1456,6 @@
   int hist_j = _jets[jet_j].cluster_hist_index();
 
-  _add_step_to_history(min(hist_i, hist_j), max(hist_i,hist_j),
+  _add_step_to_history(newstep_k, min(hist_i, hist_j), max(hist_i,hist_j),
 		       newjet_k, dij);
-
-  //  _add_step_to_history(newstep_k, min(hist_i, hist_j), max(hist_i,hist_j),
-  //		       newjet_k, dij);
-
 
 }
@@ -1698,14 +1466,11 @@
 /// jet_i with the beam
 void ClusterSequence::_do_iB_recombination_step(
-				  const int jet_i, const double diB) {
+				  const int & jet_i, const double & diB) {
+  // get history index
+  int newstep_k = _history.size();
+
   // recombine the jet with the beam
-  _add_step_to_history(_jets[jet_i].cluster_hist_index(),BeamJet,
+  _add_step_to_history(newstep_k,_jets[jet_i].cluster_hist_index(),BeamJet,
 		       Invalid, diB);
-
-  // // get history index
-  // int newstep_k = _history.size();
-  // 
-  // _add_step_to_history(newstep_k,_jets[jet_i].cluster_hist_index(),BeamJet,
-  //         	       Invalid, diB);
 
 }
Index: external/fastjet/ClusterSequence.hh
===================================================================
--- external/fastjet/ClusterSequence.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,6 @@
-#ifndef __FASTJET_CLUSTERSEQUENCE_HH__
-#define __FASTJET_CLUSTERSEQUENCE_HH__
-
-//FJSTARTHEADER
-// $Id: ClusterSequence.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ClusterSequence.hh 2806 2011-12-01 17:21:00Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,9 +25,13 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
-
+//ENDHEADER
+
+
+#ifndef __FASTJET_CLUSTERSEQUENCE_HH__
+#define __FASTJET_CLUSTERSEQUENCE_HH__
 
 #include<vector>
 #include<map>
+#include "fastjet/internal/DynamicNearestNeighbours.hh"
 #include "fastjet/PseudoJet.hh"
 #include<memory>
@@ -49,12 +48,9 @@
 #include "fastjet/ClusterSequenceStructure.hh"
 
-#include "fastjet/internal/deprecated.hh"
-
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
 
 
-// forward declarations
+// forward declaration
 class ClusterSequenceStructure;
-class DynamicNearestNeighbours;
 
 /// @ingroup basic_classes
@@ -69,6 +65,21 @@
   ClusterSequence () : _deletes_self_when_unused(false) {}
 
-  /// create a ClusterSequence, starting from the supplied set
-  /// of PseudoJets and clustering them with jet definition specified
+//   /// create a clustersequence starting from the supplied set
+//   /// of pseudojets and clustering them with the long-invariant
+//   /// kt algorithm (E-scheme recombination) with the supplied
+//   /// value for R.
+//   ///
+//   /// If strategy=DumbN3 a very stupid N^3 algorithm is used for the
+//   /// clustering; otherwise strategy = NlnN* uses cylinders algorithms
+//   /// with some number of pi coverage. If writeout_combinations=true a
+//   /// summary of the recombination sequence is written out
+//   template<class L> ClusterSequence (const std::vector<L> & pseudojets, 
+// 		   const double & R = 1.0,
+// 		   const Strategy & strategy = Best,
+// 		   const bool & writeout_combinations = false);
+
+
+  /// create a clustersequence starting from the supplied set
+  /// of pseudojets and clustering them with jet definition specified
   /// by jet_def (which also specifies the clustering strategy)
   template<class L> ClusterSequence (
@@ -82,7 +93,4 @@
   }
 
-  /// explicit assignment operator for a ClusterSequence
-  ClusterSequence & operator=(const ClusterSequence & cs);
-  
   // virtual ClusterSequence destructor, in case any derived class
   // thinks of needing a destructor at some point
@@ -96,15 +104,15 @@
   /// algorithm) with pt >= ptmin. Time taken should be of the order
   /// of the number of jets returned.
-  std::vector<PseudoJet> inclusive_jets (const double ptmin = 0.0) const;
+  std::vector<PseudoJet> inclusive_jets (const double & ptmin = 0.0) const;
 
   /// return the number of jets (in the sense of the exclusive
   /// algorithm) that would be obtained when running the algorithm
   /// with the given dcut.
-  int n_exclusive_jets (const double dcut) const;
+  int n_exclusive_jets (const double & dcut) const;
 
   /// return a vector of all jets (in the sense of the exclusive
   /// algorithm) that would be obtained when running the algorithm
   /// with the given dcut.
-  std::vector<PseudoJet> exclusive_jets (const double dcut) const;
+  std::vector<PseudoJet> exclusive_jets (const double & dcut) const;
 
   /// return a vector of all jets when the event is clustered (in the
@@ -113,5 +121,5 @@
   /// If there are fewer than njets particles in the ClusterSequence
   /// an error is thrown
-  std::vector<PseudoJet> exclusive_jets (const int njets) const;
+  std::vector<PseudoJet> exclusive_jets (const int & njets) const;
 
   /// return a vector of all jets when the event is clustered (in the
@@ -120,10 +128,10 @@
   /// If there are fewer than njets particles in the ClusterSequence
   /// the function just returns however many particles there were.
-  std::vector<PseudoJet> exclusive_jets_up_to (const int njets) const;
+  std::vector<PseudoJet> exclusive_jets_up_to (const int & njets) const;
 
   /// return the dmin corresponding to the recombination that went
   /// from n+1 to n jets (sometimes known as d_{n n+1}). If the number
   /// of particles in the event is <= njets, the function returns 0.
-  double exclusive_dmerge (const int njets) const;
+  double exclusive_dmerge (const int & njets) const;
 
   /// return the maximum of the dmin encountered during all recombinations 
@@ -131,5 +139,5 @@
   /// exclusive_dmerge, except in cases where the dmin do not increase
   /// monotonically.
-  double exclusive_dmerge_max (const int njets) const;
+  double exclusive_dmerge_max (const int & njets) const;
 
   /// return the ymin corresponding to the recombination that went from
@@ -150,5 +158,5 @@
 
 
-  //int n_exclusive_jets (const PseudoJet & jet, const double dcut) const;
+  //int n_exclusive_jets (const PseudoJet & jet, const double & dcut) const;
 
   /// return a vector of all subjets of the current jet (in the sense
@@ -161,5 +169,5 @@
   /// just getting that list of constituents.
   std::vector<PseudoJet> exclusive_subjets (const PseudoJet & jet, 
-                                            const double dcut) const;
+                                            const double & dcut) const;
 
   /// return the size of exclusive_subjets(...); still n ln n with same
@@ -167,5 +175,5 @@
   /// exclusive_subjets.size()
   int n_exclusive_subjets(const PseudoJet & jet, 
-                          const double dcut) const;
+                          const double & dcut) const;
 
   /// return the list of subjets obtained by unclustering the supplied
@@ -185,5 +193,5 @@
 						  int nsub) const;
 
-  /// returns the dij that was present in the merging nsub+1 -> nsub 
+  /// return the dij that was present in the merging nsub+1 -> nsub 
   /// subjets inside this jet.
   ///
@@ -191,5 +199,5 @@
   double exclusive_subdmerge(const PseudoJet & jet, int nsub) const;
 
-  /// returns the maximum dij that occurred in the whole event at the
+  /// return the maximum dij that occurred in the whole event at the
   /// stage that the nsub+1 -> nsub merge of subjets occurred inside 
   /// this jet.
@@ -199,6 +207,6 @@
 
   //std::vector<PseudoJet> exclusive_jets (const PseudoJet & jet, 
-  //                                       const int njets) const;
-  //double exclusive_dmerge (const PseudoJet & jet, const int njets) const;
+  //                                       const int & njets) const;
+  //double exclusive_dmerge (const PseudoJet & jet, const int & njets) const;
 
   /// returns the sum of all energies in the event (relevant mainly for e+e-)
@@ -264,5 +272,5 @@
 // Not yet. Perhaps in a future release.
 //   /// print out all inclusive jets with pt > ptmin
-//   virtual void print_jets (const double ptmin=0.0) const;
+//   virtual void print_jets (const double & ptmin=0.0) const;
 
   /// add on to subjet_vector the constituents of jet (for internal use mainly)
@@ -292,6 +300,7 @@
   ///
   /// NB: after having made this call, the user is still allowed to
-  /// delete the CS. Jets associated with it will then simply not be
-  /// able to access their substructure after that point.
+  /// delete the CS or let it go out of scope. Jets associated with it
+  /// will then simply not be able to access their substructure after
+  /// that point.
   void delete_self_when_unused();
 
@@ -304,7 +313,6 @@
 
   /// returns the scale associated with a jet as required for this
-  /// clustering algorithm (kt^2 for the kt-algorithm, 1 for the
-  /// Cambridge algorithm). Intended mainly for internal use and not
-  /// valid for plugin algorithms.
+  /// clustering algorithm (kt^2 for the kt-algorithm, 1 for the 
+  /// Cambridge algorithm). [May become virtual at some point]
   double jet_scale_for_algorithm(const PseudoJet & jet) const;
 
@@ -355,24 +363,9 @@
 
   /// the plugin can associate some extra information with the
-  /// ClusterSequence object by calling this function. The
-  /// ClusterSequence takes ownership of the pointer (and
-  /// responsibility for deleting it when the CS gets deleted).
-  inline void plugin_associate_extras(Extras * extras_in) {
-    _extras.reset(extras_in);
-  }
-
-  /// the plugin can associate some extra information with the
   /// ClusterSequence object by calling this function
-  /// 
-  /// As of FJ v3.1, this is deprecated, in line with the deprecation
-  /// of auto_ptr in C++11
-#ifndef SWIG
-#ifdef FASTJET_HAVE_AUTO_PTR_INTERFACE
-  FASTJET_DEPRECATED_MSG("Please use ClusterSequence::plugin_associate_extras(Extras * extras_in)) instead")
-  inline void plugin_associate_extras(std::auto_ptr<Extras> extras_in){
+  inline void plugin_associate_extras(std::auto_ptr<Extras> extras_in) {
+    //_extras = extras_in;
     _extras.reset(extras_in.release());
   }
-#endif
-#endif //SWIG
 
   /// returns true when the plugin is allowed to run the show.
@@ -606,5 +599,5 @@
 //DEP   /// clustering, provided for legacy purposes. The jet finder is that
 //DEP   /// specified in the static member _default_jet_algorithm.
-//DEP   void _initialise_and_run (const double R,
+//DEP   void _initialise_and_run (const double & R,
 //DEP 			    const Strategy & strategy,
 //DEP 			    const bool & writeout_combinations);
@@ -629,10 +622,10 @@
   /// jet_j, at distance scale dij; return the index newjet_k of the
   /// result of the recombination of i and j.
-  void _do_ij_recombination_step(const int jet_i, const int jet_j, 
-				 const double dij, int & newjet_k);
+  void _do_ij_recombination_step(const int & jet_i, const int & jet_j, 
+				 const double & dij, int & newjet_k);
 
   /// carry out an recombination step in which _jets[jet_i] merges with
   /// the beam, 
-  void _do_iB_recombination_step(const int jet_i, const double diB);
+  void _do_iB_recombination_step(const int & jet_i, const double & diB);
 
   /// every time a jet is added internally during clustering, this
@@ -647,33 +640,4 @@
   void _update_structure_use_count();
   
-  /// returns a suggestion for the best strategy to use on event
-  /// multiplicity, algorithm, R, etc.
-  Strategy _best_strategy() const;
-  
-  /// \if internal_doc
-  /// \class _Parabola
-  /// returns c*(a*R**2 + b*R + 1);
-  /// Written as a class in case we want to give names to different
-  /// parabolas
-  /// \endif
-  class _Parabola {
-  public:
-    _Parabola(double a, double b, double c) : _a(a), _b(b), _c(c) {}
-    inline double operator()(const double R) const {return _c*(_a*R*R + _b*R + 1);}
-  private:
-    double _a, _b, _c;
-  };
-
-  /// \if internal_doc
-  /// \class _Line
-  /// operator()(R) returns a*R+b;
-  /// \endif
-  class _Line {
-  public:
-    _Line(double a, double b) : _a(a), _b(b) {}
-    inline double operator()(const double R) const {return _a*R + _b;}
-  private:
-    double _a, _b;
-  };
 
   /// This contains the physical PseudoJets; for each PseudoJet one
@@ -717,4 +681,5 @@
 
   bool _plugin_activated;
+  //std::auto_ptr<Extras> _extras; // things the plugin might want to add
   SharedPtr<Extras> _extras; // things the plugin might want to add
 
@@ -740,8 +705,7 @@
   void _fast_NsqrtN_cluster();
 
-  void _add_step_to_history( //const int step_number,
-                            const int parent1, 
-			    const int parent2, const int jetp_index,
-			    const double dij);
+  void _add_step_to_history(const int & step_number, const int & parent1, 
+			       const int & parent2, const int & jetp_index,
+			       const double & dij);
 
   /// internal routine associated with the construction of the unique
@@ -762,5 +726,5 @@
 
   /// currently used only in the Voronoi based code
-  void _add_ktdistance_to_map(const int ii, 
+  void _add_ktdistance_to_map(const int & ii, 
 			      DistMap & DijMap,
   			      const DynamicNearestNeighbours * DNN);
@@ -770,6 +734,8 @@
   static bool _first_time;
 
-  /// manage warnings related to exclusive jets access
-  static LimitedWarning _exclusive_warnings;
+  /// record the number of warnings provided about the exclusive
+  /// algorithm -- so that we don't print it out more than a few
+  /// times.
+  static int _n_exclusive_warnings;
 
   /// the limited warning member for notification of user that 
@@ -788,4 +754,5 @@
     int        _jets_index;
   };
+
 
   /// structure analogous to BriefJet, but with the extra information
@@ -895,5 +862,5 @@
   // routines for tiled case, including some overloads of the plain
   // BriefJet cases
-  int  _tile_index(const double eta, const double phi) const;
+  int  _tile_index(const double & eta, const double & phi) const;
   void _tj_set_jetinfo ( TiledJet * const jet, const int _jets_index);
   void  _bj_remove_from_tiles(TiledJet * const jet);
@@ -904,4 +871,5 @@
   void _add_untagged_neighbours_to_tile_union(const int tile_index, 
 		 std::vector<int> & tile_union, int & n_near_tiles);
+
 
   //----------------------------------------------------------------------
@@ -955,5 +923,5 @@
 // template<class L> ClusterSequence::ClusterSequence (
 // 			          const std::vector<L> & pseudojets,
-// 				  const double R,
+// 				  const double & R,
 // 				  const Strategy & strategy,
 // 				  const bool & writeout_combinations) {
@@ -999,33 +967,4 @@
 inline unsigned int ClusterSequence::n_particles() const {return _initial_n;}
 
-//----------------------------------------------------------------------
-// implementation of JetDefinition::operator() is here to avoid nasty
-// issues of order of implementations and includes
-#ifndef __CINT__
-template<class L>
-std::vector<PseudoJet> JetDefinition::operator()(const std::vector<L> & particles) const {
-  // create a new cluster sequence
-  ClusterSequence * cs = new ClusterSequence(particles, *this);
-
-  // get the jets, and sort them according to whether the algorithm
-  // is spherical or not
-  std::vector<PseudoJet> jets;
-  if (is_spherical()) {
-    jets = sorted_by_E(cs->inclusive_jets());
-  } else {
-    jets = sorted_by_pt(cs->inclusive_jets());
-  }
-  
-  // make sure the ClusterSequence gets deleted once it's no longer
-  // needed
-  if (jets.size() != 0) {
-    cs->delete_self_when_unused();
-  } else {
-    delete cs;
-  }
-
-  return jets;
-}
-#endif // __CINT__
 
 
@@ -1048,15 +987,7 @@
 template <class J> inline double ClusterSequence::_bj_dist(
                 const J * const jetA, const J * const jetB) const {
-  //#define FASTJET_NEW_DELTA_PHI
-#ifndef FASTJET_NEW_DELTA_PHI
-  //GPS+MC old version of Delta phi calculation
   double dphi = std::abs(jetA->phi - jetB->phi);
   double deta = (jetA->eta - jetB->eta);
   if (dphi > pi) {dphi = twopi - dphi;}
-#else 
-  //GPS+MC testing for 2015-02-faster-deltaR2
-  double dphi = pi-std::abs(pi-std::abs(jetA->phi - jetB->phi));
-  double deta = (jetA->eta - jetB->eta);
-#endif 
   return dphi*dphi + deta*deta;
 }
Index: external/fastjet/ClusterSequence1GhostPassiveArea.cc
===================================================================
--- external/fastjet/ClusterSequence1GhostPassiveArea.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence1GhostPassiveArea.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence1GhostPassiveArea.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequence1GhostPassiveArea.hh"
Index: external/fastjet/ClusterSequence1GhostPassiveArea.hh
===================================================================
--- external/fastjet/ClusterSequence1GhostPassiveArea.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence1GhostPassiveArea.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence1GhostPassiveArea.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ClusterSequence1GhostPassiveArea.hh 2687 2011-11-14 11:17:51Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCE1GHOSTPASSIVEAREA_HH__
@@ -70,5 +68,5 @@
   /// AreaBase one rather than the ActiveArea one (which for which we
   /// do not have the information).
-  virtual double n_empty_jets(const Selector & selector) const FASTJET_OVERRIDE {
+  virtual double n_empty_jets(const Selector & selector) const {
     return ClusterSequenceAreaBase::n_empty_jets(selector);
   }
Index: external/fastjet/ClusterSequenceActiveArea.cc
===================================================================
--- external/fastjet/ClusterSequenceActiveArea.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceActiveArea.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceActiveArea.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/PseudoJet.hh"
Index: external/fastjet/ClusterSequenceActiveArea.hh
===================================================================
--- external/fastjet/ClusterSequenceActiveArea.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceActiveArea.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceActiveArea.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: ClusterSequenceActiveArea.hh 2687 2011-11-14 11:17:51Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEACTIVEAREA_HH__
@@ -74,10 +72,10 @@
 	  const bool & writeout_combinations = false) ;
 
-  virtual double area (const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual double area (const PseudoJet & jet) const {
                              return _average_area[jet.cluster_hist_index()];};
-  virtual double area_error (const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual double area_error (const PseudoJet & jet) const {
                              return _average_area2[jet.cluster_hist_index()];};
 
-  virtual PseudoJet area_4vector (const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual PseudoJet area_4vector (const PseudoJet & jet) const {
                     return _average_area_4vector[jet.cluster_hist_index()];};
 
@@ -85,7 +83,4 @@
   /// the background (e.g. non-jet) activity in a highly populated event; the
   /// one that has been most extensively tested is median.
-  /// 
-  /// These strategies are OBSOLETE and deprecated (see comment
-  /// for pt_per_unit_area).
   enum mean_pt_strategies{median=0, non_ghost_median, pttot_over_areatot, 
 			  pttot_over_areatot_cut, mean_ratio_cut, play,
@@ -98,10 +93,18 @@
   /// have pt/area > median(pt/area)*range.
   ///
-  /// NB: This call is OBSOLETE and deprecated; use a
-  /// JetMedianBackgroundEstimator or GridMedianBackgroundEstimator
-  /// instead.
+  /// NB: This call is OBSOLETE; use media_pt_per_unit_area from the
+  //      ClusterSequenceAreaBase class instead
   double pt_per_unit_area(mean_pt_strategies strat=median, 
                           double range=2.0 ) const;
 
+  // following code removed -- now dealt with by AreaBase class (and
+  // this definition here conflicts with it).
+//   /// fits a form pt_per_unit_area(y) = a + b*y^2 in the range
+//   /// abs(y)<raprange (for negative raprange, it defaults to
+//   /// _safe_rap_for_area).
+//   void parabolic_pt_per_unit_area(double & a,double & b, double raprange=-1.0,
+// 				  double exclude_above=-1.0, 
+// 				  bool use_area_4vector=false ) const;
+// 
   /// rewrite the empty area from the parent class, so as to use
   /// all info at our disposal
@@ -110,9 +113,9 @@
   ///
   /// The selector passed as an argument needs to apply jet by jet.
-  virtual double empty_area(const Selector & selector) const FASTJET_OVERRIDE;
+  virtual double empty_area(const Selector & selector) const;
 
   /// return the true number of empty jets (replaces
   /// ClusterSequenceAreaBase::n_empty_jets(...))
-  virtual double n_empty_jets(const Selector & selector) const FASTJET_OVERRIDE;
+  virtual double n_empty_jets(const Selector & selector) const;
 
 protected:
Index: external/fastjet/ClusterSequenceActiveAreaExplicitGhosts.cc
===================================================================
--- external/fastjet/ClusterSequenceActiveAreaExplicitGhosts.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceActiveAreaExplicitGhosts.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceActiveAreaExplicitGhosts.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh"
Index: external/fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh
===================================================================
--- external/fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceActiveAreaExplicitGhosts.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: ClusterSequenceActiveAreaExplicitGhosts.hh 2687 2011-11-14 11:17:51Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEACTIVEAREAEXPLICITGHOSTS_HH_
@@ -97,5 +95,5 @@
 
   /// returns the area of a jet
-  virtual double area (const PseudoJet & jet) const FASTJET_OVERRIDE;
+  virtual double area (const PseudoJet & jet) const;
 
   /// returns a four vector corresponding to the sum (E-scheme) of the
@@ -103,8 +101,8 @@
   /// for a small contiguous area the p_t of the extended_area jet is
   /// equal to area of the jet.
-  virtual PseudoJet area_4vector (const PseudoJet & jet) const FASTJET_OVERRIDE;
+  virtual PseudoJet area_4vector (const PseudoJet & jet) const;
 
   /// true if a jet is made exclusively of ghosts
-  virtual bool is_pure_ghost(const PseudoJet & jet) const FASTJET_OVERRIDE;
+  virtual bool is_pure_ghost(const PseudoJet & jet) const;
 
   /// true if the entry in the history index corresponds to a
@@ -114,5 +112,5 @@
 
   /// this class does have explicit ghosts
-  virtual bool has_explicit_ghosts() const FASTJET_OVERRIDE {return true;}
+  virtual bool has_explicit_ghosts() const {return true;}
 
   /// return the total area, corresponding to a given Selector, that
@@ -120,5 +118,5 @@
   ///
   /// The selector needs to apply jet by jet
-  virtual double empty_area(const Selector & selector) const FASTJET_OVERRIDE;
+  virtual double empty_area(const Selector & selector) const;
 
   /// returns the total area under study
Index: external/fastjet/ClusterSequenceArea.cc
===================================================================
--- external/fastjet/ClusterSequenceArea.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceArea.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,32 +1,2 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceArea.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2006-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
 #include "fastjet/ClusterSequenceArea.hh"
 
Index: external/fastjet/ClusterSequenceArea.hh
===================================================================
--- external/fastjet/ClusterSequenceArea.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceArea.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceArea.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2006-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: ClusterSequenceArea.hh 2690 2011-11-14 14:57:54Z soyez $
+//
+// Copyright (c) 2006-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEAREA_HH__
@@ -80,14 +78,14 @@
 
   /// return the area associated with the given jet
-  virtual double area       (const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual double area       (const PseudoJet & jet) const {
     return _area_base->area(jet);}
 
   /// return the error (uncertainty) associated with the determination
   /// of the area of this jet
-  virtual double area_error (const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual double area_error (const PseudoJet & jet) const {
     return _area_base->area_error(jet);}
 
   /// return the 4-vector area
-  virtual PseudoJet area_4vector(const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual PseudoJet area_4vector(const PseudoJet & jet) const {
     return _area_base->area_4vector(jet);}
 
@@ -110,5 +108,5 @@
   /// jet (see the BackgroundEstimator and Subtractor tools for more
   /// advanced usage)
-  virtual double empty_area(const Selector & selector) const FASTJET_OVERRIDE {
+  virtual double empty_area(const Selector & selector) const {
     return _area_base->empty_area(selector);}
 
@@ -122,15 +120,15 @@
   /// jet (see the BackgroundEstimator and Subtractor tools for more
   /// advanced usage)
-  virtual double n_empty_jets(const Selector & selector) const FASTJET_OVERRIDE {
+  virtual double n_empty_jets(const Selector & selector) const {
     return _area_base->n_empty_jets(selector);
   }
 
   /// true if a jet is made exclusively of ghosts
-  virtual bool is_pure_ghost(const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual bool is_pure_ghost(const PseudoJet & jet) const {
     return _area_base->is_pure_ghost(jet);
   }
 
   /// true if this ClusterSequence has explicit ghosts
-  virtual bool has_explicit_ghosts() const FASTJET_OVERRIDE {
+  virtual bool has_explicit_ghosts() const {
     return _area_base->has_explicit_ghosts();
   }
@@ -144,5 +142,4 @@
   /// jet (see the BackgroundEstimator and Subtractor tools for more
   /// advanced usage)
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceArea::get_median_rho_and_sigma(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void get_median_rho_and_sigma(const std::vector<PseudoJet> & all_jets,
 					const Selector & selector, 
@@ -150,7 +147,7 @@
                                         double & median, double & sigma,
                                         double & mean_area,
-					bool all_are_incl = false) const FASTJET_OVERRIDE {
+					bool all_are_incl = false) const {
     _warn_if_range_unsuitable(selector);
-    ClusterSequenceAreaBase::_get_median_rho_and_sigma(
+    ClusterSequenceAreaBase::get_median_rho_and_sigma(
                                  all_jets, selector, use_area_4vector,
 				 median, sigma, mean_area, all_are_incl);
@@ -161,10 +158,9 @@
   /// since we've overridden the 5-argument version above, we have to
   /// override the 4-argument version too.
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceArea::get_median_rho_and_sigma(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void get_median_rho_and_sigma(const Selector & selector, 
                                         bool use_area_4vector,
-                                        double & median, double & sigma) const FASTJET_OVERRIDE {
-    ClusterSequenceAreaBase::_get_median_rho_and_sigma(selector,use_area_4vector,
-                                                       median,sigma);
+                                        double & median, double & sigma) const {
+    ClusterSequenceAreaBase::get_median_rho_and_sigma(selector,use_area_4vector,
+                                                      median,sigma);
   }
 
@@ -173,11 +169,10 @@
   /// since we've overridden the multi-argument version above, we have to
   /// override the 5-argument version too.
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceArea::get_median_rho_and_sigma(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void get_median_rho_and_sigma(const Selector & selector, 
                                         bool use_area_4vector,
                                         double & median, double & sigma,
-					double & mean_area) const FASTJET_OVERRIDE {
-    ClusterSequenceAreaBase::_get_median_rho_and_sigma(selector,use_area_4vector,
-                                                       median,sigma, mean_area);
+					double & mean_area) const {
+    ClusterSequenceAreaBase::get_median_rho_and_sigma(selector,use_area_4vector,
+                                                      median,sigma, mean_area);
   }
 
@@ -186,10 +181,11 @@
   /// additionally checks compatibility between "range" and region in which
   /// ghosts are thrown.
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceArea::parabolic_pt_per_unit_area(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")  
   virtual void parabolic_pt_per_unit_area(double & a, double & b, 
                                           const Selector & selector, 
                                           double exclude_above=-1.0, 
-                                          bool use_area_4vector=false) const FASTJET_OVERRIDE {
-    return _parabolic_pt_per_unit_area(a,b,selector,exclude_above,use_area_4vector);
+                                          bool use_area_4vector=false) const {
+    _warn_if_range_unsuitable(selector);
+    ClusterSequenceAreaBase::parabolic_pt_per_unit_area(
+                                a,b,selector, exclude_above, use_area_4vector);
   }
 
@@ -206,23 +202,8 @@
                                  const JetDefinition & jet_def);
 
-  SharedPtr<ClusterSequenceAreaBase> _area_base;
+  std::auto_ptr<ClusterSequenceAreaBase> _area_base;
   AreaDefinition _area_def;
   static LimitedWarning _range_warnings;
   static LimitedWarning _explicit_ghosts_repeats_warnings;
-
-  // the following set of private methods are all deprecated. Their
-  // role is simply to hide the corresponding methods (without the
-  // first underscore) from the public interface so that they can be
-  // used internally until all the deprecated methods are removed.
-  // DO NOT USE ANY OF THESE METHODS: THEY ARE DEPRECATED AND WILL BE
-  // REMOVED.
-  virtual void _parabolic_pt_per_unit_area(double & a, double & b, 
-                                          const Selector & selector, 
-                                          double exclude_above=-1.0, 
-                                          bool use_area_4vector=false) const FASTJET_OVERRIDE {
-    _warn_if_range_unsuitable(selector);
-    ClusterSequenceAreaBase::_parabolic_pt_per_unit_area(
-                                a,b,selector, exclude_above, use_area_4vector);
-  }
 
 };
@@ -264,12 +245,10 @@
     break;
   default:
-    std::ostringstream err;
-    err << "Error: unrecognized area_type in ClusterSequenceArea:" 
-	<< _area_def.area_type();
-    throw Error(err.str());
-    //exit(-1);
+    std::cerr << "Error: unrecognized area_type in ClusterSequenceArea:" 
+              << _area_def.area_type() << std::endl;
+    exit(-1);
   }
   // now copy across the information from the area base class
-  _area_base = SharedPtr<ClusterSequenceAreaBase>(_area_base_ptr);
+  _area_base = std::auto_ptr<ClusterSequenceAreaBase>(_area_base_ptr);
   transfer_from_sequence(*_area_base);
 }
Index: external/fastjet/ClusterSequenceAreaBase.cc
===================================================================
--- external/fastjet/ClusterSequenceAreaBase.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceAreaBase.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,7 +1,7 @@
 
-//FJSTARTHEADER
-// $Id: ClusterSequenceAreaBase.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -14,9 +14,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -28,5 +26,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -79,68 +77,32 @@
 }
 
-// this is deprecated but used by other deprecated methods. So we hide
-// the implementation in a protected method so that (i) it can still
-// be used internally (without generating a compile-time warning when
-// building FastJet) and the interface can be marked as deprecated.
-// This can disappear once all the public interfaces have disappeared.
 double ClusterSequenceAreaBase::median_pt_per_unit_area(const Selector & selector) const {
-  return _median_pt_per_unit_area(selector);
-}
-
-// the hidden implementation
-double ClusterSequenceAreaBase::_median_pt_per_unit_area(const Selector & selector) const {
-  return _median_pt_per_unit_something(selector,false);
-}
-
-
-
-// this is deprecated but used by other deprecated methods. So we hide
-// the implementation in a protected method so that (i) it can still
-// be used internally (without generating a compile-time warning when
-// building FastJet) and the interface can be marked as deprecated.
-// This can disappear once all the public interfaces have disappeared.
+  return median_pt_per_unit_something(selector,false);
+}
+
 double ClusterSequenceAreaBase::median_pt_per_unit_area_4vector(const Selector & selector) const {
-  return _median_pt_per_unit_area_4vector(selector);
-}
-
-// the deprecated interface
-double ClusterSequenceAreaBase::_median_pt_per_unit_area_4vector(const Selector & selector) const {
-  return _median_pt_per_unit_something(selector,true);
-}
-
-
-//----------------------------------------------------------------------
-// this is deprecated but used by other deprecated methods. So we hide
-// the implementation in a protected method so that (i) it can still
-// be used internally (without generating a compile-time warning when
-// building FastJet) and the interface can be marked as deprecated.
-// This can disappear once all the public interfaces have disappeared.
+  return median_pt_per_unit_something(selector,true);
+}
+
+
+//----------------------------------------------------------------------
+/// the median of (pt/area) for jets contained within range, counting
+/// the empty area as if it were made up of a collection of empty
+/// jets each of area (0.55 * pi R^2).
 double ClusterSequenceAreaBase::median_pt_per_unit_something(
                 const Selector & selector, bool use_area_4vector) const {
-  return _median_pt_per_unit_something(selector, use_area_4vector);
-}
-
-// the median of (pt/area) for jets contained within range, counting
-// the empty area as if it were made up of a collection of empty
-// jets each of area (0.55 * pi R^2).
-double ClusterSequenceAreaBase::_median_pt_per_unit_something(
-                const Selector & selector, bool use_area_4vector) const {
+
   double median, sigma, mean_area;
-  _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area);
+  get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area);
   return median;
-}
-
-
-//----------------------------------------------------------------------
-/// fits a form pt_per_unit_area(y) = a + b*y^2 for jets in range.
-/// exclude_above allows one to exclude large values of pt/area from
-/// fit.  use_area_4vector = true uses the 4vector areas.
+
+}
+
+
+//----------------------------------------------------------------------
+/// fits a form pt_per_unit_area(y) = a + b*y^2 for jets in range. 
+/// exclude_above allows one to exclude large values of pt/area from fit. 
+/// use_area_4vector = true uses the 4vector areas.
 void ClusterSequenceAreaBase::parabolic_pt_per_unit_area(
-       double & a, double & b, const Selector & selector, 
-       double exclude_above, bool use_area_4vector) const {
-  return _parabolic_pt_per_unit_area(a, b, selector, exclude_above, use_area_4vector);
-}
-
-void ClusterSequenceAreaBase::_parabolic_pt_per_unit_area(
        double & a, double & b, const Selector & selector, 
        double exclude_above, bool use_area_4vector) const {
@@ -197,30 +159,16 @@
 
 
-//----------------------------------------------------------------------
+
 void ClusterSequenceAreaBase::get_median_rho_and_sigma(
             const Selector & selector, bool use_area_4vector,
             double & median, double & sigma, double & mean_area) const {
-  _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area);
-}
-
-void ClusterSequenceAreaBase::_get_median_rho_and_sigma(
-            const Selector & selector, bool use_area_4vector,
-            double & median, double & sigma, double & mean_area) const {
 
   vector<PseudoJet> incl_jets = inclusive_jets();
-  _get_median_rho_and_sigma(incl_jets, selector, use_area_4vector,
-                            median, sigma, mean_area, true);
-}
+  get_median_rho_and_sigma(incl_jets, selector, use_area_4vector,
+			   median, sigma, mean_area, true);
+}
+
 
 void ClusterSequenceAreaBase::get_median_rho_and_sigma(
-            const vector<PseudoJet> & all_jets,
-            const Selector & selector, bool use_area_4vector,
-            double & median, double & sigma, double & mean_area,
-	    bool all_are_incl) const {
-  _get_median_rho_and_sigma(all_jets, selector, use_area_4vector,
-                            median, sigma, mean_area, all_are_incl);
-}
-
-void ClusterSequenceAreaBase::_get_median_rho_and_sigma(
             const vector<PseudoJet> & all_jets,
             const Selector & selector, bool use_area_4vector,
@@ -338,21 +286,15 @@
 
 
-// return a vector of all subtracted jets, using area_4vector, given rho.
-// Only inclusive_jets above ptmin are subtracted and returned.
-// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
-// i.e. not necessarily ordered in pt once subtracted
+/// return a vector of all subtracted jets, using area_4vector, given rho.
+/// Only inclusive_jets above ptmin are subtracted and returned.
+/// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
+/// i.e. not necessarily ordered in pt once subtracted
 vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(const double rho,
                                                            const double ptmin) 
                                                            const {
-  return _subtracted_jets(rho,ptmin);
-}
-
-vector<PseudoJet> ClusterSequenceAreaBase::_subtracted_jets(const double rho,
-                                                            const double ptmin) 
-  const {
   vector<PseudoJet> sub_jets;
   vector<PseudoJet> jets_local = sorted_by_pt(inclusive_jets(ptmin));
   for (unsigned i=0; i<jets_local.size(); i++) {
-     PseudoJet sub_jet = _subtracted_jet(jets_local[i],rho);
+     PseudoJet sub_jet = subtracted_jet(jets_local[i],rho);
      sub_jets.push_back(sub_jet);
   }
@@ -360,14 +302,14 @@
 }
 
-// return a vector of subtracted jets, using area_4vector.
-// Only inclusive_jets above ptmin are subtracted and returned.
-// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
-// i.e. not necessarily ordered in pt once subtracted
+/// return a vector of subtracted jets, using area_4vector.
+/// Only inclusive_jets above ptmin are subtracted and returned.
+/// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
+/// i.e. not necessarily ordered in pt once subtracted
 vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(
                                                  const Selector & selector, 
 						 const double ptmin)
 						 const {
-  double rho = _median_pt_per_unit_area_4vector(selector);
-  return _subtracted_jets(rho,ptmin);
+  double rho = median_pt_per_unit_area_4vector(selector);
+  return subtracted_jets(rho,ptmin);
 }
 
@@ -376,9 +318,4 @@
 PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet,
                                                   const double rho) const {
-  return _subtracted_jet(jet, rho);
-}
-
-PseudoJet ClusterSequenceAreaBase::_subtracted_jet(const PseudoJet & jet,
-                                                   const double rho) const {
   PseudoJet area4vect = area_4vector(jet);
   PseudoJet sub_jet;
@@ -404,11 +341,6 @@
 PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet,
                                        const Selector & selector) const {
-  return _subtracted_jet(jet, selector);
-}
-
-PseudoJet ClusterSequenceAreaBase::_subtracted_jet(const PseudoJet & jet,
-                                       const Selector & selector) const {
-  double rho = _median_pt_per_unit_area_4vector(selector);
-  PseudoJet sub_jet = _subtracted_jet(jet, rho);
+  double rho = median_pt_per_unit_area_4vector(selector);
+  PseudoJet sub_jet = subtracted_jet(jet, rho);
   return sub_jet;
 }
@@ -419,12 +351,6 @@
                                               const double rho,
                                               bool use_area_4vector) const {
-  return _subtracted_pt(jet, rho, use_area_4vector);
-}
-
-double ClusterSequenceAreaBase::_subtracted_pt(const PseudoJet & jet,
-                                              const double rho,
-                                              bool use_area_4vector) const {
   if ( use_area_4vector ) { 
-     PseudoJet sub_jet = _subtracted_jet(jet,rho);
+     PseudoJet sub_jet = subtracted_jet(jet,rho);
      return sub_jet.perp();
   } else {
@@ -441,9 +367,9 @@
                                               bool use_area_4vector) const {
   if ( use_area_4vector ) { 
-     PseudoJet sub_jet = _subtracted_jet(jet,selector);
+     PseudoJet sub_jet = subtracted_jet(jet,selector);
      return sub_jet.perp();
   } else {
-     double rho = _median_pt_per_unit_area(selector);
-     return _subtracted_pt(jet,rho,false);
+     double rho = median_pt_per_unit_area(selector);
+     return subtracted_pt(jet,rho,false);
   }
 }  
Index: external/fastjet/ClusterSequenceAreaBase.hh
===================================================================
--- external/fastjet/ClusterSequenceAreaBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceAreaBase.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceAreaBase.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: ClusterSequenceAreaBase.hh 2687 2011-11-14 11:17:51Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEAREABASE_HH__
@@ -35,5 +33,4 @@
 #include "fastjet/LimitedWarning.hh"
 #include "fastjet/Selector.hh"
-#include "fastjet/internal/deprecated.hh"
 
 FASTJET_BEGIN_NAMESPACE
@@ -145,5 +142,4 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::median_pt_per_unit_area(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   double median_pt_per_unit_area(const Selector & selector) const;
 
@@ -153,5 +149,4 @@
   /// The selector passed as an argument has to have a finite area and
   /// apply jet-by-jet
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::median_pt_per_unit_area_4vector(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   double median_pt_per_unit_area_4vector(const Selector & selector) const;
   
@@ -160,7 +155,6 @@
   /// - something_is_area_4vect = false -> use plain area
   /// - something_is_area_4vect = true  -> use 4-vector area
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::median_pt_per_unit_something(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
-  double median_pt_per_unit_something(const Selector & selector,
-                                      bool use_area_4vector) const;
+  double median_pt_per_unit_something(
+                    const Selector & selector, bool use_area_4vector) const;
 
   /// using jets withing the selector range (and with 4-vector areas if
@@ -188,5 +182,4 @@
   /// using a scalar area causes one to neglect terms of relative
   /// order $R^2/8$ in the jet $p_t$.
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::get_median_rho_and_sigma(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void get_median_rho_and_sigma(const Selector & selector, 
                                         bool use_area_4vector,
@@ -213,5 +206,4 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::get_median_rho_and_sigma(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void get_median_rho_and_sigma(const std::vector<PseudoJet> & all_jets,
 					const Selector & selector, 
@@ -227,9 +219,10 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::get_median_rho_and_sigma(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void get_median_rho_and_sigma(const Selector & selector, 
-                                        bool use_area_4vector,
-                                        double & median, double & sigma) const{
-    return _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma);
+                                bool use_area_4vector,
+                                double & median, double & sigma) const {
+    double mean_area;
+    get_median_rho_and_sigma(selector,  use_area_4vector,
+                             median,  sigma, mean_area);
   }
   
@@ -243,5 +236,4 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  //FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::parabolic_pt_per_unit_area(...) is deprecated since FastJet 3.0. Use the BackgroundEstimator series of tools instead")
   virtual void parabolic_pt_per_unit_area(double & a, double & b, 
                                           const Selector & selector, 
@@ -253,5 +245,4 @@
   /// the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),
   /// i.e. not necessarily ordered in pt once subtracted
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::subtracted_jets(...) is deprecated since FastJet 3.0. Use the Subtractor tool (with the BackgroundEstimator series of tools) instead")
   std::vector<PseudoJet> subtracted_jets(const double rho,
                                          const double ptmin=0.0) const;
@@ -265,10 +256,8 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::subtracted_jets(...) is deprecated since FastJet 3.0. Use the Subtractor tool (with the BackgroundEstimator series of tools) instead")
   std::vector<PseudoJet> subtracted_jets(const Selector & selector, 
                                          const double ptmin=0.0) const;
 
   /// return a subtracted jet, using area_4vector, given rho
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::subtracted_jet(...) is deprecated since FastJet 3.0. Use the Subtractor tool (with the BackgroundEstimator series of tools) instead")
   PseudoJet subtracted_jet(const PseudoJet & jet,
                            const double rho) const;
@@ -282,10 +271,8 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::subtracted_jet(...) is deprecated since FastJet 3.0. Use the Subtractor tool (with the BackgroundEstimator series of tools) instead")
   PseudoJet subtracted_jet(const PseudoJet & jet,
                            const Selector & selector) const;
 
   /// return the subtracted pt, given rho
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::subtracted_pt(...) is deprecated since FastJet 3.0. Use the Subtractor tool (with the BackgroundEstimator series of tools) instead")
   double subtracted_pt(const PseudoJet & jet,
                        const double rho,
@@ -299,5 +286,4 @@
   /// apply jet-by-jet (see the BackgroundEstimator and Subtractor
   /// tools for more generic usages)
-  FASTJET_DEPRECATED_MSG("ClusterSequenceAreaBase::subtracted_pt(...) is deprecated since FastJet 3.0. Use the Subtractor tool (with the BackgroundEstimator series of tools) instead")
   double subtracted_pt(const PseudoJet & jet,
                        const Selector & selector,
@@ -308,31 +294,4 @@
   void _check_selector_good_for_median(const Selector &selector) const;
 
-  // the following set of protected methods are all deprecated. Their
-  // role is simply to hide the corresponding methods (without the
-  // first underscore) from the public interface so that they can be
-  // used internally until all the deprecated methods are removed.
-  // DO NOT USE ANY OF THESE METHODS: THEY ARE DEPRECATED AND WILL BE
-  // REMOVED.
-  virtual void _get_median_rho_and_sigma(const Selector & selector, 
-                                         bool use_area_4vector,
-                                         double & median, double & sigma,
-                                         double & mean_area) const;
-  virtual void _get_median_rho_and_sigma(const std::vector<PseudoJet> & all_jets,
-                                         const Selector & selector, 
-                                         bool use_area_4vector,
-                                         double & median, double & sigma,
-                                         double & mean_area,
-                                         bool all_are_inclusive = false) const;
-  virtual void _get_median_rho_and_sigma(const Selector & selector, 
-                                         bool use_area_4vector,
-                                         double & median, double & sigma) const {
-    double mean_area;
-    _get_median_rho_and_sigma(selector,  use_area_4vector,
-                              median,  sigma, mean_area);
-  }
-  virtual void _parabolic_pt_per_unit_area(double & a, double & b, 
-                                           const Selector & selector, 
-                                           double exclude_above=-1.0, 
-                                           bool use_area_4vector=false) const;
 
 private:
@@ -344,24 +303,5 @@
   /// check the jet algorithm is suitable (and if not issue a warning)
   void _check_jet_alg_good_for_median() const;
-
-  // the following set of private methods are all deprecated. Their
-  // role is simply to hide the corresponding methods (without the
-  // first underscore) from the public interface so that they can be
-  // used internally until all the deprecated methods are removed.
-  // DO NOT USE ANY OF THESE METHODS: THEY ARE DEPRECATED AND WILL BE
-  // REMOVED.
-  double _median_pt_per_unit_area(const Selector & selector) const;
-  double _median_pt_per_unit_area_4vector(const Selector & selector) const;
-  double _median_pt_per_unit_something(const Selector & selector,
-                                       bool use_area_4vector) const;
-  std::vector<PseudoJet> _subtracted_jets(const double rho,
-                                          const double ptmin=0.0) const;
-  PseudoJet _subtracted_jet(const PseudoJet & jet,
-                            const double rho) const;
-  PseudoJet _subtracted_jet(const PseudoJet & jet,
-                            const Selector & selector) const;
-  double _subtracted_pt(const PseudoJet & jet,
-                        const double rho,
-                        bool use_area_4vector=false) const;
+  
 };
 
Index: external/fastjet/ClusterSequencePassiveArea.cc
===================================================================
--- external/fastjet/ClusterSequencePassiveArea.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequencePassiveArea.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequencePassiveArea.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequencePassiveArea.hh"
Index: external/fastjet/ClusterSequencePassiveArea.hh
===================================================================
--- external/fastjet/ClusterSequencePassiveArea.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequencePassiveArea.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequencePassiveArea.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ClusterSequencePassiveArea.hh 2687 2011-11-14 11:17:51Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEPASSIVEAREA_HH__
@@ -65,5 +63,5 @@
   /// return an empty area that's appropriate to the passive area
   /// determination carried out
-  virtual double empty_area(const Selector & selector) const FASTJET_OVERRIDE;
+  virtual double empty_area(const Selector & selector) const;
 
 private:
Index: external/fastjet/ClusterSequenceStructure.cc
===================================================================
--- external/fastjet/ClusterSequenceStructure.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceStructure.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceStructure.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequenceStructure.hh"
@@ -33,7 +31,5 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
-#ifndef __FJCORE__
 #include "fastjet/ClusterSequenceAreaBase.hh"
-#endif  // __FJCORE__
 #include <iostream>
 
@@ -259,5 +255,4 @@
 //----------------------------------------------------------------------
 
-#ifndef __FJCORE__
 // if possible, return a valid ClusterSequenceAreaBase pointer; otherwise
 // throw an error
@@ -268,4 +263,5 @@
 }
 
+
 // check if it has a defined area
 bool ClusterSequenceStructure::has_area() const{
@@ -299,6 +295,4 @@
 }
 
-#endif  // __FJCORE__
-
 
 
Index: external/fastjet/ClusterSequenceStructure.hh
===================================================================
--- external/fastjet/ClusterSequenceStructure.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceStructure.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceStructure.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: ClusterSequenceStructure.hh 2577 2011-09-13 15:11:38Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -76,7 +74,5 @@
 
   /// description
-  virtual std::string description() const FASTJET_OVERRIDE{
-    return "PseudoJet with an associated ClusterSequence";
-  }
+  virtual std::string description() const{ return "PseudoJet with an associated ClusterSequence"; }
 
   //-------------------------------------------------------------
@@ -87,22 +83,20 @@
   //-------------------------------------------------------------
   /// returns true if there is an associated ClusterSequence
-  virtual bool has_associated_cluster_sequence() const FASTJET_OVERRIDE{ return true;}
+  virtual bool has_associated_cluster_sequence() const{ return true;}
 
   /// get a (const) pointer to the parent ClusterSequence (NULL if
   /// inexistent)
-  virtual const ClusterSequence* associated_cluster_sequence() const FASTJET_OVERRIDE;
+  virtual const ClusterSequence* associated_cluster_sequence() const;
   
   /// returns true if there is a valid associated ClusterSequence
-  virtual bool has_valid_cluster_sequence() const FASTJET_OVERRIDE;
+  virtual bool has_valid_cluster_sequence() const;
 
   /// if the jet has a valid associated cluster sequence then return a
   /// pointer to it; otherwise throw an error
-  virtual const ClusterSequence * validated_cs() const FASTJET_OVERRIDE;
-
-#ifndef __FJCORE__
+  virtual const ClusterSequence * validated_cs() const;
+
   /// if the jet has valid area information then return a pointer to
   /// the associated ClusterSequenceAreaBase object; otherwise throw an error
-  virtual const ClusterSequenceAreaBase * validated_csab() const FASTJET_OVERRIDE;
-#endif  // __FJCORE__
+  virtual const ClusterSequenceAreaBase * validated_csab() const;
 
   /// set the associated csw
@@ -127,5 +121,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual bool has_partner(const PseudoJet &reference, PseudoJet &partner) const FASTJET_OVERRIDE;
+  virtual bool has_partner(const PseudoJet &reference, PseudoJet &partner) const;
 
   /// check if it has been recombined with another PseudoJet in which
@@ -135,5 +129,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual bool has_child(const PseudoJet &reference, PseudoJet &child) const FASTJET_OVERRIDE;
+  virtual bool has_child(const PseudoJet &reference, PseudoJet &child) const;
 
   /// check if it is the product of a recombination, in which case
@@ -143,5 +137,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual bool has_parents(const PseudoJet &reference, PseudoJet &parent1, PseudoJet &parent2) const FASTJET_OVERRIDE;
+  virtual bool has_parents(const PseudoJet &reference, PseudoJet &parent1, PseudoJet &parent2) const;
 
   /// check if the reference PseudoJet is contained in the second one
@@ -153,5 +147,5 @@
   /// false is returned if the 2 PseudoJet do not belong the same
   /// ClusterSequence
-  virtual bool object_in_jet(const PseudoJet &reference, const PseudoJet &jet) const FASTJET_OVERRIDE;
+  virtual bool object_in_jet(const PseudoJet &reference, const PseudoJet &jet) const;
 
   /// return true if the structure supports constituents. 
@@ -159,5 +153,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual bool has_constituents() const FASTJET_OVERRIDE;
+  virtual bool has_constituents() const;
 
   /// retrieve the constituents. 
@@ -165,5 +159,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual std::vector<PseudoJet> constituents(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual std::vector<PseudoJet> constituents(const PseudoJet &reference) const;
 
 
@@ -172,5 +166,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual bool has_exclusive_subjets() const FASTJET_OVERRIDE;
+  virtual bool has_exclusive_subjets() const;
 
   /// return a vector of all subjets of the current jet (in the sense
@@ -185,5 +179,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual std::vector<PseudoJet> exclusive_subjets(const PseudoJet &reference, const double & dcut) const FASTJET_OVERRIDE;
+  virtual std::vector<PseudoJet> exclusive_subjets(const PseudoJet &reference, const double & dcut) const;
 
   /// return the size of exclusive_subjets(...); still n ln n with same
@@ -193,5 +187,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual int n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const FASTJET_OVERRIDE;
+  virtual int n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const;
 
   /// return the list of subjets obtained by unclustering the supplied
@@ -203,5 +197,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual std::vector<PseudoJet> exclusive_subjets_up_to (const PseudoJet &reference, int nsub) const FASTJET_OVERRIDE;
+  virtual std::vector<PseudoJet> exclusive_subjets_up_to (const PseudoJet &reference, int nsub) const;
 
   /// return the dij that was present in the merging nsub+1 -> nsub 
@@ -210,5 +204,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual double exclusive_subdmerge(const PseudoJet &reference, int nsub) const FASTJET_OVERRIDE;
+  virtual double exclusive_subdmerge(const PseudoJet &reference, int nsub) const;
 
   /// return the maximum dij that occurred in the whole event at the
@@ -218,5 +212,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  virtual double exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const FASTJET_OVERRIDE;
+  virtual double exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const;
 
 
@@ -226,5 +220,5 @@
   /// by convention, a jet associated with a ClusterSequence will have
   /// its parents as pieces
-  virtual bool has_pieces(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual bool has_pieces(const PseudoJet &reference) const;
 
   /// by convention, a jet associated with a ClusterSequence will have
@@ -237,5 +231,5 @@
   /// sequence. If the cluster sequence has gone out of scope, an
   /// error will be thrown
-  virtual std::vector<PseudoJet> pieces(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual std::vector<PseudoJet> pieces(const PseudoJet &reference) const;
 
 
@@ -243,27 +237,25 @@
   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
   //------------------------------------------------------------------
-#ifndef __FJCORE__
 
   /// check if it has a defined area
-  virtual bool has_area() const FASTJET_OVERRIDE;
+  virtual bool has_area() const;
 
   /// return the jet (scalar) area.
   /// throws an Error if there is no support for area in the parent CS
-  virtual double area(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual double area(const PseudoJet &reference) const;
 
   /// return the error (uncertainty) associated with the determination
   /// of the area of this jet.
   /// throws an Error if there is no support for area in the parent CS
-  virtual double area_error(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual double area_error(const PseudoJet &reference) const;
 
   /// return the jet 4-vector area.
   /// throws an Error if there is no support for area in the parent CS
-  virtual PseudoJet area_4vector(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual PseudoJet area_4vector(const PseudoJet &reference) const;
 
   /// true if this jet is made exclusively of ghosts.
   /// throws an Error if there is no support for area in the parent CS
-  virtual bool is_pure_ghost(const PseudoJet &reference) const FASTJET_OVERRIDE;
-
-#endif  // __FJCORE__
+  virtual bool is_pure_ghost(const PseudoJet &reference) const;
+
   //\} --- end of jet structure -------------------------------------
 
Index: external/fastjet/ClusterSequenceVoronoiArea.cc
===================================================================
--- external/fastjet/ClusterSequenceVoronoiArea.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceVoronoiArea.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,9 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceVoronoiArea.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2006-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2006-2007 Matteo Cacciari, Gavin Salam and Gregory Soyez
+//
+//----------------------------------------------------------------------
+// This file is part of a simple command-line handling environment
 //
 //  FastJet is free software; you can redistribute it and/or modify
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequenceVoronoiArea.hh"
@@ -278,5 +276,4 @@
   //  -- first the initial ones
   _voronoi_area.reserve(2*n_particles());
-  _voronoi_area_4vector.reserve(2*n_particles());
   for (unsigned int i=0; i<n_particles(); i++) {
     _voronoi_area.push_back(_pa_calc->area(i));
Index: external/fastjet/ClusterSequenceVoronoiArea.hh
===================================================================
--- external/fastjet/ClusterSequenceVoronoiArea.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceVoronoiArea.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceVoronoiArea.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ClusterSequenceVoronoiArea.hh 2687 2011-11-14 11:17:51Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEVORONOIAREA_HH__
@@ -65,17 +63,17 @@
 
   /// return the area associated with the given jet
-  virtual inline double area(const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual inline double area(const PseudoJet & jet) const {
     return _voronoi_area[jet.cluster_hist_index()];}
 
-  /// return a 4-vector area associated with the given jet -- strictly
+  /// return a 4-vector area associated with the given jet -- stricly
   /// this is not the exact 4-vector area, but rather an approximation
   /// made of sums of centres of all Voronoi cells in jet, each
   /// contributing with a normalisation equal to the area of the cell
-  virtual inline PseudoJet area_4vector(const PseudoJet & jet) const FASTJET_OVERRIDE {
+  virtual inline PseudoJet area_4vector(const PseudoJet & jet) const {
     return _voronoi_area_4vector[jet.cluster_hist_index()];}
 
   /// return the error of the area associated with the given jet
   /// (0 by definition for a voronoi area)
-  virtual inline double area_error(const PseudoJet & /*jet*/) const FASTJET_OVERRIDE {
+  virtual inline double area_error(const PseudoJet & /*jet*/) const {
     return 0.0;}
 
Index: external/fastjet/ClusterSequenceWithArea.hh
===================================================================
--- external/fastjet/ClusterSequenceWithArea.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequenceWithArea.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequenceWithArea.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ClusterSequenceWithArea.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2006-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2006-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLUSTERSEQUENCEWITHAREA_HH__
Index: external/fastjet/ClusterSequence_CP2DChan.cc
===================================================================
--- external/fastjet/ClusterSequence_CP2DChan.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence_CP2DChan.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence_CP2DChan.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequence.hh"
@@ -46,6 +44,6 @@
   public:
     int orig, mirror;
-    MirrorInfo(int a, int b) : orig(a), mirror(b) {}
-    MirrorInfo() : orig(0), mirror(0) {} // set dummy values to keep static code checkers happy
+    MirrorInfo(int a, int b) : orig(a), mirror(b) {};
+    MirrorInfo() {};
   };
 
Index: external/fastjet/ClusterSequence_Delaunay.cc
===================================================================
--- external/fastjet/ClusterSequence_Delaunay.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence_Delaunay.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence_Delaunay.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -33,5 +31,4 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
-#include "fastjet/internal/DynamicNearestNeighbours.hh"
 #include<iostream>
 #include<sstream>
@@ -69,7 +66,7 @@
 
   // initialise our DNN structure with the set of points
-  SharedPtr<DynamicNearestNeighbours> DNN;
-  const bool verbose = false;
+  auto_ptr<DynamicNearestNeighbours> DNN;
 #ifndef DROP_CGAL // strategy = NlnN* are not supported if we drop CGAL...
+  bool verbose = false;
   bool ignore_nearest_is_mirror = (_Rparam < twopi);
   if (_strategy == NlnN4pi) {
@@ -87,15 +84,11 @@
     throw Error(err.str());
     //assert(false);
-  } else
+  }
 #endif // DROP_CGAL
   {
-    //ostringstream err;
-    //err << "ERROR: Unrecognized value for strategy: "<<_strategy<<endl;
-    //throw Error(err.str());
-    //-----------------------------------------------------------------
-    // The code should never reach this point, because the checks above
-    // should always handle all _strategy values for which 
-    // _delaunay_cluster() is called 
+    ostringstream err;
+    err << "ERROR: Unrecognized value for strategy: "<<_strategy<<endl;
     assert(false);
+    throw Error(err.str());
   }
 
@@ -126,5 +119,4 @@
       jet_i = SmallestDijPair.first;
       jet_j = SmallestDijPair.second;
-      if (verbose) cout << "CS_Delaunay found recombination candidate: " << jet_i << " " << jet_j << " " << SmallestDij << endl; // GPS debugging
       // distance is immediately removed regardless of whether or not
       // it is used.
@@ -140,5 +132,5 @@
       if (!recombine_with_beam) {Valid2 = DNN->Valid(jet_j);} 
       else {Valid2 = true;}
-      if (verbose) cout << "CS_Delaunay validities i & j: " << DNN->Valid(jet_i) << " " << Valid2 << endl;
+
     } while ( !DNN->Valid(jet_i) || !Valid2);
 
@@ -149,5 +141,4 @@
     if (! recombine_with_beam) {
       int nn; // will be index of new jet
-      if (verbose) cout << "CS_Delaunay call _do_ij_recomb: " << jet_i << " " << jet_j << " " << SmallestDij << endl; // GPS debug
       _do_ij_recombination_step(jet_i, jet_j, SmallestDij, nn);
       //OBS // merge the two jets, add new jet, remove old ones
@@ -171,5 +162,4 @@
     } else {
       // recombine the jet with the beam
-      if (verbose) cout << "CS_Delaunay call _do_iB_recomb: " << jet_i << " " << SmallestDij << endl; // GPS debug
       _do_iB_recombination_step(jet_i, SmallestDij);
       //OBS _add_step_to_history(n+i,_jets[jet_i].cluster_hist_index(),BeamJet,
@@ -226,5 +216,5 @@
 ///
 void ClusterSequence::_add_ktdistance_to_map(
-                          const int ii, 
+                          const int & ii, 
 			  DistMap & DijMap,
 			  const DynamicNearestNeighbours * DNN) {
Index: external/fastjet/ClusterSequence_DumbN3.cc
===================================================================
--- external/fastjet/ClusterSequence_DumbN3.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence_DumbN3.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence_DumbN3.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/ClusterSequence_N2.cc
===================================================================
--- external/fastjet/ClusterSequence_N2.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence_N2.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence_N2.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/ClusterSequence_TiledN2.cc
===================================================================
--- external/fastjet/ClusterSequence_TiledN2.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/ClusterSequence_TiledN2.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClusterSequence_TiledN2.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,8 +25,8 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
-
-
-// The tiled N^2 part of the ClusterSequence class -- separated out
+//ENDHEADER
+
+
+// The plain N^2 part of the ClusterSequence class -- separated out
 // from the rest of the class implementation so as to speed up
 // compilation of this particular part while it is under test.
@@ -41,5 +39,4 @@
 #include "fastjet/ClusterSequence.hh"
 #include "fastjet/internal/MinHeap.hh"
-#include "fastjet/internal/TilingExtent.hh"
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -97,24 +94,20 @@
   _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
 
-  TilingExtent tiling_analysis(*this);
-  _tiles_eta_min = tiling_analysis.minrap();
-  _tiles_eta_max = tiling_analysis.maxrap();
-
-  // // always include zero rapidity in the tiling region
-  // _tiles_eta_min = 0.0;
-  // _tiles_eta_max = 0.0;
-  // // but go no further than following
-  // const double maxrap = 7.0;
-  // 
-  // // and find out how much further one should go
-  // for(unsigned int i = 0; i < _jets.size(); i++) {
-  //   double eta = _jets[i].rap();
-  //   // first check if eta is in range -- to avoid taking into account
-  //   // very spurious rapidities due to particles with near-zero kt.
-  //   if (abs(eta) < maxrap) {
-  //     if (eta < _tiles_eta_min) {_tiles_eta_min = eta;}
-  //     if (eta > _tiles_eta_max) {_tiles_eta_max = eta;}
-  //   }
-  // }
+  // always include zero rapidity in the tiling region
+  _tiles_eta_min = 0.0;
+  _tiles_eta_max = 0.0;
+  // but go no further than following
+  const double maxrap = 7.0;
+
+  // and find out how much further one should go
+  for(unsigned int i = 0; i < _jets.size(); i++) {
+    double eta = _jets[i].rap();
+    // first check if eta is in range -- to avoid taking into account
+    // very spurious rapidities due to particles with near-zero kt.
+    if (abs(eta) < maxrap) {
+      if (eta < _tiles_eta_min) {_tiles_eta_min = eta;}
+      if (eta > _tiles_eta_max) {_tiles_eta_max = eta;}
+    }
+  }
 
   // now adjust the values
@@ -174,5 +167,5 @@
 //----------------------------------------------------------------------
 /// return the tile index corresponding to the given eta,phi point
-int ClusterSequence::_tile_index(const double eta, const double phi) const {
+int ClusterSequence::_tile_index(const double & eta, const double & phi) const {
   int ieta, iphi;
   if      (eta <= _tiles_eta_min) {ieta = 0;}
@@ -256,21 +249,4 @@
 /// their "tagged" status is false; when a neighbour is added its
 /// tagged status is set to true.
-///
-/// Note that with a high level of warnings (-pedantic -Wextra -ansi,
-/// gcc complains about tile_index maybe being used uninitialised for
-/// oldB in ClusterSequence::_minheap_faster_tiled_N2_cluster(). We
-/// have explicitly checked that it was harmless so we could disable
-/// the gcc warning by hand using the construct below
-///
-///  #pragma GCC diagnostic push
-///  #pragma GCC diagnostic ignored "-Wpragmas"
-///  #pragma GCC diagnostic ignored "-Wuninitialized"
-///  #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-///    ...
-///  #pragma GCC diagnostic pop
-///
-/// the @GCC diagnostic push/pop directive was only introduced in
-/// gcc-4.6, so for broader usage, we'd need to insert #pragma GCC
-/// diagnostic ignored "-Wpragmas" at the top of this file
 inline void ClusterSequence::_add_untagged_neighbours_to_tile_union(
                const int tile_index, 
@@ -298,5 +274,5 @@
   TiledJet * jetA = briefjets, * jetB;
   TiledJet oldB;
-  oldB.tile_index=0; // prevents a gcc warning
+  
 
   // will be used quite deep inside loops, but declare it here so that
@@ -541,5 +517,5 @@
   TiledJet * jetA = briefjets, * jetB;
   TiledJet oldB;
-  oldB.tile_index=0; // prevents a gcc warning
+  
 
   // will be used quite deep inside loops, but declare it here so that
@@ -579,4 +555,5 @@
     // when we set NN for both jetA and jetB on the RH tiles.
   }
+
   
   // now create the diJ (where J is i's NN) table -- remember that 
@@ -744,4 +721,6 @@
 }
 
+
+
 //----------------------------------------------------------------------
 /// run a tiled clustering, with our minheap for keeping track of the
@@ -755,5 +734,5 @@
   TiledJet * jetA = briefjets, * jetB;
   TiledJet oldB;
-  oldB.tile_index=0; // prevents a gcc warning
+  
 
   // will be used quite deep inside loops, but declare it here so that
Index: external/fastjet/CompositeJetStructure.cc
===================================================================
--- external/fastjet/CompositeJetStructure.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/CompositeJetStructure.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CompositeJetStructure.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/CompositeJetStructure.hh>
@@ -47,6 +45,4 @@
 					     const JetDefinition::Recombiner * recombiner)
   : _pieces(initial_pieces){
-
-#ifndef __FJCORE__
   // deal with area support (cache the area if needed)
   //--------------------------------------------------
@@ -72,8 +68,4 @@
     _area_4vector_ptr = 0;
   }
-#else
-  if (recombiner){};  // ugly trick to prevent a gcc warning
-  _area_4vector_ptr = 0;
-#endif
 
 }
@@ -123,5 +115,4 @@
 
 
-#ifndef __FJCORE__
 // area-related material
 
@@ -153,5 +144,5 @@
   double a_err=0;
   for (unsigned i = 0; i < _pieces.size(); i++)
-    a_err += _pieces[i].area_error();
+    a_err += _pieces[i].area();
 
   return a_err;
@@ -176,5 +167,4 @@
 }
 
-#endif  // __FJCORE__
 
 
Index: external/fastjet/CompositeJetStructure.hh
===================================================================
--- external/fastjet/CompositeJetStructure.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/CompositeJetStructure.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CompositeJetStructure.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: CompositeJetStructure.hh 2684 2011-11-14 07:41:44Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -64,5 +62,5 @@
 
   /// description
-  virtual std::string description() const FASTJET_OVERRIDE;
+  virtual std::string description() const;
 
   // things reimplemented from the base structure
@@ -70,5 +68,5 @@
   /// true unless the jet has no pieces (see also the description of
   /// constituents() below)
-  virtual bool has_constituents() const FASTJET_OVERRIDE;
+  virtual bool has_constituents() const;
 
   /// return the constituents (i.e. the union of the constituents of each piece)
@@ -78,5 +76,5 @@
   /// Note that as a consequence, a composite jet with no pieces will
   /// have an empty vector as constituents
-  virtual std::vector<PseudoJet> constituents(const PseudoJet &jet) const FASTJET_OVERRIDE;
+  virtual std::vector<PseudoJet> constituents(const PseudoJet &jet) const;
 
   //-------------------------------------------------------------------
@@ -84,17 +82,16 @@
   //-------------------------------------------------------------------
   /// true if it has pieces (always the case)
-  virtual bool has_pieces(const PseudoJet & /*jet*/) const FASTJET_OVERRIDE {return true;}
+  virtual bool has_pieces(const PseudoJet & /*jet*/) const {return true;}
 
   /// returns the pieces
-  virtual std::vector<PseudoJet> pieces(const PseudoJet &jet) const FASTJET_OVERRIDE;
+  virtual std::vector<PseudoJet> pieces(const PseudoJet &jet) const;
 
   // area-related material
-#ifndef __FJCORE__
 
   /// check if it has a well-defined area
-  virtual bool has_area() const FASTJET_OVERRIDE;
+  virtual bool has_area() const;
 
   /// return the jet (scalar) area.
-  virtual double area(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual double area(const PseudoJet &reference) const;
 
   /// return the error (uncertainty) associated with the determination
@@ -102,38 +99,21 @@
   ///
   /// Be conservative: return the sum of the errors
-  virtual double area_error(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual double area_error(const PseudoJet &reference) const;
 
   /// return the jet 4-vector area.
-  virtual PseudoJet area_4vector(const PseudoJet &reference) const FASTJET_OVERRIDE;
+  virtual PseudoJet area_4vector(const PseudoJet &reference) const;
 
   /// true if this jet is made exclusively of ghosts.
   ///
   /// In this case, it will be true if all pieces are pure ghost
-  virtual bool is_pure_ghost(const PseudoJet &reference) const FASTJET_OVERRIDE;
-
-  //unused: // allows one to modify the area information
-  //unused: // (for use in join())
-  //unused: //
-  //unused: // This member cannot be used by users who need to create a jet with
-  //unused: // user-supplied area information, because it sets only the 4-vector
-  //unused: // part of the area, but not all the other area information
-  //unused: // (e.g. scalar area) -- that other information is always deduced
-  //unused: // dynamically from the individual constituents.
-  //unused: // ------------------------------------------------------------------------------
-  //unused: void set_area_information(PseudoJet *area_4vector_ptr){
-  //unused:   _area_4vector_ptr = area_4vector_ptr;
-  //unused: }
-
-  /// disable the area of the composite jet
-  /// 
-  /// this can be used e.g. to discard the area of a composite jet
-  /// made of pieces with non-explicit-ghost area since the area may
-  /// by erroneous in that case
-  void discard_area(){
-    if (_area_4vector_ptr) delete _area_4vector_ptr;
-    _area_4vector_ptr = 0;
+  virtual bool is_pure_ghost(const PseudoJet &reference) const;
+
+  // allow to modify the area information
+  // (for use in join())
+  //------------------------------------------------------------------------------
+  void set_area_information(PseudoJet *area_4vector_ptr){
+    _area_4vector_ptr = area_4vector_ptr;
   }
 
-#endif  // __FJCORE__
 
 protected:
@@ -244,5 +224,4 @@
 				    const JetDefinition::Recombiner & recombiner){
   std::vector<PseudoJet> pieces;
-  pieces.reserve(2);
   pieces.push_back(j1);
   pieces.push_back(j2);
@@ -256,5 +235,4 @@
 				    const JetDefinition::Recombiner & recombiner){
   std::vector<PseudoJet> pieces;
-  pieces.reserve(3);
   pieces.push_back(j1);
   pieces.push_back(j2);
@@ -269,5 +247,4 @@
 				    const JetDefinition::Recombiner & recombiner){
   std::vector<PseudoJet> pieces;
-  pieces.reserve(4);
   pieces.push_back(j1);
   pieces.push_back(j2);
Index: external/fastjet/Dnn2piCylinder.cc
===================================================================
--- external/fastjet/Dnn2piCylinder.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Dnn2piCylinder.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Dnn2piCylinder.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/Dnn3piCylinder.cc
===================================================================
--- external/fastjet/Dnn3piCylinder.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Dnn3piCylinder.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Dnn3piCylinder.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/Dnn4piCylinder.cc
===================================================================
--- external/fastjet/Dnn4piCylinder.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Dnn4piCylinder.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Dnn4piCylinder.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/DnnPlane.cc
===================================================================
--- external/fastjet/DnnPlane.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/DnnPlane.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: DnnPlane.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -35,10 +33,7 @@
 #include<list>
 #include "fastjet/internal/DnnPlane.hh"
-
 using namespace std;
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-const double DnnPlane::DISTANCE_FOR_CGAL_CHECKS=1.0e-12;  
 
 
@@ -58,38 +53,12 @@
        _TR.insert(Point(input_points[i].first, input_points[i].second));
 
-    // check if we are dealing with coincident vertices
-    int coinciding_index = _CheckIfVertexPresent(sv.vertex, i);
-    if (coinciding_index == i){
-      // we need to associate an index to each vertex -- thus when we get
-      // a vertex (e.g. as a nearest neighbour) from CGAL, we will be
-      // able to figure out which particle it corresponded to.
-      sv.vertex->info() = sv.coincidence = i;
-    } else {
-      //cout << "  coincident with " << coinciding_index << endl;
-      // the new vertex points to the already existing one and we
-      // record the coincidence
-      //
-      // Note that we must not only set the coincidence of the
-      // currently-added particle, the one it coincides with also
-      // needs be updated (taking into account that it might already
-      // coincide with another one)
-      //
-      // An example may help. Say coinciding_index = i1 and we're adding i2==i.
-      // Then _sv[i2].coincidence = i1; _sv[i1].coincidence = i2. In both
-      // cases sv.vertex->info() == i1;
-      //
-      // Later on we add i3; we find out that its coinciding index is i1;
-      // so we set _sv[i3].coincidence = i2 and sv[i1].coincidence = i3. 
-      //
-      // This gives us the structure 
-      //  _supervertex[i1].coincidence == in
-      //  _supervertex[i2].coincidence == i1
-      //  ...
-      //  _supervertex[in].coincidence == in-1
-      //
-      sv.coincidence = _supervertex[coinciding_index].coincidence; // handles cases with previous coincidences
-      _supervertex[coinciding_index].coincidence = i;
-    }
-      
+    // we are not up to dealing with coincident vertices, so make 
+    // sure the user knows!
+    _CrashIfVertexPresent(sv.vertex, i);
+    
+    // we need to assicate an index to each vertex -- thus when we get
+    // a vertex (e.g. as a nearest neighbour) from CGAL, we will be
+    // able to figure out which particle it corresponded to.
+    sv.vertex->info() = i;
     _supervertex.push_back(sv);    
   }
@@ -107,6 +76,8 @@
 /// Crashes if the given vertex handle already exists. Otherwise
 /// it does the bookkeeping for future such tests
-int DnnPlane::_CheckIfVertexPresent(
-	const Vertex_handle & vertex, const int its_index) {
+void DnnPlane::_CrashIfVertexPresent(
+	const Vertex_handle & vertex, const int & its_index) {
+  if (!_crash_on_coincidence) return;
+
   // vertices that do not have the same geometric position as any
   // other vertex so far added have info().val() == NEW_VERTEX -- this
@@ -119,15 +90,10 @@
   // DNN:DNN) to be equal to a vertex "index".
   if (vertex->info().val() != NEW_VERTEX) {
-    if (_crash_on_coincidence){
-      ostringstream err;
-      err << "Error: DnnPlane::_CheckIfVertexPresent"
-	  << "Point "<<its_index<<" coincides with point "
-	  <<vertex->info().val() << endl;
-      throw DnnError(err.str());
-    }
-    return vertex->info().val();
-  }
-
-  return its_index;
+    ostringstream err;
+    err << "ERROR in DnnPlane::_CrashIfVertexPresent"
+	 <<endl << "Point "<<its_index<<" coincides with point "
+	 <<vertex->info().val() << endl;
+    throw DnnError(err.str());
+  } 
 }
 
@@ -150,5 +116,4 @@
 			  vector<int> & indices_of_updated_neighbours) {
 
-  if (_verbose) cout << "Starting  DnnPlane::RemoveAndAddPoints" << endl;
 
   // build set of UNION of Voronoi neighbours of a pair of nearest
@@ -159,50 +124,27 @@
   set<int> indices_removed;
 
-  // for each of the indices to be removed add the voronoi
-  // neighbourhood to the NeighbourUnion set as well as the coinciding
-  // points that had the current point as coincidence before.
+  // for each of the indices to be removed add the voronoi neighbourhood to
+  // the NeighbourUnion set.
   for (size_t ir = 0; ir < indices_to_remove.size(); ir++) {
     int index = indices_to_remove[ir];
     indices_removed.insert(index);
-    if (_verbose) cout << "  scheduling point " << index << " for removal" << endl;
-
-    if (_supervertex[index].coincidence != index){
-      // we have a coincidence
-      //
-      // The only one of the coincident points that has to be
-      // inserted in the neighbourhood list (and thus updated) is the
-      // one that has 'index' as coincidence.
-      int new_index = _supervertex[index].coincidence;
-      while (_supervertex[new_index].coincidence != index)
-	new_index = _supervertex[new_index].coincidence;
-      if (_verbose) cout << "  inserted coinciding " << new_index << " to neighbours union" << endl;
-      NeighbourUnion.insert(new_index);
-
-      // if this is the point among the coiciding ones that holds the
-      // CGAL vertex, then also insert the CGAL neighbours, otherwise
-      // just skip that step.
-      if (index != _supervertex[index].vertex->info().val()) continue;
-    } 
-
+    if (_verbose) cout << " Starting  RemoveAndAddPoints" << endl; 
+    if (_verbose) cout << " point " << index << endl;			 
     // have a circulators that will go round the Voronoi neighbours of
     // _supervertex[index1].vertex
     Vertex_circulator vc = _TR.incident_vertices(_supervertex[index].vertex);
     Vertex_circulator done = vc;
-    if (vc != NULL){ // a safety check in case there is no Voronoi
-		     // neighbour (which may happen e.g. if we just
-		     // have a bunch of coincident points)
-      do  {
-	// if a neighbouring vertex is not the infinite vertex, then add it
-	// to our union of neighbouring vertices.
-	if (_verbose) cout << "examining " << vc->info().val() << endl;
-	if (vc->info().val() != INFINITE_VERTEX) {
-	  // NB: from it=1 onwards occasionally it might already have
-	  // been inserted -- but double insertion still leaves only one
-	  // copy in the set, so there's no problem
-	  NeighbourUnion.insert(vc->info().val());
-	  if (_verbose) cout << "  inserted " << vc->info().val() << " to neighbours union" << endl;
-	} 
-      } while (++vc != done);
-    }
+    do  {
+      // if a neighbouring vertex not the infinite vertex, then add it
+      // to our union of neighbouring vertices.
+      if (_verbose) cout << "examining " << vc->info().val() << endl;
+      if (vc->info().val() != INFINITE_VERTEX) {
+	// NB: from it=1 onwards occasionally it might already have
+	// been inserted -- but double insertion still leaves only one
+	// copy in the set, so there's no problem
+	NeighbourUnion.insert(vc->info().val());
+	if (_verbose) cout << "inserted " << vc->info().val() << endl;
+      } 
+    } while (++vc != done);
   }
   
@@ -218,49 +160,14 @@
   for (size_t ir = 0; ir < indices_to_remove.size(); ir++) {
     int index = indices_to_remove[ir];
-    if (_verbose) cout << "  removing " << index << endl;
 
     // NeighbourUnion should not contain the points to be removed
     // (because later we will assume they still exist).
     NeighbourUnion.erase(indices_to_remove[ir]);
-
-    // first deal with  coincidences
-    if (_supervertex[index].coincidence != index){
-      int new_index = _supervertex[index].coincidence;
-
-      // if this is the point among the coiciding ones that "owns" the
-      // CGAL vertex we need to re-label the CGAL vertex so that it
-      // points to the coincident particle and set the current one to
-      // NULL
-      //
-      // This can be done only on the first point as they all share
-      // the same value
-      //
-      // Note that this has to be done before the following step since
-      // it will alter the coincidence information
-      if (index == _supervertex[index].vertex->info().val())
-	_supervertex[new_index].vertex->info() = new_index;
-
-      // we need to browse the coincidences until we end the loop, at
-      // which point we reset the coincidence of the point that has
-      // the current one as a coincidence
-      while (_supervertex[new_index].coincidence != index)
-	new_index = _supervertex[new_index].coincidence;
-      _supervertex[new_index].coincidence = _supervertex[index].coincidence;
-
-      // remove the coincidence on the point being removed and mark it
-      // as removed
-      _supervertex[index].coincidence = index;
-      _supervertex[index].vertex = NULL;
-
-      continue;
-    }
-
+    
     // points to be removed should also be eliminated from the
     // triangulation and the supervertex structure should be updated
     // to reflect the fact that the points are no longer valid.
     _TR.remove(_supervertex[index].vertex);
-    if (_verbose) cout << "DnnPlane about to set _supervertex["<< index<<"].vertex to NULL" << endl;
     _supervertex[index].vertex = NULL;
-    if (_verbose) cout << "                 value is " << (_is_not_null(_supervertex[index].vertex)) << endl;
   }
 
@@ -285,7 +192,5 @@
   // of the neighbour union happens to be on the wrong side.
   Face_handle face;
-  //if (indices_to_remove.size() > 0) { // GS: use NeighbourUnion instead
-                                        //     (safe also in case of coincidences)
-  if (NeighbourUnion.size() > 0) {
+  if (indices_to_remove.size() > 0) {
     // face can only be found if there were points to remove in first place
     face = _TR.incident_faces(
@@ -299,9 +204,6 @@
     int index = _supervertex.size()-1;
     indices_added.push_back(index);
-    if (_verbose) cout << "  adding " << index << " at "
-                       << points_to_add[ia].first<< " " << points_to_add[ia].second << endl;
-
-    //if (indices_to_remove.size() > 0) {
-    if (NeighbourUnion.size() > 0) {
+
+    if (indices_to_remove.size() > 0) {
       // be careful of using face (for location hinting) only when it exists
       _supervertex[index].vertex = _TR.insert(Point(points_to_add[ia].first, 
@@ -311,34 +213,8 @@
 						    points_to_add[ia].second));
     }
-
-    // check if this leads to a coincidence
-    int coinciding_index = _CheckIfVertexPresent(_supervertex[index].vertex, index);
-    if (coinciding_index == index){
-      // we need to associate an index to each vertex -- thus when we get
-      // a vertex (e.g. as a nearest neighbour) from CGAL, we will be
-      // able to figure out which particle it corresponded to.
-      _supervertex[index].vertex->info() = _supervertex[index].coincidence = index;
-    } else {
-      if (_verbose) cout << "  coinciding with vertex " << coinciding_index << endl;
-      // the new vertex points to an already existing one and we
-      // record the coincidence
-      //
-      // we also update the NN of the coinciding particle (to avoid
-      // having to loop over the list of coinciding neighbours later)
-      // This is done first as it allows us to check if this is a new
-      // coincidence or a coincidence added to a particle that was
-      // previously "alone"
-      _supervertex[coinciding_index].NNindex = index;
-      _supervertex[coinciding_index].NNdistance = 0.0;
-      indices_of_updated_neighbours.push_back(coinciding_index);
-
-      // Note that we must not only set the coincidence of the
-      // currently-added particle, the one it coincides with also
-      // needs be updated (taking into account that it might already
-      // coincide with another one)
-      _supervertex[index].coincidence = _supervertex[coinciding_index].coincidence; // handles cases with previous coincidences
-      _supervertex[coinciding_index].coincidence = index;
-
-    }
+    // we are not up to dealing with coincident vertices, so make 
+    // sure the user knows!
+    _CrashIfVertexPresent(_supervertex[index].vertex, index);
+    _supervertex[index].vertex->info() = index;
     
     // first find nearest neighbour of "newpoint" (shorthand for
@@ -351,8 +227,4 @@
     indices_of_updated_neighbours.push_back(index);
     _SetAndUpdateNearest(index, indices_of_updated_neighbours);
-
-    //cout << "Added: " << setprecision(20) << " (" 
-    //     << points_to_add[ia].first << "," << points_to_add[ia].second
-    //     << ") with index " << index << endl;
   }
 
@@ -379,77 +251,11 @@
   }
 
-  if (_verbose) cout << "Leaving  DnnPlane::RemoveAndAddPoints" << endl;
-}
+}
+
 
 //----------------------------------------------------------------------
 /// Determines the index and distance of the nearest neighbour to 
 /// point j and puts the information into the _supervertex entry for j.
-void DnnPlane::_SetNearest (const int j) {
-  // first deal with the cases where we have a coincidence
-  if (_supervertex[j].coincidence != j){
-    _supervertex[j].NNindex = _supervertex[j].coincidence;
-    _supervertex[j].NNdistance = 0.0;
-    return;
-  }
-
-  // The code below entirely uses CGAL distance comparisons to compute
-  // the nearest neighbour. It has the mais drawback to induice a
-  // 10-20% time penalty so we switched to our own comparison (which
-  // only turns to CGAL for dangerous situations)
-  //
-  //  Vertex_handle current = _supervertex[j].vertex;
-  //  Vertex_circulator vc = _TR.incident_vertices(current);
-  //  Vertex_circulator done = vc;
-  //  Vertex_handle nearest = _TR.infinite_vertex();
-  //  double mindist = HUGE_DOUBLE;
-  //
-  //   // when there is only one finite point left in the triangulation, 
-  //   // there are no triangles. Presumably this is why voronoi returns
-  //   // NULL for the incident vertex circulator. Check if this is
-  //   // happening before circulating over it... (Otherwise it crashes
-  //   // when looking for neighbours of last point)
-  //   if (vc != NULL){
-  //     // initialise the nearest vertex handle to the first incident
-  //     // vertex that is not INFINITE_VERTEX
-  //     while (vc->info().val() == INFINITE_VERTEX){
-  //       vc++;
-  //       if (vc==done) break; // if vc==done, then INFINITE_VERTEX is the
-  // 			   // only element in the neighbourhood
-  //     }
-  // 
-  //     // if there is just the infinite vertex, we have vc->info().val()
-  //     // == INFINITE_VERTEX and nothing has to be done
-  //     // otherwise, use the current vc as an initialisation
-  //     if (vc->info().val() != INFINITE_VERTEX){
-  //       nearest = vc; // initialisation to the first non-infinite vertex
-  // 
-  //       // and loop over the following ones
-  //       while (++vc != done){
-  // 	// we should not compare with the infinite vertex
-  // 	if (vc->info().val() == INFINITE_VERTEX) continue;
-  // 
-  // 	if (_verbose) cout << current->info().val() << " " << vc->info().val() << endl; 
-  // 	// use CGAL's distance comparison to check if 'vc' is closer to
-  // 	// 'current' than the nearest so far (we include the == case for
-  // 	// safety though it should not matter in this precise case)
-  // 	if (CGAL::compare_distance_to_point(current->point(), vc->point(), nearest->point())!=CGAL::LARGER){
-  // 	  nearest = vc;
-  // 	  if (_verbose) cout << "nearer";
-  // 	}
-  //       }
-  // 
-  //       // now compute the distance
-  //       //
-  //       // Note that since we're always using CGAL to compare distances
-  //       // (and never the distance computed using _euclid_distance) we
-  //       // should not worry about rounding errors in mindist
-  //       mindist = _euclid_distance(current->point(), nearest->point());
-  //     }
-  //   }
-  //
-  //  // set j's supervertex info about nearest neighbour
-  //  _supervertex[j].NNindex = nearest->info().val();
-  //  _supervertex[j].NNdistance = mindist;
-
+void DnnPlane::_SetNearest (const int & j) {
   Vertex_handle current = _supervertex[j].vertex;
   Vertex_circulator vc = _TR.incident_vertices(current);
@@ -458,5 +264,5 @@
   double mindist = HUGE_DOUBLE; // change this to "HUGE" or max_double?
   Vertex_handle nearest = _TR.infinite_vertex();
-  
+
   // when there is only one finite point left in the triangulation, 
   // there are no triangles. Presumably this is why voronoi returns
@@ -468,15 +274,14 @@
       // find distance between j and its Voronoi neighbour (vc)
       if (_verbose) cout << current->info().val() << " " << vc->info().val() << endl;
-
+      dist = _euclid_distance(current->point(), vc->point());
       // check if j is closer to vc than vc's currently registered
       // nearest neighbour (and update things if it is)
-      if (_is_closer_to(current->point(), vc->point(), nearest, dist, mindist)){
-	nearest = vc; 
-      	if (_verbose) cout << "nearer ";
+      if (dist < mindist) {
+	mindist = dist; nearest = vc; 
+	if (_verbose) cout << "nearer ";
       } 
       if (_verbose) cout << vc->point() << "; "<< dist << endl;
     }
   } while (++vc != done); // move on to next Voronoi neighbour
-  
   // set j's supervertex info about nearest neighbour
   _supervertex[j].NNindex = nearest->info().val();
@@ -486,5 +291,5 @@
 //----------------------------------------------------------------------
 /// Determines and stores the nearest neighbour of j, and where
-/// necessary updates the nearest-neighbour info of Voronoi neighbours
+/// necessary update the nearest-neighbour info of Voronoi neighbours
 /// of j;
 ///
@@ -499,18 +304,10 @@
 /// NB: note that we have _SetAndUpdateNearest as a completely
 ///     separate routine from _SetNearest because we want to
-///     use one single circulation over voronoi neighbours to find the
+///     use one single ciruclation over voronoi neighbours to find the
 ///     nearest neighbour and to update the voronoi neighbours if need
 ///     be.
 void DnnPlane::_SetAndUpdateNearest(
-			  const int j, 
+			  const int & j, 
 			  vector<int> & indices_of_updated_neighbours) {
-  //cout << "SetAndUpdateNearest for point " << j << endl;
-  // first deal with coincidences
-  if (_supervertex[j].coincidence != j){
-    _supervertex[j].NNindex = _supervertex[j].coincidence;
-    _supervertex[j].NNdistance = 0.0;
-    //cout << "  set to coinciding point " << _supervertex[j].coincidence << endl;
-    return;
-  }
 
   Vertex_handle current = _supervertex[j].vertex;
@@ -529,45 +326,25 @@
     if (vc->info().val() != INFINITE_VERTEX) {
       if (_verbose) cout << current->info().val() << " " << vc->info().val() << endl;
-
+      // find distance between j and its Voronoi neighbour (vc)
+      dist = _euclid_distance(current->point(), vc->point());
       // update the mindist if we are closer than anything found so far
-      if (_is_closer_to(current->point(), vc->point(), nearest, dist, mindist)){
-	nearest = vc; 
-      	if (_verbose) cout << "nearer ";
+      if (dist < mindist) {
+	mindist = dist; nearest = vc; 
+	if (_verbose) cout << "nearer ";
       } 
-
       // find index corresponding to vc for easy manipulation
       int vcindx = vc->info().val();
       if (_verbose) cout << vc->point() << "; "<< dist << endl;
-
-      if (_is_closer_to_with_hint(vc->point(), current->point(), 
-				  _supervertex[_supervertex[vcindx].NNindex].vertex,
-				  dist, _supervertex[vcindx].NNdistance)){
+      // check if j is closer to vc than vc's currently registered
+      // nearest neighbour (and update things if it is)
+      if (dist < _supervertex[vcindx].NNdistance) {
 	if (_verbose) cout << vcindx << "'s NN becomes " << current->info().val() << endl;
+	_supervertex[vcindx].NNdistance = dist;
 	_supervertex[vcindx].NNindex = j;
 	indices_of_updated_neighbours.push_back(vcindx);
       }
-
-      // original code without the use of CGAL distance in potentially
-      // dangerous cases
-      //
-      // // check if j is closer to vc than vc's currently registered
-      // // nearest neighbour (and update things if it is)
-      // //
-      // // GS: originally, the distance test below was a strict <. It
-      // //     has to be <= because if the two distances are ==, it is
-      // //     possible that the old NN is no longer connected to vc in
-      // //     the triangulation, and we are sure that the newly
-      // //     inserted point (j) is (since we loop over j's
-      // //     neighbouring points in the triangulation).
-      // if (dist <= _supervertex[vcindx].NNdistance) {
-      // 	if (_verbose) cout << vcindx << "'s NN becomes " << current->info().val() << endl;
-      // 	_supervertex[vcindx].NNdistance = dist;
-      // 	_supervertex[vcindx].NNindex = j;
-      // 	indices_of_updated_neighbours.push_back(vcindx);
-      // }
     }
   } while (++vc != done); // move on to next Voronoi neighbour
   // set j's supervertex info about nearest neighbour
-  //cout << "  set to point " << nearest->info().val() << endl;
   _supervertex[j].NNindex = nearest->info().val();
   _supervertex[j].NNdistance = mindist;
Index: external/fastjet/Error.cc
===================================================================
--- external/fastjet/Error.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Error.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Error.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/Error.hh"
@@ -33,15 +31,9 @@
 #include <sstream>
 
-#ifndef __FJCORE__
 // printing the stack would need execinfo
 #ifdef FASTJET_HAVE_EXECINFO_H
 #include <execinfo.h>
 #include <cstdlib>
-#ifdef FASTJET_HAVE_DEMANGLING_SUPPORT
-#include <cstdio>
-#include <cxxabi.h>
-#endif // FASTJET_HAVE_DEMANGLING_SUPPORT
-#endif // FASTJET_HAVE_EXECINFO_H
-#endif  // __FJCORE__
+#endif
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -52,70 +44,11 @@
 bool Error::_print_backtrace = false;
 ostream * Error::_default_ostr = & cerr;
-#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
-  LimitedWarning Error::_execinfo_undefined;
-#endif
 
-//----------------------------------------------------------------------
-#ifndef __FJCORE__ 
-
-// demangling only is included, i.e. --enable-demangling is specified
-// at configure time, execinfo.h is present and the GNU C++ ABI is
-// supported
-#if defined(FASTJET_HAVE_EXECINFO_H) && defined(FASTJET_HAVE_DEMANGLING_SUPPORT)
-// demangle a given backtrace symbol
-//
-// Notes:
-//  - at the moment, only the symbol is parsed.
-//  - one can get the offset by using 
-//      "%*[^(]%*[^_]%127[^+)]%64[+x0123456789abcdef]", symbol, offset
-//    and checking if sscanf returns 0, 1 or 2
-//    (offset includes the leading +)
-//  - Similarly one could exctract the address and try to convert it
-//    into a filename+line number like addr2line does but this seems
-//    to require exteral dependencies. If we want to go down that
-//    route, one could look into the inplementation o faddr2line(.c)
-//    and/or dladdr.
-string Error::_demangle(const char* symbol) {
-  size_t size;
-  int status;
-  char temp[128];
-  char* demangled;
-  // first, try to demangle a c++ name
-  // decryption:
-  //   %*[^(]  matches any number of characters different from "("
-  //           the * tells not to store in input var 
-  //   %*[^_]  matches any number of characters different from "_"
-  //           the * tells not to store in input var 
-  //   %127[^)+]  matches at most 127 characters different from "+"
-  //              match is stored
-  if (1 == sscanf(symbol, "%*[^(]%*[^_]%127[^)+]", temp)) {
-    //cout << symbol << " -> " << temp << endl;
-    if (NULL != (demangled = abi::__cxa_demangle(temp, NULL, &size, &status))) {
-      string result(demangled);
-      free(demangled);
-      return result;
-    }
-  }
-  //if that didn't work, try to get a regular c symbol
-  if (1 == sscanf(symbol, "%127s", temp)) {
-    return temp;
-  }
- 
-  //if all else fails, just return the symbol
-  return symbol;
-}
-#endif  // FASTJET_HAVE_DEMANGLING_SUPPORT && FASTJET_HAVE_EXECINFO_H
-#endif  // __FJCORE__
-
-
-//----------------------------------------------------------------------
 Error::Error(const std::string & message_in) {
   _message = message_in; 
-
   if (_print_errors && _default_ostr){
     ostringstream oss;
     oss << "fastjet::Error:  "<< message_in << endl;
 
-#ifndef __FJCORE__
     // only print the stack if execinfo is available and stack enabled
 #ifdef FASTJET_HAVE_EXECINFO_H
@@ -129,15 +62,9 @@
       oss << "stack:" << endl;
       for (int i = 1; i < size && messages != NULL; ++i){
-#ifdef FASTJET_HAVE_DEMANGLING_SUPPORT
-	oss << "  #" << i << ": " << _demangle(messages[i])
-	    << " [" << messages[i]  << "]" << endl;
-#else
 	oss << "  #" << i << ": " << messages[i] << endl;
-#endif
       }
       free(messages);
     }
-#endif  // FASTJET_HAVE_EXECINFO_H
-#endif  // __FJCORE__
+#endif
 
     *_default_ostr << oss.str();
@@ -156,14 +83,4 @@
 }
 
-//----------------------------------------------------------------------
-void Error::set_print_backtrace(bool enabled) {
-#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
-  if (enabled) {
-    _execinfo_undefined.warn("Error::set_print_backtrace(true) will not work with this build of FastJet");
-  }
-#endif    
-  _print_backtrace = enabled;
-}
-
 FASTJET_END_NAMESPACE
 
Index: external/fastjet/Error.hh
===================================================================
--- external/fastjet/Error.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Error.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_ERROR_HH__
 
-//FJSTARTHEADER
-// $Id: Error.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: Error.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,13 +28,9 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include<iostream>
 #include<string>
 #include "fastjet/internal/base.hh"
-#include "fastjet/config.h"
-#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
-#include "fastjet/LimitedWarning.hh"
-#endif
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -63,7 +57,4 @@
   std::string message() const {return _message;}
 
-  /// an alternative access to the error message (more standard)
-  std::string description() const {return message();}
-  
   /// controls whether the error message (and the backtrace, if its printing is enabled) 
   /// is printed out or not
@@ -72,5 +63,5 @@
   /// controls whether the backtrace is printed out with the error message or not.
   /// The default is "false".
-  static void set_print_backtrace(bool enabled);
+  static void set_print_backtrace(bool enabled) {_print_backtrace = enabled;}
 
   /// sets the default output stream for all errors; by default
@@ -81,39 +72,10 @@
 
 private:
-
-#ifndef __FJCORE__
-#if defined(FASTJET_HAVE_EXECINFO_H) && defined(FASTJET_HAVE_DEMANGLING_SUPPORT)
-  /// demangle a given backtrace symbol
-  std::string _demangle(const char* symbol);
-#endif
-#endif
-
   std::string _message;                ///< error message
   static bool _print_errors;           ///< do we print anything?
   static bool _print_backtrace;        ///< do we print the backtrace?
   static std::ostream * _default_ostr; ///< the output stream (cerr if not set)
-#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
-  static LimitedWarning _execinfo_undefined;
-#endif
 };
 
-
-/// @ingroup error_handling
-/// \class InternalError
-/// class corresponding to critical internal errors
-/// 
-/// This is an error class (derived from Error) meant for serious,
-/// critical, internal errors that we still want to be catchable by an
-/// end-user [e.g. a serious issue in clustering where the end-user
-/// can catch it and retry with a different strategy]
-///
-/// Please directly contact the FastJet authors if you see such an
-/// error.
-class InternalError : public Error{
-public:
-  /// ctor with error message:
-  /// just add a bit of info to the message and pass it to the base class
-  InternalError(const std::string & message_in) : Error(std::string("*** CRITICAL INTERNAL FASTJET ERROR *** CONTACT THE AUTHORS *** ") + message_in){ }
-};
 
 FASTJET_END_NAMESPACE
Index: external/fastjet/FunctionOfPseudoJet.cc
===================================================================
--- external/fastjet/FunctionOfPseudoJet.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/FunctionOfPseudoJet.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: FunctionOfPseudoJet.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/FunctionOfPseudoJet.hh>
Index: external/fastjet/FunctionOfPseudoJet.hh
===================================================================
--- external/fastjet/FunctionOfPseudoJet.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/FunctionOfPseudoJet.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_FUNCTION_OF_PSEUDOJET_HH__
 
-//FJSTARTHEADER
-// $Id: FunctionOfPseudoJet.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: FunctionOfPseudoJet.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/PseudoJet.hh>
@@ -51,10 +49,6 @@
   FunctionOfPseudoJet(){}
 
-  // ctor that creates a constant function
-  //----------
-  // this declaration was present in versions of FJ from 3.0.0 to 3.0.6,
-  // but never implemented. It is being removed from 3.0.7 upwards
-  // to avoid misleading users
-  //FunctionOfPseudoJet(const TOut &constant_value);
+  /// ctor that creates a constant function
+  FunctionOfPseudoJet(const TOut &constant_value);
 
   /// default dtor (virtual to allow safe polymorphism)
Index: external/fastjet/GhostedAreaSpec.cc
===================================================================
--- external/fastjet/GhostedAreaSpec.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/GhostedAreaSpec.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: GhostedAreaSpec.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/GhostedAreaSpec.hh"
Index: external/fastjet/GhostedAreaSpec.hh
===================================================================
--- external/fastjet/GhostedAreaSpec.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/GhostedAreaSpec.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: GhostedAreaSpec.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: GhostedAreaSpec.hh 2728 2011-11-20 14:18:59Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -39,5 +37,4 @@
 #include "fastjet/Selector.hh"
 #include "fastjet/LimitedWarning.hh"
-#include "fastjet/internal/deprecated.hh"
 
 // 
@@ -125,8 +122,6 @@
 
   // for accessing values set by the user
-  inline double ghost_rapmax () const {return _ghost_maxrap;}
+  inline double ghost_etamax () const {return _ghost_maxrap;}
   inline double ghost_maxrap () const {return _ghost_maxrap;}
-  inline double ghost_etamax () const {return _ghost_maxrap;}
-  inline double ghost_maxeta () const {return _ghost_maxrap;}
   inline double ghost_area   () const {return _ghost_area   ;}
   inline double grid_scatter () const {return _grid_scatter;}
@@ -145,8 +140,6 @@
   // when explicitly modifying values, sometimes call the initializer
   inline void set_ghost_area   (double val) {_ghost_area    = val; _initialize();}
-  inline void set_ghost_rapmax (double val) {_ghost_maxrap = val; _initialize();}
+  inline void set_ghost_etamax (double val) {_ghost_maxrap = val; _initialize();}
   inline void set_ghost_maxrap (double val) {_ghost_maxrap = val; _initialize();}
-  inline void set_ghost_etamax (double val) {_ghost_maxrap = val; _initialize();}
-  inline void set_ghost_maxeta (double val) {_ghost_maxrap = val; _initialize();}
   inline void set_grid_scatter (double val) {_grid_scatter   = val; }
   inline void set_pt_scatter   (double val) {_pt_scatter     = val; }
@@ -174,5 +167,4 @@
   ///
   /// FJ2 placement is now deprecated.
-  FASTJET_DEPRECATED_MSG("This is deprecated since we strongly recomment to use the new ghost placement instead")
   void set_fj2_placement(bool  val);
 
Index: external/fastjet/JetDefinition.cc
===================================================================
--- external/fastjet/JetDefinition.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/JetDefinition.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: JetDefinition.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/JetDefinition.hh"
@@ -45,6 +43,6 @@
 JetDefinition::JetDefinition(JetAlgorithm jet_algorithm_in, 
 			     double R_in, 
+			     Strategy strategy_in,
 			     RecombinationScheme recomb_scheme_in,
-			     Strategy strategy_in,
                              int nparameters) :
   _jet_algorithm(jet_algorithm_in), _Rparam(R_in), _strategy(strategy_in) {
@@ -70,11 +68,30 @@
   // cross-check the number of parameters that were declared in setting up the
   // algorithm (passed internally from the public constructors)
-  unsigned int nparameters_expected = n_parameters_for_algorithm(jet_algorithm_in);
-  if (nparameters != (int) nparameters_expected){
-    ostringstream oss;
-    oss << "The jet algorithm you requested ("
-        << jet_algorithm_in << ") should be constructed with " << nparameters_expected 
-        << " parameter(s) but was called with " << nparameters << " parameter(s)\n";
-    throw Error(oss.str()); 
+  switch (jet_algorithm_in) {
+  case ee_kt_algorithm:
+    if (nparameters != 0) {
+      ostringstream oss;
+      oss << "ee_kt_algorithm should be constructed with 0 parameters but was called with " 
+          << nparameters << " parameter(s)\n";
+      throw Error(oss.str()); 
+    }
+    break;
+  case genkt_algorithm: 
+  case ee_genkt_algorithm: 
+    if (nparameters != 2) {
+      ostringstream oss;
+      oss << "(ee_)genkt_algorithm should be constructed with 2 parameters but was called with " 
+          << nparameters << " parameter(s)\n";
+      throw Error(oss.str()); 
+    }
+    break;
+  default:
+    if (nparameters != 1) {
+      ostringstream oss;
+      oss << "The jet algorithm you requested ("
+          << jet_algorithm_in << ") should be constructed with 1 parameter but was called with " 
+          << nparameters << " parameter(s)\n";
+      throw Error(oss.str()); 
+    }
   }
 
@@ -89,95 +106,43 @@
 
 //----------------------------------------------------------------------
-// returns true if the jet definition involves an algorithm
-// intended for use on a spherical geometry (e.g. e+e- algorithms,
-// as opposed to most pp algorithms, which use a cylindrical,
-// rapidity-phi geometry).
-bool JetDefinition::is_spherical() const {
-  if (jet_algorithm() == plugin_algorithm) {
-    return plugin()->is_spherical();
-  } else {
-    return (jet_algorithm() == ee_kt_algorithm ||  // as of 2013-02-14, the two
-            jet_algorithm() == ee_genkt_algorithm  // native spherical algorithms
-            );
-  }
-}
-
-//----------------------------------------------------------------------
 string JetDefinition::description() const {
-  ostringstream name;
-  
-  name << description_no_recombiner();
-
-  if ((jet_algorithm() == plugin_algorithm) || (jet_algorithm() == undefined_jet_algorithm)){
-    return name.str();
-  }
-
-  if (n_parameters_for_algorithm(jet_algorithm()) == 0)
-    name << " with ";
-  else 
-    name << " and ";
-  name << recombiner()->description();
-
-  return name.str();
-}
-
-//----------------------------------------------------------------------
-string JetDefinition::description_no_recombiner() const {
-  
   ostringstream name;
   if (jet_algorithm() == plugin_algorithm) {
     return plugin()->description();
+  } else if (jet_algorithm() == kt_algorithm) {
+    name << "Longitudinally invariant kt algorithm with R = " << R();
+    name << " and " << recombiner()->description();
+  } else if (jet_algorithm() == cambridge_algorithm) {
+    name << "Longitudinally invariant Cambridge/Aachen algorithm with R = " 
+	 << R() ;
+    name << " and " << recombiner()->description();
+  } else if (jet_algorithm() == antikt_algorithm) {
+    name << "Longitudinally invariant anti-kt algorithm with R = " 
+	 << R() ;
+    name << " and " << recombiner()->description();
+  } else if (jet_algorithm() == genkt_algorithm) {
+    name << "Longitudinally invariant generalised kt algorithm with R = " 
+	 << R() << ", p = " << extra_param();
+    name << " and " << recombiner()->description();
+  } else if (jet_algorithm() == cambridge_for_passive_algorithm) {
+    name << "Longitudinally invariant Cambridge/Aachen algorithm with R = " 
+	 << R() << "and a special hack whereby particles with kt < " 
+         << extra_param() << "are treated as passive ghosts";
+  } else if (jet_algorithm() == ee_kt_algorithm) {
+    name << "e+e- kt (Durham) algorithm (NB: no R)";
+    name << " with " << recombiner()->description();
+  } else if (jet_algorithm() == ee_genkt_algorithm) {
+    name << "e+e- generalised kt algorithm with R = " 
+	 << R() << ", p = " << extra_param();
+    name << " and " << recombiner()->description();
   } else if (jet_algorithm() == undefined_jet_algorithm) {
-    return "uninitialised JetDefinition (jet_algorithm=undefined_jet_algorithm)" ;
-  }
-
-  name << algorithm_description(jet_algorithm());
-  switch (n_parameters_for_algorithm(jet_algorithm())){
-  case 0: name << " (NB: no R)"; break;
-  case 1: name << " with R = " << R(); break; // the parameter is always R
-  case 2: 
-    // the 1st parameter is always R
-    name << " with R = " << R();
-    // the 2nd depends on the algorithm
-    if (jet_algorithm() == cambridge_for_passive_algorithm){
-      name << "and a special hack whereby particles with kt < " 
-           << extra_param() << "are treated as passive ghosts";
-    } else {
-      name << ", p = " << extra_param();
-    }
-  };
-
+    name << "uninitialised JetDefinition (jet_algorithm=undefined_jet_algorithm)" ;
+  } else {
+    throw Error("JetDefinition::description(): unrecognized jet_algorithm");
+  }
   return name.str();
 }
 
-//----------------------------------------------------------------------
-string JetDefinition::algorithm_description(const JetAlgorithm jet_alg){
-  ostringstream name;
-  switch (jet_alg){
-  case plugin_algorithm:                return "plugin algorithm";
-  case kt_algorithm:                    return "Longitudinally invariant kt algorithm";
-  case cambridge_algorithm:             return "Longitudinally invariant Cambridge/Aachen algorithm";
-  case antikt_algorithm:                return "Longitudinally invariant anti-kt algorithm";
-  case genkt_algorithm:                 return "Longitudinally invariant generalised kt algorithm";
-  case cambridge_for_passive_algorithm: return "Longitudinally invariant Cambridge/Aachen algorithm";
-  case ee_kt_algorithm:                 return "e+e- kt (Durham) algorithm (NB: no R)";
-  case ee_genkt_algorithm:              return "e+e- generalised kt algorithm";
-  case undefined_jet_algorithm:         return "undefined jet algorithm";
-  default:
-    throw Error("JetDefinition::algorithm_description(): unrecognized jet_algorithm");
-  };
-}
-
-//----------------------------------------------------------------------
-unsigned int JetDefinition::n_parameters_for_algorithm(const JetAlgorithm jet_alg){
-  switch (jet_alg) {
-  case ee_kt_algorithm:    return 0;
-  case genkt_algorithm:
-  case ee_genkt_algorithm: return 2;
-  default:                 return 1;
-  };
-}
-
-//----------------------------------------------------------------------
+
 void JetDefinition::set_recombination_scheme(
                                RecombinationScheme recomb_scheme) {
@@ -185,33 +150,7 @@
 
   // do not forget to delete the existing recombiner if needed
-  if (_shared_recombiner) _shared_recombiner.reset();
+  if (_recombiner_shared()) _recombiner_shared.reset();
 
   _recombiner = 0;
-}
-
-void JetDefinition::set_recombiner(const JetDefinition &other_jet_def){
-  // make sure the "invariants" of the other jet def are sensible
-  assert(other_jet_def._recombiner || 
-         other_jet_def.recombination_scheme() != external_scheme);
-
-  // first treat the situation where we're using the default recombiner
-  if (other_jet_def._recombiner == 0){
-    set_recombination_scheme(other_jet_def.recombination_scheme());
-    return;
-  }
-
-  // in other cases, copy the pointer to the recombiner
-  _recombiner = other_jet_def._recombiner;
-  // set the default recombiner appropriately
-  _default_recombiner = DefaultRecombiner(external_scheme);
-  // and set the _shared_recombiner to the same state
-  // as in the other_jet_def, whatever that was
-  _shared_recombiner.reset(other_jet_def._shared_recombiner);
-
-  // NB: it is tempting to go via set_recombiner and then to sort
-  // out the shared part, but this would be dangerous in the
-  // specific (rare?) case where other_jet_def is the same as this
-  // it deletes_recombiner_when_unused. In that case the shared
-  // pointer reset would delete the recombiner.
 }
 
@@ -224,5 +163,5 @@
   if (other_jd.recombination_scheme() != scheme) return false;
 
-  // if the scheme is "external", also check that they have the same
+  // if the scheme is "external", also check that they ahve the same
   // recombiner
   return (scheme != external_scheme) 
@@ -230,14 +169,12 @@
 }
 
-/// causes the JetDefinition to handle the deletion of the
+/// allows to let the JetDefinition handle the deletion of the
 /// recombiner when it is no longer used
 void JetDefinition::delete_recombiner_when_unused(){
   if (_recombiner == 0){
     throw Error("tried to call JetDefinition::delete_recombiner_when_unused() for a JetDefinition without a user-defined recombination scheme");
-  } else if (_shared_recombiner.get()) {
-    throw Error("Error in JetDefinition::delete_recombiner_when_unused: the recombiner is already scheduled for deletion when unused (or was already set as shared)");
-  }
-
-  _shared_recombiner.reset(_recombiner);
+  }
+
+  _recombiner_shared.reset(_recombiner);
 }
 
@@ -270,13 +207,4 @@
   case BIpt2_scheme:
     return "boost-invariant pt2 scheme recombination";
-  case WTA_pt_scheme:
-    return "pt-ordered Winner-Takes-All recombination";
-  // Energy-ordering can lead to dangerous situations with particles at
-  // rest. We instead implement the WTA_modp_scheme
-  //
-  //   case WTA_E_scheme:
-  //     return "energy-ordered Winner-Takes-All recombination";
-  case WTA_modp_scheme:
-    return "|3-momentum|-ordered Winner-Takes-All recombination";
   default:
     ostringstream err;
@@ -318,50 +246,4 @@
     weightb = pb.perp2();
     break;
-  case WTA_pt_scheme:{
-    const PseudoJet & phard = (pa.pt2() >= pb.pt2()) ? pa : pb;
-    /// keep y,phi and m from the hardest, sum pt
-    pab.reset_PtYPhiM(pa.pt()+pb.pt(), 
-                      phard.rap(), phard.phi(), phard.m());
-    return;}
-  // Energy-ordering can lead to dangerous situations with particles at
-  // rest. We instead implement the WTA_modp_scheme
-  //
-  //   case WTA_E_scheme:{
-  //     const PseudoJet & phard = (pa.E() >= pb.E()) ? pa : pb;
-  //     /// keep 3-momentum direction and mass from the hardest, sum energies
-  //     ///
-  //     /// If the particle with the largest energy is at rest, the sum
-  //     /// remains at rest, implying that the mass of the sum is larger
-  //     /// than the mass of pa.
-  //     double Eab = pa.E() + pb.E();
-  //     double scale = (phard.modp2()==0.0)
-  //       ? 0.0
-  //       : sqrt((Eab*Eab - phard.m2())/phard.modp2());
-  //     pab.reset(phard.px()*scale, phard.py()*scale, phard.pz()*scale, Eab);
-  //     return;}
-  case WTA_modp_scheme:{
-    // Note: we need to compute both a and b modp. And we need pthard
-    // and its modp. If we want to avoid repeating the test and do
-    // only 2 modp calculations, we'd have to duplicate the code (or
-    // use a pair<const PJ&>). An alternative is to write modp_soft as
-    // modp_ab-modp_hard but this could suffer from larger rounding
-    // errors
-    bool a_hardest = (pa.modp2() >= pb.modp2());
-    const PseudoJet & phard = a_hardest ? pa : pb;
-    const PseudoJet & psoft = a_hardest ? pb : pa;
-    /// keep 3-momentum direction and mass from the hardest, sum modp
-    ///
-    /// If the hardest particle is at rest, the sum remains at rest
-    /// (the energy of the sum is therefore the mass of pa)
-    double modp_hard = phard.modp();
-    double modp_ab = modp_hard + psoft.modp();
-    if (phard.modp2()==0.0){
-      pab.reset(0.0, 0.0, 0.0, phard.m());
-    } else {
-      double scale = modp_ab/modp_hard;
-      pab.reset(phard.px()*scale, phard.py()*scale, phard.pz()*scale,
-                sqrt(modp_ab*modp_ab + phard.m2()));
-    }
-    return;}
   default:
     ostringstream err;
@@ -399,7 +281,4 @@
   case BIpt_scheme:
   case BIpt2_scheme:
-  case WTA_pt_scheme:
-  //case WTA_E_scheme:
-  case WTA_modp_scheme:
     break;
   case pt_scheme:
Index: external/fastjet/JetDefinition.hh
===================================================================
--- external/fastjet/JetDefinition.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/JetDefinition.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,6 @@
-#ifndef __FASTJET_JETDEFINITION_HH__
-#define __FASTJET_JETDEFINITION_HH__
-
-//FJSTARTHEADER
-// $Id: JetDefinition.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: JetDefinition.hh 2687 2011-11-14 11:17:51Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,10 +25,12 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
+
+#ifndef __FASTJET_JETDEFINITION_HH__
+#define __FASTJET_JETDEFINITION_HH__
 
 #include<cassert>
 #include "fastjet/internal/numconsts.hh"
 #include "fastjet/PseudoJet.hh"
-#include "fastjet/internal/deprecated.hh"
 #include<string>
 #include<memory>
@@ -50,43 +47,5 @@
 /// clustering events with kt and cambridge style algorithms.
 enum Strategy {
-  /// Like N2MHTLazy9 in a number of respects, but does not calculate
-  /// ghost-ghost distances and so does not carry out ghost-ghost
-  /// recombination. 
-  ///
-  /// If you want active ghosted areas, then this is only suitable for
-  /// use with the anti-kt algorithm (or genkt with negative p), and
-  /// does not produce any pure ghost jets. If used with active areas
-  /// with Kt or Cam algorithms it will actually produce a passive
-  /// area.
-  /// 
-  /// Particles are deemed to be ghosts if their pt is below a
-  /// threshold (currently 1e-50, hard coded as ghost_limit in
-  /// LazyTiling9SeparateGhosts).
-  ///
-  /// Currently for events with a couple of thousand normal particles
-  /// and O(10k) ghosts, this can be quicker than N2MHTLazy9, which
-  /// would otherwise be the best strategy. 
-  ///
-  /// New in FJ3.1
-  N2MHTLazy9AntiKtSeparateGhosts   = -10, 
-  /// only looks into a neighbouring tile for a particle's nearest
-  /// neighbour (NN) if that particle's in-tile NN is further than the
-  /// distance to the edge of the neighbouring tile. Uses tiles of
-  /// size R and a 3x3 tile grid around the particle.
-  /// New in FJ3.1
-  N2MHTLazy9   = -7, 
-  /// Similar to N2MHTLazy9, but uses tiles of size R/2 and a 5x5 tile
-  /// grid around the particle.
-  /// New in FJ3.1
-  N2MHTLazy25   = -6, 
-  /// Like to N2MHTLazy9 but uses slightly different optimizations,
-  /// e.g. for calculations of distance to nearest tile; as of
-  /// 2014-07-18 it is slightly slower and not recommended for
-  /// production use. To considered deprecated.
-  /// New in FJ3.1
-  N2MHTLazy9Alt   = -5, 
-  /// faster that N2Tiled above about 500 particles; differs from it
-  /// by retainig the di(closest j) distances in a MinHeap (sort of
-  /// priority queue) rather than a simple vector. 
+  /// fastest form about 500..10^4
   N2MinHeapTiled   = -4, 
   /// fastest from about 50..500
@@ -98,6 +57,5 @@
   /// worse even than the usual N^3 algorithms
   N3Dumb      =  0, 
-  /// automatic selection of the best (based on N), including 
-  /// the LazyTiled strategies that are new to FJ3.1
+  /// automatic selection of the best (based on N)
   Best        =  1, 
   /// best of the NlnN variants -- best overall for N>10^4.
@@ -121,7 +79,4 @@
   /// (Does not work for R>=2pi)
   NlnNCam      = 12, // 2piMultD
-  /// the automatic strategy choice that was being made in FJ 3.0
-  /// (restricted to strategies that were present in FJ 3.0)
-  BestFJ30     =  21, 
   /// the plugin has been used...
   plugin_strategy = 999
@@ -132,7 +87,4 @@
 /// \enum JetAlgorithm
 /// the various families of jet-clustering algorithm
-//
-// [Remember to update the "is_spherical()" routine if any further
-// spherical algorithms are added to the list below]
 enum JetAlgorithm {
   /// the longitudinally invariant kt algorithm
@@ -150,12 +102,9 @@
   /// where p = extra_param()
   genkt_algorithm=3, 
-  /// a version of cambridge with a special distance measure for
-  /// particles whose pt is < extra_param(); this is not usually
-  /// intended for end users, but is instead automatically selected
-  /// when requesting a passive Cambridge area.
+  /// a version of cambridge with a special distance measure for particles
+  /// whose pt is < extra_param()
   cambridge_for_passive_algorithm=11,
   /// a version of genkt with a special distance measure for particles
   /// whose pt is < extra_param() [relevant for passive areas when p<=0]
-  /// ***** NB: THERE IS CURRENTLY NO IMPLEMENTATION FOR THIS ALG *******
   genkt_for_passive_algorithm=13, 
   //.................................................................
@@ -182,13 +131,5 @@
 
 //======================================================================
-/// The various recombination schemes
-///
-/// Note that the schemes that recombine with non-linear weighting of
-/// the directions (e.g. pt2, winner-takes-all) are collinear safe
-/// only for algorithms with a suitable ordering of the
-/// recombinations: orderings in which, for particles of comparable
-/// energies, small-angle clusterings take place before large-angle
-/// clusterings. This property is satisfied by all gen-kt algorithms.
-/// 
+/// the various recombination schemes
 enum RecombinationScheme {
   /// summing the 4-momenta
@@ -212,22 +153,4 @@
   /// no preprocessing
   BIpt2_scheme=6,
-  /// pt-based Winner-Takes-All (WTA) recombination: the
-  /// result of the recombination has the rapidity, azimuth and mass
-  /// of the PseudoJet with the larger pt, and a pt equal to the
-  /// sum of the two pt's
-  WTA_pt_scheme=7,
-  /// mod-p-based Winner-Takes-All (WTA) recombination: the result of
-  /// the recombination gets the 3-vector direction and mass of the
-  /// PseudoJet with the larger |3-momentum| (modp), and a
-  /// |3-momentum| equal to the scalar sum of the two |3-momenta|.
-  WTA_modp_scheme=8,
-  // Energy-ordering can lead to dangerous situations with particles at
-  // rest. We instead implement the WTA_modp_scheme
-  //
-  // // energy-based Winner-Takes-All (WTA) recombination: the result of
-  // // the recombination gets the 3-vector direction and mass of the
-  // // PseudoJet with the larger energy, and an energy equal to the
-  // // to the sum of the two energies
-  // WTA_E_scheme=8,
   /// for the user's external scheme
   external_scheme = 99
@@ -269,5 +192,5 @@
                 RecombinationScheme recomb_scheme_in = E_scheme,
                 Strategy strategy_in = Best) {
-    *this = JetDefinition(jet_algorithm_in, R_in, recomb_scheme_in, strategy_in, 1);
+    *this = JetDefinition(jet_algorithm_in, R_in, strategy_in, recomb_scheme_in, 1);
   }
 
@@ -278,5 +201,5 @@
                 Strategy strategy_in = Best) {
     double dummyR = 0.0;
-    *this = JetDefinition(jet_algorithm_in, dummyR, recomb_scheme_in, strategy_in, 0);
+    *this = JetDefinition(jet_algorithm_in, dummyR, strategy_in, recomb_scheme_in, 0);
   }
 
@@ -288,5 +211,5 @@
                 RecombinationScheme recomb_scheme_in = E_scheme,
                 Strategy strategy_in = Best) {
-    *this = JetDefinition(jet_algorithm_in, R_in, recomb_scheme_in, strategy_in, 2);
+    *this = JetDefinition(jet_algorithm_in, R_in, strategy_in, recomb_scheme_in, 2);
     set_extra_param(xtra_param_in);
   }
@@ -321,6 +244,7 @@
                 const Recombiner * recombiner_in,
                 Strategy strategy_in = Best) {
-    *this = JetDefinition(jet_algorithm_in, R_in, xtra_param_in, external_scheme, strategy_in);
+    *this = JetDefinition(jet_algorithm_in, R_in, external_scheme, strategy_in);
     _recombiner = recombiner_in;
+    set_extra_param(xtra_param_in);
   }
 
@@ -345,16 +269,8 @@
     _strategy = plugin_strategy;
     _Rparam = _plugin->R();
-    _extra_param = 0.0; // a dummy value to keep static code checkers happy
     _jet_algorithm = plugin_algorithm;
     set_recombination_scheme(E_scheme);
   }
 
-  /// constructor to fully specify a jet-definition (together with
-  /// information about how algorithically to run it).
-  JetDefinition(JetAlgorithm jet_algorithm_in, 
-                double R_in, 
-                RecombinationScheme recomb_scheme_in,
-                Strategy strategy_in,
-                int nparameters_in);
 
   /// constructor to fully specify a jet-definition (together with
@@ -363,20 +279,9 @@
   /// the ordering of arguments here is old and deprecated (except
   /// as the common constructor for internal use)
-  FASTJET_DEPRECATED_MSG("This argument ordering is deprecated. Use JetDefinition(alg, R, strategy, scheme[, n_parameters]) instead")
   JetDefinition(JetAlgorithm jet_algorithm_in, 
                 double R_in, 
                 Strategy strategy_in,
                 RecombinationScheme recomb_scheme_in = E_scheme,
-                int nparameters_in = 1){
-    (*this) = JetDefinition(jet_algorithm_in,R_in,recomb_scheme_in,strategy_in,nparameters_in);
-  }
-
-
-  /// cluster the supplied particles and returns a vector of resulting
-  /// jets, sorted by pt (or energy in the case of spherical,
-  /// i.e. e+e-, algorithms). This routine currently only makes
-  /// sense for "inclusive" type algorithms.
-  template <class L> 
-  std::vector<PseudoJet> operator()(const std::vector<L> & particles) const;
+                int nparameters_in = 1);
   
   /// R values larger than max_allowable_R are not allowed.
@@ -392,32 +297,12 @@
 
   /// set the recombiner class to the one provided
-  ///
-  /// Note that in order to associate to a jet definition a recombiner
-  /// from another jet definition, it is strongly recommended to use
-  /// the set_recombiner(const JetDefinition &) method below. The
-  /// latter correctly handles the situations where the jet definition
-  /// owns the recombiner (i.e. where delete_recombiner_when_unused
-  /// has been called). In such cases, using set_recombiner(const
-  /// Recombiner *) may lead to memory corruption.
   void set_recombiner(const Recombiner * recomb) {
-    if (_shared_recombiner) _shared_recombiner.reset(recomb);
+    if (_recombiner_shared()) _recombiner_shared.reset(recomb);
     _recombiner = recomb;
     _default_recombiner = DefaultRecombiner(external_scheme);
   }
 
-  /// set the recombiner to be the same as the one of 'other_jet_def'
-  ///
-  /// Note that this is the recommended method to associate to a jet
-  /// definition the recombiner from another jet definition. Compared
-  /// to the set_recombiner(const Recombiner *) above, it correctly
-  /// handles the case where the jet definition owns the recombiner
-  /// (i.e. where delete_recombiner_when_unused has been called)
-  void set_recombiner(const JetDefinition &other_jet_def);
-
   /// calling this tells the JetDefinition to handle the deletion of
-  /// the recombiner when it is no longer used. (Should not be called
-  /// if the recombiner was initialised from a JetDef whose recombiner
-  /// was already scheduled to delete itself - memory handling will
-  /// already be automatic across both JetDef's in that case).
+  /// the recombiner when it is no longer used
   void delete_recombiner_when_unused();
 
@@ -425,5 +310,5 @@
   const Plugin * plugin() const {return _plugin;};
 
-  /// calling this causes the JetDefinition to handle the deletion of the
+  /// allows to let the JetDefinition handle the deletion of the
   /// plugin when it is no longer used
   void delete_plugin_when_unused();
@@ -448,5 +333,5 @@
   void set_extra_param(double xtra_param) {_extra_param = xtra_param;}
 
-  /// returns a pointer to the currently defined recombiner. 
+  /// return a pointer to the currently defined recombiner. 
   ///
   /// Warning: the pointer may be to an internal recombiner (for
@@ -462,24 +347,10 @@
 
   /// returns true if the current jet definitions shares the same
-  /// recombiner as the one passed as an argument
+  /// recombiner as teh one passed as an argument
   bool has_same_recombiner(const JetDefinition &other_jd) const;
-
-  /// returns true if the jet definition involves an algorithm
-  /// intended for use on a spherical geometry (e.g. e+e- algorithms,
-  /// as opposed to most pp algorithms, which use a cylindrical,
-  /// rapidity-phi geometry).
-  bool is_spherical() const;
 
   /// return a textual description of the current jet definition 
   std::string description() const;
 
-  /// returns a description not including the recombiner information
-  std::string description_no_recombiner() const;
-
-  /// a short textual description of the algorithm jet_alg
-  static std::string algorithm_description(const JetAlgorithm jet_alg);
-
-  /// the number of parameters associated to a given jet algorithm
-  static unsigned int n_parameters_for_algorithm(const JetAlgorithm jet_alg);
 
 public:
@@ -534,11 +405,11 @@
       _recomb_scheme(recomb_scheme) {}
     
-    virtual std::string description() const FASTJET_OVERRIDE;
+    virtual std::string description() const;
     
     /// recombine pa and pb and put result into pab
     virtual void recombine(const PseudoJet & pa, const PseudoJet & pb, 
-                           PseudoJet & pab) const FASTJET_OVERRIDE;
-
-    virtual void preprocess(PseudoJet & p) const FASTJET_OVERRIDE;
+                           PseudoJet & pab) const;
+
+    virtual void preprocess(PseudoJet & p) const;
 
     /// return the index of the recombination scheme
@@ -591,10 +462,4 @@
     virtual bool exclusive_sequence_meaningful() const {return false;}
 
-    /// returns true if the plugin implements an algorithm intended
-    /// for use on a spherical geometry (e.g. e+e- algorithms, as
-    /// opposed to most pp algorithms, which use a cylindrical,
-    /// rapidity-phi geometry).
-    virtual bool is_spherical() const {return false;}
-
     /// a destructor to be replaced if necessary in derived classes...
     virtual ~Plugin() {};
@@ -616,5 +481,5 @@
   DefaultRecombiner _default_recombiner;
   const Recombiner * _recombiner;
-  SharedPtr<const Recombiner> _shared_recombiner;
+  SharedPtr<const Recombiner> _recombiner_shared;
 
 };
@@ -651,10 +516,8 @@
 
 
+
+
+
 FASTJET_END_NAMESPACE
 
-// include ClusterSequence which includes the implementation of the 
-// templated JetDefinition::operator()(...) member
-#include "fastjet/ClusterSequence.hh"
-
-
 #endif // __FASTJET_JETDEFINITION_HH__
Index: external/fastjet/LazyTiling25.cc
===================================================================
--- external/fastjet/LazyTiling25.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,788 +1,0 @@
-//FJSTARTHEADER
-// $Id: LazyTiling25.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include <iomanip>
-#include "fastjet/internal/LazyTiling25.hh"
-#include "fastjet/internal/TilingExtent.hh"
-using namespace std;
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-LazyTiling25::LazyTiling25(ClusterSequence & cs) :
-  _cs(cs), _jets(cs.jets())
-  //, _minheap(_jets.size()) 
-{
-#ifdef INSTRUMENT2
-  _ncall = 0; // gps tmp
-  _ncall_dtt = 0; // gps tmp
-#endif // INSTRUMENT2
-  _Rparam = cs.jet_def().R();
-  _R2 = _Rparam * _Rparam;
-  _invR2 = 1.0 / _R2;
-  _initialise_tiles();
-}
-
-
-//----------------------------------------------------------------------
-/// Set up the tiles:
-///  - decide the range in eta
-///  - allocate the tiles
-///  - set up the cross-referencing info between tiles
-///
-/// The neighbourhood of a tile is set up as follows
-///
-///          LLRRR
-///          LLRRR
-///          LLXRR
-///          LLLRR
-///          LLLRR
-///
-/// such that tiles is an array containing XLL..LLRR..RR with pointers
-///                                         |     \ RH_tiles
-///                                         \ surrounding_tiles
-///
-/// with appropriate precautions when close to the edge of the tiled
-/// region.
-///
-void LazyTiling25::_initialise_tiles() {
-
-  // first decide tile sizes (with a lower bound to avoid huge memory use with
-  // very small R)
-  double default_size = max(0.1,_Rparam)/2;
-  _tile_size_eta = default_size;
-  // it makes no sense to go below 5 tiles in phi -- 5 tiles is
-  // sufficient to make sure all pair-wise combinations up to pi in
-  // phi are possible
-  _n_tiles_phi   = max(5,int(floor(twopi/default_size)));
-  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
-
-#define _FASTJET_TILING25_USE_TILING_ANALYSIS_
-#ifdef  _FASTJET_TILING25_USE_TILING_ANALYSIS_
-  // testing
-  TilingExtent tiling_analysis(_cs);
-  _tiles_eta_min = tiling_analysis.minrap();
-  _tiles_eta_max = tiling_analysis.maxrap();
-  //cout << "Using timing analysis " << " " << _tiles_eta_min << " " << _tiles_eta_max << endl;
-#else // not _FASTJET_TILING25_USE_TILING_ANALYSIS_
-  // always include zero rapidity in the tiling region
-  _tiles_eta_min = 0.0;
-  _tiles_eta_max = 0.0;
-  // but go no further than following
-  const double maxrap = 7.0;
-  
-  // and find out how much further one should go
-  for(unsigned int i = 0; i < _jets.size(); i++) {
-    double eta = _jets[i].rap();
-    // first check if eta is in range -- to avoid taking into account
-    // very spurious rapidities due to particles with near-zero kt.
-    if (abs(eta) < maxrap) {
-      if (eta < _tiles_eta_min) {_tiles_eta_min = eta;}
-      if (eta > _tiles_eta_max) {_tiles_eta_max = eta;}
-    }
-  }
-  //cout << "NOT using timing analysis " << " " << _tiles_eta_min << " " << _tiles_eta_max << endl;
-#endif // _FASTJET_TILING25_USE_TILING_ANALYSIS_
-
-
-  // now adjust the values of the ieta extents 
-
-  // 2014-07-18: the following commented piece of code gives speed
-  // improvements for large-R jets, but occasionally it appears to
-  // hang, e.g. on 
-  //    gunzip -c  < ../data/Pythia-PtMin50-LHC-10kev.dat.gz  | time ./example/fastjet_timing_plugins -R 1000 -nev 1000 -strategy -6  -antikt  -rapmax 5.0 -repeat 1 -write
-  // 2014-07-23: this was understood because tile centres assumed 
-  //             tiles_ieta_min = tiles_eta_min (no longer true)
-  //
-#define FASTJET_LAZY25_MIN3TILESY
-#ifdef FASTJET_LAZY25_MIN3TILESY
-   if (_tiles_eta_max - _tiles_eta_min < 3*_tile_size_eta) {
-     // if we have a rapidity coverage that is small compared to the
-     // tile size then we can adjust the grid in rapidity so as to
-     // have exactly 3 tiles. This can give relevant speed improvements 
-     // for large R jets
-     _tile_size_eta = (_tiles_eta_max - _tiles_eta_min)/3;
-     _tiles_ieta_min = 0;
-     _tiles_ieta_max = 2;
-     // the eta max value is being taken as the lower edge of the
-     // highest-y tile
-     _tiles_eta_max -= _tile_size_eta;
-   } else {
-#endif //FASTJET_LAZY25_MIN3TILESY
-    _tiles_ieta_min = int(floor(_tiles_eta_min/_tile_size_eta));
-    _tiles_ieta_max = int(floor( _tiles_eta_max/_tile_size_eta));
-    _tiles_eta_min = _tiles_ieta_min * _tile_size_eta;
-    _tiles_eta_max = _tiles_ieta_max * _tile_size_eta;
-#ifdef FASTJET_LAZY25_MIN3TILESY
-   }
-#endif
-  _tile_half_size_eta = _tile_size_eta * 0.5;
-  _tile_half_size_phi = _tile_size_phi * 0.5;
-
-  // set up information about whether we need to allow for "periodic" 
-  // wrapping tests in delta_phi calculations
-  vector<bool> use_periodic_delta_phi(_n_tiles_phi, false);
-  if (_n_tiles_phi <= 5) {
-    fill(use_periodic_delta_phi.begin(), use_periodic_delta_phi.end(), true);
-  } else {
-    use_periodic_delta_phi[0] = true;
-    use_periodic_delta_phi[1] = true;
-    use_periodic_delta_phi[_n_tiles_phi-2] = true;
-    use_periodic_delta_phi[_n_tiles_phi-1] = true;
-  }
-
-  // allocate the tiles
-  _tiles.resize((_tiles_ieta_max-_tiles_ieta_min+1)*_n_tiles_phi);
-
-  // now set up the cross-referencing between tiles
-  for (int ieta = _tiles_ieta_min; ieta <= _tiles_ieta_max; ieta++) {
-    for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
-      Tile25 * tile = & _tiles[_tile_index(ieta,iphi)];
-      // no jets in this tile yet
-      tile->head = NULL; // first element of tiles points to itself
-      tile->begin_tiles[0] =  tile;
-      Tile25 ** pptile = & (tile->begin_tiles[0]);
-      pptile++;
-      //
-      // set up L's in column to the left of X
-      tile->surrounding_tiles = pptile;
-      if (ieta > _tiles_ieta_min) {
-	// with the itile subroutine, we can safely run tiles from
-	// idphi=-1 to idphi=+1, because it takes care of
-	// negative and positive boundaries
-	for (int idphi = -2; idphi <=+2; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta-1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // and the column twice to left of X
-      if (ieta > _tiles_ieta_min + 1) {
-	// with the itile subroutine, we can safely run tiles from
-	// idphi=-1 to idphi=+1, because it takes care of
-	// negative and positive boundaries
-	for (int idphi = -2; idphi <= +2; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta-2,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now set up last two L's (below X)
-      *pptile = & _tiles[_tile_index(ieta,iphi-1)];
-      pptile++;
-      *pptile = & _tiles[_tile_index(ieta,iphi-2)];
-      pptile++;
-      // set up first two R's (above X)
-      tile->RH_tiles = pptile;
-      *pptile = & _tiles[_tile_index(ieta,iphi+1)];
-      pptile++;
-      *pptile = & _tiles[_tile_index(ieta,iphi+2)];
-      pptile++;
-      // set up remaining R's, to the right of X
-      if (ieta < _tiles_ieta_max) {
-	for (int idphi = -2; idphi <= +2; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta+1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // set up remaining R's, and two cols to the right of X
-      if (ieta < _tiles_ieta_max - 1) {
-	for (int idphi = -2; idphi <= +2; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta+2,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now put semaphore for end tile
-      tile->end_tiles = pptile;
-      // finally make sure tiles are untagged
-      tile->tagged = false;
-      // and store the information about periodicity in phi
-      tile->use_periodic_delta_phi = use_periodic_delta_phi[iphi];
-      // and ensure max distance is sensibly initialised
-      tile->max_NN_dist = 0;
-      // and also position of centre of tile
-      tile->eta_centre = (ieta-_tiles_ieta_min+0.5)*_tile_size_eta + _tiles_eta_min;
-      tile->phi_centre = (iphi+0.5)*_tile_size_phi;
-    }
-  }
-
-}
-
-//----------------------------------------------------------------------
-/// return the tile index corresponding to the given eta,phi point
-int LazyTiling25::_tile_index(const double eta, const double phi) const {
-  int ieta, iphi;
-  if      (eta <= _tiles_eta_min) {ieta = 0;}
-  else if (eta >= _tiles_eta_max) {ieta = _tiles_ieta_max-_tiles_ieta_min;}
-  else {
-    //ieta = int(floor((eta - _tiles_eta_min) / _tile_size_eta));
-    ieta = int(((eta - _tiles_eta_min) / _tile_size_eta));
-    // following needed in case of rare but nasty rounding errors
-    if (ieta > _tiles_ieta_max-_tiles_ieta_min) {
-      ieta = _tiles_ieta_max-_tiles_ieta_min;} 
-  }
-  // allow for some extent of being beyond range in calculation of phi
-  // as well
-  //iphi = (int(floor(phi/_tile_size_phi)) + _n_tiles_phi) % _n_tiles_phi;
-  // with just int and no floor, things run faster but beware
-  iphi = int((phi+twopi)/_tile_size_phi) % _n_tiles_phi;
-  return (iphi + ieta * _n_tiles_phi);
-}
-
-
-//----------------------------------------------------------------------
-// sets up information regarding the tiling of the given jet
-inline void LazyTiling25::_tj_set_jetinfo( TiledJet * const jet,
-					      const int _jets_index) {
-  // first call the generic setup
-  _bj_set_jetinfo<>(jet, _jets_index);
-
-  // Then do the setup specific to the tiled case.
-
-  // Find out which tile it belonds to
-  jet->tile_index = _tile_index(jet->eta, jet->phi);
-
-  // Insert it into the tile's linked list of jets
-  Tile25 * tile = &_tiles[jet->tile_index];
-  jet->previous   = NULL;
-  jet->next       = tile->head;
-  if (jet->next != NULL) {jet->next->previous = jet;}
-  tile->head      = jet;
-}
-
-
-//----------------------------------------------------------------------
-void LazyTiling25::_bj_remove_from_tiles(TiledJet * const jet) {
-  Tile25 * tile = & _tiles[jet->tile_index];
-
-  if (jet->previous == NULL) {
-    // we are at head of the tile, so reset it.
-    // If this was the only jet on the tile then tile->head will now be NULL
-    tile->head = jet->next;
-  } else {
-    // adjust link from previous jet in this tile
-    jet->previous->next = jet->next;
-  }
-  if (jet->next != NULL) {
-    // adjust backwards-link from next jet in this tile
-    jet->next->previous = jet->previous;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// output the contents of the tiles
-void LazyTiling25::_print_tiles(TiledJet * briefjets ) const {
-  for (vector<Tile25>::const_iterator tile = _tiles.begin(); 
-       tile < _tiles.end(); tile++) {
-    cout << "Tile " << tile - _tiles.begin()
-         << " at " << setw(10) << tile->eta_centre << "," << setw(10) << tile->phi_centre
-         << " = ";
-    vector<int> list;
-    for (TiledJet * jetI = tile->head; jetI != NULL; jetI = jetI->next) {
-      list.push_back(jetI-briefjets);
-      //cout <<" "<<jetI-briefjets;
-    }
-    sort(list.begin(),list.end());
-    for (unsigned int i = 0; i < list.size(); i++) {cout <<" "<<list[i];}
-    cout <<"\n";
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Add to the vector tile_union the tiles that are in the neighbourhood
-/// of the specified tile_index, including itself -- start adding
-/// from position n_near_tiles-1, and increase n_near_tiles as
-/// you go along (could have done it more C++ like with vector with reserved
-/// space, but fear is that it would have been slower, e.g. checking
-/// for end of vector at each stage to decide whether to resize it)
-void LazyTiling25::_add_neighbours_to_tile_union(const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles) const {
-  for (Tile25 * const * near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but only adds neighbours if 
-/// their "tagged" status is false; when a neighbour is added its
-/// tagged status is set to true.
-inline void LazyTiling25::_add_untagged_neighbours_to_tile_union(
-               const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  for (Tile25 ** near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    if (! (*near_tile)->tagged) {
-      (*near_tile)->tagged = true;
-      // get the tile number
-      tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-      n_near_tiles++;
-    }
-  }
-}
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but adds tiles that are
-/// "neighbours" of a jet (rather than a tile) and only if a
-/// neighbouring tile's max_NN_dist is >= the distance between the jet
-/// and the nearest point on the tile. It ignores tiles that have
-/// already been tagged.
-inline void LazyTiling25::_add_untagged_neighbours_to_tile_union_using_max_info(
-               const TiledJet * jet, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  Tile25 & tile = _tiles[jet->tile_index];
-  
-  for (Tile25 ** near_tile = tile.begin_tiles; near_tile != tile.end_tiles; near_tile++){
-    if ((*near_tile)->tagged) continue;
-    // here we are not allowed to miss a tile due to some rounding
-    // error. We therefore allow for a margin of security
-    double dist = _distance_to_tile(jet, *near_tile) - tile_edge_security_margin;
-    // cout << "      max info looked at tile " << *near_tile - &_tiles[0] 
-    //      << ", dist = " << dist << " " << (*near_tile)->max_NN_dist
-    //      << " -> diff = " << dist-(*near_tile)->max_NN_dist << endl;
-    if (dist > (*near_tile)->max_NN_dist) continue;
-
-    // cout << "      max info tagged tile " << *near_tile - &_tiles[0] << endl;
-    (*near_tile)->tagged = true;
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-////--------TMPTMPTMPTMPTMP-----GPS TEMP--------------------
-//ostream & operator<<(ostream & ostr, const TiledJet & jet) {
-//  ostr << "j" << setw(3) << jet._jets_index << ":pt2,rap,phi=" ; ostr.flush();
-//  ostr     << jet.kt2 << ","; ostr.flush();
-//  ostr     << jet.eta << ","; ostr.flush();
-//  ostr     << jet.phi; ostr.flush();
-//  ostr     << ", tile=" << jet.tile_index; ostr.flush();
-//  return ostr;
-//}
-
-
-//----------------------------------------------------------------------
-/// returns a particle's distance to the edge of the specified tile
-inline double LazyTiling25::_distance_to_tile(const TiledJet * bj, const Tile25 * tile) 
-#ifdef INSTRUMENT2
-   {
-  _ncall_dtt++; // GPS tmp
-#else
-  const {
-#endif // INSTRUMENT2
-  // Note the careful way of checking the minimum potential deta:
-  // unlike the phi case below, we don't calculate the distance to the
-  // centre and subtract spacing/2. This is because of issue of
-  // boundary tiles, which can extend far beyond spacing/2 in eta. 
-  // Using the positions of tile centers should instead be safe.
-  double deta;
-  if (_tiles[bj->tile_index].eta_centre == tile->eta_centre) deta = 0;
-  //else   deta = std::abs(bj->eta - tile->eta_centre) - 0.5*_tile_size_eta;
-  else   deta = std::abs(bj->eta - tile->eta_centre) - _tile_half_size_eta;
-  // ------
-  //   |
-  // A | B
-  // ------
-  //   |
-  // C | D
-  // ------
-
-  double dphi = std::abs(bj->phi - tile->phi_centre);
-  if (dphi > pi) dphi = twopi-dphi;
-  dphi -= _tile_half_size_phi;
-  //dphi -= 0.5*_tile_size_phi;
-  if (dphi < 0) dphi = 0;
-
-  return dphi*dphi + deta*deta;
-}
-
-
-
-
-//----------------------------------------------------------------------
-/// looks at distance between jetX and jetI and updates the NN
-/// information if relevant; also pushes identity of jetI onto
-/// the vector of jets for minheap, to signal that it will have
-/// to be handled later.
-///
-/// GPS TEMP GPS TMP: REMOVE THIS LATER: EVEN LABELLED AS INLINE, THE
-/// CALL ADDS A SUBSTANTIAL PENALTY...
-inline void LazyTiling25::_update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, vector<TiledJet *> & jets_for_minheap) {
-  double dist = _bj_dist(jetI,jetX);
-  if (dist < jetI->NN_dist) {
-    if (jetI != jetX) {
-      jetI->NN_dist = dist;
-      jetI->NN = jetX;
-      // label jetI as needing heap action...
-      if (!jetI->minheap_update_needed()) {
-	jetI->label_minheap_update_needed();
-	jets_for_minheap.push_back(jetI);
-      }
-    }
-  }
-  if (dist < jetX->NN_dist) {
-    if (jetI != jetX) {
-      jetX->NN_dist = dist;
-      jetX->NN      = jetI;}
-  }
-}
-
-
-inline void LazyTiling25::_set_NN(TiledJet * jetI, 
-                              vector<TiledJet *> & jets_for_minheap) {
-  jetI->NN_dist = _R2;
-  jetI->NN      = NULL;
-  // label jetI as needing heap action...
-  if (!jetI->minheap_update_needed()) {
-    jetI->label_minheap_update_needed();
-    jets_for_minheap.push_back(jetI);}
-  // now go over tiles that are neighbours of I (include own tile)
-  Tile25 * tile_ptr = &_tiles[jetI->tile_index];
-  //if (tile_ptr->is_near_zero_phi(_tile_size_phi)) {
-    for (Tile25 ** near_tile  = tile_ptr->begin_tiles; 
-         near_tile != tile_ptr->end_tiles; near_tile++) {
-      // for own tile, this will be zero automatically: should we be clever
-      // and skip the test? (With some doubling of code?)
-      if (jetI->NN_dist < _distance_to_tile(jetI, *near_tile)) continue;
-      // and then over the contents of that tile
-      for (TiledJet * jetJ  = (*near_tile)->head; 
-           jetJ != NULL; jetJ = jetJ->next) {
-        double dist = _bj_dist(jetI,jetJ);
-        if (dist < jetI->NN_dist && jetJ != jetI) {
-          jetI->NN_dist = dist; jetI->NN = jetJ;
-        }
-      }
-    }
-  // } else {
-  //   // second copy that exploits the fact that for this tile we needn't worry
-  //   // about periodicity
-  //   for (Tile25 ** near_tile  = tile_ptr->begin_tiles; 
-  //        near_tile != tile_ptr->end_tiles; near_tile++) {
-  //     // for own tile, this will be zero automatically: should we be clever
-  //     // and skip the test? (With some doubling of code?)
-  //     if (jetI->NN_dist < _distance_to_tile(jetI, *near_tile)) continue;
-  //     // and then over the contents of that tile
-  //     for (TiledJet * jetJ  = (*near_tile)->head; 
-  //          jetJ != NULL; jetJ = jetJ->next) {
-  //       double dist = _bj_dist_not_periodic(jetI,jetJ);
-  //       if (dist < jetI->NN_dist && jetJ != jetI) {
-  //         jetI->NN_dist = dist; jetI->NN = jetJ;
-  //       }
-  //     }
-  //   }
-  // }
-}
-
-
-void LazyTiling25::run() {
-
-  //_initialise_tiles();
-
-  int n = _jets.size();
-  if (n == 0) return; 
-
-  TiledJet * briefjets = new TiledJet[n];
-  TiledJet * jetA = briefjets, * jetB;
-  // avoid warning about uninitialised oldB below; 
-  // only valid for n>=1 (hence the test n==0 test above)
-  TiledJet oldB = briefjets[0]; 
-
-  // will be used quite deep inside loops, but declare it here so that
-  // memory (de)allocation gets done only once
-  vector<int> tile_union(3*25);
-  
-  // initialise the basic jet info 
-  for (int i = 0; i< n; i++) {
-    _tj_set_jetinfo(jetA, i);
-    //cout << i<<": "<<jetA->tile_index<<"\n";
-    jetA++; // move on to next entry of briefjets
-  }
-  TiledJet * head = briefjets; // a nicer way of naming start
-
-  // set up the initial nearest neighbour information
-  vector<Tile25>::iterator tile;
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    // first do it on this tile
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
-	double dist = _bj_dist_not_periodic(jetA,jetB);
-	if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-	if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-      }
-    }
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    if (tile->use_periodic_delta_phi) {
-      // then do it for RH tiles; 
-      for (Tile25 ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = _distance_to_tile(jetA, *RTile);
-          // it only makes sense to do a tile if jetA is close enough to the Rtile
-          // either for a jet in the Rtile to be closer to jetA than it's current NN
-          // or if jetA could be closer to something in the Rtile than the largest
-          // NN distance within the RTile.
-          //
-          // GPS note: also tried approach where we perform only the
-          //           first test and run over all surrounding tiles
-          //           (not just RH ones). The test is passed less
-          //           frequently, but one is running over more tiles
-          //           and on balance, for the trial event we used, it's
-          //           a bit slower.
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= (*RTile)->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-        }
-      }
-    } else {
-      // this second version of the code uses the faster
-      // "not_periodic" version because it knows that the tile is
-      // sufficiently far from the edge.
-      for (Tile25 ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = _distance_to_tile(jetA, *RTile);
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= (*RTile)->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist_not_periodic(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-        }
-      }
-    }
-    // no need to do it for LH tiles, since they are implicitly done
-    // when we set NN for both jetA and jetB on the RH tiles.
-  }
-  // Now update the max_NN_dist within each tile. Not strictly
-  // necessary, because existing max_NN_dist is an upper bound.  but
-  // costs little and may give some efficiency gain later.
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    tile->max_NN_dist = 0;
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-
-#ifdef INSTRUMENT2
-  cout << "intermediate ncall, dtt = " << _ncall << " " << _ncall_dtt << endl; // GPS tmp
-#endif // INSTRUMENT2
-
-  // GPS debugging
-  // _print_tiles(briefjets);
-  // for (jetB = briefjets; jetB < briefjets+n; jetB++) {
-  //   cout << "Tiled jet " << jetB->_jets_index << " has NN " << jetB->NN-briefjets << endl;
-  // }
-
-  vector<double> diJs(n);
-  for (int i = 0; i < n; i++) {
-    diJs[i] = _bj_diJ(&briefjets[i]);
-    briefjets[i].label_minheap_update_done();
-  }
-  MinHeap minheap(diJs);
-  // have a stack telling us which jets we'll have to update on the heap
-  vector<TiledJet *> jets_for_minheap;
-  jets_for_minheap.reserve(n); 
-
-  // now run the recombination loop
-  int history_location = n-1;
-  while (n > 0) {
-
-    double diJ_min = minheap.minval() *_invR2;
-    jetA = head + minheap.minloc();
-
-    // do the recombination between A and B
-    history_location++;
-    jetB = jetA->NN;
-
-    if (jetB != NULL) {
-      // jet-jet recombination
-      // If necessary relabel A & B to ensure jetB < jetA, that way if
-      // the larger of them == newtail then that ends up being jetA and 
-      // the new jet that is added as jetB is inserted in a position that
-      // has a future!
-      if (jetA < jetB) {std::swap(jetA,jetB);}
-
-      int nn; // new jet index
-      _cs.plugin_record_ij_recombination(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
-      
-      // what was jetB will now become the new jet
-      _bj_remove_from_tiles(jetA);
-      oldB = * jetB;  // take a copy because we will need it...
-      _bj_remove_from_tiles(jetB);
-      _tj_set_jetinfo(jetB, nn); // cause jetB to become _jets[nn]
-                                 // (also registers the jet in the tiling)
-    } else {
-      // jet-beam recombination
-      // get the hist_index
-      _cs.plugin_record_iB_recombination(jetA->_jets_index, diJ_min);
-      _bj_remove_from_tiles(jetA);
-    }
-
-    // remove the minheap entry for jetA
-    minheap.remove(jetA-head);
-
-    int n_near_tiles = 0;
-
-    // GS comment:
-    //
-    // At this stage, we have perforned the clustering in
-    // ClusterSequence and we need to update the NNs. The objects we
-    // deal with are jetA and oldB (the once that have been clustered)
-    // as well as jetB (the result of the clustering)
-    //
-    // There are two types of objects we need to update:
-    //  - find jetB NN
-    //  - update the NN of points which had jetA or jetB as their NN
-    //
-    // Wile we find jetB's NN, browsing relevant tiles near jetB, we
-    // also search for points which had jetA or jetB as their
-    // NN. These are tagged. Then we list the relevant tiles where we
-    // can potentially have points to update (i.e. points which had
-    // jetA and oldB as NN) in the yet untagged relevant tiles near
-    // jetA and oldB.
-    //
-    // DEBUG:
-    // if (jetB != NULL) {
-    //   cout << "jetA = " << jetA->_jets_index << " (tile " << jetA->tile_index << "), "
-    //        << "oldB = " << oldB._jets_index  << " (tile " << oldB. tile_index << "), "
-    //        << "jetB = " << jetB->_jets_index << " (tile " << jetB->tile_index << ")" << endl;
-    // } else {
-    //   cout << "jetA = " << jetA->_jets_index << " (tile " << jetA->tile_index << ")" << endl;
-    // }
-    
-    // Initialise jetB's NN distance as well as updating it for other
-    // particles. While doing so, examine whether jetA or old jetB was
-    // some other particle's NN.
-    if (jetB != NULL) {
-      Tile25 & jetB_tile = _tiles[jetB->tile_index];
-      for (Tile25 ** near_tile  = jetB_tile.begin_tiles; 
-	           near_tile != jetB_tile.end_tiles; near_tile++) {
-
-    	double dist_to_tile = _distance_to_tile(jetB, *near_tile);
-        // use <= in next line so that on first tile, relevant_for_jetB is 
-        // set to true
-    	bool relevant_for_jetB  = dist_to_tile <= jetB->NN_dist;
-    	bool relevant_for_near_tile = dist_to_tile <= (*near_tile)->max_NN_dist;
-        bool relevant = relevant_for_jetB || relevant_for_near_tile;
-
-        // cout << "  Relevance of tile " << *near_tile - & _tiles[0]
-        //      << " wrt jetB is " << relevant << endl;
-
-        if (! relevant) continue;
-        // now label this tile as having been considered (so that we 
-        // don't go over it again later)
-        tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-        (*near_tile)->tagged = true;
-        n_near_tiles++;
-        
-        // if going over the neighbouring tile's jets, check anyway
-        // whether A or B were nearest neighbours, since it comes at a
-        // modest cost relative to the distance computation (and we would
-        // in most cases have to do it again later anyway).
-        for (TiledJet * jetI = (*near_tile)->head; jetI != NULL; jetI = jetI->next) {
-          if (jetI->NN == jetA || jetI->NN == jetB) _set_NN(jetI, jets_for_minheap);
-          _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-        }
-      }
-    }
-
-    // first establish the set of tiles over which we are going to
-    // have to run searches for updated and new nearest-neighbours --
-    // basically a combination of vicinity of the tiles of the two old
-    // and one new jet.
-    int n_done_tiles = n_near_tiles;
-    //cout << "Looking at relevant tiles to update for jetA" << endl;
-    _add_untagged_neighbours_to_tile_union_using_max_info(jetA, 
-       					   tile_union, n_near_tiles);
-    if (jetB != NULL) {
-      // cout << "Looking at relevant tiles to update for oldB" << endl;
-	_add_untagged_neighbours_to_tile_union_using_max_info(&oldB,
-							      tile_union,n_near_tiles);
-      jetB->label_minheap_update_needed();
-      jets_for_minheap.push_back(jetB);
-    }
-
-
-    // first untag the tiles we have already dealt with
-    for (int itile = 0; itile < n_done_tiles; itile++) {
-      _tiles[tile_union[itile]].tagged = false;
-    }
-    // now run over the tiles that were tagged earlier and that we haven't yet
-    // had a change to visit.
-    for (int itile = n_done_tiles; itile < n_near_tiles; itile++) {
-      Tile25 * tile_ptr = &_tiles[tile_union[itile]];
-      tile_ptr->tagged = false;
-      // run over all jets in the current tile
-      for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
-        // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-        if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
-          _set_NN(jetI, jets_for_minheap);
-        }
-      }
-    }
-
-    // deal with jets whose minheap entry needs updating
-    //if (verbose) cout << "  jets whose NN was modified: " << endl;
-    while (jets_for_minheap.size() > 0) {
-      TiledJet * jetI = jets_for_minheap.back(); 
-      jets_for_minheap.pop_back();
-      minheap.update(jetI-head, _bj_diJ(jetI));
-      jetI->label_minheap_update_done();
-      // handle max_NN_dist update for all jets that might have
-      // seen a change (increase) of distance
-      Tile25 & tile_I = _tiles[jetI->tile_index];
-      if (tile_I.max_NN_dist < jetI->NN_dist) tile_I.max_NN_dist = jetI->NN_dist;
-    }
-    n--;
-  }
-
-  // final cleaning up;
-  delete[] briefjets;
-#ifdef INSTRUMENT2
-  cout << "ncall, dtt = " << _ncall << " " << _ncall_dtt << endl; // GPS tmp
-#endif // INSTRUMENT2
-
-}
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/LazyTiling9.cc
===================================================================
--- external/fastjet/LazyTiling9.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,751 +1,0 @@
-//FJSTARTHEADER
-// $Id: LazyTiling9.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-
-#include <iomanip>
-#include <limits>
-#include <cmath>
-#include "fastjet/internal/LazyTiling9.hh"
-#include "fastjet/internal/TilingExtent.hh"
-using namespace std;
-
-// uncomment the line below to use TilingExtent in LazyTiling9
-#define _FASTJET_TILING2_USE_TILING_ANALYSIS_
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-
-LazyTiling9::LazyTiling9(ClusterSequence & cs) :
-  _cs(cs), _jets(cs.jets())
-  //, _minheap(_jets.size()) 
-{
-#ifdef INSTRUMENT2
-  _ncall = 0; // gps tmp
-  _ncall_dtt = 0; // gps tmp
-#endif // INSTRUMENT2
-  _Rparam = cs.jet_def().R();
-  _R2 = _Rparam * _Rparam;
-  _invR2 = 1.0 / _R2;
-  _initialise_tiles();
-}
-
-
-//----------------------------------------------------------------------
-/// Set up the tiles:
-///  - decide the range in eta
-///  - allocate the tiles
-///  - set up the cross-referencing info between tiles
-///
-/// The neighbourhood of a tile is set up as follows
-///
-/// 	      LRR
-///           LXR
-///           LLR
-///
-/// such that tiles is an array containing XLLLLRRRR with pointers
-///                                         |   \ RH_tiles
-///                                         \ surrounding_tiles
-///
-/// with appropriate precautions when close to the edge of the tiled
-/// region.
-///
-void LazyTiling9::_initialise_tiles() {
-
-  // first decide tile sizes (with a lower bound to avoid huge memory use with
-  // very small R)
-  double default_size = max(0.1,_Rparam);
-  _tile_size_eta = default_size;
-  // it makes no sense to go below 3 tiles in phi -- 3 tiles is
-  // sufficient to make sure all pair-wise combinations up to pi in
-  // phi are possible
-  _n_tiles_phi   = max(3,int(floor(twopi/default_size)));
-  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
-
-#ifdef _FASTJET_TILING2_USE_TILING_ANALYSIS_
-  // testing
-  TilingExtent tiling_analysis(_cs);
-  _tiles_eta_min = tiling_analysis.minrap();
-  _tiles_eta_max = tiling_analysis.maxrap();
-  //cout << "Using timing analysis " << " " << _tiles_eta_min << " " << _tiles_eta_max << endl;
-#else
-  // always include zero rapidity in the tiling region
-  _tiles_eta_min = 0.0;
-  _tiles_eta_max = 0.0;
-  // but go no further than following
-  const double maxrap = 7.0;
-  
-  // and find out how much further one should go
-  for(unsigned int i = 0; i < _jets.size(); i++) {
-    double eta = _jets[i].rap();
-    // first check if eta is in range -- to avoid taking into account
-    // very spurious rapidities due to particles with near-zero kt.
-    if (abs(eta) < maxrap) {
-      if (eta < _tiles_eta_min) {_tiles_eta_min = eta;}
-      if (eta > _tiles_eta_max) {_tiles_eta_max = eta;}
-    }
-  }
-  //cout << "NOT using timing analysis " << " " << _tiles_eta_min << " " << _tiles_eta_max << endl;
-#endif
-
-  // Now adjust the values for the rapidity ("eta") range.
-  //
-  // When tile_size_eta is large, we have two options:
-  // - always have at least two tiles in rapidity (FASTJET_LAZY9_MIN2TILESY),
-  //   currently split down the middle of the rapidity extent of the particles
-  // - take whatever we get from the original 
-  //   _tiles_ieta_min[max] = int(floor(_tiles_eta_min[max]/_tile_size_eta));
-  //   which will sometimes leave us with just one tile in Y; 
-  //
-  // For events that are symetric in Y this should not change
-  // anything, but for asymmetric ones FASTJET_LAZY9_MIN2TILESY may be
-  // a bit faster.
-  // 
-#define FASTJET_LAZY9_MIN2TILESY
-#ifdef FASTJET_LAZY9_MIN2TILESY
-   if (_tiles_eta_max - _tiles_eta_min < 2*_tile_size_eta) {
-     // if we have a rapidity coverage that is small compared to the
-     // tile size then we can adjust the grid in rapidity so as to
-     // have exactly 3 tiles. This can give relevant speed improvements 
-     // for large R jets
-     _tile_size_eta = (_tiles_eta_max - _tiles_eta_min)/2;
-     _tiles_ieta_min = 0;
-     _tiles_ieta_max = 1;
-     // the eta max value is being taken as the lower edge of the
-     // highest-y tile
-     _tiles_eta_max -= _tile_size_eta;
-   } else {
-#endif //FASTJET_LAZY9_MIN2TILESY
-  _tiles_ieta_min = int(floor(_tiles_eta_min/_tile_size_eta));
-  _tiles_ieta_max = int(floor( _tiles_eta_max/_tile_size_eta));
-  _tiles_eta_min = _tiles_ieta_min * _tile_size_eta;
-  _tiles_eta_max = _tiles_ieta_max * _tile_size_eta;
-#ifdef FASTJET_LAZY9_MIN2TILESY
-   }
-#endif
-
-  _tile_half_size_eta = _tile_size_eta * 0.5;
-  _tile_half_size_phi = _tile_size_phi * 0.5;
-
-  // set up information about whether we need to allow for "periodic" 
-  // wrapping tests in delta_phi calculations
-  vector<bool> use_periodic_delta_phi(_n_tiles_phi, false);
-  if (_n_tiles_phi <= 3) {
-    fill(use_periodic_delta_phi.begin(), use_periodic_delta_phi.end(), true);
-  } else {
-    use_periodic_delta_phi[0] = true;
-    use_periodic_delta_phi[_n_tiles_phi-1] = true;
-  }
-
-  // allocate the tiles
-  _tiles.resize((_tiles_ieta_max-_tiles_ieta_min+1)*_n_tiles_phi);
-
-  // now set up the cross-referencing between tiles
-  for (int ieta = _tiles_ieta_min; ieta <= _tiles_ieta_max; ieta++) {
-    for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
-      Tile2 * tile = & _tiles[_tile_index(ieta,iphi)];
-      // no jets in this tile yet
-      tile->head = NULL; // first element of tiles points to itself
-      tile->begin_tiles[0] =  tile;
-      Tile2 ** pptile = & (tile->begin_tiles[0]);
-      pptile++;
-      //
-      // set up L's in column to the left of X
-      tile->surrounding_tiles = pptile;
-      if (ieta > _tiles_ieta_min) {
-	// with the itile subroutine, we can safely run tiles from
-	// idphi=-1 to idphi=+1, because it takes care of
-	// negative and positive boundaries
-	for (int idphi = -1; idphi <=+1; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta-1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now set up last L (below X)
-      *pptile = & _tiles[_tile_index(ieta,iphi-1)];
-      pptile++;
-      // set up first R (above X)
-      tile->RH_tiles = pptile;
-      *pptile = & _tiles[_tile_index(ieta,iphi+1)];
-      pptile++;
-      // set up remaining R's, to the right of X
-      if (ieta < _tiles_ieta_max) {
-	for (int idphi = -1; idphi <= +1; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta+1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now put semaphore for end tile
-      tile->end_tiles = pptile;
-      // finally make sure tiles are untagged
-      tile->tagged = false;
-      // and store the information about periodicity in phi
-      tile->use_periodic_delta_phi = use_periodic_delta_phi[iphi];
-      // and ensure max distance is sensibly initialised
-      tile->max_NN_dist = 0;
-      // and also position of centre of tile
-      tile->eta_centre = (ieta-_tiles_ieta_min+0.5)*_tile_size_eta + _tiles_eta_min;
-      tile->phi_centre = (iphi+0.5)*_tile_size_phi;
-    }
-  }
-
-}
-
-//----------------------------------------------------------------------
-/// return the tile index corresponding to the given eta,phi point
-int LazyTiling9::_tile_index(const double eta, const double phi) const {
-  int ieta, iphi;
-  if      (eta <= _tiles_eta_min) {ieta = 0;}
-  else if (eta >= _tiles_eta_max) {ieta = _tiles_ieta_max-_tiles_ieta_min;}
-  else {
-    //ieta = int(floor((eta - _tiles_eta_min) / _tile_size_eta));
-    ieta = int(((eta - _tiles_eta_min) / _tile_size_eta));
-    // following needed in case of rare but nasty rounding errors
-    if (ieta > _tiles_ieta_max-_tiles_ieta_min) {
-      ieta = _tiles_ieta_max-_tiles_ieta_min;} 
-  }
-  // allow for some extent of being beyond range in calculation of phi
-  // as well
-  //iphi = (int(floor(phi/_tile_size_phi)) + _n_tiles_phi) % _n_tiles_phi;
-  // with just int and no floor, things run faster but beware
-  iphi = int((phi+twopi)/_tile_size_phi) % _n_tiles_phi;
-  return (iphi + ieta * _n_tiles_phi);
-}
-
-
-//----------------------------------------------------------------------
-// sets up information regarding the tiling of the given jet
-inline void LazyTiling9::_tj_set_jetinfo( TiledJet * const jet,
-					      const int _jets_index) {
-  // first call the generic setup
-  _bj_set_jetinfo<>(jet, _jets_index);
-
-  // Then do the setup specific to the tiled case.
-
-  // Find out which tile it belonds to
-  jet->tile_index = _tile_index(jet->eta, jet->phi);
-
-  // Insert it into the tile's linked list of jets
-  Tile2 * tile = &_tiles[jet->tile_index];
-  jet->previous   = NULL;
-  jet->next       = tile->head;
-  if (jet->next != NULL) {jet->next->previous = jet;}
-  tile->head      = jet;
-}
-
-
-//----------------------------------------------------------------------
-void LazyTiling9::_bj_remove_from_tiles(TiledJet * const jet) {
-  Tile2 * tile = & _tiles[jet->tile_index];
-
-  if (jet->previous == NULL) {
-    // we are at head of the tile, so reset it.
-    // If this was the only jet on the tile then tile->head will now be NULL
-    tile->head = jet->next;
-  } else {
-    // adjust link from previous jet in this tile
-    jet->previous->next = jet->next;
-  }
-  if (jet->next != NULL) {
-    // adjust backwards-link from next jet in this tile
-    jet->next->previous = jet->previous;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// output the contents of the tiles
-void LazyTiling9::_print_tiles(TiledJet * briefjets ) const {
-  for (vector<Tile2>::const_iterator tile = _tiles.begin(); 
-       tile < _tiles.end(); tile++) {
-    cout << "Tile " << tile - _tiles.begin()<<" = ";
-    vector<int> list;
-    for (TiledJet * jetI = tile->head; jetI != NULL; jetI = jetI->next) {
-      list.push_back(jetI-briefjets);
-      //cout <<" "<<jetI-briefjets;
-    }
-    sort(list.begin(),list.end());
-    for (unsigned int i = 0; i < list.size(); i++) {cout <<" "<<list[i];}
-    cout <<"\n";
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Add to the vector tile_union the tiles that are in the neighbourhood
-/// of the specified tile_index, including itself -- start adding
-/// from position n_near_tiles-1, and increase n_near_tiles as
-/// you go along (could have done it more C++ like with vector with reserved
-/// space, but fear is that it would have been slower, e.g. checking
-/// for end of vector at each stage to decide whether to resize it)
-void LazyTiling9::_add_neighbours_to_tile_union(const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles) const {
-  for (Tile2 * const * near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but only adds neighbours if 
-/// their "tagged" status is false; when a neighbour is added its
-/// tagged status is set to true.
-inline void LazyTiling9::_add_untagged_neighbours_to_tile_union(
-               const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  for (Tile2 ** near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    if (! (*near_tile)->tagged) {
-      (*near_tile)->tagged = true;
-      // get the tile number
-      tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-      n_near_tiles++;
-    }
-  }
-}
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but adds tiles that are
-/// "neighbours" of a jet (rather than a tile) and only if a
-/// neighbouring tile's max_NN_dist is >= the distance between the jet
-/// and the nearest point on the tile. It ignores tiles that have
-/// already been tagged.
-inline void LazyTiling9::_add_untagged_neighbours_to_tile_union_using_max_info(
-               const TiledJet * jet, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  Tile2 & tile = _tiles[jet->tile_index];
-  
-  for (Tile2 ** near_tile = tile.begin_tiles; near_tile != tile.end_tiles; near_tile++){
-    if ((*near_tile)->tagged) continue;
-    // here we are not allowed to miss a tile due to some rounding
-    // error. We therefore allow for a margin of security
-    double dist = _distance_to_tile(jet, *near_tile) - tile_edge_security_margin;
-    // cout << "      max info looked at tile " << *near_tile - &_tiles[0] 
-    // 	 << ", dist = " << dist << " " << (*near_tile)->max_NN_dist
-    // 	 << endl;
-    if (dist > (*near_tile)->max_NN_dist) continue;
-
-    // cout << "      max info tagged tile " << *near_tile - &_tiles[0] << endl;
-    (*near_tile)->tagged = true;
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-////--------TMPTMPTMPTMPTMP-----GPS TEMP--------------------
-//ostream & operator<<(ostream & ostr, const TiledJet & jet) {
-//  ostr << "j" << setw(3) << jet._jets_index << ":pt2,rap,phi=" ; ostr.flush();
-//  ostr     << jet.kt2 << ","; ostr.flush();
-//  ostr     << jet.eta << ","; ostr.flush();
-//  ostr     << jet.phi; ostr.flush();
-//  ostr     << ", tile=" << jet.tile_index; ostr.flush();
-//  return ostr;
-//}
-
-
-//----------------------------------------------------------------------
-/// returns a particle's distance to the edge of the specified tile
-inline double LazyTiling9::_distance_to_tile(const TiledJet * bj, const Tile2 * tile) 
-#ifdef INSTRUMENT2
-   {
-  _ncall_dtt++; // GPS tmp
-#else
-  const {
-#endif // INSTRUMENT2
-  // Note the careful way of checking the minimum potential deta:
-  // unlike the phi case below, we don't calculate the distance to the
-  // centre and subtract spacing/2. This is because of issue of
-  // boundary tiles, which can extend far beyond spacing/2 in eta. 
-  // Using the positions of tile centers should instead be safe.
-  double deta;
-  if (_tiles[bj->tile_index].eta_centre == tile->eta_centre) deta = 0;
-  //else   deta = std::abs(bj->eta - tile->eta_centre) - 0.5*_tile_size_eta;
-  else   deta = std::abs(bj->eta - tile->eta_centre) - _tile_half_size_eta;
-  // ------
-  //   |
-  // A | B
-  // ------
-  //   |
-  // C | D
-  // ------
-
-  double dphi = std::abs(bj->phi - tile->phi_centre);
-  if (dphi > pi) dphi = twopi-dphi;
-  dphi -= _tile_half_size_phi;
-  //dphi -= 0.5*_tile_size_phi;
-  if (dphi < 0) dphi = 0;
-
-  return dphi*dphi + deta*deta;
-}
-
-
-
-
-//----------------------------------------------------------------------
-/// looks at distance between jetX and jetI and updates the NN
-/// information if relevant; also pushes identity of jetI onto
-/// the vector of jets for minheap, to signal that it will have
-/// to be handled later.
-///
-/// GPS TEMP GPS TMP: REMOVE THIS LATER: EVEN LABELLED AS INLINE, THE
-/// CALL ADDS A SUBSTANTIAL PENALTY...
-inline void LazyTiling9::_update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, vector<TiledJet *> & jets_for_minheap) {
-  double dist = _bj_dist(jetI,jetX);
-  if (dist < jetI->NN_dist) {
-    if (jetI != jetX) {
-      jetI->NN_dist = dist;
-      jetI->NN = jetX;
-      // label jetI as needing heap action...
-      if (!jetI->minheap_update_needed()) {
-	jetI->label_minheap_update_needed();
-	jets_for_minheap.push_back(jetI);
-      }
-    }
-  }
-  if (dist < jetX->NN_dist) {
-    if (jetI != jetX) {
-      jetX->NN_dist = dist;
-      jetX->NN      = jetI;}
-  }
-}
-
-
-inline void LazyTiling9::_set_NN(TiledJet * jetI, 
-                              vector<TiledJet *> & jets_for_minheap) {
-  jetI->NN_dist = _R2;
-  jetI->NN      = NULL;
-  // label jetI as needing heap action...
-  if (!jetI->minheap_update_needed()) {
-    jetI->label_minheap_update_needed();
-    jets_for_minheap.push_back(jetI);}
-  // now go over tiles that are neighbours of I (include own tile)
-  Tile2 * tile_ptr = &_tiles[jetI->tile_index];
-  //if (tile_ptr->is_near_zero_phi(_tile_size_phi)) {
-    for (Tile2 ** near_tile  = tile_ptr->begin_tiles; 
-         near_tile != tile_ptr->end_tiles; near_tile++) {
-      // for own tile, this will be zero automatically: should we be clever
-      // and skip the test? (With some doubling of code?)
-      if (jetI->NN_dist < _distance_to_tile(jetI, *near_tile)) continue;
-      // and then over the contents of that tile
-      for (TiledJet * jetJ  = (*near_tile)->head; 
-           jetJ != NULL; jetJ = jetJ->next) {
-        double dist = _bj_dist(jetI,jetJ);
-        if (dist < jetI->NN_dist && jetJ != jetI) {
-          jetI->NN_dist = dist; jetI->NN = jetJ;
-        }
-      }
-    }
-  // } else {
-  //   // second copy that exploits the fact that for this tile we needn't worry
-  //   // about periodicity
-  //   for (Tile2 ** near_tile  = tile_ptr->begin_tiles; 
-  //        near_tile != tile_ptr->end_tiles; near_tile++) {
-  //     // for own tile, this will be zero automatically: should we be clever
-  //     // and skip the test? (With some doubling of code?)
-  //     if (jetI->NN_dist < _distance_to_tile(jetI, *near_tile)) continue;
-  //     // and then over the contents of that tile
-  //     for (TiledJet * jetJ  = (*near_tile)->head; 
-  //          jetJ != NULL; jetJ = jetJ->next) {
-  //       double dist = _bj_dist_not_periodic(jetI,jetJ);
-  //       if (dist < jetI->NN_dist && jetJ != jetI) {
-  //         jetI->NN_dist = dist; jetI->NN = jetJ;
-  //       }
-  //     }
-  //   }
-  // }
-}
-
-
-void LazyTiling9::run() {
-
-  //_initialise_tiles();
-
-  int n = _jets.size();
-  if (n == 0) return; 
-
-  TiledJet * briefjets = new TiledJet[n];
-  TiledJet * jetA = briefjets, * jetB;
-  // avoid warning about uninitialised oldB below; 
-  // only valid for n>=1 (hence the test n==0 test above)
-  TiledJet oldB = briefjets[0]; 
-
-  // will be used quite deep inside loops, but declare it here so that
-  // memory (de)allocation gets done only once
-  vector<int> tile_union(3*n_tile_neighbours);
-  
-  // initialise the basic jet info 
-  for (int i = 0; i< n; i++) {
-    _tj_set_jetinfo(jetA, i);
-    //cout << i<<": "<<jetA->tile_index<<"\n";
-    jetA++; // move on to next entry of briefjets
-  }
-  TiledJet * head = briefjets; // a nicer way of naming start
-
-
-  // // count the contents of the tiles
-  // for (int ieta = _tiles_ieta_min; ieta <= _tiles_ieta_max; ieta++) {
-  //   for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
-  //     Tile2 * tile = & _tiles[_tile_index(ieta,iphi)];
-  //     int njets = 0;
-  //     const TiledJet * jet = tile->head;
-  //     while (jet != 0) {
-  //       njets++;
-  //       jet = jet->next;
-  //     }
-  //     cout << ieta 
-  //          << " " << iphi 
-  //          << " " << tile->jet_count()
-  //          << endl;
-  //   }
-  // }
-
-
-  // set up the initial nearest neighbour information
-  vector<Tile2>::iterator tile;
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    // first do it on this tile
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
-	double dist = _bj_dist_not_periodic(jetA,jetB);
-	if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-	if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-      }
-    }
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    if (tile->use_periodic_delta_phi) {
-      // then do it for RH tiles; 
-      for (Tile2 ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = _distance_to_tile(jetA, *RTile);
-          // it only makes sense to do a tile if jetA is close enough to the Rtile
-          // either for a jet in the Rtile to be closer to jetA than it's current NN
-          // or if jetA could be closer to something in the Rtile than the largest
-          // NN distance within the RTile.
-          //
-          // GPS note: also tried approach where we perform only the
-          //           first test and run over all surrounding tiles
-          //           (not just RH ones). The test is passed less
-          //           frequently, but one is running over more tiles
-          //           and on balance, for the trial event we used, it's
-          //           a bit slower.
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= (*RTile)->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-        }
-      }
-    } else {
-      // this second version of the code uses the faster
-      // "not_periodic" version because it knows that the tile is
-      // sufficiently far from the edge.
-      for (Tile2 ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = _distance_to_tile(jetA, *RTile);
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= (*RTile)->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist_not_periodic(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-        }
-      }
-    }
-    // no need to do it for LH tiles, since they are implicitly done
-    // when we set NN for both jetA and jetB on the RH tiles.
-  }
-  // Now update the max_NN_dist within each tile. Not strictly
-  // necessary, because existing max_NN_dist is an upper bound.  but
-  // costs little and may give some efficiency gain later.
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    tile->max_NN_dist = 0;
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-
-#ifdef INSTRUMENT2
-  cout << "intermediate ncall, dtt = " << _ncall << " " << _ncall_dtt << endl; // GPS tmp
-#endif // INSTRUMENT2
-
-  vector<double> diJs(n);
-  for (int i = 0; i < n; i++) {
-    diJs[i] = _bj_diJ(&briefjets[i]);
-    briefjets[i].label_minheap_update_done();
-  }
-  MinHeap minheap(diJs);
-  // have a stack telling us which jets we'll have to update on the heap
-  vector<TiledJet *> jets_for_minheap;
-  jets_for_minheap.reserve(n); 
-
-  // now run the recombination loop
-  int history_location = n-1;
-  while (n > 0) {
-
-    double diJ_min = minheap.minval() *_invR2;
-    jetA = head + minheap.minloc();
-
-    // do the recombination between A and B
-    history_location++;
-    jetB = jetA->NN;
-
-    if (jetB != NULL) {
-      // jet-jet recombination
-      // If necessary relabel A & B to ensure jetB < jetA, that way if
-      // the larger of them == newtail then that ends up being jetA and 
-      // the new jet that is added as jetB is inserted in a position that
-      // has a future!
-      if (jetA < jetB) {std::swap(jetA,jetB);}
-
-      int nn; // new jet index
-      _cs.plugin_record_ij_recombination(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
-      
-      // what was jetB will now become the new jet
-      _bj_remove_from_tiles(jetA);
-      oldB = * jetB;  // take a copy because we will need it...
-      _bj_remove_from_tiles(jetB);
-      _tj_set_jetinfo(jetB, nn); // cause jetB to become _jets[nn]
-                                 // (also registers the jet in the tiling)
-    } else {
-      // jet-beam recombination
-      // get the hist_index
-      _cs.plugin_record_iB_recombination(jetA->_jets_index, diJ_min);
-      _bj_remove_from_tiles(jetA);
-    }
-
-    // remove the minheap entry for jetA
-    minheap.remove(jetA-head);
-
-    int n_near_tiles = 0;
-
-    // Initialise jetB's NN distance as well as updating it for other
-    // particles. While doing so, examine whether jetA or old jetB was
-    // some other particle's NN.
-    if (jetB != NULL) {
-      Tile2 & jetB_tile = _tiles[jetB->tile_index];
-      for (Tile2 ** near_tile  = jetB_tile.begin_tiles; 
-	           near_tile != jetB_tile.end_tiles; near_tile++) {
-
-    	double dist_to_tile = _distance_to_tile(jetB, *near_tile);
-        // use <= in next line so that on first tile, relevant_for_jetB is 
-        // set to true
-    	bool relevant_for_jetB  = dist_to_tile <= jetB->NN_dist;
-    	bool relevant_for_near_tile = dist_to_tile <= (*near_tile)->max_NN_dist;
-        bool relevant = relevant_for_jetB || relevant_for_near_tile;
-        if (! relevant) continue;
-        // now label this tile as having been considered (so that we 
-        // don't go over it again later)
-        tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-        (*near_tile)->tagged = true;
-        n_near_tiles++;
-        
-        // if going over the neighbouring tile's jets, check anyway
-        // whether A or B were nearest neighbours, since it comes at a
-        // modest cost relative to the distance computation (and we would
-        // in most cases have to do it again later anyway).
-        for (TiledJet * jetI = (*near_tile)->head; jetI != NULL; jetI = jetI->next) {
-          if (jetI->NN == jetA || jetI->NN == jetB) _set_NN(jetI, jets_for_minheap);
-          _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-        }
-      }
-    }
-
-    // first establish the set of tiles over which we are going to
-    // have to run searches for updated and new nearest-neighbours --
-    // basically a combination of vicinity of the tiles of the two old
-    // and one new jet.
-    int n_done_tiles = n_near_tiles;
-    _add_untagged_neighbours_to_tile_union_using_max_info(jetA, 
-       					   tile_union, n_near_tiles);
-    if (jetB != NULL) {
-	_add_untagged_neighbours_to_tile_union_using_max_info(&oldB,
-							      tile_union,n_near_tiles);
-      jetB->label_minheap_update_needed();
-      jets_for_minheap.push_back(jetB);
-    }
-
-
-    // first untag the tiles we have already dealt with
-    for (int itile = 0; itile < n_done_tiles; itile++) {
-      _tiles[tile_union[itile]].tagged = false;
-    }
-    // now run over the tiles that were tagged earlier and that we haven't yet
-    // had a change to visit.
-    for (int itile = n_done_tiles; itile < n_near_tiles; itile++) {
-      Tile2 * tile_ptr = &_tiles[tile_union[itile]];
-      tile_ptr->tagged = false;
-      // run over all jets in the current tile
-      for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
-        // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-        if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
-          _set_NN(jetI, jets_for_minheap);
-        }
-      }
-    }
-
-    // deal with jets whose minheap entry needs updating
-    //if (verbose) cout << "  jets whose NN was modified: " << endl;
-    while (jets_for_minheap.size() > 0) {
-      TiledJet * jetI = jets_for_minheap.back(); 
-      jets_for_minheap.pop_back();
-      minheap.update(jetI-head, _bj_diJ(jetI));
-      jetI->label_minheap_update_done();
-      // handle max_NN_dist update for all jets that might have
-      // seen a change (increase) of distance
-      Tile2 & tile_I = _tiles[jetI->tile_index];
-      if (tile_I.max_NN_dist < jetI->NN_dist) tile_I.max_NN_dist = jetI->NN_dist;
-    }
-    n--;
-  }
-
-  // final cleaning up;
-  delete[] briefjets;
-#ifdef INSTRUMENT2
-  cout << "ncall, dtt = " << _ncall << " " << _ncall_dtt << endl; // GPS tmp
-#endif // INSTRUMENT2
-
-}
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/LazyTiling9Alt.cc
===================================================================
--- external/fastjet/LazyTiling9Alt.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,726 +1,0 @@
-//FJSTARTHEADER
-// $Id: LazyTiling9Alt.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include <iomanip>
-#include "fastjet/internal/LazyTiling9Alt.hh"
-#include "fastjet/internal/TilingExtent.hh"
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-LazyTiling9Alt::LazyTiling9Alt(ClusterSequence & cs) :
-  _cs(cs), _jets(cs.jets())
-  //, _minheap(_jets.size()) 
-{
-  _Rparam = cs.jet_def().R();
-  _R2 = _Rparam * _Rparam;
-  _invR2 = 1.0 / _R2;
-  _initialise_tiles();
-}
-
-
-//----------------------------------------------------------------------
-/// Set up the tiles:
-///  - decide the range in eta
-///  - allocate the tiles
-///  - set up the cross-referencing info between tiles
-///
-/// The neighbourhood of a tile is set up as follows
-///
-/// 	      LRR
-///           LXR
-///           LLR
-///
-/// such that tiles is an array containing XLLLLRRRR with pointers
-///                                         |   \ RH_tiles
-///                                         \ surrounding_tiles
-///
-/// with appropriate precautions when close to the edge of the tiled
-/// region.
-///
-void LazyTiling9Alt::_initialise_tiles() {
-
-  // first decide tile sizes (with a lower bound to avoid huge memory use with
-  // very small R)
-  double default_size = max(0.1,_Rparam);
-  _tile_size_eta = default_size;
-  // it makes no sense to go below 3 tiles in phi -- 3 tiles is
-  // sufficient to make sure all pair-wise combinations up to pi in
-  // phi are possible
-  _n_tiles_phi   = max(3,int(floor(twopi/default_size)));
-  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
-
-  // always include zero rapidity in the tiling region
-  _tiles_eta_min = 0.0;
-  _tiles_eta_max = 0.0;
-  // but go no further than following
-  const double maxrap = 7.0;
-
-  // and find out how much further one should go
-  for(unsigned int i = 0; i < _jets.size(); i++) {
-    double eta = _jets[i].rap();
-    // first check if eta is in range -- to avoid taking into account
-    // very spurious rapidities due to particles with near-zero kt.
-    if (abs(eta) < maxrap) {
-      if (eta < _tiles_eta_min) {_tiles_eta_min = eta;}
-      if (eta > _tiles_eta_max) {_tiles_eta_max = eta;}
-    }
-  }
-
-  // now adjust the values
-  _tiles_ieta_min = int(floor(_tiles_eta_min/_tile_size_eta));
-  _tiles_ieta_max = int(floor( _tiles_eta_max/_tile_size_eta));
-  _tiles_eta_min = _tiles_ieta_min * _tile_size_eta;
-  _tiles_eta_max = _tiles_ieta_max * _tile_size_eta;
-
-  _tile_half_size_eta = _tile_size_eta * 0.5;
-  _tile_half_size_phi = _tile_size_phi * 0.5;
-
-  // set up information about whether we need to allow for "periodic" 
-  // wrapping tests in delta_phi calculations
-  vector<bool> use_periodic_delta_phi(_n_tiles_phi, false);
-  if (_n_tiles_phi <= 3) {
-    fill(use_periodic_delta_phi.begin(), use_periodic_delta_phi.end(), true);
-  } else {
-    use_periodic_delta_phi[0] = true;
-    use_periodic_delta_phi[_n_tiles_phi-1] = true;
-  }
-
-  // allocate the tiles
-  _tiles.resize((_tiles_ieta_max-_tiles_ieta_min+1)*_n_tiles_phi);
-
-  // now set up the cross-referencing between tiles
-  for (int ieta = _tiles_ieta_min; ieta <= _tiles_ieta_max; ieta++) {
-    for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
-      Tile * tile = & _tiles[_tile_index(ieta,iphi)];
-      // no jets in this tile yet
-      tile->head = NULL; // first element of tiles points to itself
-      tile->begin_tiles[0] =  Tile::TileFnPair(tile,&Tile::distance_to_centre);
-      Tile::TileFnPair * pptile = & (tile->begin_tiles[0]);
-      pptile++;
-      //
-      // set up L's in column to the left of X
-      tile->surrounding_tiles = pptile;
-      if (ieta > _tiles_ieta_min) {
-	// with the itile subroutine, we can safely run tiles from
-	// idphi=-1 to idphi=+1, because it takes care of
-	// negative and positive boundaries
-	//for (int idphi = -1; idphi <=+1; idphi++) {
-        //  *pptile = & _tiles[_tile_index(ieta-1,iphi+idphi)];
-        //  pptile++;
-        //}	
-        *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta-1,iphi-1)],
-                                   &Tile::distance_to_left_bottom);
-        pptile++;
-        *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta-1,iphi)],
-                                   &Tile::distance_to_left);
-        pptile++;
-        *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta-1,iphi+1)],
-                                   &Tile::distance_to_left_top);
-        pptile++;
-      }
-      // now set up last L (below X)
-      *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta,iphi-1)], 
-                                 &Tile::distance_to_bottom);
-      pptile++;
-      // set up first R (above X)
-      tile->RH_tiles = pptile;
-      *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta,iphi+1)], 
-                                 &Tile::distance_to_top);
-      pptile++;
-      // set up remaining R's, to the right of X
-      if (ieta < _tiles_ieta_max) {
-	//for (int idphi = -1; idphi <= +1; idphi++) {
-	//  *pptile = & _tiles[_tile_index(ieta+1,iphi+idphi)];
-	//  pptile++;
-	//}	
-        *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta+1,iphi-1)],
-                                   &Tile::distance_to_right_bottom);
-        pptile++;
-        *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta+1,iphi)],
-                                   &Tile::distance_to_right);
-        pptile++;
-        *pptile = Tile::TileFnPair(& _tiles[_tile_index(ieta+1,iphi+1)],
-                                   &Tile::distance_to_right_top);
-        pptile++;
-      }
-      // now put semaphore for end tile
-      tile->end_tiles = pptile;
-      // finally make sure tiles are untagged
-      tile->tagged = false;
-      // and store the information about periodicity in phi
-      tile->use_periodic_delta_phi = use_periodic_delta_phi[iphi];
-      // and ensure max distance is sensibly initialised
-      tile->max_NN_dist = 0;
-      // and also position of centre of tile
-      tile->eta_min = ieta*_tile_size_eta;
-      tile->eta_max = (ieta+1)*_tile_size_eta;
-      tile->phi_min = iphi*_tile_size_phi;
-      tile->phi_max = (iphi+1)*_tile_size_phi;
-    }
-  }
-
-}
-
-//----------------------------------------------------------------------
-/// return the tile index corresponding to the given eta,phi point
-int LazyTiling9Alt::_tile_index(const double eta, const double phi) const {
-  int ieta, iphi;
-  if      (eta <= _tiles_eta_min) {ieta = 0;}
-  else if (eta >= _tiles_eta_max) {ieta = _tiles_ieta_max-_tiles_ieta_min;}
-  else {
-    //ieta = int(floor((eta - _tiles_eta_min) / _tile_size_eta));
-    ieta = int(((eta - _tiles_eta_min) / _tile_size_eta));
-    // following needed in case of rare but nasty rounding errors
-    if (ieta > _tiles_ieta_max-_tiles_ieta_min) {
-      ieta = _tiles_ieta_max-_tiles_ieta_min;} 
-  }
-  // allow for some extent of being beyond range in calculation of phi
-  // as well
-  //iphi = (int(floor(phi/_tile_size_phi)) + _n_tiles_phi) % _n_tiles_phi;
-  // with just int and no floor, things run faster but beware
-  iphi = int((phi+twopi)/_tile_size_phi) % _n_tiles_phi;
-  return (iphi + ieta * _n_tiles_phi);
-}
-
-
-//----------------------------------------------------------------------
-// sets up information regarding the tiling of the given jet
-inline void LazyTiling9Alt::_tj_set_jetinfo( TiledJet * const jet,
-					      const int _jets_index) {
-  // first call the generic setup
-  _bj_set_jetinfo<>(jet, _jets_index);
-
-  // Then do the setup specific to the tiled case.
-
-  // Find out which tile it belonds to
-  jet->tile_index = _tile_index(jet->eta, jet->phi);
-
-  // Insert it into the tile's linked list of jets
-  Tile * tile = &_tiles[jet->tile_index];
-  jet->previous   = NULL;
-  jet->next       = tile->head;
-  if (jet->next != NULL) {jet->next->previous = jet;}
-  tile->head      = jet;
-}
-
-
-//----------------------------------------------------------------------
-void LazyTiling9Alt::_bj_remove_from_tiles(TiledJet * const jet) {
-  Tile * tile = & _tiles[jet->tile_index];
-
-  if (jet->previous == NULL) {
-    // we are at head of the tile, so reset it.
-    // If this was the only jet on the tile then tile->head will now be NULL
-    tile->head = jet->next;
-  } else {
-    // adjust link from previous jet in this tile
-    jet->previous->next = jet->next;
-  }
-  if (jet->next != NULL) {
-    // adjust backwards-link from next jet in this tile
-    jet->next->previous = jet->previous;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// output the contents of the tiles
-void LazyTiling9Alt::_print_tiles(TiledJet * briefjets ) const {
-  for (vector<Tile>::const_iterator tile = _tiles.begin(); 
-       tile < _tiles.end(); tile++) {
-    cout << "Tile " << tile - _tiles.begin()<<" = ";
-    vector<int> list;
-    for (TiledJet * jetI = tile->head; jetI != NULL; jetI = jetI->next) {
-      list.push_back(jetI-briefjets);
-      //cout <<" "<<jetI-briefjets;
-    }
-    sort(list.begin(),list.end());
-    for (unsigned int i = 0; i < list.size(); i++) {cout <<" "<<list[i];}
-    cout <<"\n";
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Add to the vector tile_union the tiles that are in the neighbourhood
-/// of the specified tile_index, including itself -- start adding
-/// from position n_near_tiles-1, and increase n_near_tiles as
-/// you go along (could have done it more C++ like with vector with reserved
-/// space, but fear is that it would have been slower, e.g. checking
-/// for end of vector at each stage to decide whether to resize it)
-void LazyTiling9Alt::_add_neighbours_to_tile_union(const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles) const {
-  for (Tile::TileFnPair const * near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    // get the tile number
-    tile_union[n_near_tiles] = near_tile->first - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but only adds neighbours if 
-/// their "tagged" status is false; when a neighbour is added its
-/// tagged status is set to true.
-inline void LazyTiling9Alt::_add_untagged_neighbours_to_tile_union(
-               const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  for (Tile::TileFnPair * near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    if (! (near_tile->first)->tagged) {
-      (near_tile->first)->tagged = true;
-      // get the tile number
-      tile_union[n_near_tiles] = near_tile->first - & _tiles[0];
-      n_near_tiles++;
-    }
-  }
-}
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but adds tiles that are
-/// "neighbours" of a jet (rather than a tile) and only if a
-/// neighbouring tile's max_NN_dist is >= the distance between the jet
-/// and the nearest point on the tile. It ignores tiles that have
-/// already been tagged.
-inline void LazyTiling9Alt::_add_untagged_neighbours_to_tile_union_using_max_info(
-               const TiledJet * jet, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  Tile & tile = _tiles[jet->tile_index];
-  
-  for (Tile::TileFnPair * near_tile = tile.begin_tiles; near_tile != tile.end_tiles; near_tile++){
-    if ((near_tile->first)->tagged) continue;
-    // here we are not allowed to miss a tile due to some rounding
-    // error. We therefore allow for a margin of security
-    double dist = (tile.*(near_tile->second))(jet) - tile_edge_security_margin;
-    // cout << "      max info looked at tile " << *near_tile - &_tiles[0] 
-    // 	 << ", dist = " << dist << " " << (*near_tile)->max_NN_dist
-    // 	 << endl;
-    if (dist > (near_tile->first)->max_NN_dist) continue;
-
-    // cout << "      max info tagged tile " << *near_tile - &_tiles[0] << endl;
-    (near_tile->first)->tagged = true;
-    // get the tile number
-    tile_union[n_near_tiles] = near_tile->first - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-//--------TMPTMPTMPTMPTMP-----GPS TEMP--------------------
-ostream & operator<<(ostream & ostr, const TiledJet & jet) {
-  ostr << "j" << setw(3) << jet._jets_index << ":pt2,rap,phi=" ; ostr.flush();
-  ostr     << jet.kt2 << ","; ostr.flush();
-  ostr     << jet.eta << ","; ostr.flush();
-  ostr     << jet.phi; ostr.flush();
-  ostr     << ", tile=" << jet.tile_index; ostr.flush();
-  return ostr;
-}
-
-
-// //----------------------------------------------------------------------
-// /// returns a particle's distance to the edge of the specified tile
-// inline double LazyTiling9Alt::_distance_to_tile(const TiledJet * bj, const Tile * tile) const {
-// 
-// //   // Note the careful way of checking the minimum potential deta:
-// //   // unlike the phi case below, we don't calculate the distance to the
-// //   // centre and subtract spacing/2. This is because of issue of
-// //   // boundary tiles, which can extend far beyond spacing/2 in eta. 
-// //   // Using the positions of tile centers should instead be safe.
-// //   double deta;
-// //   if (_tiles[bj->tile_index].eta_centre == tile->eta_centre) deta = 0;
-// //   //else   deta = std::abs(bj->eta - tile->eta_centre) - 0.5*_tile_size_eta;
-// //   else   deta = std::abs(bj->eta - tile->eta_centre) - _tile_half_size_eta;
-// //   // ------
-// //   //   |
-// //   // A | B
-// //   // ------
-// //   //   |
-// //   // C | D
-// //   // ------
-// // 
-// //   double dphi = std::abs(bj->phi - tile->phi_centre);
-// //   if (dphi > pi) dphi = twopi-dphi;
-// //   dphi -= _tile_half_size_phi;
-// //   //dphi -= 0.5*_tile_size_phi;
-// //   if (dphi < 0) dphi = 0;
-// // 
-// //   return dphi*dphi + deta*deta;
-// 
-//   return 0.0;
-// }
-
-
-
-
-//----------------------------------------------------------------------
-/// looks at distance between jetX and jetI and updates the NN
-/// information if relevant; also pushes identity of jetI onto
-/// the vector of jets for minheap, to signal that it will have
-/// to be handled later.
-///
-/// GPS TEMP GPS TMP: REMOVE THIS LATER: EVEN LABELLED AS INLINE, THE
-/// CALL ADDS A SUBSTANTIAL PENALTY...
-inline void LazyTiling9Alt::_update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, vector<TiledJet *> & jets_for_minheap) {
-  double dist = _bj_dist(jetI,jetX);
-  if (dist < jetI->NN_dist) {
-    if (jetI != jetX) {
-      jetI->NN_dist = dist;
-      jetI->NN = jetX;
-      // label jetI as needing heap action...
-      if (!jetI->minheap_update_needed()) {
-	jetI->label_minheap_update_needed();
-	jets_for_minheap.push_back(jetI);
-      }
-    }
-  }
-  if (dist < jetX->NN_dist) {
-    if (jetI != jetX) {
-      jetX->NN_dist = dist;
-      jetX->NN      = jetI;}
-  }
-}
-
-
-inline void LazyTiling9Alt::_set_NN(TiledJet * jetI, 
-                            vector<TiledJet *> & jets_for_minheap) {
-  jetI->NN_dist = _R2;
-  jetI->NN      = NULL;
-  // label jetI as needing heap action...
-  if (!jetI->minheap_update_needed()) {
-    jetI->label_minheap_update_needed();
-    jets_for_minheap.push_back(jetI);}
-  // now go over tiles that are neighbours of I (include own tile)
-  Tile * tile_ptr = &_tiles[jetI->tile_index];
-  //if (tile_ptr->is_near_zero_phi(_tile_half_size_phi)) {
-    for (Tile::TileFnPair * near_tile  = tile_ptr->begin_tiles; 
-         near_tile != tile_ptr->end_tiles; near_tile++) {
-      // for own tile, this will be zero automatically: should we be clever
-      // and skip the test? (With some doubling of code?)
-      if (jetI->NN_dist < (tile_ptr->*(near_tile->second))(jetI)) continue;
-      // and then over the contents of that tile
-      for (TiledJet * jetJ  = (near_tile->first)->head; 
-           jetJ != NULL; jetJ = jetJ->next) {
-        double dist = _bj_dist(jetI,jetJ);
-        if (dist < jetI->NN_dist && jetJ != jetI) {
-          jetI->NN_dist = dist; jetI->NN = jetJ;
-        }
-      }
-    }
-  // } else {
-  //   // second copy that exploits the fact that for this tile we needn't worry
-  //   // about periodicity
-  //   for (Tile::TileFnPair * near_tile  = tile_ptr->begin_tiles; 
-  //        near_tile != tile_ptr->end_tiles; near_tile++) {
-  //     // for own tile, this will be zero automatically: should we be clever
-  //     // and skip the test? (With some doubling of code?)
-  //     if (jetI->NN_dist < tile_ptr->(*(near_tile->second)(jetI))) continue;
-  //     // and then over the contents of that tile
-  //     for (TiledJet * jetJ  = (*near_tile)->head; 
-  //          jetJ != NULL; jetJ = jetJ->next) {
-  //       double dist = _bj_dist_not_periodic(jetI,jetJ);
-  //       if (dist < jetI->NN_dist && jetJ != jetI) {
-  //         jetI->NN_dist = dist; jetI->NN = jetJ;
-  //       }
-  //     }
-  //   }
-  // }
-}
-
-
-void LazyTiling9Alt::run() {
-
-  //_initialise_tiles();
-
-  int n = _jets.size();
-  TiledJet * briefjets = new TiledJet[n];
-  TiledJet * jetA = briefjets, * jetB;
-  TiledJet oldB;
-  
-
-  // will be used quite deep inside loops, but declare it here so that
-  // memory (de)allocation gets done only once
-  vector<int> tile_union(3*n_tile_neighbours);
-  
-  // initialise the basic jet info 
-  for (int i = 0; i< n; i++) {
-    _tj_set_jetinfo(jetA, i);
-    //cout << i<<": "<<jetA->tile_index<<"\n";
-    jetA++; // move on to next entry of briefjets
-  }
-  TiledJet * head = briefjets; // a nicer way of naming start
-
-  // set up the initial nearest neighbour information
-  vector<Tile>::iterator tile;
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    // first do it on this tile
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
-	double dist = _bj_dist_not_periodic(jetA,jetB);
-	if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-	if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-      }
-    }
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    if (tile->use_periodic_delta_phi) {
-      // then do it for RH tiles; 
-      for (Tile::TileFnPair * RTileFnPair = tile->RH_tiles; 
-           RTileFnPair != tile->end_tiles; RTileFnPair++) {
-        Tile *RTile = RTileFnPair->first;
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = ((*tile).*(RTileFnPair->second))(jetA);
-          // it only makes sense to do a tile if jetA is close enough to the Rtile
-          // either for a jet in the Rtile to be closer to jetA than it's current NN
-          // or if jetA could be closer to something in the Rtile than the largest
-          // NN distance within the RTile.
-          //
-          // GPS note: also tried approach where we perform only the
-          //           first test and run over all surrounding tiles
-          //           (not just RH ones). The test is passed less
-          //           frequently, but one is running over more tiles
-          //           and on balance, for the trial event we used, it's
-          //           a bit slower.
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= RTile->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = RTile->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-        }
-      }
-    } else {
-      // this second version of the code uses the faster
-      // "not_periodic" version because it knows that the tile is
-      // sufficiently far from the edge.
-      for (Tile::TileFnPair* RTileFnPair = tile->RH_tiles;
-           RTileFnPair != tile->end_tiles; RTileFnPair++) {
-        Tile *RTile = RTileFnPair->first;
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = ((*tile).*(RTileFnPair->second))(jetA);
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= RTile->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = RTile->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist_not_periodic(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-        }
-      }
-    }
-    // no need to do it for LH tiles, since they are implicitly done
-    // when we set NN for both jetA and jetB on the RH tiles.
-  }
-  // Now update the max_NN_dist within each tile. Not strictly
-  // necessary, because existing max_NN_dist is an upper bound.  but
-  // costs little and may give some efficiency gain later.
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    tile->max_NN_dist = 0;
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-
-
-  vector<double> diJs(n);
-  for (int i = 0; i < n; i++) {
-    diJs[i] = _bj_diJ(&briefjets[i]);
-    briefjets[i].label_minheap_update_done();
-  }
-  MinHeap minheap(diJs);
-  // have a stack telling us which jets we'll have to update on the heap
-  vector<TiledJet *> jets_for_minheap;
-  jets_for_minheap.reserve(n); 
-
-  // now run the recombination loop
-  int history_location = n-1;
-  while (n > 0) {
-
-    double diJ_min = minheap.minval() *_invR2;
-    jetA = head + minheap.minloc();
-
-    // do the recombination between A and B
-    history_location++;
-    jetB = jetA->NN;
-
-    if (jetB != NULL) {
-      // jet-jet recombination
-      // If necessary relabel A & B to ensure jetB < jetA, that way if
-      // the larger of them == newtail then that ends up being jetA and 
-      // the new jet that is added as jetB is inserted in a position that
-      // has a future!
-      if (jetA < jetB) {std::swap(jetA,jetB);}
-
-      int nn; // new jet index
-      _cs.plugin_record_ij_recombination(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
-      
-      // what was jetB will now become the new jet
-      _bj_remove_from_tiles(jetA);
-      oldB = * jetB;  // take a copy because we will need it...
-      _bj_remove_from_tiles(jetB);
-      _tj_set_jetinfo(jetB, nn); // cause jetB to become _jets[nn]
-                                 // (also registers the jet in the tiling)
-    } else {
-      // jet-beam recombination
-      // get the hist_index
-      _cs.plugin_record_iB_recombination(jetA->_jets_index, diJ_min);
-      _bj_remove_from_tiles(jetA);
-    }
-
-    // remove the minheap entry for jetA
-    minheap.remove(jetA-head);
-
-    // first establish the set of tiles over which we are going to
-    // have to run searches for updated and new nearest-neighbours --
-    // basically a combination of vicinity of the tiles of the two old
-    // and one new jet.
-    int n_near_tiles = 0;
-    _add_untagged_neighbours_to_tile_union_using_max_info(jetA, 
-       					   tile_union, n_near_tiles);
-    if (jetB != NULL) {
-	_add_untagged_neighbours_to_tile_union_using_max_info(&oldB,
-							      tile_union,n_near_tiles);
-      jetB->label_minheap_update_needed();
-      jets_for_minheap.push_back(jetB);
-    }
-
-
-    // Initialise jetB's NN distance as well as updating it for 
-    // other particles.
-    // Run over all tiles in our union 
-
-    if (jetB != NULL) {
-      Tile & jetB_tile = _tiles[jetB->tile_index];
-      for (Tile::TileFnPair * near_tile_fn_pair  = jetB_tile.begin_tiles; 
-	           near_tile_fn_pair != jetB_tile.end_tiles; near_tile_fn_pair++) {
-        Tile * near_tile = near_tile_fn_pair->first;
-
-    	double dist_to_tile = (jetB_tile.*(near_tile_fn_pair->second))(jetB);
-        // use <= in next line so that on first tile, relevant_for_jetB is 
-        // set to true
-    	bool relevant_for_jetB  = dist_to_tile <= jetB->NN_dist;
-    	bool relevant_for_near_tile = dist_to_tile <= near_tile->max_NN_dist;
-        bool relevant = relevant_for_jetB || relevant_for_near_tile;
-        // this first option decides exactly what loop to do based on whether 
-        // the near tile was tagged. You'd think it's more efficient, but
-        // not necessarily...
-        if (relevant) {
-          if (near_tile->tagged) {
-            for (TiledJet * jetI = near_tile->head; jetI != NULL; jetI = jetI->next) {
-              if (jetI->NN == jetA || jetI->NN == jetB) _set_NN(jetI, jets_for_minheap);
-              _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-            }
-          near_tile->tagged = false;
-          } else {
-            for (TiledJet * jetI = near_tile->head; jetI != NULL; jetI = jetI->next) {
-              _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-            }
-          }
-        }
-
-        // this second option does everything independently of whether the near tile
-        // was tagged -- somehow you'd expect it to be slower, but it may actually be
-        // marginally faster.
-        // if (relevant_for_jetB || relevant_for_near_tile) {
-        //   for (TiledJet * jetI = (*near_tile)->head; jetI != NULL; jetI = jetI->next) {
-        // 
-        //     if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
-        //       _set_NN(jetI, jets_for_minheap);
-        //     }
-        // 
-        //     _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-	//     // -- Keep this old inline code for later speed tests
-        //     // double dist = _bj_dist(jetI,jetB);
-        //     // if (dist < jetI->NN_dist) {
-        //     //   if (jetI != jetB) {
-        //     //     jetI->NN_dist = dist;
-        //     //     jetI->NN = jetB;
-        //     //     // label jetI as needing heap action...
-        //     //     if (!jetI->minheap_update_needed()) {
-        //     //       jetI->label_minheap_update_needed();
-        //     //       jets_for_minheap.push_back(jetI);
-        //     //     }
-        //     //   }
-        //     // }
-        //     // if (dist < jetB->NN_dist) {
-        //     //   if (jetI != jetB) {
-        //     //     jetB->NN_dist = dist;
-        //     //     jetB->NN      = jetI;}
-        //     // }
-        //   }
-        //   (*near_tile)->tagged = false;
-        // }
-      }
-    }
-
-    // now run over the tiles that were tagged earlier and that we haven't yet
-    // had a change to visit.
-    for (int itile = 0; itile < n_near_tiles; itile++) {
-      Tile * tile_ptr = &_tiles[tile_union[itile]];
-      if (!tile_ptr->tagged) continue; // because earlier loop may have undone the tag
-      tile_ptr->tagged = false;
-      // run over all jets in the current tile
-      for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
-        // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-        if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
-          _set_NN(jetI, jets_for_minheap);
-        }
-      }
-    }
-
-    // deal with jets whose minheap entry needs updating
-    //if (verbose) cout << "  jets whose NN was modified: " << endl;
-    while (jets_for_minheap.size() > 0) {
-      TiledJet * jetI = jets_for_minheap.back(); 
-      jets_for_minheap.pop_back();
-      minheap.update(jetI-head, _bj_diJ(jetI));
-      jetI->label_minheap_update_done();
-      // handle max_NN_dist update for all jets that might have
-      // seen a change (increase) of distance
-      Tile & tile_I = _tiles[jetI->tile_index];
-      if (tile_I.max_NN_dist < jetI->NN_dist) tile_I.max_NN_dist = jetI->NN_dist;
-    }
-    n--;
-  }
-
-  // final cleaning up;
-  delete[] briefjets;
-}
-
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/LazyTiling9SeparateGhosts.cc
===================================================================
--- external/fastjet/LazyTiling9SeparateGhosts.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,773 +1,0 @@
-//FJSTARTHEADER
-// $Id: LazyTiling9SeparateGhosts.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include "fastjet/internal/LazyTiling9SeparateGhosts.hh"
-#include "fastjet/internal/TilingExtent.hh"
-#include <iomanip>
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-double LazyTiling9SeparateGhosts::ghost_pt2_threshold = 1e-100; 
-
-LazyTiling9SeparateGhosts::LazyTiling9SeparateGhosts(ClusterSequence & cs) :
-  _cs(cs), _jets(cs.jets())
-  //, _minheap(_jets.size()) 
-{
-  _Rparam = cs.jet_def().R();
-  _R2 = _Rparam * _Rparam;
-  _invR2 = 1.0 / _R2;
-  _initialise_tiles();
-}
-
-
-//----------------------------------------------------------------------
-/// Set up the tiles:
-///  - decide the range in eta
-///  - allocate the tiles
-///  - set up the cross-referencing info between tiles
-///
-/// The neighbourhood of a tile is set up as follows
-///
-/// 	      LRR
-///           LXR
-///           LLR
-///
-/// such that tiles is an array containing XLLLLRRRR with pointers
-///                                         |   \ RH_tiles
-///                                         \ surrounding_tiles
-///
-/// with appropriate precautions when close to the edge of the tiled
-/// region.
-///
-void LazyTiling9SeparateGhosts::_initialise_tiles() {
-
-  // first decide tile sizes (with a lower bound to avoid huge memory use with
-  // very small R)
-  double default_size = max(0.1,_Rparam);
-  _tile_size_eta = default_size;
-  // it makes no sense to go below 3 tiles in phi -- 3 tiles is
-  // sufficient to make sure all pair-wise combinations up to pi in
-  // phi are possible
-  _n_tiles_phi   = max(3,int(floor(twopi/default_size)));
-  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
-
-  // always include zero rapidity in the tiling region
-  _tiles_eta_min = 0.0;
-  _tiles_eta_max = 0.0;
-  // but go no further than following
-  const double maxrap = 7.0;
-
-  // and find out how much further one should go
-  for(unsigned int i = 0; i < _jets.size(); i++) {
-    double eta = _jets[i].rap();
-    // first check if eta is in range -- to avoid taking into account
-    // very spurious rapidities due to particles with near-zero kt.
-    if (abs(eta) < maxrap) {
-      if (eta < _tiles_eta_min) {_tiles_eta_min = eta;}
-      if (eta > _tiles_eta_max) {_tiles_eta_max = eta;}
-    }
-  }
-
-  // now adjust the values
-  _tiles_ieta_min = int(floor(_tiles_eta_min/_tile_size_eta));
-  _tiles_ieta_max = int(floor( _tiles_eta_max/_tile_size_eta));
-  _tiles_eta_min = _tiles_ieta_min * _tile_size_eta;
-  _tiles_eta_max = _tiles_ieta_max * _tile_size_eta;
-
-  _tile_half_size_eta = _tile_size_eta * 0.5;
-  _tile_half_size_phi = _tile_size_phi * 0.5;
-
-  // allocate the tiles
-  _tiles.resize((_tiles_ieta_max-_tiles_ieta_min+1)*_n_tiles_phi);
-
-  // now set up the cross-referencing between tiles
-  for (int ieta = _tiles_ieta_min; ieta <= _tiles_ieta_max; ieta++) {
-    for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
-      Tile3 * tile = & _tiles[_tile_index(ieta,iphi)];
-      // no jets in this tile yet
-      tile->head = NULL; // first element of tiles points to itself
-      tile->ghost_head = NULL; // first element of tiles points to itself
-      tile->begin_tiles[0] =  tile;
-      Tile3 ** pptile = & (tile->begin_tiles[0]);
-      pptile++;
-      //
-      // set up L's in column to the left of X
-      tile->surrounding_tiles = pptile;
-      if (ieta > _tiles_ieta_min) {
-	// with the itile subroutine, we can safely run tiles from
-	// idphi=-1 to idphi=+1, because it takes care of
-	// negative and positive boundaries
-	for (int idphi = -1; idphi <=+1; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta-1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now set up last L (below X)
-      *pptile = & _tiles[_tile_index(ieta,iphi-1)];
-      pptile++;
-      // set up first R (above X)
-      tile->RH_tiles = pptile;
-      *pptile = & _tiles[_tile_index(ieta,iphi+1)];
-      pptile++;
-      // set up remaining R's, to the right of X
-      if (ieta < _tiles_ieta_max) {
-	for (int idphi = -1; idphi <= +1; idphi++) {
-	  *pptile = & _tiles[_tile_index(ieta+1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now put semaphore for end tile
-      tile->end_tiles = pptile;
-      // finally make sure tiles are untagged
-      tile->tagged = false;
-      // and ensure max distance is sensibly initialised
-      tile->max_NN_dist = 0;
-      // and also position of centre of tile
-      tile->eta_centre = (ieta+0.5)*_tile_size_eta;
-      tile->phi_centre = (iphi+0.5)*_tile_size_phi;
-    }
-  }
-
-}
-
-//----------------------------------------------------------------------
-/// return the tile index corresponding to the given eta,phi point
-int LazyTiling9SeparateGhosts::_tile_index(const double eta, const double phi) const {
-  int ieta, iphi;
-  if      (eta <= _tiles_eta_min) {ieta = 0;}
-  else if (eta >= _tiles_eta_max) {ieta = _tiles_ieta_max-_tiles_ieta_min;}
-  else {
-    //ieta = int(floor((eta - _tiles_eta_min) / _tile_size_eta));
-    ieta = int(((eta - _tiles_eta_min) / _tile_size_eta));
-    // following needed in case of rare but nasty rounding errors
-    if (ieta > _tiles_ieta_max-_tiles_ieta_min) {
-      ieta = _tiles_ieta_max-_tiles_ieta_min;} 
-  }
-  // allow for some extent of being beyond range in calculation of phi
-  // as well
-  //iphi = (int(floor(phi/_tile_size_phi)) + _n_tiles_phi) % _n_tiles_phi;
-  // with just int and no floor, things run faster but beware
-  iphi = int((phi+twopi)/_tile_size_phi) % _n_tiles_phi;
-  return (iphi + ieta * _n_tiles_phi);
-}
-
-
-//----------------------------------------------------------------------
-// sets up information regarding the tiling of the given jet
-inline void LazyTiling9SeparateGhosts::_tj_set_jetinfo( TiledJet3 * const jet,
-				      const int _jets_index, bool is_ghost) {
-  // first call the generic setup
-  _bj_set_jetinfo<>(jet, _jets_index);
-
-  // Then do the setup specific to the tiled case.
-  jet->is_ghost = is_ghost;
-
-  // Find out which tile it belonds to
-  jet->tile_index = _tile_index(jet->eta, jet->phi);
-
-  // Insert it into the tile's linked list of jets
-  Tile3 * tile = &_tiles[jet->tile_index];
-  jet->previous   = NULL;
-  if (is_ghost) {
-    jet->next        = tile->ghost_head;
-    tile->ghost_head = jet;
-  } else {
-    jet->next        = tile->head;
-    tile->head       = jet;
-  }
-  if (jet->next != NULL) {jet->next->previous = jet;}
-}
-
-
-//----------------------------------------------------------------------
-void LazyTiling9SeparateGhosts::_bj_remove_from_tiles(TiledJet3 * const jet) {
-  Tile3 * tile = & _tiles[jet->tile_index];
-
-  if (jet->previous == NULL) {
-    // we are at head of the tile, so reset it.
-    // If this was the only jet on the tile then tile->head will now be NULL
-    if (jet->is_ghost) {
-      tile->ghost_head = jet->next;
-    } else {
-      tile->head = jet->next;
-    }
-  } else {
-    // adjust link from previous jet in this tile
-    jet->previous->next = jet->next;
-  }
-  if (jet->next != NULL) {
-    // adjust backwards-link from next jet in this tile
-    jet->next->previous = jet->previous;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// output the contents of the tiles
-void LazyTiling9SeparateGhosts::_print_tiles(TiledJet3 * briefjets ) const {
-  for (vector<Tile3>::const_iterator tile = _tiles.begin(); 
-       tile < _tiles.end(); tile++) {
-    cout << "Tile " << tile - _tiles.begin()<<" = ";
-    vector<int> list;
-    for (TiledJet3 * jetI = tile->head; jetI != NULL; jetI = jetI->next) {
-      list.push_back(jetI-briefjets);
-      //cout <<" "<<jetI-briefjets;
-    }
-    sort(list.begin(),list.end());
-    for (unsigned int i = 0; i < list.size(); i++) {cout <<" "<<list[i];}
-    cout <<"\n";
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Add to the vector tile_union the tiles that are in the neighbourhood
-/// of the specified tile_index, including itself -- start adding
-/// from position n_near_tiles-1, and increase n_near_tiles as
-/// you go along (could have done it more C++ like with vector with reserved
-/// space, but fear is that it would have been slower, e.g. checking
-/// for end of vector at each stage to decide whether to resize it)
-void LazyTiling9SeparateGhosts::_add_neighbours_to_tile_union(const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles) const {
-  for (Tile3 * const * near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but only adds neighbours if 
-/// their "tagged" status is false; when a neighbour is added its
-/// tagged status is set to true.
-inline void LazyTiling9SeparateGhosts::_add_untagged_neighbours_to_tile_union(
-               const int tile_index, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  for (Tile3 ** near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    if (! (*near_tile)->tagged) {
-      (*near_tile)->tagged = true;
-      // get the tile number
-      tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-      n_near_tiles++;
-    }
-  }
-}
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but adds tiles that are
-/// "neighbours" of a jet (rather than a tile) and only if a
-/// neighbouring tile's max_NN_dist is >= the distance between the jet
-/// and the nearest point on the tile. It ignores tiles that have
-/// already been tagged.
-inline void LazyTiling9SeparateGhosts::_add_untagged_neighbours_to_tile_union_using_max_info(
-               const TiledJet3 * jet, 
-	       vector<int> & tile_union, int & n_near_tiles)  {
-  Tile3 & tile = _tiles[jet->tile_index];
-  
-  for (Tile3 ** near_tile = tile.begin_tiles; near_tile != tile.end_tiles; near_tile++){
-    if ((*near_tile)->tagged) continue;
-    // here we are not allowed to miss a tile due to some rounding
-    // error. We therefore allow for a margin of security
-    double dist = _distance_to_tile(jet, *near_tile) - tile_edge_security_margin;
-    // cout << "      max info looked at tile " << *near_tile - &_tiles[0] 
-    // 	 << ", dist = " << dist << " " << (*near_tile)->max_NN_dist
-    // 	 << endl;
-    if (dist > (*near_tile)->max_NN_dist) continue;
-
-    // cout << "      max info tagged tile " << *near_tile - &_tiles[0] << endl;
-    (*near_tile)->tagged = true;
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-////--------TMPTMPTMPTMPTMP-----GPS TEMP--------------------
-//ostream & operator<<(ostream & ostr, const TiledJet3 & jet) {
-//  ostr << "j" << setw(3) << jet._jets_index << ":pt2,rap,phi=" ; ostr.flush();
-//  ostr     << jet.kt2 << ","; ostr.flush();
-//  ostr     << jet.eta << ","; ostr.flush();
-//  ostr     << jet.phi; ostr.flush();
-//  ostr     << ", tile=" << jet.tile_index; ostr.flush();
-//  return ostr;
-//}
-
-
-//----------------------------------------------------------------------
-/// returns a particle's distance to the edge of the specified tile
-inline double LazyTiling9SeparateGhosts::_distance_to_tile(const TiledJet3 * bj, const Tile3 * tile) const {
-
-  // Note the careful way of checking the minimum potential deta:
-  // unlike the phi case below, we don't calculate the distance to the
-  // centre and subtract spacing/2. This is because of issue of
-  // boundary tiles, which can extend far beyond spacing/2 in eta. 
-  // Using the positions of tile centers should instead be safe.
-  double deta;
-  if (_tiles[bj->tile_index].eta_centre == tile->eta_centre) deta = 0;
-  //else   deta = std::abs(bj->eta - tile->eta_centre) - 0.5*_tile_size_eta;
-  else   deta = std::abs(bj->eta - tile->eta_centre) - _tile_half_size_eta;
-  // ------
-  //   |
-  // A | B
-  // ------
-  //   |
-  // C | D
-  // ------
-
-  double dphi = std::abs(bj->phi - tile->phi_centre);
-  if (dphi > pi) dphi = twopi-dphi;
-  dphi -= _tile_half_size_phi;
-  //dphi -= 0.5*_tile_size_phi;
-  if (dphi < 0) dphi = 0;
-
-  return dphi*dphi + deta*deta;
-}
-
-
-
-
-//----------------------------------------------------------------------
-/// looks at distance between jetX and jetI and updates the NN
-/// information if relevant; also pushes identity of jetI onto
-/// the vector of jets for minheap, to signal that it will have
-/// to be handled later.
-///
-inline void LazyTiling9SeparateGhosts::_update_jetX_jetI_NN(TiledJet3 * jetX, TiledJet3 * jetI, vector<TiledJet3 *> & jets_for_minheap) {
-  assert(! (jetX->is_ghost || jetI->is_ghost));
-  double dist = _bj_dist(jetI,jetX);
-  if (dist < jetI->NN_dist) {
-    if (jetI != jetX) {
-      jetI->NN_dist = dist;
-      jetI->NN = jetX;
-      // label jetI as needing heap action...
-      if (!jetI->minheap_update_needed()) {
-	jetI->label_minheap_update_needed();
-	jets_for_minheap.push_back(jetI);
-      }
-    }
-  }
-  if (dist < jetX->NN_dist) {
-    if (jetI != jetX) {
-      jetX->NN_dist = dist;
-      jetX->NN      = jetI;}
-  }
-}
-
-
-inline void LazyTiling9SeparateGhosts::_set_NN(TiledJet3 * jetI, 
-                              vector<TiledJet3 *> & jets_for_minheap) {
-  assert(! jetI->is_ghost);
-  jetI->NN_dist = _R2;
-  jetI->NN      = NULL;
-  // label jetI as needing heap action...
-  if (!jetI->minheap_update_needed()) {
-    jetI->label_minheap_update_needed();
-    jets_for_minheap.push_back(jetI);}
-  // now go over tiles that are neighbours of I (include own tile)
-  Tile3 * tile_ptr = &_tiles[jetI->tile_index];
-  //if (tile_ptr->is_near_zero_phi(_tile_size_phi)) {
-    for (Tile3 ** near_tile  = tile_ptr->begin_tiles; 
-         near_tile != tile_ptr->end_tiles; near_tile++) {
-      // for own tile, this will be zero automatically: should we be clever
-      // and skip the test? (With some doubling of code?)
-      if (jetI->NN_dist < _distance_to_tile(jetI, *near_tile)) continue;
-      // and then over the contents of that tile
-      for (TiledJet3 * jetJ  = (*near_tile)->head; jetJ != NULL; jetJ = jetJ->next) {
-        double dist = _bj_dist(jetI,jetJ);
-        if (dist < jetI->NN_dist && jetJ != jetI) {
-          jetI->NN_dist = dist; jetI->NN = jetJ;
-        }
-      }
-      // deal with the ghosts
-      for (TiledJet3 * jetJ  = (*near_tile)->ghost_head; jetJ != NULL; jetJ = jetJ->next) {
-        double dist = _bj_dist(jetI,jetJ);
-        if (dist < jetI->NN_dist) {
-          jetI->NN_dist = dist; jetI->NN = jetJ;
-        }
-      }
-    }
-  // } else {
-  //   // second copy that exploits the fact that for this tile we needn't worry
-  //   // about periodicity
-  //   for (Tile3 ** near_tile  = tile_ptr->begin_tiles; 
-  //        near_tile != tile_ptr->end_tiles; near_tile++) {
-  //     // for own tile, this will be zero automatically: should we be clever
-  //     // and skip the test? (With some doubling of code?)
-  //     if (jetI->NN_dist < _distance_to_tile(jetI, *near_tile)) continue;
-  //     // and then over the contents of that tile
-  //     for (TiledJet3 * jetJ  = (*near_tile)->head; 
-  //          jetJ != NULL; jetJ = jetJ->next) {
-  //       double dist = _bj_dist_not_periodic(jetI,jetJ);
-  //       if (dist < jetI->NN_dist && jetJ != jetI) {
-  //         jetI->NN_dist = dist; jetI->NN = jetJ;
-  //       }
-  //     }
-  //   }
-  // }
-}
-
-
-void LazyTiling9SeparateGhosts::run() {
-
-  //_initialise_tiles();
-
-  int ntot = _jets.size();
-  if (ntot == 0) return;
-
-  TiledJet3 * briefjets = new TiledJet3[ntot];
-  TiledJet3 * jetA = briefjets, * jetB;
-  // avoid warning about uninitialised oldB below; 
-  // only valid for ntot>=1 (hence the test ntot==0 test above)
-  TiledJet3 oldB = briefjets[0];
-  
-
-  // will be used quite deep inside loops, but declare it here so that
-  // memory (de)allocation gets done only once
-  vector<int> tile_union(3*n_tile_neighbours);
-  
-  TiledJet3 * head = briefjets; // a nicer way of naming start
-
-  // initialise the basic jet info 
-  //
-  // Note that the threshold is a static member of the class
-  // first get the particles we'll keep as "real"
-  for (int i = 0; i< ntot; i++) {
-    bool is_ghost = _jets[i].perp2() < ghost_pt2_threshold; 
-    if (!is_ghost) {
-      _tj_set_jetinfo(jetA, i, is_ghost);
-      jetA++; // move on to next entry of briefjets
-    }
-  }
-  int nreal = jetA - briefjets;
-  // then the ones we will label as ghosts
-  for (int i = 0; i< ntot; i++) {
-    bool is_ghost = _jets[i].perp2() < ghost_pt2_threshold;
-    if (is_ghost) {
-      _tj_set_jetinfo(jetA, i, is_ghost);
-      jetA++; // move on to next entry of briefjets
-    }
-  }
-  
-
-  // set up the initial nearest neighbour information
-  vector<Tile3>::iterator tile;
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    // first do it on this tile
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      // real particles cluster with real particles
-      for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
-	double dist = _bj_dist_not_periodic(jetA,jetB);
-	if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-	if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-      }
-      // they can also cluster with ghosts
-      for (jetB = tile->ghost_head; jetB != NULL; jetB = jetB->next) {
-	double dist = _bj_dist_not_periodic(jetA,jetB);
-	if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-      }
-    }
-    // only look out for NN dists of real particles, because ghosts never
-    // have NN in our structure
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    //if (tile->is_near_zero_phi(_tile_size_phi)) {
-      // then do it for RH tiles; 
-      for (Tile3 ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = _distance_to_tile(jetA, *RTile);
-          // it only makes sense to do a tile if jetA is close enough to the Rtile
-          // either for a jet in the Rtile to be closer to jetA than it's current NN
-          // or if jetA could be closer to something in the Rtile than the largest
-          // NN distance within the RTile.
-          //
-          // GPS note: also tried approach where we perform only the
-          //           first test and run over all surrounding tiles
-          //           (not just RH ones). The test is passed less
-          //           frequently, but one is running over more tiles
-          //           and on balance, for the trial event we used, it's
-          //           a bit slower.
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          bool relevant_for_RTile = dist_to_tile <= (*RTile)->max_NN_dist;
-          if (relevant_for_jetA || relevant_for_RTile) {
-            for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-              if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-            }
-          } 
-	  // now do the check over ghosts
-          if (relevant_for_jetA) {
-            for (jetB = (*RTile)->ghost_head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-            }
-	  }	  
-        }
-      }
-      // and do a special loop to catch ghosts that are among the LH tiles
-      for (Tile3 ** LTile = tile->surrounding_tiles; LTile != tile->RH_tiles; LTile++) {
-        for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-          double dist_to_tile = _distance_to_tile(jetA, *LTile);
-          // it only makes sense to do a tile if jetA is close enough to the Rtile
-          // for a (ghost) jet in the Ltile to be closer to jetA than it's current NN.
-          bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-          if (relevant_for_jetA) {
-            for (jetB = (*LTile)->ghost_head; jetB != NULL; jetB = jetB->next) {
-              double dist = _bj_dist(jetA,jetB);
-              if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-            }
-          } 
-        }
-      }
-    // } else {
-    //   // this second version of the code uses the faster
-    //   // "not_periodic" version because it knows that the tile is
-    //   // sufficiently far from the edge.
-    //   for (Tile3 ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-    //     for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-    //       double dist_to_tile = _distance_to_tile(jetA, *RTile);
-    //       bool relevant_for_jetA  = dist_to_tile <= jetA->NN_dist;
-    //       bool relevant_for_RTile = dist_to_tile <= (*RTile)->max_NN_dist;
-    //       if (relevant_for_jetA || relevant_for_RTile) {
-    //         for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-    //           double dist = _bj_dist_not_periodic(jetA,jetB);
-    //           if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-    //           if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-    //         }
-    //       } 
-    //     }
-    //   }
-    // }
-    // no need to do it for LH tiles, since they are implicitly done
-    // when we set NN for both jetA and jetB on the RH tiles.
-  }
-  // Now update the max_NN_dist within each tile. Not strictly
-  // necessary, because existing max_NN_dist is an upper bound.  but
-  // costs little and may give some efficiency gain later.
-  // (Do it only for real particles -- ghosts don't come into the game).
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    tile->max_NN_dist = 0;
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      if (jetA->NN_dist > tile->max_NN_dist) tile->max_NN_dist = jetA->NN_dist;
-    }
-  }
-
-
-  vector<double> diJs(nreal);
-  for (int i = 0; i < nreal; i++) {
-    diJs[i] = _bj_diJ(&briefjets[i]);
-    briefjets[i].label_minheap_update_done();
-  }
-  MinHeap minheap(diJs);
-  // have a stack telling us which jets we'll have to update on the heap
-  vector<TiledJet3 *> jets_for_minheap;
-  jets_for_minheap.reserve(ntot);  // GPS TMP: return here
-
-  // now run the recombination loop
-  while (nreal > 0) {
-
-    double diJ_min = minheap.minval() *_invR2;
-    jetA = head + minheap.minloc();
-
-    // do the recombination between A and B
-    jetB = jetA->NN;
-
-    if (jetB != NULL) {
-      // jet-jet recombination
-      // If necessary relabel A & B to ensure jetB < jetA, that way if
-      // the larger of them == newtail then that ends up being jetA and 
-      // the new jet that is added as jetB is inserted in a position that
-      // has a future!
-      if (jetA < jetB) {std::swap(jetA,jetB);}
-
-      int nn; // new jet index
-      _cs.plugin_record_ij_recombination(jetA->_jets_index, jetB->_jets_index, diJ_min, nn);
-      
-      // what was jetB will now become the new jet
-      _bj_remove_from_tiles(jetA);
-      oldB = * jetB;  // take a copy because we will need it...
-      _bj_remove_from_tiles(jetB);
-      bool is_ghost = false;
-      _tj_set_jetinfo(jetB, nn, is_ghost); // cause jetB to become _jets[nn]
-                                 // (also registers the jet in the tiling); it will never be a ghost
-    } else {
-      // jet-beam recombination
-      // get the hist_index
-      _cs.plugin_record_iB_recombination(jetA->_jets_index, diJ_min);
-      _bj_remove_from_tiles(jetA);
-    }
-
-    // remove the minheap entry for jetA if jetA is a real particle;
-    // only in this case 
-    if (!jetA->is_ghost) {
-      minheap.remove(jetA-head);
-      // jetB cannot be a ghost; so when jetA is not a ghost we decrease
-      // our count of remaining real particles
-      nreal--;
-    }
-    
-
-    
-
-    // first establish the set of tiles over which we are going to
-    // have to run searches for updated and new nearest-neighbours --
-    // basically a combination of vicinity of the tiles of the two old
-    // and one new jet.
-    int n_near_tiles = 0;
-    // add tiles neighbouring A even if A is a ghost because a ghost
-    // could have been the NN of some other particle
-    _add_untagged_neighbours_to_tile_union_using_max_info(jetA, 
-       					   tile_union, n_near_tiles);
-    if (jetB != NULL) {
-	_add_untagged_neighbours_to_tile_union_using_max_info(&oldB,
-							      tile_union,n_near_tiles);
-      jetB->label_minheap_update_needed();
-      jets_for_minheap.push_back(jetB);
-    }
-
-
-    // Initialise jetB's NN distance as well as updating it for 
-    // other particles.
-    // Run over all tiles in our union 
-    if (jetB != NULL) {
-      Tile3 & jetB_tile = _tiles[jetB->tile_index];
-      for (Tile3 ** near_tile  = jetB_tile.begin_tiles; 
-	           near_tile != jetB_tile.end_tiles; near_tile++) {
-
-    	double dist_to_tile = _distance_to_tile(jetB, *near_tile);
-        // use <= in next line so that on first tile, relevant_for_jetB is 
-        // set to true
-    	bool relevant_for_jetB  = dist_to_tile <= jetB->NN_dist;
-    	bool relevant_for_near_tile = dist_to_tile <= (*near_tile)->max_NN_dist;
-        bool relevant = relevant_for_jetB || relevant_for_near_tile;
-        // this first option decides exactly what loop to do based on whether 
-        // the near tile was tagged. You'd think it's more efficient, but
-        // not necessarily...
-        if (relevant) {
-          if ((*near_tile)->tagged) {
-            for (TiledJet3 * jetI = (*near_tile)->head; jetI != NULL; jetI = jetI->next) {
-              if (jetI->NN == jetA || jetI->NN == jetB) _set_NN(jetI, jets_for_minheap);
-              _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-            }
-	    (*near_tile)->tagged = false;
-          } else {
-            for (TiledJet3 * jetI = (*near_tile)->head; jetI != NULL; jetI = jetI->next) {
-              _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-            }
-          }
-        }
-	// Now HANDLE GHOSTS
-	if (relevant_for_jetB) {
-	  for (TiledJet3 * jetI  = (*near_tile)->ghost_head; jetI != NULL; jetI = jetI->next) {
-	    double dist = _bj_dist(jetB,jetI);
-	    if (dist < jetB->NN_dist) {
-	      jetB->NN_dist = dist; jetB->NN = jetI;
-	    }
-	  }
-	}
-	
-
-        // this second option does everything independently of whether the near tile
-        // was tagged -- somehow you'd expect it to be slower, but it may actually be
-        // marginally faster.
-        // if (relevant_for_jetB || relevant_for_near_tile) {
-        //   for (TiledJet3 * jetI = (*near_tile)->head; jetI != NULL; jetI = jetI->next) {
-        // 
-        //     if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
-        //       _set_NN(jetI, jets_for_minheap);
-        //     }
-        // 
-        //     _update_jetX_jetI_NN(jetB, jetI, jets_for_minheap);
-	//     // -- Keep this old inline code for later speed tests
-        //     // double dist = _bj_dist(jetI,jetB);
-        //     // if (dist < jetI->NN_dist) {
-        //     //   if (jetI != jetB) {
-        //     //     jetI->NN_dist = dist;
-        //     //     jetI->NN = jetB;
-        //     //     // label jetI as needing heap action...
-        //     //     if (!jetI->minheap_update_needed()) {
-        //     //       jetI->label_minheap_update_needed();
-        //     //       jets_for_minheap.push_back(jetI);
-        //     //     }
-        //     //   }
-        //     // }
-        //     // if (dist < jetB->NN_dist) {
-        //     //   if (jetI != jetB) {
-        //     //     jetB->NN_dist = dist;
-        //     //     jetB->NN      = jetI;}
-        //     // }
-        //   }
-        //   (*near_tile)->tagged = false;
-        // }
-      }
-    }
-
-    // now run over the tiles that were tagged earlier and that we haven't yet
-    // had a change to visit.
-    for (int itile = 0; itile < n_near_tiles; itile++) {
-      Tile3 * tile_ptr = &_tiles[tile_union[itile]];
-      if (!tile_ptr->tagged) continue; // because earlier loop may have undone the tag
-      tile_ptr->tagged = false;
-      // run over all jets in the current tile
-      for (TiledJet3 * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
-        // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-        if (jetI->NN == jetA || (jetI->NN == jetB && jetB != NULL)) {
-          _set_NN(jetI, jets_for_minheap);
-        }
-      }
-    }
-
-    // deal with jets whose minheap entry needs updating
-    //if (verbose) cout << "  jets whose NN was modified: " << endl;
-    while (jets_for_minheap.size() > 0) {
-      TiledJet3 * jetI = jets_for_minheap.back(); 
-      jets_for_minheap.pop_back();
-      minheap.update(jetI-head, _bj_diJ(jetI));
-      jetI->label_minheap_update_done();
-      // handle max_NN_dist update for all jets that might have
-      // seen a change (increase) of distance
-      Tile3 & tile_I = _tiles[jetI->tile_index];
-      if (tile_I.max_NN_dist < jetI->NN_dist) tile_I.max_NN_dist = jetI->NN_dist;
-    }
-  }
-
-  // final cleaning up;
-  delete[] briefjets;
-}
-
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/LimitedWarning.cc
===================================================================
--- external/fastjet/LimitedWarning.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/LimitedWarning.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: LimitedWarning.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/LimitedWarning.hh"
@@ -42,10 +40,10 @@
 
 
-// /// output a warning to ostr
-// void LimitedWarning::warn(const std::string & warning) {
-//   warn(warning, _default_ostr);
-// }
+/// output a warning to ostr
+void LimitedWarning::warn(const std::string & warning) {
+  warn(warning, _default_ostr);
+}
 
-void LimitedWarning::warn(const char * warning, std::ostream * ostr) {
+void LimitedWarning::warn(const std::string & warning, std::ostream * ostr) {
   if (_this_warning_summary == 0) {
     // prepare the information for the summary
@@ -56,5 +54,5 @@
     // prepare the warning within a string stream
     ostringstream warnstr;
-    warnstr << "WARNING from FastJet: ";
+    warnstr << "WARNING: ";
     warnstr << warning;
     _n_warn_so_far++;
Index: external/fastjet/LimitedWarning.hh
===================================================================
--- external/fastjet/LimitedWarning.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/LimitedWarning.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_LIMITEDWARNING_HH__
 
-//FJSTARTHEADER
-// $Id: LimitedWarning.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: LimitedWarning.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -52,19 +50,12 @@
 
   /// constructor that provides a user-set max number of warnings
-  LimitedWarning(int max_warn_in) : _max_warn(max_warn_in), _n_warn_so_far(0), _this_warning_summary(0) {}
+  LimitedWarning(int max_warn) : _max_warn(max_warn), _n_warn_so_far(0), _this_warning_summary(0) {}
 
   /// outputs a warning to standard error (or the user's default
   /// warning stream if set)
-  void warn(const char * warning) {warn(warning, _default_ostr);}
-
-  /// outputs a warning to standard error (or the user's default
-  /// warning stream if set)
-  void warn(const std::string & warning) {warn(warning.c_str(), _default_ostr);}
+  void warn(const std::string & warning);
 
   /// outputs a warning to the specified stream
-  void warn(const char * warning, std::ostream * ostr);
-
-  /// outputs a warning to the specified stream
-  void warn(const std::string & warning, std::ostream * ostr) {warn(warning.c_str(), ostr);}
+  void warn(const std::string & warning, std::ostream * ostr);
 
   /// sets the default output stream for all warnings (by default
@@ -79,12 +70,4 @@
     _max_warn_default = max_warn;
   }
-
-  /// the maximum number of warning messages that will be printed
-  /// by this instance of the class
-  int max_warn() const {return _max_warn;}
-
-  /// the number of times so far that a warning has been registered
-  /// with this instance of the class.
-  int n_warn_so_far() const {return _n_warn_so_far;}
 
   /// returns a summary of all the warnings that came through the
Index: external/fastjet/MinHeap.cc
===================================================================
--- external/fastjet/MinHeap.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/MinHeap.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: MinHeap.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/internal/MinHeap.hh"
@@ -45,5 +43,5 @@
 ///
 ///   . for _heap[i], the "parent" is to be found at (i-1)/2
-void MinHeap::initialise(const std::vector<double> & values){
+void MinHeap::_initialise(const std::vector<double> & values){
   
   // fill the high-range of the heap with the largest possible value
@@ -110,13 +108,5 @@
 
     // now compare current location to children (at 2*loc+1, 2*loc+2)
-    //ValueLoc * child = &(_heap[2*loc+1]);
-    // GPS 2020-04-07: changed the way the following line
-    //   is expressed, so as to work around issue reported by
-    //   Andrii Verbyitskyi where compilation with gcc's
-    //   -D_GLIBCXX_ASSERTIONS=1  -D_GLIBCXX_SANITIZE_VECTOR=1
-    //   results in a crash because the compiler thinks we
-    //   are accessing the vector at a location that is sometimes
-    //   invalid, whereas we are just getting the address
-    ValueLoc * child = &(_heap[0]) + (2*loc+1);
+    ValueLoc * child = &(_heap[2*loc+1]);
     if (child < heap_end && child->minloc->value < here->minloc->value ) {
       here->minloc = child->minloc;
Index: external/fastjet/NNBase.hh
===================================================================
--- external/fastjet/NNBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,192 +1,0 @@
-#ifndef __FASTJET_NNBASE_HH__
-#define __FASTJET_NNBASE_HH__
-
-//FJSTARTHEADER
-// $Id: NNBase.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2016-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include<fastjet/ClusterSequence.hh>
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-/// @ingroup advanced_usage
-/// \class _NoInfo
-/// internal dummy class, used as a default template argument
-class _NoInfo {};
-
-/// @ingroup advanced_usage
-/// \class NNInfo
-///
-/// internal helper template class to facilitate initialisation of a
-/// BJ with a PseudoJet and extra information. Implementations of
-/// NN-based clustering do not need to explicitly use or refer to
-/// this class!
-template<class I> class NNInfo {
-public:
-  NNInfo()         : _info(NULL) {}
-  NNInfo(I * info) : _info(info) {}
-  template<class BJ> void init_jet(BJ * briefjet, const fastjet::PseudoJet & jet, int index) { briefjet->init(jet, index, _info);}
-private:
-  I * _info;
-};
-
-/// @ingroup advanced_usage Internal helper specialisation of NNInfo
-/// for cases where there is no extra info
-template<> class NNInfo<_NoInfo>  {
-public:
-  NNInfo()           {}
-  NNInfo(_NoInfo * ) {}
-  template<class BJ> void init_jet(BJ * briefjet, const fastjet::PseudoJet & jet, int index) { briefjet->init(jet, index);}
-};
-
-
-//----------------------------------------------------------------------
-/// @ingroup advanced_usage
-/// \class NNBase
-/// Helps solve closest pair problems with generic interparticle and
-/// particle-beam distances.
-///
-/// \section Description Description and derived classes:
-///
-///   This is an abstract base class which defines the interface for
-///   several classes that help carry out nearest-neighbour
-///   clustering:
-///  
-///    - NNH          provides an implementation for generic measures,
-///  
-///    - NNFJN2Plain  provides an implementation for distances
-///                   satisfying the FastJet lemma i.e. distances for
-///                   which the minimum dij has the property that i is
-///                   the geometrical nearest neighbour of j, or vice
-///                   versa. I.e. the distance can be factorised in a
-///                   momentum factor and a geometric piece. This is
-///                   based on the fastjet N2Plain clustering strategy
-///  
-///    - NNFJN2Tiled  is a tiled version of NNFJN2Plain (based on the
-///                   N2Tiled FastJet clustering strategy). Like
-///                   NNPlain2 it applies to distance measures that
-///                   satisfy the FastJet lemma, with the additional
-///                   restriction that: (a) the underlying geometry
-///                   should be cylindrical (e.g. rapidity--azimuth)
-///                   and (b) the search for the geometric nearest
-///                   neighbour of each particle can be limited to
-///                   that particle's tile and its neighbouring tiles.
-///
-/// If you can use NNFJN2Plain it will usually be faster than
-/// NNH. NNFJN2Tiled, where it can be used, will be faster for
-/// multiplicities above a few tens of particles.
-///
-///   NOTE: IN ALL CASES, THE DISTANCE MUST BE SYMMETRIC (dij=dji)!!!
-///
-/// \section BJ Underlying BriefJet (BJ) class:
-/// 
-///   All derived classes must be templated with a BriefJet (BJ)
-///   class --- BJ should basically cache the minimal amount of
-///   information that is needed to efficiently calculate
-///   interparticle distances and particle-beam distances.
-///   
-///   This class can be used with or without an extra "Information"
-///   template, i.e. `NN*<BJ>` or `NN*<BJ,I>`. Accordingly BJ must provide
-///   one of the two following init functions:
-///
-///   \code
-///     void  BJ::init(const PseudoJet & jet);            // initialise with a PseudoJet
-///     void  BJ::init(const PseudoJet & jet, I * info);  // initialise with a PseudoJet + info
-///   \endcode
-///
-///   where info might be a pointer to a class that contains, e.g.,
-///   information about R, or other parameters of the jet algorithm
-///   
-///   The BJ then provides information about interparticle and
-///   particle-beam distances. The exact requirements depend on
-///   whether you use NNH, NNFJN2Plain or NNFJN2Tiled. (See the
-///   corresponding classes for details).
-///
-///
-/// \section Workflow Workflow:
-///
-///   In all cases, the usage of NNBase classes works as follows:
-///
-///   First, from the list of particles, create an `NN*<BJ>`
-///   object of the appropriate type with the appropriate BJ class
-///   (and optional extra info).
-///
-///   Then, cluster using a loop like this (assuming a FastJet plugin)
-///
-///   \code
-///     while (njets > 0) {
-///       int i, j, k;
-///       // get the i and j that minimize the distance
-///       double dij = nn.dij_min(i, j);  
-///     
-///       // do the appropriate recombination and update the nn
-///       if (j >= 0) {    // interparticle recombination
-///         cs.plugin_record_ij_recombination(i, j, dij, k);
-///         nn.merge_jets(i, j, cs.jets()[k], k); 
-///       } else {         // bbeam recombination
-///         double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB
-///         cs.plugin_record_iB_recombination(i, diB);
-///         nn.remove_jet(i);
-///       }
-///       njets--;
-///     }
-///   \endcode
-///
-/// For an example of how the NNH<BJ> class is used, see the
-/// JadePlugin or EECambridgePlugin.
-template<class I = _NoInfo> class NNBase : public NNInfo<I> {
-public:
-  /// Default constructor
-  NNBase() {}
-  /// Constuctor with additional Info 
-  NNBase(I * info) : NNInfo<I>(info) {}
-
-  /// initialisation from a given list of particles
-  virtual void start(const std::vector<PseudoJet> & jets) = 0;
-  
-  /// returns the dij_min and indices iA, iB, for the corresponding jets.
-  /// If iB < 0 then iA recombines with the beam
-  virtual double dij_min(int & iA, int & iB) = 0;
-
-  /// removes the jet pointed to by index iA
-  virtual void remove_jet(int iA) = 0;
-
-  /// merges the jets pointed to by indices A and B and replaces them with
-  /// jet, assigning it an index jet_index.
-  virtual void merge_jets(int iA, int iB, const PseudoJet & jet, int jet_index) =  0;
-
-  virtual ~NNBase() {};
-};
-
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-#endif // __FASTJET_NNBASE_HH__
Index: external/fastjet/NNFJN2Plain.hh
===================================================================
--- external/fastjet/NNFJN2Plain.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,401 +1,0 @@
-#ifndef __FASTJET_NNFJN2PLAIN_HH__
-#define __FASTJET_NNFJN2PLAIN_HH__
-
-//FJSTARTHEADER
-// $Id: NNFJN2Plain.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include <fastjet/NNBase.hh>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-//----------------------------------------------------------------------
-/// @ingroup advanced_usage
-/// \class NNFJN2Plain
-///
-/// Helps solve closest pair problems with factorised interparticle
-/// and beam distances (ie satisfying the FastJet lemma)
-///
-/// (see NNBase.hh for an introductory description)
-///
-/// This variant provides an implementation based on the N2Plain
-/// clustering strategy in FastJet. The interparticle and beam
-/// distances should be of the form
-///
-/// \code
-///   dij = min(mom_factor(i), mom_factor(j)) * geometrical_distance(i,j)
-///   diB = mom_factor(i) * geometrical_beam_distance(i)
-/// \endcode
-///
-/// The class is templated with a BJ (brief jet) class and can be used
-/// with or without an extra "Information" template,
-/// i.e. NNFJN2Plain<BJ> or NNFJN2Plain<BJ,I>
-///
-/// For the NNH_N2Plain<BJ> version of the class to function, BJ must
-/// provide four member functions
-///  
-/// \code
-///   void   BJ::init(const PseudoJet & jet);                   // initialise with a PseudoJet
-///   double BJ::geometrical_distance(const BJ * other_bj_jet); // distance between this and other_bj_jet (geometrical part)
-///   double BJ::geometrical_beam_distance();                   // distance to the beam (geometrical part)
-///   double BJ::momentum_factor();                             // extra momentum factor
-/// \endcode
-///
-/// For the NNH_N2Plain<BJ,I> version to function, the BJ::init(...)
-/// member must accept an extra argument
-///
-/// \code
-///   void  BJ::init(const PseudoJet & jet, I * info);   // initialise with a PseudoJet + info
-/// \endcode
-///
-/// NOTE: THE DISTANCE MUST BE SYMMETRIC I.E. SATISFY
-/// \code
-///     a.geometrical_distance(b) == b.geometrical_distance(a)
-/// \endcode
-///
-/// Note that you are strongly advised to add the following lines to
-/// your BJ class to allow it to be used also with NNH:
-///
-/// \code
-///   /// make this BJ class compatible with the use of NNH
-///   double BJ::distance(const BJ * other_bj_jet){
-///     double mom1 = momentum_factor();
-///     double mom2 = other_bj_jet->momentum_factor();
-///     return (mom1<mom2 ? mom1 : mom2) * geometrical_distance(other_bj_jet);
-///   }
-///   double BJ::beam_distance(){
-///     return momentum_factor() * geometrical_beam_distance();
-///   }
-/// \endcode
-///
-template<class BJ, class I = _NoInfo> class NNFJN2Plain : public NNBase<I> {
-public:
-
-  /// constructor with an initial set of jets (which will be assigned indices
-  /// `0...jets.size()-1`)
-  NNFJN2Plain(const std::vector<PseudoJet> & jets)           : NNBase<I>()     {start(jets);}
-  NNFJN2Plain(const std::vector<PseudoJet> & jets, I * info) : NNBase<I>(info) {start(jets);}
-  
-  /// initialisation from a given list of particles
-  virtual void start(const std::vector<PseudoJet> & jets);
-
-  /// returns the dij_min and indices iA, iB, for the corresponding jets.
-  /// If iB < 0 then iA recombines with the beam
-  double dij_min(int & iA, int & iB);
-
-  /// removes the jet pointed to by index iA
-  void remove_jet(int iA);
-
-  /// merges the jets pointed to by indices A and B and replace them with
-  /// jet, assigning it an index jet_index.
-  void merge_jets(int iA, int iB, const PseudoJet & jet, int jet_index);
-
-  /// a destructor
-  ~NNFJN2Plain() {
-    delete[] briefjets;
-    delete[] diJ;
-  }
-    
-private:
-  class NNBJ; // forward declaration
-
-  // return the full distance of a particle to its NN
-  inline double compute_diJ(const NNBJ * const jet) const {
-    double mom_fact = jet->momentum_factor();
-    if (jet->NN != NULL) {
-      double other_mom_fact = jet->NN->momentum_factor();
-      if (other_mom_fact < mom_fact) {mom_fact = other_mom_fact;}
-    }
-    return jet->NN_dist * mom_fact;
-  }
-
-  /// establish the nearest neighbour for jet, and cross check consistency
-  /// of distances for the other jets that are encountered. Assumes
-  /// jet not contained within begin...end
-  void set_NN_crosscheck(NNBJ * jet, NNBJ * begin, NNBJ * end);
-
-  /// establish the nearest neighbour for jet; don't cross check other jets'
-  /// distances and allow jet to be contained within begin...end
-  void set_NN_nocross   (NNBJ * jet, NNBJ * begin, NNBJ * end);
-
-  /// contains the briefjets
-  NNBJ * briefjets;
-
-  /// semaphores for the current extent of our structure
-  NNBJ * head, * tail;
-
-  /// currently active number of jets
-  int n;
-
-  /// where_is[i] contains a pointer to the jet with index i
-  std::vector<NNBJ *> where_is;
-
-  /// a table containing all the (full) distances to each object's NN
-  double * diJ;
-
-  /// a class that wraps around the BJ, supplementing it with extra information
-  /// such as pointers to neighbours, etc.
-  class NNBJ : public BJ {
-  public:
-    void init(const PseudoJet & jet, int index_in) {
-      BJ::init(jet);
-      other_init(index_in);
-    }
-    void init(const PseudoJet & jet, int index_in, I * info) {
-      BJ::init(jet, info);
-      other_init(index_in);
-    }
-    void other_init(int index_in) {
-      _index = index_in;
-      NN_dist = BJ::geometrical_beam_distance();
-      NN = NULL;
-    }
-    int index() const {return _index;}
-    
-    double NN_dist;
-    NNBJ * NN;
-    
-  private:
-    int _index;
-  };
-
-};
-
-
-
-//----------------------------------------------------------------------
-template<class BJ, class I> void NNFJN2Plain<BJ,I>::start(const std::vector<PseudoJet> & jets) {
-  n = jets.size();
-  briefjets = new NNBJ[n];
-  where_is.resize(2*n);
-
-  NNBJ * jetA = briefjets;
-  
-  // initialise the basic jet info 
-  for (int i = 0; i< n; i++) {
-    // the this-> in the next line is required by standard compiler
-    // see e.g. http://stackoverflow.com/questions/10639053/name-lookups-in-c-templates
-    this->init_jet(jetA, jets[i], i);
-    where_is[i] = jetA;
-    jetA++; // move on to next entry of briefjets
-  }
-  tail = jetA; // a semaphore for the end of briefjets
-  head = briefjets; // a nicer way of naming start
-
-  // now initialise the NN distances: jetA will run from 1..n-1; and
-  // jetB from 0..jetA-1
-  for (jetA = head + 1; jetA != tail; jetA++) {
-    // set NN info for jetA based on jets running from head..jetA-1,
-    // checking in the process whether jetA itself is an undiscovered
-    // NN of one of those jets.
-    set_NN_crosscheck(jetA, head, jetA);
-  }
-
-  // now create the diJ (where J is i's NN) table -- remember that 
-  // we differ from standard normalisation here by a factor of R2
-  diJ = new double[n];
-  jetA = head;
-  for (int i = 0; i < n; i++) {
-    diJ[i] = compute_diJ(jetA);
-    jetA++; // have jetA follow i
-  }
-}
-
-
-//----------------------------------------------------------------------
-template<class BJ, class I> double NNFJN2Plain<BJ,I>::dij_min(int & iA, int & iB) {
-  // find the minimum of the diJ on this round
-  double diJ_min = diJ[0];
-  int diJ_min_jet = 0;
-  for (int i = 1; i < n; i++) {
-    if (diJ[i] < diJ_min) {
-      diJ_min_jet = i;
-      diJ_min  = diJ[i];
-    }
-  }
-
-  // return information to user about recombination
-  NNBJ * jetA = & briefjets[diJ_min_jet];
-  //std::cout << jetA - briefjets << std::endl; 
-  iA = jetA->index();
-  iB = jetA->NN ? jetA->NN->index() : -1;
-  return diJ_min;
-}
-
-
-//----------------------------------------------------------------------
-// remove jetA from the list
-template<class BJ, class I> void NNFJN2Plain<BJ,I>::remove_jet(int iA) {
-  NNBJ * jetA = where_is[iA];
-  // now update our nearest neighbour info and diJ table
-  // first reduce size of table
-  tail--; n--;
-  // Copy last jet contents and diJ info into position of jetA
-  *jetA = *tail;
-  // update the info on where the given index is stored
-  where_is[jetA->index()] = jetA;
-  diJ[jetA - head] = diJ[tail-head];
-
-  // updating NN infos. 2 cases to watch for (see below)
-  for (NNBJ * jetI = head; jetI != tail; jetI++) {
-    // see if jetI had jetA as a NN -- if so recalculate the NN
-    if (jetI->NN == jetA) {
-      set_NN_nocross(jetI, head, tail);
-      diJ[jetI-head] = compute_diJ(jetI); // update diJ 
-    } 
-    // if jetI's NN is the new tail then relabel it so that it becomes jetA
-    if (jetI->NN == tail) {jetI->NN = jetA;}
-  }
-}
-
-
-//----------------------------------------------------------------------
-template<class BJ, class I> void NNFJN2Plain<BJ,I>::merge_jets(int iA, int iB, 
-					const PseudoJet & jet, int index) {
-
-  NNBJ * jetA = where_is[iA];
-  NNBJ * jetB = where_is[iB];
-
-  // If necessary relabel A & B to ensure jetB < jetA, that way if
-  // the larger of them == newtail then that ends up being jetA and 
-  // the new jet that is added as jetB is inserted in a position that
-  // has a future!
-  if (jetA < jetB) std::swap(jetA,jetB);
-
-  // initialise jetB based on the new jet
-  this->init_jet(jetB, jet, index);
-  // and record its position (making sure we have the space)
-  if (index >= int(where_is.size())) where_is.resize(2*index);
-  where_is[jetB->index()] = jetB;
-
-  // now update our nearest neighbour info
-  // first reduce size of table
-  tail--; n--;
-  // Copy last jet contents into position of jetA
-  *jetA = *tail;
-  // update the info on where the tail's index is stored
-  where_is[jetA->index()] = jetA;
-  diJ[jetA - head] = diJ[tail-head];
-
-  // initialise jetB NN's distance and update NN infos
-  for (NNBJ * jetI = head; jetI != tail; jetI++) {
-    // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-    if (jetI->NN == jetA || jetI->NN == jetB) {
-      set_NN_nocross(jetI, head, tail);
-      diJ[jetI-head] = compute_diJ(jetI); // update diJ 
-    } 
-
-    // check whether new jetB is closer than jetI's current NN and
-    // if need be update things
-    double dist = jetI->geometrical_distance(jetB);
-    if (dist < jetI->NN_dist) {  // we need to update I
-      if (jetI != jetB) {
-        jetI->NN_dist = dist;
-        jetI->NN = jetB;
-        diJ[jetI-head] = compute_diJ(jetI); // update diJ...
-      }
-    }
-    if (dist < jetB->NN_dist) { // we need to update B
-      if (jetI != jetB) {
-        jetB->NN_dist = dist;
-        jetB->NN      = jetI;
-      }
-    }
-
-    // if jetI's NN is the new tail then relabel it so that it becomes jetA
-    if (jetI->NN == tail) {jetI->NN = jetA;}
-  }
-
-  // update info for jetB
-  diJ[jetB-head] = compute_diJ(jetB);
-}
-
-
-//----------------------------------------------------------------------
-// this function assumes that jet is not contained within begin...end
-template <class BJ, class I> void NNFJN2Plain<BJ,I>::set_NN_crosscheck(NNBJ * jet, 
-		    NNBJ * begin, NNBJ * end) {
-  double NN_dist = jet->geometrical_beam_distance();
-  NNBJ * NN      = NULL;
-  for (NNBJ * jetB = begin; jetB != end; jetB++) {
-    double dist = jet->geometrical_distance(jetB);
-    if (dist < NN_dist) {
-      NN_dist = dist;
-      NN = jetB;
-    }
-    if (dist < jetB->NN_dist) {
-      jetB->NN_dist = dist;
-      jetB->NN = jet;
-    }
-  }
-  jet->NN = NN;
-  jet->NN_dist = NN_dist;
-}
-
-
-//----------------------------------------------------------------------
-// set the NN for jet without checking whether in the process you might
-// have discovered a new nearest neighbour for another jet
-template <class BJ, class I>  void NNFJN2Plain<BJ,I>::set_NN_nocross(
-                 NNBJ * jet, NNBJ * begin, NNBJ * end) {
-  double NN_dist = jet->geometrical_beam_distance();
-  NNBJ * NN      = NULL;
-  // if (head < jet) {
-  //   for (NNBJ * jetB = head; jetB != jet; jetB++) {
-  if (begin < jet) {
-    for (NNBJ * jetB = begin; jetB != jet; jetB++) {
-      double dist = jet->geometrical_distance(jetB);
-      if (dist < NN_dist) {
-	NN_dist = dist;
-	NN = jetB;
-      }
-    }
-  }
-  // if (tail > jet) {
-  //   for (NNBJ * jetB = jet+1; jetB != tail; jetB++) {
-  if (end > jet) {
-    for (NNBJ * jetB = jet+1; jetB != end; jetB++) {
-      double dist = jet->geometrical_distance(jetB);
-      if (dist < NN_dist) {
-	NN_dist = dist;
-	NN = jetB;
-      }
-    }
-  }
-  jet->NN = NN;
-  jet->NN_dist = NN_dist;
-}
-
-
-
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-#endif // __FASTJET_NNFJN2PLAIN_HH__
Index: external/fastjet/NNFJN2Tiled.hh
===================================================================
--- external/fastjet/NNFJN2Tiled.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,716 +1,0 @@
-#ifndef __FASTJET_NNFJN2TILED_HH__
-#define __FASTJET_NNFJN2TILED_HH__
-
-//FJSTARTHEADER
-// $Id: NNFJN2Tiled.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2016-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include <fastjet/NNBase.hh>
-#include <fastjet/internal/TilingExtent.hh>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-//----------------------------------------------------------------------
-/// @ingroup advanced_usage
-/// \class NNFJN2Tiled
-///
-/// Helps solve closest pair problems with factorised interparticle
-/// and beam distances (ie satisfying the FastJet lemma) that are on
-/// a cylindrical geometry and allow tiling.
-///
-/// (see NNBase.hh for an introductory description)
-///
-/// This variant provides an implementation based on the N2Tiled
-/// clustering strategy in FastJet. As for the NNFJN2Plain case, the
-/// interparticle and beam distances should be of the form
-///
-/// \code
-///   dij = min(mom_factor(i), mom_factor(j)) * geometrical_distance(i,j)
-///   diB = mom_factor(i) * geometrical_beam_distance(i)
-/// \endcode
-///
-/// Additionally, the NNFJN2Tiled class takes a tile_size parameter
-/// that controls the size of the tiles. It must be such that, for any
-/// two points in non-neighbouring (and non-identical) tiles, the
-/// geometrical distance between the 2 points is larger than the
-/// geometrical beam distance of each of the 2 points.
-///
-/// It is templated with a BJ (brief jet) class and can be used with or
-/// without an extra "Information" template, i.e. NNFJN2Tiled<BJ> or
-/// NNFJN2Tiled<BJ,I>
-///
-/// For the NNFJN2Tiled<BJ> version of the class to function, BJ must provide 
-/// three member functions
-///  
-/// \code
-///   void   BJ::init(const PseudoJet & jet);                   // initialise with a PseudoJet
-///   double BJ::geometrical_distance(const BJ * other_bj_jet); // distance between this and other_bj_jet (geometrical part)
-///   double BJ::geometrical_beam_distance();                   // distance to the beam (geometrical part)
-///   double BJ::momentum_factor();                             // extra momentum factor
-/// \endcode
-///
-/// For the NNFJN2Tiled<BJ,I> version to function, the BJ::init(...) member
-/// must accept an extra argument
-///
-/// \code
-///   void BJ::init(const PseudoJet & jet, I * info);   // initialise with a PseudoJet + info
-/// \endcode
-///
-/// NOTE: THE DISTANCE MUST BE SYMMETRIC I.E. SATISFY
-/// \code
-///     a.geometrical_distance(b) == b.geometrical_distance(a)
-/// \endcode
-///
-/// Finally, the BJ class needs to provide access to the variables used
-/// for the rectangular tiling:
-///
-/// \code
-///   double BJ::rap(); // rapidity-like variable
-///   double BJ::phi(); // azimutal-angle-like variable (should be > -2pi)
-/// \endcode
-///
-/// Note that you are strongly advised to add the following lines
-/// to your BJ class to allow it to be used also with NNH:
-///
-/// \code
-///   /// make this BJ class compatible with the use of NNH
-///   double BJ::distance(const BJ * other_bj_jet){
-///     double mom1 = momentum_factor();
-///     double mom2 = other_bj_jet->momentum_factor();
-///     return (mom1<mom2 ? mom1 : mom2) * geometrical_distance(other_bj_jet);
-///   }
-///   double BJ::beam_distance(){
-///     return momentum_factor() * geometrical_beam_distance();
-///   }
-/// \endcode
-///
-template<class BJ, class I = _NoInfo> class NNFJN2Tiled : public NNBase<I> {
-public:
-
-  /// constructor with an initial set of jets (which will be assigned indices
-  /// `0...jets.size()-1`)
-  NNFJN2Tiled(const std::vector<PseudoJet> & jets, double requested_tile_size)
-    : NNBase<I>(),     _requested_tile_size(requested_tile_size) {start(jets);}
-  NNFJN2Tiled(const std::vector<PseudoJet> & jets, double requested_tile_size, I * info)
-    : NNBase<I>(info), _requested_tile_size(requested_tile_size) {start(jets);}
-  
-  void start(const std::vector<PseudoJet> & jets);
-
-  /// return the dij_min and indices iA, iB, for the corresponding jets.
-  /// If iB < 0 then iA recombines with the beam
-  double dij_min(int & iA, int & iB);
-
-  /// remove the jet pointed to by index iA
-  void remove_jet(int iA);
-
-  /// merge the jets pointed to by indices A and B and replace them with
-  /// jet, assigning it an index jet_index.
-  void merge_jets(int iA, int iB, const PseudoJet & jet, int jet_index);
-
-  /// a destructor
-  ~NNFJN2Tiled() {
-    delete[] briefjets;
-    delete[] diJ;
-  }
-    
-private:
-  class TiledJet; // forward declaration
-  class Tile;
-  class diJ_plus_link;
-
-  // Set up the tiles:
-  void _initialise_tiles(const std::vector<PseudoJet> & particles);
-
-  // return the full distance of a particle to its NN
-  inline double _compute_diJ(const TiledJet * const jet) const {
-    double mom_fact = jet->momentum_factor();
-    if (jet->NN != NULL) {
-      double other_mom_fact = jet->NN->momentum_factor();
-      if (other_mom_fact < mom_fact) {mom_fact = other_mom_fact;}
-    }
-    return jet->NN_dist * mom_fact;
-  }
-
-  // reasonably robust return of tile index given irap and iphi, in particular
-  // it works even if iphi is negative
-  inline int _tile_index (int irap, int iphi) const {
-    // note that (-1)%n = -1 so that we have to add _n_tiles_phi
-    // before performing modulo operation
-    return (irap-_tiles_irap_min)*_n_tiles_phi
-                  + (iphi+_n_tiles_phi) % _n_tiles_phi;
-  }
-
-  int  _tile_index(const double rap, const double phi) const;
-  void _tiledjet_set_jetinfo ( TiledJet * const tiled_jet, const PseudoJet &jet, int index);
-  void _bj_remove_from_tiles(TiledJet * const jet);
-  void _initialise_tiles();
-  void _print_tiles(TiledJet * briefjets ) const;
-  void _add_neighbours_to_tile_union(const int tile_index, int & n_near_tiles) const;
-  void _add_untagged_neighbours_to_tile_union(const int tile_index, int & n_near_tiles);
-
-
-  /// contains the briefjets
-  TiledJet * briefjets;
-
-  /// semaphores for the current extent of our structure
-  TiledJet * head;
-
-  /// currently active number of jets
-  int n;
-
-  /// where_is[i] contains a pointer to the jet with index i
-  std::vector<TiledJet *> where_is;
-
-  /// helper to keep tracks of tiles to be checked for updates
-  std::vector<int> tile_union;
-
-  /// a table containing all the (full) distances to each object's NN
-  diJ_plus_link * diJ;
-
-  /// tiling information
-  std::vector<Tile> _tiles;
-  double _requested_tile_size;
-  double _tiles_rap_min, _tiles_rap_max;
-  double _tile_size_rap, _tile_size_phi;
-  int    _n_tiles_phi,_tiles_irap_min,_tiles_irap_max;
-  
-  /// a class that wraps around the BJ, supplementing it with extra information
-  /// such as pointers to neighbours, etc.
-  class TiledJet : public BJ {
-  public:
-    void init(const PseudoJet & jet, int index_in) {
-      BJ::init(jet);
-      other_init(index_in);
-    }
-    void init(const PseudoJet & jet, int index_in, I * info) {
-      BJ::init(jet, info);
-      other_init(index_in);
-    }
-    void other_init(int index_in) {
-      _index = index_in;
-      NN_dist = BJ::geometrical_beam_distance();
-      NN = NULL;
-    }
-    int jet_index() const {return _index;}
-    
-    double NN_dist;
-    TiledJet * NN, *previous, * next;
-    int tile_index, diJ_posn;
-    // routines that are useful in the minheap version of tiled
-    // clustering ("misuse" the otherwise unused diJ_posn, so as
-    // to indicate whether jets need to have their minheap entries
-    // updated).
-    inline void label_minheap_update_needed() {diJ_posn = 1;}
-    inline void label_minheap_update_done()   {diJ_posn = 0;}
-    inline bool minheap_update_needed() const {return diJ_posn==1;}
-    
-  private:
-    int _index;
-  };
-
-  /// number of neighbours that a tile will have (rectangular geometry
-  /// gives 9 neighbours).
-  static const int n_tile_neighbours = 9;
-  //----------------------------------------------------------------------
-  /// The fundamental structures to be used for the tiled N^2 algorithm
-  /// (see CCN27-44 for some discussion of pattern of tiling)
-  class Tile {
-  public:
-    /// pointers to neighbouring tiles, including self
-    Tile *   begin_tiles[n_tile_neighbours]; 
-    /// neighbouring tiles, excluding self
-    Tile **  surrounding_tiles; 
-    /// half of neighbouring tiles, no self
-    Tile **  RH_tiles;  
-    /// just beyond end of tiles
-    Tile **  end_tiles; 
-    /// start of list of BriefJets contained in this tile
-    TiledJet * head;    
-    /// sometimes useful to be able to tag a tile
-    bool     tagged;    
-  };
-
-  // structure that holds the real, full, distance (as well as a pointer to the corresponding TiledJet)
-  class diJ_plus_link {
-  public:
-    double     diJ; // the distance
-    TiledJet * jet; // the jet (i) for which we've found this distance
-                    // (whose NN will the J).
-  };
-
-};
-
-
-
-//----------------------------------------------------------------------
-template<class BJ, class I> void NNFJN2Tiled<BJ,I>::start(const std::vector<PseudoJet> & jets) {
-
-  _initialise_tiles(jets);
-
-  n = jets.size();
-
-  briefjets = new TiledJet[n];
-  where_is.resize(2*n);
-
-  TiledJet * jetA = briefjets, * jetB;
-
-  // will be used quite deep inside loops, but declare it here so that
-  // memory (de)allocation gets done only once
-  tile_union.resize(3*n_tile_neighbours);
-  
-  // initialise the basic jet info 
-  for (int i = 0; i< n; i++) {
-    _tiledjet_set_jetinfo(jetA, jets[i], i);
-    where_is[i] = jetA;
-    jetA++; // move on to next entry of briefjets
-  }
-
-  head = briefjets; // a nicer way of naming start
-
-  // set up the initial nearest neighbour information
-  typename std::vector<Tile>::const_iterator tile;
-  for (tile = _tiles.begin(); tile != _tiles.end(); tile++) {
-    // first do it on this tile
-    for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-      for (jetB = tile->head; jetB != jetA; jetB = jetB->next) {
-	double dist = jetA->geometrical_distance(jetB);
-	if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-	if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-      }
-    }
-    // then do it for RH tiles
-    for (Tile ** RTile = tile->RH_tiles; RTile != tile->end_tiles; RTile++) {
-      for (jetA = tile->head; jetA != NULL; jetA = jetA->next) {
-	for (jetB = (*RTile)->head; jetB != NULL; jetB = jetB->next) {
-	  double dist = jetA->geometrical_distance(jetB);
-	  if (dist < jetA->NN_dist) {jetA->NN_dist = dist; jetA->NN = jetB;}
-	  if (dist < jetB->NN_dist) {jetB->NN_dist = dist; jetB->NN = jetA;}
-	}
-      }
-    }
-    // no need to do it for LH tiles, since they are implicitly done
-    // when we set NN for both jetA and jetB on the RH tiles.
-  }
-  
-  diJ = new diJ_plus_link[n];
-  jetA = head;
-  for (int i = 0; i < n; i++) {
-    diJ[i].diJ = _compute_diJ(jetA); // kt distance * R^2
-    diJ[i].jet = jetA;  // our compact diJ table will not be in	     
-    jetA->diJ_posn = i; // one-to-one corresp. with non-compact jets,
-                        // so set up bi-directional correspondence here.
-    jetA++; // have jetA follow i 
-  }
-}
-
-
-//----------------------------------------------------------------------
-template<class BJ, class I> double NNFJN2Tiled<BJ,I>::dij_min(int & iA, int & iB) {
-  // find the minimum of the diJ on this round
-  diJ_plus_link * best, *stop; // pointers a bit faster than indices
-                               // could use best to keep track of diJ
-                               // min, but it turns out to be
-                               // marginally faster to have a separate
-                               // variable (avoids n dereferences at
-                               // the expense of n/2 assignments).
-  double diJ_min = diJ[0].diJ; // initialise the best one here.
-  best = diJ;                  // and here
-  stop = diJ+n;
-  for (diJ_plus_link * here = diJ+1; here != stop; here++) {
-    if (here->diJ < diJ_min) {best = here; diJ_min  = here->diJ;}
-  }
-
-  // return information to user about recombination
-  TiledJet * jetA = best->jet;
-  iA = jetA->jet_index();
-  iB = jetA->NN ? jetA->NN->jet_index() : -1;
-  return diJ_min;
-}
-
-
-//----------------------------------------------------------------------
-// remove jetA from the list
-template<class BJ, class I> void NNFJN2Tiled<BJ,I>::remove_jet(int iA) {
-  TiledJet * jetA = where_is[iA];
-
-  _bj_remove_from_tiles(jetA);
-
-  // first establish the set of tiles over which we are going to
-  // have to run searches for updated and new nearest-neighbours --
-  // basically a combination of vicinity of the tiles of the two old
-  // and one new jet.
-  int n_near_tiles = 0;
-  _add_untagged_neighbours_to_tile_union(jetA->tile_index, n_near_tiles);
-
-  // now update our nearest neighbour info and diJ table
-  // first reduce size of table
-  n--;
-  // then compactify the diJ by taking the last of the diJ and copying
-  // it to the position occupied by the diJ for jetA
-  diJ[n].jet->diJ_posn = jetA->diJ_posn;
-  diJ[jetA->diJ_posn] = diJ[n];
-
-  // updating other particles' NN.
-  // Run over all tiles in our union 
-  for (int itile = 0; itile < n_near_tiles; itile++) {
-    Tile * tile_ptr = &_tiles[tile_union[itile]];
-    tile_ptr->tagged = false; // reset tag, since we're done with unions
-    // run over all jets in the current tile
-    for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
-      // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-      if (jetI->NN == jetA) {
-        jetI->NN_dist = jetI->geometrical_beam_distance();
-        jetI->NN      = NULL;
-        // now go over tiles that are neighbours of I (include own tile)
-        for (Tile ** near_tile  = tile_ptr->begin_tiles; 
-             near_tile != tile_ptr->end_tiles; near_tile++) {
-          // and then over the contents of that tile
-          for (TiledJet * jetJ  = (*near_tile)->head; jetJ != NULL; jetJ = jetJ->next) {
-            double dist = jetI->geometrical_distance(jetJ);
-            if (dist < jetI->NN_dist && jetJ != jetI) {
-              jetI->NN_dist = dist; jetI->NN = jetJ;
-            }
-          }
-        }
-        diJ[jetI->diJ_posn].diJ = _compute_diJ(jetI); // update diJ kt-dist
-      }
-    }
-  }
-
-}
-
-
-//----------------------------------------------------------------------
-template<class BJ, class I> void NNFJN2Tiled<BJ,I>::merge_jets(int iA, int iB, 
-					const PseudoJet & jet, int index) {
-
-  TiledJet * jetA = where_is[iA];
-  TiledJet * jetB = where_is[iB];
-
-  // jet-jet recombination
-  // If necessary relabel A & B to ensure jetB < jetA, that way if
-  // the larger of them == newtail then that ends up being jetA and 
-  // the new jet that is added as jetB is inserted in a position that
-  // has a future!
-  if (jetA < jetB) {std::swap(jetA,jetB);}
-
-  // what was jetB will now become the new jet
-  _bj_remove_from_tiles(jetA);
-  TiledJet oldB = * jetB;  // take a copy because we will need it...
-  _bj_remove_from_tiles(jetB);
-  _tiledjet_set_jetinfo(jetB, jet, index); // cause jetB to become _jets[nn]
-                                           // (also registers the jet in the tiling)
-  where_is[index] = jetB;
-  
-  // first establish the set of tiles over which we are going to
-  // have to run searches for updated and new nearest-neighbours --
-  // basically a combination of vicinity of the tiles of the two old
-  // and one new jet.
-  int n_near_tiles = 0;
-  _add_untagged_neighbours_to_tile_union(jetA->tile_index, n_near_tiles);
-  if (jetB->tile_index != jetA->tile_index) {
-    _add_untagged_neighbours_to_tile_union(jetB->tile_index, n_near_tiles);
-  }
-  if (oldB.tile_index != jetA->tile_index && 
-      oldB.tile_index != jetB->tile_index) {
-    _add_untagged_neighbours_to_tile_union(oldB.tile_index, n_near_tiles);
-  }
-
-  // now update our nearest neighbour info and diJ table
-  // first reduce size of table
-  n--;
-  // then compactify the diJ by taking the last of the diJ and copying
-  // it to the position occupied by the diJ for jetA
-  diJ[n].jet->diJ_posn = jetA->diJ_posn;
-  diJ[jetA->diJ_posn] = diJ[n];
-
-  // Initialise jetB's NN distance as well as updating it for 
-  // other particles.
-  // Run over all tiles in our union 
-  for (int itile = 0; itile < n_near_tiles; itile++) {
-    Tile * tile_ptr = &_tiles[tile_union[itile]];
-    tile_ptr->tagged = false; // reset tag, since we're done with unions
-    // run over all jets in the current tile
-    for (TiledJet * jetI = tile_ptr->head; jetI != NULL; jetI = jetI->next) {
-      // see if jetI had jetA or jetB as a NN -- if so recalculate the NN
-      if ((jetI->NN == jetA) || (jetI->NN == jetB)) {
-        jetI->NN_dist = jetI->geometrical_beam_distance();
-        jetI->NN      = NULL;
-        // now go over tiles that are neighbours of I (include own tile)
-        for (Tile ** near_tile  = tile_ptr->begin_tiles; near_tile != tile_ptr->end_tiles; near_tile++) {
-          // and then over the contents of that tile
-          for (TiledJet * jetJ  = (*near_tile)->head; jetJ != NULL; jetJ = jetJ->next) {
-            double dist = jetI->geometrical_distance(jetJ);
-            if (dist < jetI->NN_dist && jetJ != jetI) {
-              jetI->NN_dist = dist; jetI->NN = jetJ;
-            }
-          }
-        }
-        diJ[jetI->diJ_posn].diJ = _compute_diJ(jetI); // update diJ kt-dist
-      }
-      // check whether new jetB is closer than jetI's current NN and
-      // if jetI is closer than jetB's current (evolving) nearest
-      // neighbour. Where relevant update things
-      double dist = jetI->geometrical_distance(jetB);
-      if (dist < jetI->NN_dist) {
-        if (jetI != jetB) {
-          jetI->NN_dist = dist;
-          jetI->NN = jetB;
-          diJ[jetI->diJ_posn].diJ = _compute_diJ(jetI); // update diJ...
-        }
-      }
-      if (dist < jetB->NN_dist) {
-        if (jetI != jetB) {
-          jetB->NN_dist = dist;
-          jetB->NN      = jetI;}
-      }
-    }
-  }
-
-  // finally, register the updated kt distance for B
-  diJ[jetB->diJ_posn].diJ = _compute_diJ(jetB);
-}
-
-
-//----------------------------------------------------------------------
-/// Set up the tiles:
-///  - decide the range in eta
-///  - allocate the tiles
-///  - set up the cross-referencing info between tiles
-///
-/// The neighbourhood of a tile is set up as follows
-///
-/// 	      LRR
-///           LXR
-///           LLR
-///
-/// such that tiles is an array containing XLLLLRRRR with pointers
-///                                         |   \ RH_tiles
-///                                         \ surrounding_tiles
-///
-/// with appropriate precautions when close to the edge of the tiled
-/// region.
-///
-template <class BJ, class I>
-void NNFJN2Tiled<BJ,I>::_initialise_tiles(const std::vector<PseudoJet> &particles) {
-
-  // first decide tile sizes (with a lower bound to avoid huge memory use with
-  // very small R)
-  double default_size = _requested_tile_size>0.1 ? _requested_tile_size : 0.1;
-  _tile_size_rap = default_size;
-  // it makes no sense to go below 3 tiles in phi -- 3 tiles is
-  // sufficient to make sure all pair-wise combinations up to pi in
-  // phi are possible
-  _n_tiles_phi   = int(floor(twopi/default_size));
-  if (_n_tiles_phi<3) _n_tiles_phi = 3;
-  _tile_size_phi = twopi / _n_tiles_phi; // >= _Rparam and fits in 2pi
-
-  TilingExtent tiling_analysis(particles);
-  _tiles_rap_min = tiling_analysis.minrap();
-  _tiles_rap_max = tiling_analysis.maxrap();
-
-  // now adjust the values
-  _tiles_irap_min = int(floor(_tiles_rap_min/_tile_size_rap));
-  _tiles_irap_max = int(floor( _tiles_rap_max/_tile_size_rap));
-  _tiles_rap_min = _tiles_irap_min * _tile_size_rap;
-  _tiles_rap_max = _tiles_irap_max * _tile_size_rap;
-
-  // allocate the tiles
-  _tiles.resize((_tiles_irap_max-_tiles_irap_min+1)*_n_tiles_phi);
-
-  // now set up the cross-referencing between tiles
-  for (int irap = _tiles_irap_min; irap <= _tiles_irap_max; irap++) {
-    for (int iphi = 0; iphi < _n_tiles_phi; iphi++) {
-      Tile * tile = & _tiles[_tile_index(irap,iphi)];
-      // no jets in this tile yet
-      tile->head = NULL; // first element of tiles points to itself
-      tile->begin_tiles[0] =  tile;
-      Tile ** pptile = & (tile->begin_tiles[0]);
-      pptile++;
-      //
-      // set up L's in column to the left of X
-      tile->surrounding_tiles = pptile;
-      if (irap > _tiles_irap_min) {
-	// with the itile subroutine, we can safely run tiles from
-	// idphi=-1 to idphi=+1, because it takes care of
-	// negative and positive boundaries
-	for (int idphi = -1; idphi <=+1; idphi++) {
-	  *pptile = & _tiles[_tile_index(irap-1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now set up last L (below X)
-      *pptile = & _tiles[_tile_index(irap,iphi-1)];
-      pptile++;
-      // set up first R (above X)
-      tile->RH_tiles = pptile;
-      *pptile = & _tiles[_tile_index(irap,iphi+1)];
-      pptile++;
-      // set up remaining R's, to the right of X
-      if (irap < _tiles_irap_max) {
-	for (int idphi = -1; idphi <= +1; idphi++) {
-	  *pptile = & _tiles[_tile_index(irap+1,iphi+idphi)];
-	  pptile++;
-	}	
-      }
-      // now put semaphore for end tile
-      tile->end_tiles = pptile;
-      // finally make sure tiles are untagged
-      tile->tagged = false;
-    }
-  }
-
-}
-
-//----------------------------------------------------------------------
-/// return the tile index corresponding to the given rap,phi point
-template <class BJ, class I>
-int NNFJN2Tiled<BJ,I>::_tile_index(const double rap, const double phi) const {
-  int irap, iphi;
-  if      (rap <= _tiles_rap_min) {irap = 0;}
-  else if (rap >= _tiles_rap_max) {irap = _tiles_irap_max-_tiles_irap_min;}
-  else {
-    //irap = int(floor((rap - _tiles_rap_min) / _tile_size_rap));
-    irap = int(((rap - _tiles_rap_min) / _tile_size_rap));
-    // following needed in case of rare but nasty rounding errors
-    if (irap > _tiles_irap_max-_tiles_irap_min) {
-      irap = _tiles_irap_max-_tiles_irap_min;} 
-  }
-  // allow for some extent of being beyond range in calculation of phi
-  // as well
-  //iphi = (int(floor(phi/_tile_size_phi)) + _n_tiles_phi) % _n_tiles_phi;
-  // with just int and no floor, things run faster but beware
-  iphi = int((phi+twopi)/_tile_size_phi) % _n_tiles_phi;
-  return (iphi + irap * _n_tiles_phi);
-}
-
-//----------------------------------------------------------------------
-template <class BJ, class I>
-void NNFJN2Tiled<BJ,I>::_bj_remove_from_tiles(TiledJet * const jet) {
-  Tile * tile = & _tiles[jet->tile_index];
-
-  if (jet->previous == NULL) {
-    // we are at head of the tile, so reset it.
-    // If this was the only jet on the tile then tile->head will now be NULL
-    tile->head = jet->next;
-  } else {
-    // adjust link from previous jet in this tile
-    jet->previous->next = jet->next;
-  }
-  if (jet->next != NULL) {
-    // adjust backwards-link from next jet in this tile
-    jet->next->previous = jet->previous;
-  }
-}
-
-
-//----------------------------------------------------------------------
-// overloaded version which additionally sets up information regarding the
-// tiling
-template <class BJ, class I>
-inline void NNFJN2Tiled<BJ,I>::_tiledjet_set_jetinfo(TiledJet * const tile_jet,
-                                                   const PseudoJet &jet, 
-                                                   int index) {
-  // the this-> in the next line is required by standard compiler
-  // see e.g. http://stackoverflow.com/questions/10639053/name-lookups-in-c-templates
-  this->init_jet(tile_jet, jet, index); 
-
-  // Then do the setup specific to the tiled case.
-
-  // Find out which tile it belonds to
-  tile_jet->tile_index = _tile_index(tile_jet->rap(), tile_jet->phi());
-
-  // Insert it into the tile's linked list of jets
-  Tile * tile = &_tiles[tile_jet->tile_index];
-  tile_jet->previous   = NULL;
-  tile_jet->next       = tile->head;
-  if (tile_jet->next != NULL) {tile_jet->next->previous = tile_jet;}
-  tile->head      = tile_jet;
-}
-
-//----------------------------------------------------------------------
-/// Add to the vector tile_union the tiles that are in the neighbourhood
-/// of the specified tile_index, including itself -- start adding
-/// from position n_near_tiles-1, and increase n_near_tiles as
-/// you go along (could have done it more C++ like with vector with reserved
-/// space, but fear is that it would have been slower, e.g. checking
-/// for end of vector at each stage to decide whether to resize it)
-template <class BJ, class I>
-void NNFJN2Tiled<BJ,I>::_add_neighbours_to_tile_union(const int tile_index, 
-                                                    int & n_near_tiles) const {
-  for (Tile * const * near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    // get the tile number
-    tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-    n_near_tiles++;
-  }
-}
-
-//----------------------------------------------------------------------
-/// Like _add_neighbours_to_tile_union, but only adds neighbours if 
-/// their "tagged" status is false; when a neighbour is added its
-/// tagged status is set to true.
-///
-/// Note that with a high level of warnings (-pedantic -Wextra -ansi,
-/// gcc complains about tile_index maybe being used uninitialised for
-/// oldB in ClusterSequence::_minheap_faster_tiled_N2_cluster(). We
-/// have explicitly checked that it was harmless so we could disable
-/// the gcc warning by hand using the construct below
-///
-///  #pragma GCC diagnostic push
-///  #pragma GCC diagnostic ignored "-Wpragmas"
-///  #pragma GCC diagnostic ignored "-Wuninitialized"
-///  #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-///    ...
-///  #pragma GCC diagnostic pop
-///
-/// the @GCC diagnostic push/pop directive was only introduced in
-/// gcc-4.6, so for broader usage, we'd need to insert #pragma GCC
-/// diagnostic ignored "-Wpragmas" at the top of this file
-template <class BJ, class I>
-inline void NNFJN2Tiled<BJ,I>::_add_untagged_neighbours_to_tile_union(
-               const int tile_index, 
-	       int & n_near_tiles)  {
-  for (Tile ** near_tile = _tiles[tile_index].begin_tiles; 
-       near_tile != _tiles[tile_index].end_tiles; near_tile++){
-    if (! (*near_tile)->tagged) {
-      (*near_tile)->tagged = true;
-      // get the tile number
-      tile_union[n_near_tiles] = *near_tile - & _tiles[0];
-      n_near_tiles++;
-    }
-  }
-}
-
-
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-#endif // __FASTJET_NNFJN2TILED_HH__
Index: external/fastjet/NNH.hh
===================================================================
--- external/fastjet/NNH.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/NNH.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,9 @@
-#ifndef __FASTJET_NNH_HH__
-#define __FASTJET_NNH_HH__
-
-//FJSTARTHEADER
-// $Id: NNH.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+#ifndef __NNH_HH__
+#define __NNH_HH__
+
+//STARTHEADER
+// $Id: NNH.hh 2891 2012-06-15 12:47:59Z soyez $
+//
+// Copyright (c) 2009, Matteo Cacciari, Gavin Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,9 +28,37 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
-
-#include <fastjet/NNBase.hh>
+//ENDHEADER
+
+#include<fastjet/ClusterSequence.hh>
+
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
+
+/// @ingroup advanced_usage
+/// \class _NoInfo
+/// dummy class, used as a default template argument
+class _NoInfo {};
+
+/// @ingroup advanced_usage
+/// \class NNHInfo
+/// template that will help initialise a BJ with a PseudoJet and extra information
+template<class I> class NNHInfo {
+public:
+  NNHInfo()         : _info(NULL) {}
+  NNHInfo(I * info) : _info(info) {}
+  template<class NNBJ> void init_jet(NNBJ * briefjet, const fastjet::PseudoJet & jet, int index) { briefjet->init(jet, index, _info);}
+private:
+  I * _info;
+};
+
+/// @ingroup advanced_usage
+/// Specialisation of NNHInfo for cases where there is no extra info
+template<> class NNHInfo<_NoInfo>  {
+public:
+  NNHInfo()           {}
+  NNHInfo(_NoInfo * ) {}
+  template<class NNBJ> void init_jet(NNBJ * briefjet, const fastjet::PseudoJet & jet, int index) { briefjet->init(jet, index);}
+};
+
 
 //----------------------------------------------------------------------
@@ -40,11 +66,17 @@
 /// \class NNH
 /// Help solve closest pair problems with generic interparticle and
-/// beam distance (generic case)
-///
-/// (see NNBase.hh for an introductory description)
-///
-/// This variant provides an implementation for any distance measure.
-/// It is templated with a BJ (brief jet) classand can be used with or
-/// without an extra "Information" template, i.e. NNH<BJ> or NNH<BJ,I>
+/// beam distance.
+///
+/// Class to help solve closest pair problems with generic interparticle
+/// distances and a beam distance, using Anderberg's Nearest Neighbour
+/// Heuristic.
+///
+/// It is templated with a BJ (brief jet) class --- BJ should
+/// basically cache the minimal amount of information that is needed
+/// to efficiently calculate interparticle distances and particle-beam
+/// distances.
+///
+/// This class can be used with or without an extra "Information" template, 
+/// i.e. NNB<BJ> or NNH<BJ,I>
 /// 
 /// For the NNH<BJ> version of the class to function, BJ must provide 
@@ -54,5 +86,5 @@
 ///  - double BJ::distance(const BJ * other_bj_jet); // distance between this and other_bj_jet
 ///  - double BJ::beam_distance()                  ; // distance to the beam
-/// 
+///
 /// For the NNH<BJ,I> version to function, the BJ::init(...) member
 /// must accept an extra argument
@@ -60,6 +92,6 @@
 ///  - void   BJ::init(const PseudoJet & jet, I * info);   // initialise with a PseudoJet + info
 ///
-/// NOTE: THE DISTANCE MUST BE SYMMETRIC I.E. SATISFY
-///     a.distance(b) == b.distance(a)
+/// where info might be a pointer to a class that contains, e.g., information
+/// about R, or other parameters of the jet algorithm 
 ///
 /// For an example of how the NNH<BJ> class is used, see the Jade (and
@@ -73,13 +105,16 @@
 /// implementations.
 ///
-template<class BJ, class I = _NoInfo> class NNH : public NNBase<I> {
+///
+/// Implementation note: this class derives from NNHInfo, which deals
+/// with storing any global information that is needed during the clustering
+
+template<class BJ, class I = _NoInfo> class NNH : public NNHInfo<I> {
 public:
 
   /// constructor with an initial set of jets (which will be assigned indices
   /// 0 ... jets.size()-1
-  NNH(const std::vector<PseudoJet> & jets)           : NNBase<I>()     {start(jets);}
-  NNH(const std::vector<PseudoJet> & jets, I * info) : NNBase<I>(info) {start(jets);}
-
-  // initialisation from a given list of particles
+  NNH(const std::vector<PseudoJet> & jets) {start(jets);}
+  NNH(const std::vector<PseudoJet> & jets, I * info) : NNHInfo<I>(info) {start(jets);}
+  
   void start(const std::vector<PseudoJet> & jets);
 
@@ -103,5 +138,5 @@
   class NNBJ; // forward declaration
   
-  /// establish the nearest neighbour for jet, and cross check consistency
+  /// establish the nearest neighbour for jet, and cross check constistency
   /// of distances for the other jets that are encountered. Assumes
   /// jet not contained within begin...end
@@ -344,3 +379,3 @@
 
 
-#endif // __FASTJET_NNH_HH__
+#endif // __NNH_HH__
Index: external/fastjet/PseudoJet.cc
===================================================================
--- external/fastjet/PseudoJet.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/PseudoJet.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: PseudoJet.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -33,7 +31,5 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
-#ifndef __FJCORE__
 #include "fastjet/ClusterSequenceAreaBase.hh"
-#endif  // __FJCORE__
 #include "fastjet/CompositeJetStructure.hh"
 #include<valarray>
@@ -71,12 +67,4 @@
   _kt2 = this->px()*this->px() + this->py()*this->py();
   _phi = pseudojet_invalid_phi;
-  // strictly speaking, _rap does not need initialising, because
-  // it's never used as long as _phi == pseudojet_invalid_phi
-  // (and gets set when _phi is requested). However ATLAS
-  // 2013-03-28 complained that they sometimes have NaN's in
-  // _rap and this interferes with some of their internal validation. 
-  // So we initialise it; penalty is about 0.3ns per PseudoJet out of about
-  // 10ns total initialisation time (on a intel Core i7 2.7GHz)
-  _rap = pseudojet_invalid_rap;
 }
 
@@ -178,8 +166,4 @@
 // return the product, coeff * jet
 PseudoJet operator* (double coeff, const PseudoJet & jet) {
-  // see the comment in operator*= about ensuring valid rap phi
-  // before a multiplication to handle case of multiplication by
-  // zero, while maintaining rapidity and phi
-  jet._ensure_valid_rap_phi(); 
   //return PseudoJet(coeff*jet.four_mom());
   // the following code is hopefully more efficient
@@ -203,13 +187,5 @@
 //----------------------------------------------------------------------
 /// multiply the jet's momentum by the coefficient
-PseudoJet & PseudoJet::operator*=(double coeff) {
-  // operator*= aims to maintain the rapidity and azimuth
-  // for the PseudoJet; if they have already been evaluated
-  // this is fine, but if they haven't and coeff is sufficiently
-  // small as to cause a zero or underflow result, then a subsequent
-  // invocation of rap or phi will lead to a non-sensical result. 
-  // So, here, we preemptively ensure that rapidity and phi
-  // are correctly cached
-  _ensure_valid_rap_phi(); 
+void PseudoJet::operator*=(double coeff) {
   _px *= coeff;
   _py *= coeff;
@@ -218,12 +194,10 @@
   _kt2*= coeff*coeff;
   // phi and rap are unchanged
-  return *this;
 }
 
 //----------------------------------------------------------------------
 /// divide the jet's momentum by the coefficient
-PseudoJet & PseudoJet::operator/=(double coeff) {
+void PseudoJet::operator/=(double coeff) {
   (*this) *= 1.0/coeff;
-  return *this;
 }
 
@@ -231,5 +205,5 @@
 //----------------------------------------------------------------------
 /// add the other jet's momentum to this jet
-PseudoJet & PseudoJet::operator+=(const PseudoJet & other_jet) {
+void PseudoJet::operator+=(const PseudoJet & other_jet) {
   _px += other_jet._px;
   _py += other_jet._py;
@@ -237,5 +211,4 @@
   _E  += other_jet._E ;
   _finish_init(); // we need to recalculate phi,rap,kt2
-  return *this;
 }
 
@@ -243,5 +216,5 @@
 //----------------------------------------------------------------------
 /// subtract the other jet's momentum from this jet
-PseudoJet & PseudoJet::operator-=(const PseudoJet & other_jet) {
+void PseudoJet::operator-=(const PseudoJet & other_jet) {
   _px -= other_jet._px;
   _py -= other_jet._py;
@@ -249,5 +222,4 @@
   _E  -= other_jet._E ;
   _finish_init(); // we need to recalculate phi,rap,kt2
-  return *this;
 }
 
@@ -279,6 +251,6 @@
 
 //----------------------------------------------------------------------
-/// transform this jet (given in the rest frame of prest) into a jet
-/// in the lab frame 
+/// transform this jet (given in lab) into a jet in the rest
+/// frame of prest
 //
 // NB: code adapted from that in herwig f77 (checked how it worked
@@ -306,6 +278,6 @@
 
 //----------------------------------------------------------------------
-/// transform this jet (given in lab) into a jet in the rest
-/// frame of prest  
+/// transform this jet (given in the rest frame of prest) into a jet
+/// in the lab frame;
 //
 // NB: code adapted from that in herwig f77 (checked how it worked
@@ -413,9 +385,9 @@
 string PseudoJet::description() const{
   // the "default" case of a PJ which does not belong to any cluster sequence
-  if (!_structure)
+  if (!_structure())
     return "standard PseudoJet (with no associated clustering information)";
   
   // for all the other cases, the description comes from the structure
-  return _structure->description();
+  return _structure()->description();
 }
 
@@ -433,5 +405,5 @@
 // ClusterSequence
 bool PseudoJet::has_associated_cluster_sequence() const{
-  return (_structure) && (_structure->has_associated_cluster_sequence());
+  return (_structure()) && (_structure->has_associated_cluster_sequence());
 }
 
@@ -450,5 +422,5 @@
 // ClusterSequence that is still valid
 bool PseudoJet::has_valid_cluster_sequence() const{
-  return (_structure) && (_structure->has_valid_cluster_sequence());
+  return (_structure()) && (_structure->has_valid_cluster_sequence());
 }
 
@@ -471,7 +443,7 @@
 
 //----------------------------------------------------------------------
-// return true if there is some structure associated with this PseudoJet
+// return true if there is some strusture associated with this PseudoJet
 bool PseudoJet::has_structure() const{
-  return bool(_structure);
+  return _structure();
 }
 
@@ -482,6 +454,6 @@
 // return NULL if there is no associated structure
 const PseudoJetStructureBase* PseudoJet::structure_ptr() const {
-  //if (!_structure) return NULL;
-  return _structure.get();
+  if (!_structure()) return NULL;
+  return _structure();
 }
   
@@ -497,6 +469,6 @@
 // underlying structure.
 PseudoJetStructureBase* PseudoJet::structure_non_const_ptr(){
-  //if (!_structure) return NULL;
-  return _structure.get();
+  if (!_structure()) return NULL;
+  return _structure();
 }
   
@@ -507,7 +479,7 @@
 // throw an error if there is no associated structure
 const PseudoJetStructureBase* PseudoJet::validated_structure_ptr() const {
-  if (!_structure) 
+  if (!_structure()) 
     throw Error("Trying to access the structure of a PseudoJet which has no associated structure");
-  return _structure.get();
+  return _structure();
 }
   
@@ -577,5 +549,5 @@
 // returns true if the PseudoJet has constituents
 bool PseudoJet::has_constituents() const{
-  return (_structure) && (_structure->has_constituents());
+  return (_structure()) && (_structure->has_constituents());
 }
 
@@ -590,5 +562,5 @@
 // returns true if the PseudoJet has support for exclusive subjets
 bool PseudoJet::has_exclusive_subjets() const{
-  return (_structure) && (_structure->has_exclusive_subjets());
+  return (_structure()) && (_structure->has_exclusive_subjets());
 }
 
@@ -605,5 +577,5 @@
 // an Error is thrown if this PseudoJet has no currently valid
 // associated ClusterSequence
-std::vector<PseudoJet> PseudoJet::exclusive_subjets (const double dcut) const {
+std::vector<PseudoJet> PseudoJet::exclusive_subjets (const double & dcut) const {
   return validated_structure_ptr()->exclusive_subjets(*this, dcut);
 }
@@ -616,5 +588,5 @@
 // an Error is thrown if this PseudoJet has no currently valid
 // associated ClusterSequence
-int PseudoJet::n_exclusive_subjets(const double dcut) const {
+int PseudoJet::n_exclusive_subjets(const double & dcut) const {
   return validated_structure_ptr()->n_exclusive_subjets(*this, dcut);
 }
@@ -674,5 +646,5 @@
 // ClusterSequence have no pieces and this methos will return false.
 bool PseudoJet::has_pieces() const{
-  return ((_structure) && (_structure->has_pieces(*this)));
+  return ((_structure()) && (_structure->has_pieces(*this)));
 }
 
@@ -696,6 +668,4 @@
 //----------------------------------------------------------------------
 
-#ifndef __FJCORE__
-
 //----------------------------------------------------------------------
 // if possible, return a valid ClusterSequenceAreaBase pointer; otherwise
@@ -745,5 +715,4 @@
 }
 
-#endif  // __FJCORE__
 
 //----------------------------------------------------------------------
@@ -769,4 +738,33 @@
 }
 
+
+
+//----------------------------------------------------------------------
+/// given a vector of values with a one-to-one correspondence with the
+/// vector of objects, sort objects into an order such that the
+/// associated values would be in increasing order
+template<class T> vector<T>  objects_sorted_by_values(
+                       const vector<T> & objects, 
+		       const vector<double> & values) {
+
+  assert(objects.size() == values.size());
+
+  // get a vector of indices
+  vector<int> indices(values.size());
+  for (size_t i = 0; i < indices.size(); i++) {indices[i] = i;}
+  
+  // sort the indices
+  sort_indices(indices, values);
+  
+  // copy the objects 
+  vector<T> objects_sorted(objects.size());
+  
+  // place the objects in the correct order
+  for (size_t i = 0; i < indices.size(); i++) {
+    objects_sorted[i] = objects[indices[i]];
+  }
+
+  return objects_sorted;
+}
 
 //----------------------------------------------------------------------
@@ -836,5 +834,4 @@
 PseudoJet join(const PseudoJet & j1, const PseudoJet & j2){
   vector<PseudoJet> pieces;
-  pieces.reserve(2);
   pieces.push_back(j1);
   pieces.push_back(j2);
@@ -845,5 +842,4 @@
 PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3){
   vector<PseudoJet> pieces;
-  pieces.reserve(3);
   pieces.push_back(j1);
   pieces.push_back(j2);
@@ -855,5 +851,4 @@
 PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3, const PseudoJet & j4){
   vector<PseudoJet> pieces;
-  pieces.reserve(4);
   pieces.push_back(j1);
   pieces.push_back(j2);
Index: external/fastjet/PseudoJet.hh
===================================================================
--- external/fastjet/PseudoJet.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/PseudoJet.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: PseudoJet.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: PseudoJet.hh 2728 2011-11-20 14:18:59Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -54,10 +52,7 @@
 /// default value for phi, meaning it (and rapidity) have yet to be calculated) 
 const double pseudojet_invalid_phi = -100.0;
-const double pseudojet_invalid_rap = -1e200;
-
-#ifndef __FJCORE__
+
 // forward definition
 class ClusterSequenceAreaBase;
-#endif  // __FJCORE__
 
 /// @ingroup basic_classes
@@ -78,13 +73,10 @@
   // internal shared pointer: see PJtiming.cc and the notes therein)
   PseudoJet() : _px(0), _py(0), _pz(0), _E(0) {_finish_init(); _reset_indices();}
-  //PseudoJet() : _px(0), _py(0), _pz(0), _E(0), _phi(pseudojet_invalid_phi), _rap(pseudojet_invalid_rap), _kt2(0) {_reset_indices();}
   /// construct a pseudojet from explicit components
   PseudoJet(const double px, const double py, const double pz, const double E);
 
   /// constructor from any object that has px,py,pz,E = some_four_vector[0--3],
-  #ifndef SWIG
   template <class L> PseudoJet(const L & some_four_vector);
-  #endif
-  
+
   // Constructor that performs minimal initialisation (only that of
   // the shared pointers), of use in certain speed-critical contexts
@@ -172,12 +164,4 @@
   inline double Et2() const {return (_kt2==0) ? 0.0 : _E*_E/(1.0+_pz*_pz/_kt2);}
 
-  /// cos of the polar angle
-  /// should we have: min(1.0,max(-1.0,_pz/sqrt(modp2()))); 
-  inline double cos_theta() const {
-    return std::min(1.0, std::max(-1.0, _pz/sqrt(modp2())));
-  }
-  /// polar angle
-  inline double theta() const { return acos(cos_theta()); }
-
   /// returns component i, where X==0, Y==1, Z==2, E==3
   double operator () (int i) const ; 
@@ -230,14 +214,14 @@
   //----------------------------------------------------------------------
   /// transform this jet (given in the rest frame of prest) into a jet
-  /// in the lab frame
+  /// in the lab frame [NOT FULLY TESTED]
   PseudoJet & boost(const PseudoJet & prest);
   /// transform this jet (given in lab) into a jet in the rest
-  /// frame of prest
+  /// frame of prest  [NOT FULLY TESTED]
   PseudoJet & unboost(const PseudoJet & prest);
 
-  PseudoJet & operator*=(double);
-  PseudoJet & operator/=(double);
-  PseudoJet & operator+=(const PseudoJet &);
-  PseudoJet & operator-=(const PseudoJet &);
+  void operator*=(double);
+  void operator/=(double);
+  void operator+=(const PseudoJet &);
+  void operator-=(const PseudoJet &);
 
   /// reset the 4-momentum according to the supplied components and
@@ -259,5 +243,4 @@
   /// (accessible via indexing, [0]==px,...[3]==E) and put the user
   /// and history indices back to their default values.
-#ifndef SWIG
   template <class L> inline void reset(const L & some_four_vector) {
     // check if some_four_vector can be cast to a PseudoJet
@@ -268,9 +251,5 @@
     // dynamic_cast, NULL is returned if L is not derived from
     // PseudoJet
-    //
-    // Note the explicit request for fastjet::cast_if_derived; when
-    // combining fastjet and fjcore, this avoids ambiguity in which of
-    // the two cast_if_derived calls to use.
-    const PseudoJet * pj = fastjet::cast_if_derived<const PseudoJet>(&some_four_vector);
+    const PseudoJet * pj = cast_if_derived<const PseudoJet>(&some_four_vector);
 
     if (pj){
@@ -281,5 +260,4 @@
     }
   }
-#endif // SWIG
 
   /// reset the PseudoJet according to the specified pt, rapidity,
@@ -449,7 +427,5 @@
   /// retrieve a pointer to the (const) user information
   const UserInfoBase * user_info_ptr() const{
-    // the line below is not needed since the next line would anyway
-    // return NULL in that case
-    //if (!_user_info) return NULL;
+    if (!_user_info()) return NULL;
     return _user_info.get();
   }
@@ -528,5 +504,4 @@
   const ClusterSequence * validated_cs() const;
 
-#ifndef __FJCORE__
   /// if the jet has valid area information then return a pointer to
   /// the associated ClusterSequenceAreaBase object; otherwise throw an error
@@ -537,6 +512,4 @@
   /// shorthand for validated_cluster_sequence_area_base()
   const ClusterSequenceAreaBase * validated_csab() const;
-#endif  //  __FJCORE__
-
   //\}
 
@@ -587,5 +560,5 @@
   /// structure type
   ///
-  /// If there is no structure associated, an Error is thrown.
+  /// If there is no sructure associated, an Error is thrown.
   /// If the type is not met, a std::bad_cast error is thrown.
   template<typename StructureType>
@@ -680,5 +653,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  std::vector<PseudoJet> exclusive_subjets (const double dcut) const;
+  std::vector<PseudoJet> exclusive_subjets (const double & dcut) const;
 
   /// return the size of exclusive_subjets(...); still n ln n with same
@@ -688,5 +661,5 @@
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
-  int n_exclusive_subjets(const double dcut) const;
+  int n_exclusive_subjets(const double & dcut) const;
 
   /// return the list of subjets obtained by unclustering the supplied
@@ -710,18 +683,14 @@
   std::vector<PseudoJet> exclusive_subjets_up_to (int nsub) const;
 
-  /// Returns the dij that was present in the merging nsub+1 -> nsub 
+  /// return the dij that was present in the merging nsub+1 -> nsub 
   /// subjets inside this jet.
   ///
-  /// Returns 0 if there were nsub or fewer constituents in the jet.
-  ///
   /// an Error is thrown if this PseudoJet has no currently valid
   /// associated ClusterSequence
   double exclusive_subdmerge(int nsub) const;
 
-  /// Returns the maximum dij that occurred in the whole event at the
+  /// return the maximum dij that occurred in the whole event at the
   /// stage that the nsub+1 -> nsub merge of subjets occurred inside 
   /// this jet.
-  ///
-  /// Returns 0 if there were nsub or fewer constituents in the jet.
   ///
   /// an Error is thrown if this PseudoJet has no currently valid
@@ -749,5 +718,4 @@
   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
   //------------------------------------------------------------------
-#ifndef __FJCORE__
 
   /// check if it has a defined area
@@ -771,5 +739,4 @@
   virtual bool is_pure_ghost() const;
 
-#endif  // __FJCORE__
   //\} --- end of jet structure -------------------------------------
 
@@ -822,7 +789,4 @@
   /// set cached rapidity and phi values
   void _set_rap_phi() const;
-
-  // needed for operator* to have access to _ensure_valid_rap_phi()
-  friend PseudoJet operator*(double, const PseudoJet &);
 };
 
@@ -848,25 +812,11 @@
 /// momentum components are equal to val (=0.0)
 bool operator==(const PseudoJet & jet, const double val);
-inline bool operator==(const double val, const PseudoJet & jet) {return jet == val;}
 
 /// Can only be used with val=0 and tests whether at least one of the
 /// four momentum components is different from val (=0.0)
-inline bool operator!=(const PseudoJet & a, const double val)  {return !(a==val);}
-inline bool operator!=( const double val, const PseudoJet & a) {return !(a==val);}
-
-/// returns the 4-vector dot product of a and b
+inline bool operator!=(const PseudoJet & a, const double & val) {return !(a==val);}
+
 inline double dot_product(const PseudoJet & a, const PseudoJet & b) {
   return a.E()*b.E() - a.px()*b.px() - a.py()*b.py() - a.pz()*b.pz();
-}
-
-/// returns the cosine of the angle between a and b
-inline double cos_theta(const PseudoJet & a, const PseudoJet & b) {
-  double dot_3d = a.px()*b.px() + a.py()*b.py() + a.pz()*b.pz();
-  return std::min(1.0, std::max(-1.0, dot_3d/sqrt(a.modp2()*b.modp2())));
-}
-
-/// returns the angle between a and b
-inline double theta(const PseudoJet & a, const PseudoJet & b) {
-  return acos(cos_theta(a,b));
 }
 
@@ -906,27 +856,5 @@
 /// touch the values vector in the process).
 template<class T> std::vector<T> objects_sorted_by_values(const std::vector<T> & objects, 
-					      const std::vector<double> & values) {
-  //assert(objects.size() == values.size());
-  if (objects.size() != values.size()){
-    throw Error("fastjet::objects_sorted_by_values(...): the size of the 'objects' vector must match the size of the 'values' vector");
-  }
-  
-  // get a vector of indices
-  std::vector<int> indices(values.size());
-  for (size_t i = 0; i < indices.size(); i++) {indices[i] = i;}
-  
-  // sort the indices
-  sort_indices(indices, values);
-  
-  // copy the objects 
-  std::vector<T> objects_sorted(objects.size());
-  
-  // place the objects in the correct order
-  for (size_t i = 0; i < indices.size(); i++) {
-    objects_sorted[i] = objects[indices[i]];
-  }
-
-  return objects_sorted;
-}
+					      const std::vector<double> & values);
 
 /// \if internal_doc
@@ -940,5 +868,5 @@
     _ref_values = reference_values;
   };
-  inline int operator() (const int i1, const int i2) const {
+  inline int operator() (const int & i1, const int & i2) const {
     return  (*_ref_values)[i1] < (*_ref_values)[i2];
   };
@@ -952,9 +880,7 @@
 // NB: do not know if it really needs to be inline, but when it wasn't
 //     linking failed with g++ (who knows what was wrong...)
-#ifndef SWIG
 template <class L> inline  PseudoJet::PseudoJet(const L & some_four_vector) {
   reset(some_four_vector);
 }
-#endif
 
 //----------------------------------------------------------------------
@@ -1020,5 +946,5 @@
 template<typename TransformerType>
 bool PseudoJet::has_structure_of() const{
-  if (!_structure) return false;
+  if (!_structure()) return false;
 
   return dynamic_cast<const typename TransformerType::StructureType *>(_structure.get()) != 0;
@@ -1030,5 +956,5 @@
 template<typename TransformerType>
 const typename TransformerType::StructureType & PseudoJet::structure_of() const{
-  if (!_structure) 
+  if (!_structure()) 
     throw Error("Trying to access the structure of a PseudoJet without an associated structure");
 
Index: external/fastjet/PseudoJetStructureBase.cc
===================================================================
--- external/fastjet/PseudoJetStructureBase.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/PseudoJetStructureBase.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: PseudoJetStructureBase.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -34,7 +32,5 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
-#ifndef __FJCORE__
 #include "fastjet/ClusterSequenceAreaBase.hh"
-#endif  // __FJCORE__
 
 using namespace std;
@@ -78,5 +74,4 @@
 }
 
-#ifndef __FJCORE__
 // if the jet has valid area information then return a pointer to
 // the associated ClusterSequenceAreaBase object; otherwise throw an error
@@ -86,5 +81,4 @@
   throw Error("This PseudoJet structure is not associated with a valid cluster sequence with area");
 }
-#endif
 
 
@@ -199,5 +193,4 @@
 // parent ClusterSequence (See ClusterSequenceAreaBase for details)
 //------------------------------------------------------------------
-#ifndef __FJCORE__
 
 // return the jet (scalar) area.
@@ -229,5 +222,4 @@
   throw Error("This PseudoJet structure has no implementation for is_pure_ghost");
 }
-#endif  // __FJCORE__
 
 FASTJET_END_NAMESPACE
Index: external/fastjet/PseudoJetStructureBase.hh
===================================================================
--- external/fastjet/PseudoJetStructureBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/PseudoJetStructureBase.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,6 @@
-#ifndef __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
-#define __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
-
-//FJSTARTHEADER
-// $Id: PseudoJetStructureBase.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: PseudoJetStructureBase.hh 2670 2011-11-11 17:01:06Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,6 +25,9 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
-
+//ENDHEADER
+
+
+#ifndef __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
+#define __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
 
 #include "fastjet/internal/base.hh"
@@ -42,7 +40,5 @@
 class PseudoJet;
 class ClusterSequence;
-#ifndef __FJCORE__
 class ClusterSequenceAreaBase;
-#endif  // __FJCORE__
 
 /// @ingroup extra_info
@@ -89,9 +85,7 @@
   virtual const ClusterSequence * validated_cs() const;
 
-#ifndef __FJCORE__
   /// if the jet has valid area information then return a pointer to
   /// the associated ClusterSequenceAreaBase object; otherwise throw an error
   virtual const ClusterSequenceAreaBase * validated_csab() const;
-#endif
 
   //\}
@@ -158,9 +152,4 @@
   ///
   /// By default, throws an Error
-  ///
-  /// Note: in a future major release of FastJet (4 or higher), 
-  /// "const double & dcut" may be replaced with "const double dcut",
-  /// requiring a modification of derived classes that overload
-  /// this function.
   virtual std::vector<PseudoJet> exclusive_subjets(const PseudoJet &reference, const double & dcut) const;
 
@@ -170,9 +159,4 @@
   ///
   /// By default, throws an Error
-  ///
-  /// Note: in a future major release of FastJet (4 or higher), 
-  /// "const double & dcut" may be replaced with "const double dcut",
-  /// requiring a modification of derived classes that overload
-  /// this function.
   virtual int n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const;
 
@@ -219,5 +203,4 @@
   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
   //------------------------------------------------------------------
-#ifndef __FJCORE__
 
   /// check if it has a defined area
@@ -247,5 +230,4 @@
   virtual bool is_pure_ghost(const PseudoJet &reference) const;
 
-#endif  // __FJCORE__
   //\} --- end of jet structure -------------------------------------
 };
Index: external/fastjet/RangeDefinition.cc
===================================================================
--- external/fastjet/RangeDefinition.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/RangeDefinition.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: RangeDefinition.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/RangeDefinition.hh"
Index: external/fastjet/RangeDefinition.hh
===================================================================
--- external/fastjet/RangeDefinition.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/RangeDefinition.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: RangeDefinition.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: RangeDefinition.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_RANGEDEFINITION_HH__
@@ -35,5 +33,4 @@
 #include "fastjet/Error.hh"
 #include "fastjet/LimitedWarning.hh"
-#include "fastjet/internal/deprecated.hh"
 #include<sstream>
 #include<iostream>
@@ -52,9 +49,7 @@
 public:
   /// default constructor
-  FASTJET_DEPRECATED_MSG("RangeDefinition is deprecated since FastJet 3.0. Use the Selector mechanism instead")
   RangeDefinition() { _warn_deprecated(); }
 
   /// constructor for a range definition given by |y|<rapmax
-  FASTJET_DEPRECATED_MSG("RangeDefinition is deprecated since FastJet 3.0. Use the Selector mechanism instead")
   RangeDefinition(double rapmax) {  _warn_deprecated(); 
                      assert ( rapmax > 0.0 );
Index: external/fastjet/RectangularGrid.cc
===================================================================
--- external/fastjet/RectangularGrid.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,135 +1,0 @@
-//FJSTARTHEADER
-// $Id: RectangularGrid.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-
-
-#include "fastjet/RectangularGrid.hh"
-#include <sstream>
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-  /// dummy ctor (will give an unusable grid)
-RectangularGrid::RectangularGrid()
-    : _ymax(-1.0), _ymin(1.0), _requested_drap(-1.0), _requested_dphi(-1.0) {
-  // put in nonsensical values for the other variables too, to keep coverity happy
-  _ntotal = -1;
-  _ngood  = -1;
-  _dy = 0.0;
-  _dphi = 0.0;
-  _cell_area = 0.0;
-  _inverse_dy = 0;
-  _inverse_dphi = 0;
-  _ny   = 0;
-  _nphi = 0;
-}
-
-
-int RectangularGrid::tile_index(const PseudoJet & p) const {
-  // the code below has seem some degree of optimization: don't change
-  // it without testing the speed again
-
-  // new version as of 2014-08-04
-  double y_minus_ymin = p.rap() - _ymin;
-  if (y_minus_ymin < 0) return -1;
-  int iy = int(y_minus_ymin * _inverse_dy); // guaranteed positive, so int is safe
-  if (iy >= _ny) return -1;
-
-  // old version: gives a SoftKiller that's about 10% slower on Gavin's retina mac.
-  // (though having it hard coded inside SoftKiller returns that advantage)
-  // BUT: some comments said that this was a factor of two faster than
-  //      something similar to the version above. What is going on?
-  // int iy = int(floor( (p.rap() - _ymin) * _inverse_dy ));
-  // if (iy < 0 || iy >= _ny) return -1;
-
-  int iphi = int( p.phi() * _inverse_dphi );
-  if (iphi == _nphi) iphi = 0; // just in case of rounding errors
-
-  return iy*_nphi + iphi;
-}
-
-
-//----------------------------------------------------------------------
-void RectangularGrid::_setup_grid() {
-  // initial sanity checks
-  assert(_ymax > _ymin);
-  assert(_requested_drap > 0);
-  assert(_requested_dphi > 0);
-
-  double ny_double = (_ymax-_ymin) / _requested_drap;
-  _ny = max(int(ny_double+0.5),1);
-  _dy = (_ymax-_ymin) / _ny;
-  _inverse_dy = _ny/(_ymax-_ymin);
-  
-  _nphi = int (twopi / _requested_dphi + 0.5);
-  _dphi = twopi / _nphi;
-  _inverse_dphi = _nphi/twopi;
-
-  // some sanity checking (could throw a fastjet::Error)
-  assert(_ny >= 1 && _nphi >= 1);
-
-  _ntotal = _nphi * _ny;
-  //_max_pt.resize(_ntotal);
-  _cell_area = _dy * _dphi;
-
-  // if we have a selector, establish which tiles are good;
-  // apply the selector to a 4-vector at the tile's centre
-  if (_tile_selector.worker()) {
-    _is_good.resize(n_tiles());
-    _ngood = 0;
-    for (int i = 0; i < n_tiles(); i++) {
-      int iphi = i % _nphi;
-      int irap = i / _nphi;
-      double phi = (iphi + 0.5)*_dphi;
-      double rap = (irap + 0.5)*_dy + _ymin;
-      _is_good[i] = _tile_selector.pass(PtYPhiM(1.0, rap, phi));
-      if (_is_good[i]) _ngood++;
-    }
-  } else {
-    _ngood = n_tiles();
-  }
-}
-
-//----------------------------------------------------------------------
-string RectangularGrid::description() const {
-  if (! is_initialised())
-    return "Uninitialised rectangular grid";
-
-  ostringstream oss;
-  oss << "rectangular grid with rapidity extent " << _ymin << " < rap < " << _ymax
-      << ", tile size drap x dphi = " << _dy << " x " << _dphi;
-
-  if (_tile_selector.worker()) {
-    oss << ", good tiles are those that pass selector " <<  _tile_selector.description();
-  }
-  return oss.str();
-}
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/RectangularGrid.hh
===================================================================
--- external/fastjet/RectangularGrid.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,181 +1,0 @@
-#ifndef __FASTJET_RECTANGULARGRID_HH__
-#define __FASTJET_RECTANGULARGRID_HH__
-
-//FJSTARTHEADER
-// $Id: RectangularGrid.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include "fastjet/PseudoJet.hh"
-#include "fastjet/Selector.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-//----------------------------------------------------------------------
-/// Class to indicate generic structure of tilings
-class TilingBase {
-public:
-  /// returns the index of the tile in which p is located, or -1 if p
-  /// is outside the tiling region
-  virtual int tile_index(const PseudoJet & p) const = 0;
-
-  /// returns the total number of tiles in the tiling; valid tile
-  /// indices run from 0 ... n_tiles()-1;
-  virtual int n_tiles() const = 0;
-
-  /// returns the number of tiles that are "good"; i.e. there is scope
-  /// for having tiles that, for whatever reason, should be ignored;
-  /// there are situations in which having "non-good" tiles may be the
-  /// simplest mechanism to obtain a tiling with holes in it
-  virtual int n_good_tiles() const {return n_tiles();}
-
-  /// returns whether a given tile is good
-  virtual bool tile_is_good(int /* itile */) const {return true;}
-
-  /// returns whether all tiles are good
-  virtual bool all_tiles_good() const {return n_good_tiles() == n_tiles();}
-
-  /// returns true if all tiles have the same area
-  virtual bool all_tiles_equal_area() const {return true;}
-
-  /// returns the area of tile itile. Here with a default
-  /// implementation to return mean_tile_area(), consistent with the
-  /// fact that all_tiles_equal_area() returns true.
-  virtual double tile_area(int /* itile */) const {return mean_tile_area();}
-
-  /// returns the mean area of the tiles.
-  virtual double mean_tile_area() const = 0;
-
-  /// returns a string to describe the tiling
-  virtual std::string description() const = 0;
-
-  /// returns true if the Tiling structure is in a suitably initialised state
-  virtual bool is_initialised() const = 0;
-  bool is_initialized() const {return is_initialised();}
-
-  /// virtual destructor
-  virtual ~TilingBase() {}
-};
-
-//----------------------------------------------------------------------
-/// Class that holds a generic rectangular tiling
-class RectangularGrid : public TilingBase {
-public:
-  /// ctor with simple initialisation
-  ///  \param rapmax     the maximal absolute rapidity extent of the grid
-  ///  \param cell_size  the grid spacing (equivalently, cell size)
-  RectangularGrid(double rapmax_in, double cell_size) :
-      _ymax(rapmax_in), _ymin(-rapmax_in), 
-      _requested_drap(cell_size), _requested_dphi(cell_size) {
-    _setup_grid();
-  }
-
-  /// ctor with more control over initialisation
-  ///  \param rapmin         the minimum rapidity extent of the grid
-  ///  \param rapmax         the maximum rapidity extent of the grid
-  ///  \param drap           the grid spacing in rapidity
-  ///  \param dphi           the grid spacing in azimuth
-  ///  \param tile_selector  optional (geometric) selector to specify 
-  ///                        which tiles are good; a tile is good if
-  ///                        a massless 4-vector at the center of the tile passes
-  ///                        the selection
-  RectangularGrid(double rapmin_in, double rapmax_in, double drap_in, double dphi_in,
-                  Selector tile_selector = Selector()) 
-    : _ymax(rapmax_in), _ymin(rapmin_in), 
-      _requested_drap(drap_in), _requested_dphi(dphi_in),
-      _tile_selector(tile_selector)
-  {
-    _setup_grid();
-  }
-
-  /// dummy ctor (will give an unusable grid)
-  RectangularGrid();
-
-  virtual int n_tiles() const FASTJET_OVERRIDE {return _ntotal;}
-
-  virtual int n_good_tiles() const FASTJET_OVERRIDE {return _ngood;}
-
-  // this was being kept inline, but it seems to make little
-  // difference whether it is or not (at least on Gavin's mac)
-  virtual int tile_index(const PseudoJet & p) const FASTJET_OVERRIDE;
-
-  /// returns whether a given tile is good
-  // tested in "issue" 2014-08-08-testing-rect-grid
-  virtual bool tile_is_good(int itile) const FASTJET_OVERRIDE {
-    return _tile_selector.worker() ? _is_good[itile] : true;
-  }
-
-  /// returns the area of tile itile.
-  virtual double tile_area(int /* itile */) const FASTJET_OVERRIDE {
-    return mean_tile_area();
-  }
-
-  /// returns the mean area of tiles.
-  virtual double mean_tile_area() const FASTJET_OVERRIDE {return _dphi*_dy;};
-
-  /// returns a textual description of the grid
-  virtual std::string description() const FASTJET_OVERRIDE;
-  
-  /// returns the minimum rapidity extent of the grid
-  double rapmin() const {return _ymin;}
-  /// returns the maxmium rapidity extent of the grid
-  double rapmax() const {return _ymax;}
-  /// returns the spacing of the grid in rapidity
-  double drap()   const {return _dy;}
-  /// returns the spacing of the grid in azimuth
-  double dphi()   const {return _dphi;}
-
-  /// returns true if the grid is in a suitably initialised state
-  virtual bool is_initialised() const FASTJET_OVERRIDE {return _ntotal > 0;}
-
-private:
-  void _setup_grid();
-  
-  // information about the requested grid
-  double _ymax, _ymin;  ///< maximal and minimal rapidity coverage of the grid
-  double _requested_drap; ///< requested rapidity spacing
-  double _requested_dphi; ///< requested phi spacing
-
-  // information about the actual grid
-  double _dy, _dphi, _cell_area, _inverse_dy, _inverse_dphi;
-  int _ny, _nphi, _ntotal;
-  int _ngood;
-
-  // a tile selector
-  Selector _tile_selector;
-  // if there's a tile selector, then for each tile, this caches the
-  // information about whether it is "good" i.e. it passes the tile
-  // selector
-  std::vector<bool> _is_good;
-  
-};
-
-FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
-
-#endif // __FASTJET_RECTANGULARGRID_HH__
Index: external/fastjet/Selector.cc
===================================================================
--- external/fastjet/Selector.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Selector.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Selector.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -33,7 +31,5 @@
 #include <algorithm>
 #include "fastjet/Selector.hh"
-#ifndef __FJCORE__
 #include "fastjet/GhostedAreaSpec.hh"  // for area support
-#endif  // __FJCORE__
 
 using namespace std;
@@ -95,54 +91,4 @@
 
   return n;
-}
-
-//----------------------------------------------------------------------
-// sum the momenta of the jets that pass the cuts
-PseudoJet Selector::sum(const std::vector<PseudoJet> & jets) const {
-  PseudoJet this_sum(0,0,0,0);
-  const SelectorWorker * worker_local = validated_worker();
-  
-  // separate strategies according to whether the worker applies jet by jet
-  if (worker_local->applies_jet_by_jet()) {
-    for (unsigned i = 0; i < jets.size(); i++) {
-      if (worker_local->pass(jets[i])) this_sum += jets[i];
-    }
-  } else {
-    std::vector<const PseudoJet *> jetptrs(jets.size());
-    for (unsigned i = 0; i < jets.size(); i++) {
-      jetptrs[i] = & jets[i];
-    }
-    worker_local->terminator(jetptrs);
-    for (unsigned i = 0; i < jetptrs.size(); i++) {
-      if (jetptrs[i]) this_sum += jets[i];
-    }
-  }
-
-  return this_sum;
-}
-
-//----------------------------------------------------------------------
-// sum the (scalar) pt of the jets that pass the cuts
-double Selector::scalar_pt_sum(const std::vector<PseudoJet> & jets) const {
-  double this_sum = 0.0;
-  const SelectorWorker * worker_local = validated_worker();
-  
-  // separate strategies according to whether the worker applies jet by jet
-  if (worker_local->applies_jet_by_jet()) {
-    for (unsigned i = 0; i < jets.size(); i++) {
-      if (worker_local->pass(jets[i])) this_sum += jets[i].pt();
-    }
-  } else {
-    std::vector<const PseudoJet *> jetptrs(jets.size());
-    for (unsigned i = 0; i < jets.size(); i++) {
-      jetptrs[i] = & jets[i];
-    }
-    worker_local->terminator(jetptrs);
-    for (unsigned i = 0; i < jetptrs.size(); i++) {
-      if (jetptrs[i]) this_sum += jets[i].pt();
-    }
-  }
-
-  return this_sum;
 }
 
@@ -185,5 +131,4 @@
 }
 
-#ifndef __FJCORE__
 // area using default ghost area
 double Selector::area() const{
@@ -208,5 +153,4 @@
   return ghost_spec.ghost_area() * ((*this)(ghosts)).size();
 }
-#endif  // __FJCORE__
 
 
@@ -1107,5 +1051,5 @@
 class SW_Circle : public SW_WithReference {
 public:
-  SW_Circle(const double radius) : _radius2(radius*radius) {}
+  SW_Circle(const double &radius) : _radius2(radius*radius) {}
 
   /// return a copy of the current object
@@ -1152,5 +1096,5 @@
 
 // select on objets within a distance 'radius' of a variable location
-Selector SelectorCircle(const double radius) {
+Selector SelectorCircle(const double & radius) {
   return Selector(new SW_Circle(radius));
 }
@@ -1162,5 +1106,5 @@
 class SW_Doughnut : public SW_WithReference {
 public:
-  SW_Doughnut(const double radius_in, const double radius_out)
+  SW_Doughnut(const double &radius_in, const double &radius_out)
     : _radius_in2(radius_in*radius_in), _radius_out2(radius_out*radius_out) {}
 
@@ -1211,5 +1155,5 @@
 
 // select on objets with distance from the centre is between 'radius_in' and 'radius_out' 
-Selector SelectorDoughnut(const double radius_in, const double radius_out) {
+Selector SelectorDoughnut(const double & radius_in, const double & radius_out) {
   return Selector(new SW_Doughnut(radius_in, radius_out));
 }
@@ -1220,5 +1164,5 @@
 class SW_Strip : public SW_WithReference {
 public:
-  SW_Strip(const double delta) : _delta(delta) {}
+  SW_Strip(const double &delta) : _delta(delta) {}
 
   /// return a copy of the current object
@@ -1265,5 +1209,5 @@
 
 // select on objets within a distance 'radius' of a variable location
-Selector SelectorStrip(const double half_width) {
+Selector SelectorStrip(const double & half_width) {
   return Selector(new SW_Strip(half_width));
 }
@@ -1276,5 +1220,5 @@
 class SW_Rectangle : public SW_WithReference {
 public:
-  SW_Rectangle(const double delta_rap, const double delta_phi)
+  SW_Rectangle(const double &delta_rap, const double &delta_phi)
     : _delta_rap(delta_rap),  _delta_phi(delta_phi) {}
 
@@ -1322,5 +1266,5 @@
 
 // select on objets within a distance 'radius' of a variable location
-Selector SelectorRectangle(const double half_rap_width, const double half_phi_width) {
+Selector SelectorRectangle(const double & half_rap_width, const double & half_phi_width) {
   return Selector(new SW_Rectangle(half_rap_width, half_phi_width));
 }
@@ -1396,5 +1340,4 @@
 
 //----------------------------------------------------------------------
-#ifndef __FJCORE__
 /// helper for selecting the pure ghost
 class SW_IsPureGhost : public SelectorWorker {
@@ -1421,4 +1364,5 @@
   return Selector(new SW_IsPureGhost());
 }
+
 
 //----------------------------------------------------------------------
@@ -1476,5 +1420,4 @@
   _worker.reset(new SW_RangeDefinition(range));
 }
-#endif  // __FJCORE__
 
 
Index: external/fastjet/Selector.hh
===================================================================
--- external/fastjet/Selector.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Selector.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,9 @@
-#ifndef __FASTJET_SELECTOR_HH__
-#define __FASTJET_SELECTOR_HH__
-
-//FJSTARTHEADER
-// $Id: Selector.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2009-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+#ifndef __SELECTOR_HH__
+#define __SELECTOR_HH__
+
+//STARTHEADER
+// $Id: Selector.hh 2687 2011-11-14 11:17:51Z soyez $
+//
+// Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,10 +28,8 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/PseudoJet.hh"
-#ifndef __FJCORE__
 #include "fastjet/RangeDefinition.hh"  // for initialisation from a RangeDefinition
-#endif  // __FJCORE__
 #include <limits>
 #include <cmath>
@@ -69,17 +65,12 @@
   //----------------------------------------------------------
 
-  /// returns true if a given object passes the selection criterion,
-  /// and is the main function that needs to be overloaded by derived
-  /// workers. 
-  ///
-  /// NB: this function is used only if applies_jet_by_jet() returns
-  /// true. If it does not, then derived classes are expected to
-  /// (re)implement the terminator function()
+  /// returns true if a given object passes the selection criterion.
+  /// This has to be overloaded by derived workers
   virtual bool pass(const PseudoJet & jet) const = 0;
 
   /// For each jet that does not pass the cuts, this routine sets the 
-  /// pointer to 0.
-  ///
-  /// It does not assume that the PseudoJet* passed as argument are not NULL
+  /// pointer to 0. 
+  ///
+  /// It does not assume that the PseudoJet* passed as argumetn are not NULL
   virtual void terminator(std::vector<const PseudoJet *> & jets) const {
     for (unsigned i = 0; i < jets.size(); i++) {
@@ -140,5 +131,4 @@
     throw Error("this selector has no computable area");
   }
-
 };
 
@@ -159,5 +149,5 @@
   Selector(SelectorWorker * worker_in) {_worker.reset(worker_in);}
 
-#ifndef __FJCORE__
+
   /// ctor from a RangeDefinition
   ///
@@ -170,5 +160,4 @@
   /// the direct use of this constructor.
   Selector(const RangeDefinition &range);
-#endif  // __FJCORE__
 
   /// dummy virtual dtor
@@ -194,16 +183,4 @@
   unsigned int count(const std::vector<PseudoJet> & jets) const;
 
-  /// Return the 4-vector sum of the objects that pass the selection.
-  ///
-  /// This will often be more efficient that getting the vector of objects that
-  /// passes and then evaluating the size of the vector
-  PseudoJet sum(const std::vector<PseudoJet> & jets) const;
-
-  /// Return the scalar pt sum of the objects that pass the selection.
-  ///
-  /// This will often be more efficient that getting the vector of objects that
-  /// passes and then evaluating the size of the vector
-  double scalar_pt_sum(const std::vector<PseudoJet> & jets) const;
-
   /// sift the input jets into two vectors -- those that pass the selector
   /// and those that do not
@@ -252,5 +229,4 @@
   }
 
-#ifndef __FJCORE__
   /// returns the rapidity-phi area associated with the Selector
   /// (throws InvalidArea if the area does not make sense).
@@ -272,5 +248,4 @@
   ///
   double area(double ghost_area) const;
-#endif  // __FJCORE__
 
   /// returns a (reference to) the underlying worker's shared pointer
@@ -305,5 +280,5 @@
   }
 
-  /// class that gets thrown when a Selector is applied despite it not
+  /// class that gets throw when a Selector is applied despite it not
   /// having a valid underlying worker.
   class InvalidWorker : public Error {
@@ -312,6 +287,6 @@
   };
 
-  /// class that gets thrown when the area is requested from a Selector for which
-  /// the area is not meaningful
+  /// class that gets throw when a Selector is applied despite it not
+  /// having a valid underlying worker.
   class InvalidArea : public Error {
   public:
@@ -452,18 +427,18 @@
 /// select objets within a distance 'radius' from the location of the
 /// reference jet, set by Selector::set_reference(...)
-Selector SelectorCircle(const double radius); 
+Selector SelectorCircle(const double & radius); 
 
 /// select objets with distance from the reference jet is between 'radius_in'
 /// and 'radius_out'; the reference jet is set by Selector::set_reference(...)
-Selector SelectorDoughnut(const double radius_in, const double radius_out); 
+Selector SelectorDoughnut(const double & radius_in, const double & radius_out); 
 
 /// select objets within a rapidity distance 'half_width' from the
 /// location of the reference jet, set by Selector::set_reference(...)
-Selector SelectorStrip(const double half_width);
+Selector SelectorStrip(const double & half_width);
 
 /// select objets within rapidity distance 'half_rap_width' from the
 /// reference jet and azimuthal-angle distance within 'half_phi_width'; the
 /// reference jet is set by Selector::set_reference(...)
-Selector SelectorRectangle(const double half_rap_width, const double half_phi_width);
+Selector SelectorRectangle(const double & half_rap_width, const double & half_phi_width);
 
 
@@ -480,9 +455,7 @@
 Selector SelectorIsZero();
 
-#ifndef __FJCORE__
 /// select objects that are (or are only made of) ghosts.
 /// PseudoJets for which has_area() are considered non-pure-ghost.
 Selector SelectorIsPureGhost();
-#endif  // __FJCORE__
 
 /// @}
@@ -490,4 +463,4 @@
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
 
-#endif // __FASTJET_SELECTOR_HH__
-
+#endif // __SELECTOR_HH__
+
Index: external/fastjet/SharedPtr.hh
===================================================================
--- external/fastjet/SharedPtr.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/SharedPtr.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_SHARED_PTR_HH__
 
-//FJSTARTHEADER
-// $Id: SharedPtr.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: SharedPtr.hh 2680 2011-11-12 17:12:05Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/internal/base.hh"
@@ -37,15 +35,13 @@
 // for testing purposes, the following define makes it possible
 // for our SharedPtr simply to be derived from the STL TR1 one.
-// #define __FASTJET_USETR1SHAREDPTR
-
-#include "fastjet/internal/deprecated.hh"
-
-#ifdef __FASTJET_USETR1SHAREDPTR
+// #define USETR1SHAREDPTR
+
+#ifdef USETR1SHAREDPTR
 #include <tr1/memory>
-#endif // __FASTJET_USETR1SHAREDPTR
+#endif // USETR1SHAREDPTR
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
 
-#ifdef __FASTJET_USETR1SHAREDPTR
+#ifdef USETR1SHAREDPTR
 
 /// @ingroup advanced_usage
@@ -74,7 +70,4 @@
   SharedPtr(const SharedPtr<T> & t) : std::tr1::shared_ptr<T>(t) {}
   // for some reason operator() doesn't get inherited
-  #ifdef FASTJET_HAVE_EXPLICIT_FOR_OPERATORS
-  explicit
-  #endif
   inline operator bool() const {return (this->get()!=NULL);}
   /// return the pointer we're pointing to  
@@ -85,5 +78,5 @@
 
 
-#else // __FASTJET_USETR1SHAREDPTR
+#else // USETR1SHAREDPTR
 
 /**
@@ -216,9 +209,5 @@
   }
   
-  /// return the pointer we're pointing to
-  ///
-  /// Since FastJet 3.2.0, this is depracated since it is no longer
-  /// part of std::shared_ptr<T>. Use SharedPtr<T>::get() instead
-  FASTJET_DEPRECATED_MSG("Use SharedPtr<T>::get() instead")
+  /// return the pointer we're pointing to  
   T* operator ()() const{
     if (_ptr==NULL) return NULL;
@@ -266,7 +255,4 @@
   /// conversion to bool
   /// This will allow you to use the indirection nicely
-  #ifdef FASTJET_HAVE_EXPLICIT_FOR_OPERATORS
-  explicit
-  #endif
   inline operator bool() const{
     return (get()!=NULL);
@@ -404,5 +390,5 @@
 }
 
-#endif // __FASTJET_USETR1SHAREDPTR
+#endif // USETR1SHAREDPTR
 
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/TilingExtent.cc
===================================================================
--- external/fastjet/TilingExtent.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,156 +1,0 @@
-//FJSTARTHEADER
-// $Id: TilingExtent.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#include <iomanip>
-#include <limits>
-#include <cmath>
-#include "fastjet/internal/TilingExtent.hh"
-using namespace std;
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-TilingExtent::TilingExtent(ClusterSequence & cs) {
-  _determine_rapidity_extent(cs.jets());
-}
-
-TilingExtent::TilingExtent(const vector<PseudoJet> &particles) {
-  _determine_rapidity_extent(particles);
-}
-
-void TilingExtent::_determine_rapidity_extent(const vector<PseudoJet> & particles) {
-  // have a binning of rapidity that goes from -nrap to nrap
-  // in bins of size 1; the left and right-most bins include
-  // include overflows from smaller/larger rapidities
-  int nrap = 20; 
-  int nbins = 2*nrap;
-  vector<double> counts(nbins, 0);
-  
-  // get the minimum and maximum rapidities and at the same time bin
-  // the multiplicities as a function of rapidity to help decide how
-  // far out it's worth going
-  _minrap =  numeric_limits<double>::max();
-  _maxrap = -numeric_limits<double>::max();
-  int ibin;
-  for (unsigned i = 0; i < particles.size(); i++) {
-    // ignore particles with infinite rapidity
-    if (particles[i].E() == abs(particles[i].pz())) continue;
-    double rap = particles[i].rap();
-    if (rap < _minrap) _minrap = rap;
-    if (rap > _maxrap) _maxrap = rap;
-    // now bin the rapidity to decide how far to go with the tiling.
-    // Remember the bins go from ibin=0 (rap=-infinity..-19)
-    // to ibin = nbins-1 (rap=19..infinity for nrap=20)
-    ibin = int(rap+nrap); 
-    if (ibin < 0) ibin = 0;
-    if (ibin >= nbins) ibin = nbins - 1;
-    counts[ibin]++;
-  }
-
-  // now figure out the particle count in the busiest bin
-  double max_in_bin = 0;
-  for (ibin = 0; ibin < nbins; ibin++) {
-    if (max_in_bin < counts[ibin]) max_in_bin = counts[ibin];
-  }
-  
-  // and find _minrap, _maxrap such that edge bin never contains more
-  // than some fraction of busiest, and at least a few particles; first do
-  // it from left. NB: the thresholds chosen here are largely
-  // guesstimates as to what might work.
-  //
-  // 2014-07-17: in some tests at high multiplicity (100k) and particles going up to
-  //             about 7.3, anti-kt R=0.4, we found that 0.25 gave 20% better run times
-  //             than the original value of 0.5.
-  const double allowed_max_fraction = 0.25;
-  // the edge bins should also contain at least min_multiplicity particles
-  const double min_multiplicity = 4;
-  // now calculate how much we can accumulate into an edge bin
-  double allowed_max_cumul = floor(max(max_in_bin * allowed_max_fraction, min_multiplicity));
-  // make sure we don't require more particles in a bin than max_in_bin
-  if (allowed_max_cumul > max_in_bin) allowed_max_cumul = max_in_bin;
-
-  // start scan over rapidity bins from the left, to find out minimum rapidity of tiling
-  double cumul_lo = 0;
-  _cumul2 = 0;
-  for (ibin = 0; ibin < nbins; ibin++) {
-    cumul_lo += counts[ibin];
-    if (cumul_lo >= allowed_max_cumul) {
-      double y = ibin-nrap;
-      if (y > _minrap) _minrap = y;
-      break;
-    }
-  }
-  assert(ibin != nbins); // internal consistency check that you found a bin
-  _cumul2 += cumul_lo*cumul_lo;
-
-  // ibin_lo is the index of the leftmost bin that should be considered
-  int ibin_lo = ibin;
-
-  // then do it from right, to find out maximum rapidity of tiling
-  double cumul_hi = 0;
-  for (ibin = nbins-1; ibin >= 0; ibin--) {
-    cumul_hi += counts[ibin];
-    if (cumul_hi >= allowed_max_cumul) {
-      double y = ibin-nrap+1; // +1 here is the rapidity bin width
-      if (y < _maxrap) _maxrap = y;
-      break;
-    }
-  }
-  assert(ibin >= 0); // internal consistency check that you found a bin
-
-  // ibin_hi is the index of the rightmost bin that should be considered
-  int ibin_hi = ibin;
-
-  // consistency check 
-  assert(ibin_hi >= ibin_lo); 
-
-  // now work out cumul2
-  if (ibin_hi == ibin_lo) {
-    // if there is a single bin (potentially including overflows
-    // from both sides), cumul2 is the square of the total contents
-    // of that bin, which we obtain from cumul_lo and cumul_hi minus
-    // the double counting of part that is contained in both
-    // (putting double 
-    _cumul2 = pow(double(cumul_lo + cumul_hi - counts[ibin_hi]), 2);
-  } else {
-    // otherwise we have a straightforward sum of squares of bin
-    // contents
-    _cumul2 += cumul_hi*cumul_hi;
-
-    // now get the rest of the squared bin contents
-    for (ibin = ibin_lo+1; ibin < ibin_hi; ibin++) {
-      _cumul2 += counts[ibin]*counts[ibin];
-    }
-  }
-
-}
-
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/VERSION
===================================================================
--- external/fastjet/VERSION	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
+++ external/fastjet/VERSION	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -0,0 +1,1 @@
+3.0.3
Index: external/fastjet/Voronoi.cc
===================================================================
--- external/fastjet/Voronoi.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/Voronoi.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,31 +1,26 @@
-//FJSTARTHEADER
-// $Id: Voronoi.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 1994 by AT&T Bell Laboratories (see below)
+//
 //
 //----------------------------------------------------------------------
-// This file is part of FastJet.
+// This file is included as part of FastJet but was mostly written by
+// S. Fortune in C, put into C++ with memory management by S
+// O'Sullivan, and with further interface and memory management
+// modifications by Gregory Soyez.
 //
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
+// Permission to use, copy, modify, and distribute this software for
+// any purpose without fee is hereby granted, provided that this
+// entire notice is included in all copies of any software which is or
+// includes a copy or modification of this software and in all copies
+// of the supporting documentation for such software. THIS SOFTWARE IS
+// BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY.
+// IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY REPRESENTATION
+// OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
+// SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
 //
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/WrappedStructure.hh
===================================================================
--- external/fastjet/WrappedStructure.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/WrappedStructure.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: WrappedStructure.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: WrappedStructure.hh 2577 2011-09-13 15:11:38Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -57,5 +55,5 @@
   WrappedStructure(const SharedPtr<PseudoJetStructureBase> & to_be_shared)
     : _structure(to_be_shared){
-    if (!_structure)
+    if (!_structure())
       throw Error("Trying to construct a wrapped structure around an empty (NULL) structure");
   }
@@ -65,5 +63,5 @@
 
   /// description
-  virtual std::string description() const FASTJET_OVERRIDE{ 
+  virtual std::string description() const{ 
     return "PseudoJet wrapping the structure ("+_structure->description()+")"; 
   }
@@ -76,5 +74,5 @@
   //-------------------------------------------------------------
   /// returns true if there is an associated ClusterSequence
-  virtual bool has_associated_cluster_sequence() const FASTJET_OVERRIDE {
+  virtual bool has_associated_cluster_sequence() const {
     return _structure->has_associated_cluster_sequence();
   }
@@ -82,5 +80,5 @@
   /// get a (const) pointer to the parent ClusterSequence (NULL if
   /// inexistent)
-  virtual const ClusterSequence* associated_cluster_sequence() const FASTJET_OVERRIDE{
+  virtual const ClusterSequence* associated_cluster_sequence() const{
     return _structure->associated_cluster_sequence();
   }
@@ -88,5 +86,5 @@
   /// returns true if this PseudoJet has an associated and still
   /// valid ClusterSequence.
-  virtual bool has_valid_cluster_sequence() const FASTJET_OVERRIDE {
+  virtual bool has_valid_cluster_sequence() const {
     return _structure->has_valid_cluster_sequence();
   }
@@ -94,5 +92,5 @@
   /// if the jet has a valid associated cluster sequence then return a
   /// pointer to it; otherwise throw an error
-  virtual const ClusterSequence * validated_cs() const FASTJET_OVERRIDE{
+  virtual const ClusterSequence * validated_cs() const{
     return _structure->validated_cs();
   }
@@ -100,5 +98,5 @@
   /// if the jet has valid area information then return a pointer to
   /// the associated ClusterSequenceAreaBase object; otherwise throw an error
-  virtual const ClusterSequenceAreaBase * validated_csab() const FASTJET_OVERRIDE{
+  virtual const ClusterSequenceAreaBase * validated_csab() const{
     return _structure->validated_csab();
   }
@@ -120,5 +118,5 @@
   ///
   /// By default, throws an Error
-  virtual bool has_partner(const PseudoJet &reference, PseudoJet &partner) const FASTJET_OVERRIDE{
+  virtual bool has_partner(const PseudoJet &reference, PseudoJet &partner) const{
     return _structure->has_partner(reference, partner);
   }
@@ -129,5 +127,5 @@
   /// 
   /// By default, throws an Error
-  virtual bool has_child(const PseudoJet &reference, PseudoJet &child) const FASTJET_OVERRIDE{
+  virtual bool has_child(const PseudoJet &reference, PseudoJet &child) const{
     return _structure->has_child(reference, child);
   }
@@ -138,6 +136,5 @@
   ///
   /// By default, throws an Error
-  virtual bool has_parents(const PseudoJet &reference,
-                           PseudoJet &parent1, PseudoJet &parent2) const FASTJET_OVERRIDE{
+  virtual bool has_parents(const PseudoJet &reference, PseudoJet &parent1, PseudoJet &parent2) const{
     return _structure->has_parents(reference, parent1, parent2);
   }
@@ -147,6 +144,5 @@
   ///
   /// By default, throws an Error
-  virtual bool object_in_jet(const PseudoJet &reference,
-                             const PseudoJet &jet) const FASTJET_OVERRIDE{
+  virtual bool object_in_jet(const PseudoJet &reference, const PseudoJet &jet) const{
     return _structure->object_in_jet(reference, jet);
   }
@@ -156,5 +152,5 @@
   ///
   /// false by default
-  virtual bool has_constituents() const  FASTJET_OVERRIDE{
+  virtual bool has_constituents() const {
     return _structure->has_constituents();
   }
@@ -163,10 +159,10 @@
   ///
   /// By default, throws an Error
-  virtual std::vector<PseudoJet> constituents(const PseudoJet &reference) const FASTJET_OVERRIDE{
+  virtual std::vector<PseudoJet> constituents(const PseudoJet &reference) const{
     return _structure->constituents(reference);
   }
 
   /// return true if the structure supports exclusive_subjets. 
-  virtual bool has_exclusive_subjets() const  FASTJET_OVERRIDE{
+  virtual bool has_exclusive_subjets() const {
     return _structure->has_exclusive_subjets();
   }
@@ -182,6 +178,5 @@
   ///
   /// By default, throws an Error
-  virtual std::vector<PseudoJet> exclusive_subjets(const PseudoJet &reference,
-                                                   const double & dcut) const FASTJET_OVERRIDE{
+  virtual std::vector<PseudoJet> exclusive_subjets(const PseudoJet &reference, const double & dcut) const{
     return _structure->exclusive_subjets(reference, dcut);
   }
@@ -192,6 +187,5 @@
   ///
   /// By default, throws an Error
-  virtual int n_exclusive_subjets(const PseudoJet &reference,
-                                  const double & dcut) const FASTJET_OVERRIDE{
+  virtual int n_exclusive_subjets(const PseudoJet &reference, const double & dcut) const{
     return _structure->n_exclusive_subjets(reference, dcut);
   }
@@ -202,6 +196,5 @@
   ///
   /// By default, throws an Error
-  virtual std::vector<PseudoJet> exclusive_subjets_up_to (const PseudoJet &reference,
-                                                          int nsub) const FASTJET_OVERRIDE{
+  virtual std::vector<PseudoJet> exclusive_subjets_up_to (const PseudoJet &reference, int nsub) const{
     return _structure->exclusive_subjets_up_to (reference, nsub);
   }
@@ -211,5 +204,5 @@
   ///
   /// By default, throws an Error
-  virtual double exclusive_subdmerge(const PseudoJet &reference, int nsub) const FASTJET_OVERRIDE{
+  virtual double exclusive_subdmerge(const PseudoJet &reference, int nsub) const{
     return _structure->exclusive_subdmerge(reference, nsub);
   }
@@ -220,5 +213,5 @@
   ///
   /// By default, throws an Error
-  virtual double exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const FASTJET_OVERRIDE{
+  virtual double exclusive_subdmerge_max(const PseudoJet &reference, int nsub) const{
     return _structure->exclusive_subdmerge_max(reference, nsub);
   }
@@ -231,5 +224,5 @@
   ///
   /// false by default
-  virtual bool has_pieces(const PseudoJet &reference) const FASTJET_OVERRIDE {
+  virtual bool has_pieces(const PseudoJet &reference) const {
     return _structure->has_pieces(reference);
   }
@@ -238,5 +231,5 @@
   ///
   /// By default, throws an Error
-  virtual std::vector<PseudoJet> pieces(const PseudoJet &reference) const FASTJET_OVERRIDE {
+  virtual std::vector<PseudoJet> pieces(const PseudoJet &reference) const{
     return _structure->pieces(reference);
   }
@@ -249,5 +242,5 @@
   ///
   /// false by default
-  virtual bool has_area() const FASTJET_OVERRIDE  {
+  virtual bool has_area() const {
     return _structure->has_area();
   }
@@ -256,5 +249,5 @@
   ///
   /// By default, throws an Error
-  virtual double area(const PseudoJet &reference) const FASTJET_OVERRIDE{
+  virtual double area(const PseudoJet &reference) const{
     return _structure->area(reference);
   }
@@ -264,5 +257,5 @@
   ///
   /// By default, throws an Error
-  virtual double area_error(const PseudoJet &reference) const FASTJET_OVERRIDE{
+  virtual double area_error(const PseudoJet &reference) const{
     return _structure->area_error(reference);
   }
@@ -271,5 +264,5 @@
   ///
   /// By default, throws an Error
-  virtual PseudoJet area_4vector(const PseudoJet &reference) const FASTJET_OVERRIDE{
+  virtual PseudoJet area_4vector(const PseudoJet &reference) const{
     return _structure->area_4vector(reference);
   }
@@ -278,5 +271,5 @@
   ///
   /// By default, throws an Error
-  virtual bool is_pure_ghost(const PseudoJet &reference) const FASTJET_OVERRIDE{
+  virtual bool is_pure_ghost(const PseudoJet &reference) const{
     return _structure->is_pure_ghost(reference);
   }
Index: external/fastjet/config_auto.h
===================================================================
--- external/fastjet/config_auto.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/config_auto.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -64,14 +64,4 @@
 #endif
 
-/* compile the deprecated parts of the interface using auto-ptr */
-/* #undef HAVE_AUTO_PTR_INTERFACE */
-
-/* compiler supports c++14 deprecated keyword */
-/* #undef HAVE_CXX14_DEPRECATED */
-
-/* defined if demangling is enabled at configure time and is supported through
-   the GNU C++ ABI */
-/* #undef HAVE_DEMANGLING_SUPPORT */
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #ifndef FASTJET_HAVE_DLFCN_H 
@@ -82,15 +72,4 @@
 #ifndef FASTJET_HAVE_EXECINFO_H 
 #define FASTJET_HAVE_EXECINFO_H  1 
-#endif
-
-/* compiler supports the "explicit" keyword for operators */
-/* #undef HAVE_EXPLICIT_FOR_OPERATORS */
-
-/* Define to 1 if you have the <gmp.h> header file. */
-/* #undef HAVE_GMP_H */
-
-/* compiler supports GNU c++ deprecated attribute */
-#ifndef FASTJET_HAVE_GNUCXX_DEPRECATED 
-#define FASTJET_HAVE_GNUCXX_DEPRECATED  /**/ 
 #endif
 
@@ -109,10 +88,4 @@
 #define FASTJET_HAVE_MEMORY_H  1 
 #endif
-
-/* Define to 1 if you have the <mpfr.h> header file. */
-/* #undef HAVE_MPFR_H */
-
-/* compiler supports the "override" keyword */
-/* #undef HAVE_OVERRIDE */
 
 /* Define to 1 if you have the <stdint.h> header file. */
@@ -151,5 +124,6 @@
 #endif
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
 #ifndef FASTJET_LT_OBJDIR 
 #define FASTJET_LT_OBJDIR  ".libs/" 
@@ -173,5 +147,5 @@
 /* Define to the full name and version of this package. */
 #ifndef FASTJET_PACKAGE_STRING 
-#define FASTJET_PACKAGE_STRING  "FastJet 3.3.4" 
+#define FASTJET_PACKAGE_STRING  "FastJet 3.0.3" 
 #endif
 
@@ -188,5 +162,5 @@
 /* Define to the version of this package. */
 #ifndef FASTJET_PACKAGE_VERSION 
-#define FASTJET_PACKAGE_VERSION  "3.3.4" 
+#define FASTJET_PACKAGE_VERSION  "3.0.3" 
 #endif
 
@@ -198,29 +172,6 @@
 /* Version number of package */
 #ifndef FASTJET_VERSION 
-#define FASTJET_VERSION  "3.3.4" 
+#define FASTJET_VERSION  "3.0.3" 
 #endif
-
-/* Major version of this package */
-#ifndef FASTJET_VERSION_MAJOR 
-#define FASTJET_VERSION_MAJOR  3 
-#endif
-
-/* Minor version of this package */
-#ifndef FASTJET_VERSION_MINOR 
-#define FASTJET_VERSION_MINOR  3 
-#endif
-
-/* Version of the package under the form XYYZZ (instead of X.Y.Z) */
-#ifndef FASTJET_VERSION_NUMBER 
-#define FASTJET_VERSION_NUMBER  30304 
-#endif
-
-/* Patch version of this package */
-#ifndef FASTJET_VERSION_PATCHLEVEL 
-#define FASTJET_VERSION_PATCHLEVEL  4 
-#endif
-
-/* Pre-release version of this package */
-/* #undef VERSION_PRERELEASE */
  
 /* once: _INCLUDE_FASTJET_CONFIG_AUTO_H */
Index: external/fastjet/config_raw.h
===================================================================
--- external/fastjet/config_raw.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/config_raw.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -38,14 +38,4 @@
 #define ENABLE_PLUGIN_TRACKJET /**/
 
-/* compile the deprecated parts of the interface using auto-ptr */
-/* #undef HAVE_AUTO_PTR_INTERFACE */
-
-/* compiler supports c++14 deprecated keyword */
-/* #undef HAVE_CXX14_DEPRECATED */
-
-/* defined if demangling is enabled at configure time and is supported through
-   the GNU C++ ABI */
-/* #undef HAVE_DEMANGLING_SUPPORT */
-
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
@@ -53,13 +43,4 @@
 /* Define to 1 if you have the <execinfo.h> header file. */
 #define HAVE_EXECINFO_H 1
-
-/* compiler supports the "explicit" keyword for operators */
-/* #undef HAVE_EXPLICIT_FOR_OPERATORS */
-
-/* Define to 1 if you have the <gmp.h> header file. */
-/* #undef HAVE_GMP_H */
-
-/* compiler supports GNU c++ deprecated attribute */
-#define HAVE_GNUCXX_DEPRECATED /**/
 
 /* Define to 1 if you have the <inttypes.h> header file. */
@@ -71,10 +52,4 @@
 /* Define to 1 if you have the <memory.h> header file. */
 #define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <mpfr.h> header file. */
-/* #undef HAVE_MPFR_H */
-
-/* compiler supports the "override" keyword */
-/* #undef HAVE_OVERRIDE */
 
 /* Define to 1 if you have the <stdint.h> header file. */
@@ -99,5 +74,6 @@
 #define HAVE_UNISTD_H 1
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
 #define LT_OBJDIR ".libs/"
 
@@ -112,5 +88,5 @@
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "FastJet 3.3.4"
+#define PACKAGE_STRING "FastJet 3.0.3"
 
 /* Define to the one symbol short name of this package. */
@@ -121,5 +97,5 @@
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "3.3.4"
+#define PACKAGE_VERSION "3.0.3"
 
 /* Define to 1 if you have the ANSI C header files. */
@@ -127,18 +103,3 @@
 
 /* Version number of package */
-#define VERSION "3.3.4"
-
-/* Major version of this package */
-#define VERSION_MAJOR 3
-
-/* Minor version of this package */
-#define VERSION_MINOR 3
-
-/* Version of the package under the form XYYZZ (instead of X.Y.Z) */
-#define VERSION_NUMBER 30304
-
-/* Patch version of this package */
-#define VERSION_PATCHLEVEL 4
-
-/* Pre-release version of this package */
-/* #undef VERSION_PRERELEASE */
+#define VERSION "3.0.3"
Index: external/fastjet/config_win.h
===================================================================
--- external/fastjet/config_win.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/config_win.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,4 @@
-#define FASTJET_PACKAGE_STRING  "FastJet 3.3.4"
-#define FASTJET_PACKAGE_VERSION  "3.3.4"
-#define FASTJET_VERSION  "3.3.4"
-#define FASTJET_VERSION_MAJOR       3
-#define FASTJET_VERSION_MINOR       3
-#define FASTJET_VERSION_PATCHLEVEL  4
-#define FASTJET_VERSION_NUMBER      30304
+#define FASTJET_PACKAGE_STRING  "FastJet 3.0.3"
+#define FASTJET_PACKAGE_VERSION  "3.0.3"
 
 /* The ATLASCone plugin is disabled by default*/
Index: external/fastjet/contribs/Nsubjettiness/AUTHORS
===================================================================
--- external/fastjet/contribs/Nsubjettiness/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,47 +1,0 @@
--------------------------------------------------------------------------------
-
-The Nsubjettiness FastJet contrib was written, maintained, and developed by:
-
-   Jesse Thaler <jthaler@mit.edu>
-   Ken Van Tilburg <kenvt@stanford.edu>
-   Christopher K. Vermilion <christopher.vermilion@gmail.com>
-   TJ Wilkason <tjwilk@mit.edu>
-
-Questions and comments should be directed to:  jthaler@mit.edu.
-
--------------------------------------------------------------------------------
-
-For physics details on N-subjettiness, see:
-
-   Identifying Boosted Objects with N-subjettiness.
-   Jesse Thaler and Ken Van Tilburg.
-   JHEP 1103:015 (2011), arXiv:1011.2268.
-
-   Maximizing Boosted Top Identification by Minimizing N-subjettiness. 
-   Jesse Thaler and Ken Van Tilburg.  
-   JHEP 1202:093 (2012), arXiv:1108.2701.
-
-New in v2.0 is the winner-take-all axis, described in:
-
-   Jet Observables Without Jet Algorithms. 
-   Daniele Bertolini, Tucker Chan, and Jesse Thaler. 
-   JHEP 1404:013 (2014), arXiv:1310.7584.
-
-   Jet Shapes with the Broadening Axis. 
-   Andrew J. Larkoski, Duff Neill, and Jesse Thaler. 
-   JHEP 1404:017 (2014), arXiv:1401.2158.
-
-   Unpublished work by Gavin Salam.
-
-New in v2.2 is the XCone jet algorithm, described in:
-
-   XCone: N-jettiness as an Exclusive Cone Jet Algorithm.
-   Iain W. Stewart, Frank J. Tackmann, Jesse Thaler,
-   Christopher K. Vermilion, and Thomas F. Wilkason.
-   JHEP 1511:072 (2015), arXiv:1508.01516.
-
-   Resolving Boosted Jets with XCone.
-   Jesse Thaler and Thomas F. Wilkason.
-   JHEP 1512:051 (2015), arXiv:1508.01518.
-
--------------------------------------------------------------------------------
Index: external/fastjet/contribs/Nsubjettiness/AxesDefinition.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/AxesDefinition.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,95 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: AxesDefinition.cc 833 2015-07-23 14:35:23Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "AxesDefinition.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-  
-// Repeatedly calls the one pass finder to try to find global minimum
-std::vector<fastjet::PseudoJet> AxesDefinition::get_multi_pass_axes(int n_jets,
-                                                                    const std::vector <fastjet::PseudoJet> & inputJets,
-                                                                    const std::vector <fastjet::PseudoJet> & seedAxes,
-                                                                    const MeasureDefinition* measure) const {
-   
-   assert(n_jets == (int)seedAxes.size()); //added int casting to get rid of compiler warning
-   
-   // first iteration
-   std::vector<fastjet::PseudoJet> bestAxes = measure->get_one_pass_axes(n_jets, inputJets, seedAxes,_nAttempts,_accuracy);
-   
-   double bestTau = measure->result(inputJets,bestAxes);
-   
-   for (int l = 1; l < _Npass; l++) { // Do minimization procedure multiple times (l = 1 to start since first iteration is done already)
-      
-      // Add noise to current best axes
-      std::vector< PseudoJet > noiseAxes(n_jets, PseudoJet(0,0,0,0));
-      for (int k = 0; k < n_jets; k++) {
-         noiseAxes[k] = jiggle(bestAxes[k]);
-      }
-      
-      std::vector<fastjet::PseudoJet> testAxes = measure->get_one_pass_axes(n_jets, inputJets, noiseAxes,_nAttempts,_accuracy);
-      double testTau = measure->result(inputJets,testAxes);
-      
-      if (testTau < bestTau) {
-         bestTau = testTau;
-         bestAxes = testAxes;
-      }
-   }
-   
-   return bestAxes;
-}
-
-   
-// Used by multi-pass minimization to jiggle axes with noise range.
-PseudoJet AxesDefinition::jiggle(const PseudoJet& axis) const {
-   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;
-   
-   double new_phi = axis.phi() + phi_noise;
-   if (new_phi >= 2.0*M_PI) new_phi -= 2.0*M_PI;
-   if (new_phi <= -2.0*M_PI) new_phi += 2.0*M_PI;
-   
-   PseudoJet newAxis(0,0,0,0);
-   newAxis.reset_PtYPhiM(axis.perp(),axis.rap() + rap_noise,new_phi);
-   return newAxis;
-}
-
-   
-LimitedWarning HardestJetAxes::_too_few_axes_warning;
-LimitedWarning ExclusiveJetAxes::_too_few_axes_warning;
-LimitedWarning ExclusiveCombinatorialJetAxes::_too_few_axes_warning;
-
-std::vector<fastjet::PseudoJet> Manual_Axes::get_starting_axes(int,
-                                                               const std::vector<fastjet::PseudoJet>&,
-                                                               const MeasureDefinition *) const {
-   // This is a function dummy and should never be called
-   assert(false);
-   std::vector<fastjet::PseudoJet> dummy;
-   return dummy;
-}
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/AxesDefinition.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/AxesDefinition.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,1272 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: AxesDefinition.hh 1130 2018-06-06 12:09:46Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_AXES_DEFINITION_HH__
-#define __FASTJET_CONTRIB_AXES_DEFINITION_HH__
-
-
-#include "MeasureDefinition.hh"
-#include "ExtraRecombiners.hh"
-
-#include "fastjet/PseudoJet.hh"
-#include <fastjet/LimitedWarning.hh>
-
-#include <iomanip>
-#include <cmath>
-#include <vector>
-#include <list>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-   
-// The following AxesDefinitions are currently available (and the relevant arguments, if needed)
-class KT_Axes;
-class CA_Axes;
-class AntiKT_Axes;         // (R0)
-class WTA_KT_Axes;
-class WTA_CA_Axes;
-class GenKT_Axes;          // (p, R0 = infinity)
-class WTA_GenKT_Axes;      // (p, R0 = infinity)
-class GenET_GenKT_Axes;    // (delta, p, R0 = infinity)
-class Manual_Axes;
-   
-class OnePass_KT_Axes;
-class OnePass_CA_Axes;
-class OnePass_AntiKT_Axes;       // (R0)
-class OnePass_WTA_KT_Axes;
-class OnePass_WTA_CA_Axes;
-class OnePass_GenKT_Axes;        // (p, R0 = infinity)
-class OnePass_WTA_GenKT_Axes;    // (p, R0 = infinity)
-class OnePass_GenET_GenKT_Axes;  // (delta, p, R0 = infinity)
-class OnePass_Manual_Axes;
-   
-class MultiPass_Axes;            // (NPass) (currently only defined for KT_Axes)
-class MultiPass_Manual_Axes;     // (NPass)
-
-class Comb_GenKT_Axes;           // (nExtra, p, R0 = infinity)
-class Comb_WTA_GenKT_Axes;       // (nExtra, p, R0 = infinity)
-class Comb_GenET_GenKT_Axes;     // (nExtra, delta, p, R0 = infinity)
-
-///////
-//
-// AxesDefinition
-//
-///////
-
-///------------------------------------------------------------------------
-/// \class AxesDefinition
-/// \brief Base class for axes definitions
-///
-/// A generic AxesDefinition first finds a set of seed axes.
-/// Then, if desired, uses measure information
-/// (from MeasureDefinition) to refine those axes starting from those seed axes.
-/// The AxesDefinitions are typically based on sequential jet algorithms.
-///------------------------------------------------------------------------
-class AxesDefinition {
-   
-public:
-   
-   /// This function should be overloaded in all derived classes, and defines how to find the seed axes.
-   /// If desired, the measure information (which might be NULL) can be used to test multiple axes choices, but should
-   /// not be used for iterative refining (since that is the job of MeasureDefinition).
-   virtual std::vector<fastjet::PseudoJet> get_starting_axes(int n_jets,
-                                                             const std::vector<fastjet::PseudoJet>& inputs,
-                                                             const MeasureDefinition * measure) const = 0;
-   
-   /// Short description of AxesDefinitions (and any parameters)
-   virtual std::string short_description() const = 0;
-
-   /// Long description of AxesDefinitions (and any parameters)
-   virtual std::string description() const = 0;
-   
-   /// This has to be defined in all derived classes, and allows these to be copied around.
-   virtual AxesDefinition* create() const = 0;
-   
-public:
-   
-   /// Starting from seeds, refine axes using one or more passes.
-   /// Note that in order to do >0 passes, we need information from the MeasureDefinition about how to do the appropriate minimization.
-   std::vector<fastjet::PseudoJet> get_refined_axes(int n_jets,
-                                                    const std::vector<fastjet::PseudoJet>& inputs,
-                                                    const std::vector<fastjet::PseudoJet>& seedAxes,
-                                                    const MeasureDefinition * measure = NULL) const {
-
-      assert(n_jets == (int)seedAxes.size()); //added int casting to get rid of compiler warning
-            
-      if (_Npass == 0) {
-         // no refining, just use seeds
-         return seedAxes;
-      } else if (_Npass == 1) {
-         if (measure == NULL) throw Error("AxesDefinition:  One-pass minimization requires specifying a MeasureDefinition.");
-         
-         // do one pass minimum using measure definition
-         return measure->get_one_pass_axes(n_jets, inputs, seedAxes,_nAttempts,_accuracy);
-      } else {
-         if (measure == NULL) throw Error("AxesDefinition:  Multi-pass minimization requires specifying a MeasureDefinition.");
-         return get_multi_pass_axes(n_jets, inputs, seedAxes, measure);
-      }
-   }
-   
-   /// Combines get_starting_axes with get_refined_axes.
-   /// In the Njettiness class, these two steps are done separately in order to store seed axes information.
-   std::vector<fastjet::PseudoJet> get_axes(int n_jets,
-                                            const std::vector<fastjet::PseudoJet>& inputs,
-                                            const MeasureDefinition * measure = NULL) const {
-      std::vector<fastjet::PseudoJet> seedAxes = get_starting_axes(n_jets, inputs, measure);
-      return get_refined_axes(n_jets,inputs,seedAxes,measure);
-   }
-
-   
-   /// Short-hand for the get_axes function.  Useful when trying to write terse code.
-   inline std::vector<fastjet::PseudoJet> operator() (int n_jets,
-                                               const std::vector<fastjet::PseudoJet>& inputs,
-                                               const MeasureDefinition * measure = NULL) const {
-      return get_axes(n_jets,inputs,measure);
-   }
-   
-   /// \enum AxesRefiningEnum
-   /// Defines the cases of zero pass and one pass for convenience
-   enum AxesRefiningEnum {
-      UNDEFINED_REFINE = -1, // added to create a default value
-      NO_REFINING = 0,
-      ONE_PASS = 1,
-      MULTI_PASS = 100,
-   };
-   
-   /// A integer that is used externally to decide how to do multi-pass minimization
-   int nPass() const { return _Npass; }
-
-   /// A flag that indicates whether results are deterministics.
-   bool givesRandomizedResults() const {
-      return (_Npass > 1);
-   }
-   
-   /// A flag that indicates whether manual axes are being used.
-   bool needsManualAxes() const {
-      return _needsManualAxes; // if there is no starting axes finder
-   }
-   
-   /// Allows user to change number of passes.  Also used internally to set nPass.
-   /// Can also specify details of one/multi pass minimziation
-   void setNPass(int nPass,
-                 int nAttempts = 1000,
-                 double accuracy  = 0.0001,
-                 double noise_range = 1.0 // only needed for MultiPass minimization
-                 )
-   {
-      _Npass = nPass;
-      _nAttempts = nAttempts;
-      _accuracy = accuracy;
-      _noise_range = noise_range;
-      if (nPass < 0) throw Error("AxesDefinition requires a nPass >= 0");
-   }
-   
-   /// Destructor
-   virtual ~AxesDefinition() {};
-   
-protected:
-   
-   /// Default constructor contains no information.  Number of passes has to be set
-   /// manually by derived classes using setNPass function.
-   AxesDefinition() : _Npass(UNDEFINED_REFINE),
-                     _nAttempts(0),
-                     _accuracy(0.0),
-                     _noise_range(0.0),
-                     _needsManualAxes(false) {}
-
-   /// Does multi-pass minimization by randomly jiggling the axes within _noise_range
-   std::vector<fastjet::PseudoJet> get_multi_pass_axes(int n_jets,
-                                                       const std::vector<fastjet::PseudoJet>& inputs,
-                                                       const std::vector<fastjet::PseudoJet>& seedAxes,
-                                                       const MeasureDefinition* measure) const;
-   
-   /// Function to jiggle axes within _noise_range
-   PseudoJet jiggle(const PseudoJet& axis) const;
-   
-   int _Npass;            ///< Number of passes (0 = no refining, 1 = one-pass, >1 multi-pass)
-   int _nAttempts;        ///< Number of attempts per pass
-   double _accuracy;      ///< Accuracy goal per pass
-   double _noise_range;   ///< Noise in rapidity/phi (for multi-pass minimization only)
-   bool _needsManualAxes; ///< Flag to indicate special case of manual axes
-};
-  
-///------------------------------------------------------------------------
-/// \class ExclusiveJetAxes
-/// \brief Base class for axes defined from exclusive jet algorithm
-///
-/// This class finds axes by clustering particles with an exclusive jet definition.
-/// This can be implemented with different jet algorithms.  The user can call this directly
-/// using their favorite fastjet::JetDefinition
-///------------------------------------------------------------------------
-class ExclusiveJetAxes : public AxesDefinition {
-   
-public:
-   /// Constructor takes JetDefinition as an argument
-   ExclusiveJetAxes(fastjet::JetDefinition def)
-   : AxesDefinition(), _def(def) {
-      setNPass(NO_REFINING);    // default to no minimization
-   }
-   
-   /// Starting axes obtained by creating a cluster sequenence and running exclusive_jets.
-   virtual std::vector<fastjet::PseudoJet> get_starting_axes(int n_jets,
-                                                             const std::vector <fastjet::PseudoJet> & inputs,
-                                                             const MeasureDefinition * ) const {
-      fastjet::ClusterSequence jet_clust_seq(inputs, _def);
-      
-      std::vector<fastjet::PseudoJet> axes = jet_clust_seq.exclusive_jets_up_to(n_jets);
-      
-      if ((int)axes.size() < n_jets) {
-         _too_few_axes_warning.warn("ExclusiveJetAxes::get_starting_axes:  Fewer than N axes found; results are unpredictable.");
-         axes.resize(n_jets);  // resize to make sure there are enough axes to not yield an error elsewhere
-      }
-      
-      return axes;
-   }
-   
-   /// Short description
-   virtual std::string short_description() const { return "ExclAxes";}
-   /// Long description
-   virtual std::string description() const { return "ExclAxes: " + _def.description();}
-   
-   /// To make it possible to copy around.
-   virtual ExclusiveJetAxes* create() const {return new ExclusiveJetAxes(*this);}
-
-private:
-   fastjet::JetDefinition _def; ///< Jet definition to use.
-   static LimitedWarning _too_few_axes_warning;
-};
-
-///------------------------------------------------------------------------
-/// \class ExclusiveCombinatorialJetAxes
-/// \brief Base class for axes defined from exclusive jet algorithm, checking combinatorial options
-///
-/// This class finds axes by clustering particles with an exclusive jet definition.
-/// It takes an extra number of jets (specificed by the user via nExtra), and then finds the set of N that minimizes N-jettiness.
-/// WARNING: If one wants to be guarenteed that results improve by increasing nExtra, then one should use
-/// winner-take-all-style recombination schemes
-///------------------------------------------------------------------------
-class ExclusiveCombinatorialJetAxes : public AxesDefinition {
-   
-public:
-   /// Constructor takes JetDefinition and nExtra as options (nExtra=0 acts the same as ExclusiveJetAxes)
-   ExclusiveCombinatorialJetAxes(fastjet::JetDefinition def, int nExtra = 0)
-   : AxesDefinition(), _def(def), _nExtra(nExtra) {
-      if (nExtra < 0) throw Error("Need nExtra >= 0");
-      setNPass(NO_REFINING);   // default to no minimization
-   }
-   
-    /// Find n_jets + _nExtra axes, and then choose the n_jets subset with the smallest N-(sub)jettiness value.
-    virtual std::vector<fastjet::PseudoJet> get_starting_axes(int n_jets, 
-                                                           const std::vector<fastjet::PseudoJet> & inputs,
-                                                           const MeasureDefinition *measure) const {
-      int starting_number = n_jets + _nExtra;
-      fastjet::ClusterSequence jet_clust_seq(inputs, _def);
-      std::vector<fastjet::PseudoJet> starting_axes = jet_clust_seq.exclusive_jets_up_to(starting_number);
-       
-       if ((int)starting_axes.size() < n_jets) {
-          _too_few_axes_warning.warn("ExclusiveCombinatorialJetAxes::get_starting_axes:  Fewer than N + nExtra axes found; results are unpredictable.");
-          starting_axes.resize(n_jets);  // resize to make sure there are enough axes to not yield an error elsewhere
-       }
-       
-      std::vector<fastjet::PseudoJet> final_axes;
-
-      // check so that no computation time is wasted if there are no extra axes
-      if (_nExtra == 0) final_axes = starting_axes;
-
-      else {
- 
-        // define string of 1's based on number of desired jets
-        std::string bitmask(n_jets, 1);
-        // expand the array size to the total number of jets with extra 0's at the end, makes string easy to permute
-        bitmask.resize(starting_number, 0); 
- 
-        double min_tau = std::numeric_limits<double>::max();
-        std::vector<fastjet::PseudoJet> temp_axes;
-         
-        do {
-
-          temp_axes.clear();
- 
-          // only take an axis if it is listed as true (1) in the string
-          for (int i = 0; i < (int)starting_axes.size(); ++i) {
-            if (bitmask[i]) temp_axes.push_back(starting_axes[i]);
-          }
- 
-          double temp_tau = measure->result(inputs, temp_axes);
-          if (temp_tau < min_tau) {
-            min_tau = temp_tau;
-            final_axes = temp_axes;
-          }
- 
-          // permutes string of 1's and 0's according to next lexicographic ordering and returns true
-          // continues to loop through all possible lexicographic orderings
-          // returns false and breaks the loop when there are no more possible orderings
-        } while (std::prev_permutation(bitmask.begin(), bitmask.end()));
-      }
-
-      return final_axes;
-    }
-
-   /// Short description
-   virtual std::string short_description() const { return "ExclCombAxes";}
-   /// Long description
-   virtual std::string description() const { return "ExclCombAxes: " + _def.description();}
-   /// To make it possible to copy around.
-   virtual ExclusiveCombinatorialJetAxes* create() const {return new ExclusiveCombinatorialJetAxes(*this);}
-
-private:
-   fastjet::JetDefinition _def;   ///< Jet definition to use
-   int _nExtra;                   ///< Extra axes to find
-   static LimitedWarning _too_few_axes_warning;
-};
-   
-///------------------------------------------------------------------------
-/// \class HardestJetAxes
-/// \brief Base class for axes defined from an inclusive jet algorithm
-///
-/// This class finds axes by running an inclusive algorithm and then finding the n hardest jets.
-/// This can be implemented with different jet algorithms, and can be called by the user.
-///------------------------------------------------------------------------
-class HardestJetAxes : public AxesDefinition {
-public:
-   /// Constructor takes JetDefinition
-   HardestJetAxes(fastjet::JetDefinition def)
-   : AxesDefinition(), _def(def) {
-      setNPass(NO_REFINING);    // default to no minimization
-   }
-   
-   /// Finds seed axes by running a ClusterSequence, running inclusive_jets, and finding the N hardest
-   virtual std::vector<fastjet::PseudoJet> get_starting_axes(int n_jets,
-                                                             const std::vector <fastjet::PseudoJet> & inputs,
-                                                             const MeasureDefinition * ) const {
-      fastjet::ClusterSequence jet_clust_seq(inputs, _def);
-      std::vector<fastjet::PseudoJet> axes = sorted_by_pt(jet_clust_seq.inclusive_jets());
-      
-      if ((int)axes.size() < n_jets) {
-         _too_few_axes_warning.warn("HardestJetAxes::get_starting_axes:  Fewer than N axes found; results are unpredictable.");
-      }
-      
-      axes.resize(n_jets);  // only keep n hardest
-      return axes;
-   }
-   
-   /// Short description
-   virtual std::string short_description() const { return "HardAxes";}
-   /// Long description
-   virtual std::string description() const { return "HardAxes: " + _def.description();}
-   /// To make it possible to copy around.
-   virtual HardestJetAxes* create() const {return new HardestJetAxes(*this);}
-   
-private:
-   fastjet::JetDefinition _def;  ///< Jet Definition to use.
-   
-   static LimitedWarning _too_few_axes_warning;
-
-};
-   
-///------------------------------------------------------------------------
-/// \class KT_Axes
-/// \brief Axes from exclusive kT
-///
-/// Axes from kT algorithm with E_scheme recombination.
-///------------------------------------------------------------------------
-class KT_Axes : public ExclusiveJetAxes {
-public:
-   /// Constructor
-   KT_Axes()
-   : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::kt_algorithm,
-                                             fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant
-                                             fastjet::E_scheme,
-                                             fastjet::Best)
-                      ) {
-      setNPass(NO_REFINING);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "KT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "KT Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual KT_Axes* create() const {return new KT_Axes(*this);}
-
-};
-
-///------------------------------------------------------------------------
-/// \class CA_Axes
-/// \brief Axes from exclusive CA
-///
-/// Axes from CA algorithm with E_scheme recombination.
-///------------------------------------------------------------------------
-class CA_Axes : public ExclusiveJetAxes {
-public:
-   /// Constructor
-   CA_Axes()
-   : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::cambridge_algorithm,
-                                             fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant
-                                             fastjet::E_scheme,
-                                             fastjet::Best)
-                      ) {
-      setNPass(NO_REFINING);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "CA";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "CA Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual CA_Axes* create() const {return new CA_Axes(*this);}
-   
-};
-
-   
-///------------------------------------------------------------------------
-/// \class AntiKT_Axes
-/// \brief Axes from inclusive anti-kT
-///
-/// Axes from anti-kT algorithm and E_scheme.
-/// The one parameter R0 is subjet radius
-///------------------------------------------------------------------------
-class AntiKT_Axes : public HardestJetAxes {
-
-public:
-   /// Constructor.  Takes jet radius as argument
-   AntiKT_Axes(double R0)
-   : HardestJetAxes(fastjet::JetDefinition(fastjet::antikt_algorithm,
-                                           R0,
-                                           fastjet::E_scheme,
-                                           fastjet::Best)
-                    ), _R0(R0) {
-      setNPass(NO_REFINING);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "AKT" << _R0;
-      return stream.str();
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Anti-KT Axes (R0 = " << _R0 << ")";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual AntiKT_Axes* create() const {return new AntiKT_Axes(*this);}
-   
-protected:
-   double _R0;  ///<  AKT jet radius
-
-};
-
-///------------------------------------------------------------------------
-/// \class JetDefinitionWrapper
-/// \brief Wrapper for jet definitions (for memory management)
-///
-/// This class is used by all AxesDefinition with a manual recombiner to
-/// ensure that the delete_recombiner_when_unused function is always called
-///------------------------------------------------------------------------
-class JetDefinitionWrapper {
-
-public: 
-   
-   /// Default Constructor
-   JetDefinitionWrapper(JetAlgorithm jet_algorithm_in, double R_in, double xtra_param_in, const JetDefinition::Recombiner *recombiner) {
-      jet_def = fastjet::JetDefinition(jet_algorithm_in, R_in, xtra_param_in);
-      jet_def.set_recombiner(recombiner);
-      jet_def.delete_recombiner_when_unused();        // added to prevent memory leaks
-   }
-
-   /// Additional constructor so that build-in FastJet algorithms can also be called
-   JetDefinitionWrapper(JetAlgorithm jet_algorithm_in, double R_in, const JetDefinition::Recombiner *recombiner, fastjet::Strategy strategy_in) {
-      jet_def = fastjet::JetDefinition(jet_algorithm_in, R_in, recombiner, strategy_in);
-      jet_def.delete_recombiner_when_unused();
-   }
-
-   /// Return jet definition
-   JetDefinition getJetDef() {
-      return jet_def;
-   }
-
-private:
-   JetDefinition jet_def;  ///< my jet definition
-};
-
-///------------------------------------------------------------------------
-/// \class WTA_KT_Axes
-/// \brief Axes from exclusive kT, winner-take-all recombination
-///
-/// Axes from kT algorithm and winner-take-all recombination
-///------------------------------------------------------------------------
-class WTA_KT_Axes : public ExclusiveJetAxes {
-public:
-   /// Constructor
-   WTA_KT_Axes()
-   : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::kt_algorithm,
-                                          fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant
-                                          new WinnerTakeAllRecombiner(), // Needs to be explicitly declared (this will be deleted by JetDefinitionWrapper)
-                                          fastjet::Best).getJetDef()
-                      ) {
-      setNPass(NO_REFINING);
-    }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "WTA KT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Winner-Take-All KT Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual WTA_KT_Axes* create() const {return new WTA_KT_Axes(*this);}
-
-};
-   
-///------------------------------------------------------------------------
-/// \class WTA_CA_Axes
-/// \brief Axes from exclusive CA, winner-take-all recombination
-///
-/// Axes from CA algorithm and winner-take-all recombination
-///------------------------------------------------------------------------
-class WTA_CA_Axes : public ExclusiveJetAxes {
-public:
-   /// Constructor
-   WTA_CA_Axes()
-   : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::cambridge_algorithm,
-                                             fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant
-                                             new WinnerTakeAllRecombiner(), // Needs to be explicitly declared (this will be deleted by JetDefinitionWrapper)
-                                             fastjet::Best).getJetDef()) {
-    setNPass(NO_REFINING);
-  }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "WTA CA";
-   };
-   
-   /// Long descriptions
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Winner-Take-All CA Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual WTA_CA_Axes* create() const {return new WTA_CA_Axes(*this);}
-  
-};
-
-
-///------------------------------------------------------------------------
-/// \class GenKT_Axes
-/// \brief Axes from exclusive generalized kT
-///
-/// Axes from a general KT algorithm (standard E-scheme recombination)
-/// Requires the power of the KT algorithm to be used and the radius parameter
-///------------------------------------------------------------------------
-class GenKT_Axes : public ExclusiveJetAxes {
-   
-public:
-   /// Constructor
-   GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R)
-   : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::genkt_algorithm,
-                                             R0,
-                                             p)), _p(p), _R0(R0) {
-      if (p < 0) throw Error("GenKT_Axes:  Currently only p >=0 is supported.");
-      setNPass(NO_REFINING);
-   }
-   
-   /// Short description
-   virtual std::string short_description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "GenKT Axes";
-      return stream.str();
-   };
-   
-   /// Long descriptions
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual GenKT_Axes* create() const {return new GenKT_Axes(*this);}
-   
-protected:
-   double _p;   ///< genkT power
-   double _R0;  ///< jet radius
-};
-   
-   
-///------------------------------------------------------------------------
-/// \class WTA_GenKT_Axes
-/// \brief Axes from exclusive generalized kT, winner-take-all recombination
-///
-/// Axes from a general KT algorithm with a Winner Take All Recombiner
-/// Requires the power of the KT algorithm to be used and the radius parameter
-///------------------------------------------------------------------------
-class WTA_GenKT_Axes : public ExclusiveJetAxes {
-
-public:
-   /// Constructor
-   WTA_GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R)
-   : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::genkt_algorithm,
-                                            R0,
-                                            p,
-                                            new WinnerTakeAllRecombiner()
-                                            ).getJetDef()), _p(p), _R0(R0) {
-      if (p < 0) throw Error("WTA_GenKT_Axes:  Currently only p >=0 is supported.");
-      setNPass(NO_REFINING);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "WTA, GenKT Axes";
-      return stream.str();
-   };
-   
-   /// Long descriptions
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual WTA_GenKT_Axes* create() const {return new WTA_GenKT_Axes(*this);}
-   
-protected:
-   double _p;   ///< genkT power
-   double _R0;  ///< jet radius
-};
-   
-///------------------------------------------------------------------------
-/// \class GenET_GenKT_Axes
-/// \brief Axes from exclusive kT, generalized Et-scheme recombination
-///
-/// Class using general KT algorithm with a more general recombination scheme
-/// Requires power of KT algorithm, power of recombination weights, and radius parameter
-///------------------------------------------------------------------------
-class GenET_GenKT_Axes : public ExclusiveJetAxes {
-
-public:
-   /// Constructor
-   GenET_GenKT_Axes(double delta, double p, double R0 = fastjet::JetDefinition::max_allowable_R)
-   : ExclusiveJetAxes((JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new GeneralEtSchemeRecombiner(delta))).getJetDef() ),
-    _delta(delta), _p(p), _R0(R0) {
-       if (p < 0) throw Error("GenET_GenKT_Axes:  Currently only p >=0 is supported.");
-       if (delta <= 0) throw Error("GenET_GenKT_Axes:  Currently only delta >0 is supported.");
-       setNPass(NO_REFINING);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "GenET, GenKT Axes";
-      return stream.str();
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2);
-      // TODO: if _delta is huge, change to "WTA"
-      if (_delta < std::numeric_limits<int>::max()) stream << "General Recombiner (delta = " << _delta << "), " << "General KT (p = " << _p << ") Axes, R0 = " << _R0;
-      else stream << "Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0;
-
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual GenET_GenKT_Axes* create() const {return new GenET_GenKT_Axes(*this);}
-   
-protected:
-   double _delta; ///< Recombination pT weighting
-   double _p;     ///< GenkT power
-   double _R0;    ///< jet radius
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_KT_Axes
-/// \brief Axes from exclusive kT, with one-pass minimization
-///
-/// Onepass minimization from kt axes
-///------------------------------------------------------------------------
-class OnePass_KT_Axes : public KT_Axes {
-public:
-   /// Constructor
-   OnePass_KT_Axes() : KT_Axes() {
-      setNPass(ONE_PASS);
-   }
-   
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass KT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from KT Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_KT_Axes* create() const {return new OnePass_KT_Axes(*this);}
-   
-
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_CA_Axes
-/// \brief Axes from exclusive CA, with one-pass minimization
-///
-/// Onepass minimization from CA axes
-///------------------------------------------------------------------------
-class OnePass_CA_Axes : public CA_Axes {
-public:
-   /// Constructor
-   OnePass_CA_Axes() : CA_Axes() {
-      setNPass(ONE_PASS);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass CA";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from CA Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_CA_Axes* create() const {return new OnePass_CA_Axes(*this);}
-
-
-};
-   
-///------------------------------------------------------------------------
-/// \class OnePass_AntiKT_Axes
-/// \brief Axes from inclusive anti-kT, with one-pass minimization
-///
-/// Onepass minimization from AntiKT axes, one parameter R0
-///------------------------------------------------------------------------
-class OnePass_AntiKT_Axes : public AntiKT_Axes {
-
-public:
-   /// Constructor
-   OnePass_AntiKT_Axes(double R0) : AntiKT_Axes(R0) {
-      setNPass(ONE_PASS);
-   }
-   
-   /// Short Description
-   virtual std::string short_description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "OnePassAKT" << _R0;
-      return stream.str();
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from Anti-KT Axes (R0 = " << _R0 << ")";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_AntiKT_Axes* create() const {return new OnePass_AntiKT_Axes(*this);}
-
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_WTA_KT_Axes
-/// \brief Axes from exclusive kT, winner-take-all recombination, with one-pass minimization
-///
-/// Onepass minimization from winner-take-all kt axes
-///------------------------------------------------------------------------
-class OnePass_WTA_KT_Axes : public WTA_KT_Axes {
-public:
-   /// Constructor
-   OnePass_WTA_KT_Axes() : WTA_KT_Axes() {
-      setNPass(ONE_PASS);
-   }
-   
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass WTA KT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from Winner-Take-All KT Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_WTA_KT_Axes* create() const {return new OnePass_WTA_KT_Axes(*this);}
-   
-
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_WTA_CA_Axes
-/// \brief Axes from exclusive CA, winner-take-all recombination, with one-pass minimization
-///
-/// Onepass minimization from winner-take-all CA axes
-///------------------------------------------------------------------------
-class OnePass_WTA_CA_Axes : public WTA_CA_Axes {
-   
-public:
-   /// Constructor
-   OnePass_WTA_CA_Axes() : WTA_CA_Axes() {
-      setNPass(ONE_PASS);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass WTA CA";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from Winner-Take-All CA Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_WTA_CA_Axes* create() const {return new OnePass_WTA_CA_Axes(*this);}
-   
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_GenKT_Axes
-/// \brief Axes from exclusive generalized kT with one-pass minimization
-///
-/// Onepass minimization, General KT Axes (standard E-scheme recombination)
-///------------------------------------------------------------------------
-class OnePass_GenKT_Axes : public GenKT_Axes {
-   
-public:
-   /// Constructor
-   OnePass_GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R) : GenKT_Axes(p, R0) {
-      setNPass(ONE_PASS);
-   }
-   
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass GenKT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_GenKT_Axes* create() const {return new OnePass_GenKT_Axes(*this);}
-};
-   
-///------------------------------------------------------------------------
-/// \class OnePass_WTA_GenKT_Axes
-/// \brief Axes from exclusive generalized kT, winner-take-all recombination, with one-pass minimization
-///
-/// Onepass minimization from winner-take-all, General KT Axes
-///------------------------------------------------------------------------
-class OnePass_WTA_GenKT_Axes : public WTA_GenKT_Axes {
-   
-public:
-   /// Constructor
-   OnePass_WTA_GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R) : WTA_GenKT_Axes(p, R0) {
-      setNPass(ONE_PASS);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass WTA GenKT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_WTA_GenKT_Axes* create() const {return new OnePass_WTA_GenKT_Axes(*this);}
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_GenET_GenKT_Axes
-/// \brief Axes from exclusive generalized kT, generalized Et-scheme recombination, with one-pass minimization
-///
-/// Onepass minimization from General Recomb, General KT axes
-///------------------------------------------------------------------------
-class OnePass_GenET_GenKT_Axes : public GenET_GenKT_Axes {
-   
-public:
-   /// Constructor
-   OnePass_GenET_GenKT_Axes(double delta, double p, double R0 = fastjet::JetDefinition::max_allowable_R) : GenET_GenKT_Axes(delta, p, R0) {
-      setNPass(ONE_PASS);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass GenET, GenKT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2);
-      if (_delta < std::numeric_limits<int>::max()) stream << "One-Pass Minimization from General Recombiner (delta = " 
-        << _delta << "), " << "General KT (p = " << _p << ") Axes, R0 = " << _R0;
-      else stream << "One-Pass Minimization from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual OnePass_GenET_GenKT_Axes* create() const {return new OnePass_GenET_GenKT_Axes(*this);}
-};
-
-
-///------------------------------------------------------------------------
-/// \class Manual_Axes
-/// \brief Manual axes finding
-///
-/// Allows the user to set the axes manually
-///------------------------------------------------------------------------
-class Manual_Axes : public AxesDefinition {
-public:
-   /// Constructor.  Note that _needsManualAxes is set to true.
-   Manual_Axes() : AxesDefinition() {
-      setNPass(NO_REFINING);
-      _needsManualAxes = true;
-   }
-   
-   /// This is now a dummy function since this is manual mode
-   virtual std::vector<fastjet::PseudoJet> get_starting_axes(int,
-                                                             const std::vector<fastjet::PseudoJet>&,
-                                                             const MeasureDefinition *) const;
-
-   
-   /// Short description
-   virtual std::string short_description() const {
-      return "Manual";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Manual Axes";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual Manual_Axes* create() const {return new Manual_Axes(*this);}
-
-
-};
-
-///------------------------------------------------------------------------
-/// \class OnePass_Manual_Axes
-/// \brief Manual axes finding, with one-pass minimization
-///
-/// One pass minimization from manual starting point
-///------------------------------------------------------------------------
-class OnePass_Manual_Axes : public Manual_Axes {
-public:
-   /// Constructor.  Note that _needsManualAxes is set to true.
-   OnePass_Manual_Axes() : Manual_Axes() {
-      setNPass(ONE_PASS);
-   }
-   
-   /// Short description
-   virtual std::string short_description() const {
-      return "OnePass Manual";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "One-Pass Minimization from Manual Axes";
-      return stream.str();
-   };
-   
-   // For copying purposes
-   virtual OnePass_Manual_Axes* create() const {return new OnePass_Manual_Axes(*this);}
-
-};
-   
-///------------------------------------------------------------------------
-/// \class MultiPass_Axes
-/// \brief Manual axes finding, with multi-pass (randomized) minimization
-///
-/// Multi-pass minimization from kT starting point
-///------------------------------------------------------------------------
-class MultiPass_Axes : public KT_Axes {
-
-public:
-   
-   /// Constructor
-   MultiPass_Axes(unsigned int Npass) : KT_Axes() {
-      setNPass(Npass);
-   }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "MultiPass";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Multi-Pass Axes (Npass = " << _Npass << ")";
-      return stream.str();
-   };
-   
-   /// For copying purposs
-   virtual MultiPass_Axes* create() const {return new MultiPass_Axes(*this);}
-   
-};
-
-///------------------------------------------------------------------------
-/// \class MultiPass_Manual_Axes
-/// \brief Axes finding from exclusive kT, with multi-pass (randomized) minimization
-///
-/// multi-pass minimization from kT starting point
-///------------------------------------------------------------------------
-class MultiPass_Manual_Axes : public Manual_Axes {
-
-public:
-   /// Constructor
-   MultiPass_Manual_Axes(unsigned int Npass) : Manual_Axes() {
-      setNPass(Npass);
-   }
-
-   /// Short Description
-   virtual std::string short_description() const {
-      return "MultiPass Manual";
-   };
-   
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "Multi-Pass Manual Axes (Npass = " << _Npass << ")";
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual MultiPass_Manual_Axes* create() const {return new MultiPass_Manual_Axes(*this);}
-   
-};
-
-///------------------------------------------------------------------------
-/// \class Comb_GenKT_Axes
-/// \brief Axes from exclusive generalized kT with combinatorial testing
-///
-/// Axes from kT algorithm (standard E-scheme recombination)
-/// Requires nExtra parameter and returns set of N that minimizes N-jettiness
-/// Note that this method is not guaranteed to find a deeper minimum than GenKT_Axes
-///------------------------------------------------------------------------
-class Comb_GenKT_Axes : public ExclusiveCombinatorialJetAxes {
-public:
-   /// Constructor
-   Comb_GenKT_Axes(int nExtra, double p, double R0 = fastjet::JetDefinition::max_allowable_R)
-   : ExclusiveCombinatorialJetAxes(fastjet::JetDefinition(fastjet::genkt_algorithm, R0, p), nExtra),
-      _p(p), _R0(R0) {
-      if (p < 0) throw Error("Comb_GenKT_Axes:  Currently only p >=0 is supported.");
-      setNPass(NO_REFINING);
-   }
-   
-   /// Short description
-   virtual std::string short_description() const {
-      return "N Choose M GenKT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "N Choose M Minimization (nExtra = " << _nExtra << ") from General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual Comb_GenKT_Axes* create() const {return new Comb_GenKT_Axes(*this);}
-   
-private:
-   double _nExtra;   ///< Number of extra axes
-   double _p;        ///< GenkT power
-   double _R0;       ///< jet radius
-};
-   
-   
-
-///------------------------------------------------------------------------
-/// \class Comb_WTA_GenKT_Axes
-/// \brief Axes from exclusive generalized kT, winner-take-all recombination, with combinatorial testing
-///
-/// Axes from kT algorithm and winner-take-all recombination
-/// Requires nExtra parameter and returns set of N that minimizes N-jettiness
-///------------------------------------------------------------------------
-class Comb_WTA_GenKT_Axes : public ExclusiveCombinatorialJetAxes {
-public:
-   /// Constructor
-   Comb_WTA_GenKT_Axes(int nExtra, double p, double R0 = fastjet::JetDefinition::max_allowable_R)
-   : ExclusiveCombinatorialJetAxes((JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new WinnerTakeAllRecombiner())).getJetDef(), nExtra),
-    _p(p), _R0(R0) {
-       if (p < 0) throw Error("Comb_WTA_GenKT_Axes:  Currently only p >=0 is supported.");
-       setNPass(NO_REFINING);
-    }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "N Choose M WTA GenKT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2)
-      << "N Choose M Minimization (nExtra = " << _nExtra << ") from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual Comb_WTA_GenKT_Axes* create() const {return new Comb_WTA_GenKT_Axes(*this);}
-
-private:
-   double _nExtra;   ///< Number of extra axes
-   double _p;        ///< GenkT power
-   double _R0;       ///< jet radius
-};
-   
-///------------------------------------------------------------------------
-/// \class Comb_GenET_GenKT_Axes
-/// \brief Axes from exclusive generalized kT, generalized Et-scheme recombination, with combinatorial testing
-///
-/// Axes from kT algorithm and General Et scheme recombination
-/// Requires nExtra parameter and returns set of N that minimizes N-jettiness
-///------------------------------------------------------------------------
-class Comb_GenET_GenKT_Axes : public ExclusiveCombinatorialJetAxes {
-public:
-   /// Constructor
-   Comb_GenET_GenKT_Axes(int nExtra, double delta, double p, double R0 = fastjet::JetDefinition::max_allowable_R)
-   : ExclusiveCombinatorialJetAxes((JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new GeneralEtSchemeRecombiner(delta))).getJetDef(), nExtra),
-    _delta(delta), _p(p), _R0(R0) {
-       if (p < 0) throw Error("Comb_GenET_GenKT_Axes:  Currently only p >=0 is supported.");
-       if (delta <= 0) throw Error("Comb_GenET_GenKT_Axes:  Currently only delta >=0 is supported.");
-        setNPass(NO_REFINING);
-    }
-
-   /// Short description
-   virtual std::string short_description() const {
-      return "N Choose M GenET GenKT";
-   };
-   
-   /// Long description
-   virtual std::string description() const {
-      std::stringstream stream;
-      stream << std::fixed << std::setprecision(2);
-      if (_delta < std::numeric_limits<int>::max()) stream << "N choose M Minimization (nExtra = " << _nExtra 
-        << ") from General Recombiner (delta = " << _delta << "), " << "General KT (p = " << _p << ") Axes, R0 = " << _R0;
-      else stream << "N choose M Minimization (nExtra = " << _nExtra << ") from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0;
-      return stream.str();
-   };
-   
-   /// For copying purposes
-   virtual Comb_GenET_GenKT_Axes* create() const {return new Comb_GenET_GenKT_Axes(*this);}
-
-private:
-   double _nExtra;   ///< Number of extra axes
-   double _delta;    ///< Recombination pT weighting exponent
-   double _p;        ///< GenkT power
-   double _R0;       ///< jet radius
-};
-   
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_NJETTINESS_HH__
-
Index: external/fastjet/contribs/Nsubjettiness/COPYING
===================================================================
--- external/fastjet/contribs/Nsubjettiness/COPYING	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,369 +1,0 @@
-The Nsubjettiness contrib to FastJet is released 
-under the terms of the GNU General Public License v2 (GPLv2). 
-
-A copy of the GPLv2 is to be found at the end of this file.
-
-While the GPL license grants you considerable freedom, please bear in
-mind that this code's use falls under guidelines similar to those that
-are standard for Monte Carlo event generators
-(http://www.montecarlonet.org/GUIDELINES). In particular, if you use
-this code as part of work towards a scientific publication, whether
-directly or contained within another program you should include a citation 
-to
-
-N-subjettiness:
-  arXiv:1011.2268
-  arXiv:1108.2701
-
-Winner-take-all axes:
-  arXiv:1310.7584
-  arXiv:1401.2158
-
-XCone:
-  arXiv:1508.01516
-  arXiv:1508.01518
-
-
-======================================================================
-======================================================================
-======================================================================
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 2 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, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
Index: external/fastjet/contribs/Nsubjettiness/ChangeLog
===================================================================
--- external/fastjet/contribs/Nsubjettiness/ChangeLog	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,332 +1,0 @@
-2018-07-06 <jthaler>
-   Updated comments in AxesDefinition.hh about role of JetDefinitionWrapper
-   Updated AUTHORS with JHEP publication information for XCone
-   Prepared VERSION and NEWS for 2.2.5 release
-2018-07-05 <jthaler>
-   Fixed bug in AxesDefinition.hh where _recomb was used before it was declared.
-2016-06-08 <jthaler>
-   Fixed bug in MeasureDefinition.cc where axes were not completely defined,
-      leading to problems with multi-pass axes 
-2016-04-04 <jthaler>
-   Fixed Njettiness.cc to give value of _current_tau_components even if less
-      than N constituents
-   Delete extraneous code in example_advanced_usage.cc
-2016-03-29 <jthaler>
-   Update for FJ 3.2.0 to deal with SharedPtr () deprecation
-2015-09-28 <jthaler>
-   Updated NEWS for 2.2.1 release.
-2015-09-18 <jthaler>
-   Fixed duplicate XConePlugin entry in Makefile.
-2015-08-20 <jthaler>
-   Trying to fix "abs" bug in ExtraRecombiners.cc
-2015-08-19 <jthaler>
-   Adding arXiv numbers to XCone papers
-   Used this_jet in example_basic_usage.
-   Fixed typo in example_advanced_usage header.
-   Added copy/paste code in README file.
-2015-08-13 <jthaler>
-   Ready for 2.2.0 release
-2015-07-23 <jthaler>
-   Fixed typo in GenET_GenKT_Axes error message
-   Added _too_few_axes_warning to ExclusiveJetAxes and ExclusiveCombinatorialJetAxes
-   Switched to ../data/single_event_ee.dat for make check
-2015-07-20 <jthaler>
-   Renamed WinnerTakeAllRecombiner.hh/cc to ExtraRecombiners.hh/cc
-   Added _too_few_axes_warning to HardestJetAxes
-   Added GenKT_Axes and OnePass_GenKT_Axes and Comb_GenKT_Axes (using E-scheme recombination).
-   Added warning about p < 0 or delta <=0 in GenKT axes finders.
-   Added warning about beta <= 0 in all measures.
-2015-07-10 <jthaler>
-   Putting in small tweaks in documentation to get ready for 2.2 release candidate 1.
-2015-06-15 <jthaler>
-   Starting doxygen file for eventual improved documentation.
-   Starting long process of improving documentation throughout.
-   Made the basic usage file a bit easier to read.
-   Adding in LimitedWarnings for old style constructors
-2015-06-12 <jthaler>
-   Synchronized definition of new measures with XCone paper.
-   In MeasureDefinition, added default values of jet_distance_squared and beam_distance_squared for cases where we don't want to optimize specifically.
-   Fixed bug in OriginalGeometricMeasure and ModifiedGeometric Measure
-   Commented out DeprecatedGeometricMeasure and DeprecatedGeometricCutoffMeasure since they were only causing confusion
-2015-05-26 <TJW>
-   Removed axis_scale_factor(), added bool to calculate this value if needed to save computation time
-   Defined small offset in denominator of axis scaling according to accuracy of refinement
-   Updated advanced examples to include tau values and number of jet constituents
-2015-05-25 <jthaler>
-   Clean up of AxesDefinition
-   Splitting get_axes into get_starting_axes and get_refined axes
-   Putting in proper noise ranges (hopefully) for MultiPass
-   Clean up of MeasureDefinition, rename jet_gamma to beam_gamma
-   Put in zero checking for jet_distance in ConicalGeometricMeasure
-   Added in ConicalMeasure for consistency
-   Changing OnePass Minimization to allow for temporary uphill
-2015-05-24 <TJW>
-   Added Combinatorial GenET_GenKT_Axes and MultiPass_Manual_Axes
-   Moved Axes refining information into MeasureDefinition, associated each measure with corresponding axes refiner
-   Moved get_one_pass_axes into MeasureDefinition, removed any mention of Npass
-   Moved all information on number of passes to AxesDefinition
-   Made AxesRefiner.hh/.cc into defunct files
-2015-05-22 <jthaler>
-   Cleaning out commented text.  Renaming classes to be consistent with recommended usage.
-2015-05-22 <TJW>
-   Added XConePlugin as a specific implementation of NjettinessPlugin
-   Added usage of XCone beta = 1.0 and beta = 2.0 to both basic and advanced example files
-   Added OriginalGeometric, ModifiedGeometric, ConicalGeometric, and XCone measures to list of test measures
-   Added OnePass_GenRecomb_GenKT_Axes to list of test axes
-   Added description to XCone measure in MeasureDefinition
-2015-05-21 <TJW>
-   Updated minimization scheme to avoid divide-by-zero errors
-   Fixed various factors of 2 in the definition of the measures
-2015-04-19 <TJW>
-   Fixed bug in minimization scheme for GeneralAxesRefiner
-   Moved measure_type to DefaultMeasure, removed geometric measure from e+e- example file
-2015-03-22 <TJW>
-   Added OriginalGeometricMeasure and ModifiedGeometricMeasure definitions
-   Changed all instances of GeometricMeasure to DeprecatedGeometricMeasure, and added error statements
-   Made GeneralAxesRefiner the default axes refiner for Measure Definition, overwritten by DefaultMeasure and GeometricMeasure
-   Created DefaultMeasure class for all the conical measure subclasses
-   Separated out e+e- and pp measures into separate example files
-2015-03-09 <TJW>
-   Added ConicalGeometric measures with jet_beta and jet_gamma definitions
-   Added XCone measures derived from ConicalGeometric with jet_gamma = 1.0
-   Added GeneralAxesRefiner for use with any measure (currently defined with XCone measure)
-   Added axes_numerator in MeasureDefinition to define the momentum scaling for minimization (currently only defined for Conical Geometric measure)
-2014-11-28 <TJW>
-   Minor change to default parameters in axes definition
-2014-10-08 <TJW>
-   Updated example file with new e+e- measure definitions
-   Added measure type to measure definition descriptions
-   Changed order of parameters in new axes definitions
-   Added standard C++ epsilon definition to GeneralERecombiner
-2014-10-07 <TJW>
-   Updated example_advanced_usage with new axes choices
-   Reversed inheritance of NormalizedMeasure and NormalizedCutoffMeasure (and Geometric) back to original
-   Storing _RcutoffSq as separate variable, and recalculating it in NormalizedMeasure 
-   Cleaning up ExclusiveCombinatorialJetAxes and added comments to explain the process
-   Fixed memory leaks using delete_recombiner_when_unused()
-   Fixed manual axes bug in Njettiness
-   Cleaned up enum definitions
-2014-10-01 <TJW>
-   Added new parameterized recombination scheme to Winner-Take-All recombiner
-   Created Winner-Take-All GenKT and general Recomb GenKT axes finders and onepass versions
-   Created new N choose M minimization axis finder, created N choose M WTA GenKT axis finder as example
-   Removed NPass as constructor argument in AxesDefinition, made it set through protected method
-   Removed TauMode as constructor argument in MeasureDefinition, made it set through protected method
-   Flipped inheritance of NormalizedMeasure and NormalizedCutoffMeasure (same for Geometric) to remove error of squaring the integer maximum
-   Created new MeasureType enum to allow user to choose between pp and ee variables (ee variables need testing)
-   Updated MeasureDefinition constructors to take in extra MeasureType parameter (but defaulted to pp variables)
-   Added new Default TauMode argument 
-   Fixed unsigned integers in various places
-   Added setAxes method to NjettinessPlugin
-2014-08-26 <JDT>
-   Enhanced TauComponents to include more infomation
-   NjettinessExtras now inherits from TauComponents
-   Removed getPartition from Njettiness, to avoid code duplication
-   Fixed double calculating issue in NjettinessPlugin::run_clustering()
-   Now AxesDefinition can use measure information without running AxesRefiner
-   Added TauStructure so the jets returned by TauComponents can know their tau value.
-2014-08-25 <JDT>
-   Merged MeasureDefinition and MeasureFunction into new MeasureDefinition.
-   Merged StartingAxesFinder and AxesDefinition into new AxesDefinition.
-   Renamed AxesFinder.cc/hh to AxesRefiner.cc/hh
-   Renamed NjettinessDefinition.cc/hh to AxesDefinition.cc/hh
-   Renamed MeasureFunction.cc/hh to MeasureDefinition.cc/hh
-   Renaming result() function in MeasureDefinition to be consistent with Nsubjettiness interface.
-   Split off TauComponents into separate header
-   Added TauPartition class for readability of partitioning
-   Moved NjettinessExtras into TauComponents, as this will eventually be the logical location
-   Added cross check of new MeasureDefinition and AxesDefinition in example_advanced_usage.
-   Lots of comments updated.
-   Changed version number to 2.2.0-alpha-dev, since this is going to be a bigger update than I had originally thought
-2014-08-20 <JDT>
-   Incorporated code in NjettinessPlugin to handle FJ3.1 treatment of auto_ptr (thanks Gregory)
-   Changed version number to 2.1.1-alpha-dev
-   Split AxesFinder into StartingAxesFinder and RefiningAxesFinder for clarity.
-   Manual axes mode now corresponds to a NULL StartingAxesFinder in Njettiness (so removed AxesFinderFromUserInput)
-   Added AxesRefiningMode to make selection of minimization routine more transparent in Njettiness
-   Moved sq() to more appropriate place in AxesFinder.hh
-   Rearranged Nsubjettiness.hh to make the old code less visible.
-   Renamed AxesFinderFromOnePassMinimization -> AxesFinderFromConicalMinimization
-   Renamed DefaultUnnormalizedMeasureFunction -> ConicalUnnormalizedMeasureFunction
-   Removed supportsMultiPassMinimization() from MeasureDefinition since any One Pass algorithm can be multipass.
-2014-07-09 <JDT>
-   Changed version for 2.1.0 release.
-   Updated NEWS to reflect 2.1.0 release
-2014-07-07 <JDT>
-   Added forward declaration of options in NjettinessDefinition for readability.
-   Updated README with some clarifications
-   Added usage information in the example file
-   Reran svn propset svn:keywords Id *.cc *.hh
-2014-06-25 <JDT>
-   Declaring release candidate of 2.1
-2014-06-11 <JDT>
-   Fixed virtual destructor issue in AxesFinder
-   Changing copy() to create() in NjettinessDefinition for "new" clarity
-   Converted some SharedPtr to regular pointers in NjettinessDefinition to be consistent on meaning of "create" commands.
-2014-06-10 <JDT>
-   Slight modification of example_advanced_usage
-   Fixed bug in GeometricCutoffMeasure (incorrect denominator setting)
-2014-06-05 <JDT>
-   Moved public before private in the .hh files for readability
-   Starting process of switching to SharedPtr internally
-   Clean up of AxesFinderFromGeometricMinimization
-   Simplified AxesFinder interface such that it doesn't know about starting axes finders (this is now handled in Njettiness).
-   Added const qualifiers in Njettiness
-2014-06-04 <JDT>
-   Implemented AxesDefinition class
-   Added descriptions to AxesDefinition and MeasureDefinition
-   Simplified example_advanced_usage with new Definitions
-   Made copy constructor private for Njettiness, to avoid copying 
-2014-06-03 <JDT>
-   Implemented remaining suggestions from FJ authors (Thanks!)
-   Fixed bug in example_advanced_usage where wrong beta value was used for NjettinessPlugin tests.
-   Removed NANs as signals for number of parameters in Nsubjettiness and NjettinessPlugin
-   Reduced the number of allowed parameters from 4 to 3.
-   Wrapped NEWS to 80 characters
-   Added MeasureDefinition as way to safely store information about the measures used
-   Converted a few NANs to std::numeric_limits<double>::quiet_NaN() when a parameter shouldn't be used.
-   Added AxesStruct and MeasureStruct to simplify the form of example_advanced_usage
-   Added example_v1p0p3 to check for backwards compatibility with v1.0.3
-   Changed the names of the MeasureFunctions in order to avoid conflicts with the new MeasureDefinitions
-   Fixed bug in correlation between subjets and tau values in NjettinessPlugin
-   Added currentTauComponents to Nsubjettiness
-   Added subTau information to example_basic_usage
-   Added file NjettinessDefinition to hold MeasureDefinition
-   Changed Njettiness constructors to treat MeasureSpecification as primary object
-   Fixed segmentation fault with ClusterSequenceAreas
-2014-06-02 <JDT>
-   Implemented many suggestions from FJ authors (Thanks!)
-   Removed FastJet 2 specific code
-   Made sq() function into internal namespace (as "inline static" to avoid conflicts with other packages)
-   Made setAxes() take const reference argument
-   Rewrapped README to 80 characters and updated/improved some of the descriptions
-   Clarified NEWS about what parts of the Nsubjettiness code is backwards compatible with v1.0.3
-   Clarified the para choices in Nsubjettiness constructor
-2014-04-30 <JDT>
-   Added (void)(n_jets) in AxesFinder.hh to fix unused-parameter warning
-2014-04-29 <JDT>
-   Added manual definition of NAN for compilers that don't have it.
-   Removed a few more unused parameters for compilation
-2014-04-22 <JDT>
-   Turned on -Wunused-parameter compiler flag to fix ATLAS compile issues.
-2014-04-18 <JDT>
-   Tweaks to NEWS and README.  Preparing for 2.0.0-rc1 release.
-2014-04-16 <JDT>
-   Decided that enough has changed that this should be v2.0
-   Added Id tags
-2014-04-14 <JDT>
-   Added get_partition_list to MeasureFunction
-   Removed do_cluster from MeasureFunction (no longer needed)
-   Fixed bug with NjettinessPlugin where jets were listed in backwards order from axes.
-   Removed various commented out pieces of code.
-2014-03-16 <JDT>
-   Added partitioning information to Nsubjettiness
-   Partitioning is now calculated in MeasureFunction and stored by Njettiness.
-   Rewrote MeasureFunction result() to call result_from_partition()
-   Added subjet (and constituent counting) information to example_basic_usage
-   Commented out redundant "getJets" function
-2014-02-25 <JDT>
-   Added access to seedAxes used for one-pass minimization routines.
-   Added axes print out to example_basic_usage, and fixed too many PrintJets declarations
-2014-02-24 <JDT>
-   Fixed embarrassing bug with min_axes (error introduced after v1.0 to make it the same as onepass_kt)
-   Simplified GeometricMeasure and added possibility of beta dependence
-   Commented out WTA2 options, since those have not been fully tested (nor do they seem particularly useful at the moment).  They can be reinstated if the physics case can be made to use them.
-   Split example into example_basic_usage and example_advanced_usage
-2014-01-28 <TJ>
-   Added new options in WinnerTakeAllRecombiner to use either pT or pT^2/E to recombine particles
-2014-01-24 <JDT>
-   Added access to currentAxes from Nsubjettiness.
-2014-01-18 <JDT>
-   Added beam regions to MeasureFunction, correspondingly renamed functions to have jet and beam regions
-   Renamed functions in TauComponents for consistency with MeasureFunction
-   Adding debugging code to AxesFinderFromOnePassMinimization::getAxes
-   Worked extensively on example.cc to make sure that it tests all available options.
-   Rewrote PrintJets command in example.cc for later improvements
-   Converted some magic numbers to std::numeric_limits<double>::max()
-2014-01-17 <JDT>
-   Rewrote KMeansMinimization to call OnePassMinimization, adding noise explicitly.
-   Removed any nothing of noise from OnePassMinimization
-   Removed Double32_t for root usage is Nsubjettiness
-   Clean up of many comments throughout the code, updating of README file
-   Removed unnecessary establishAxes in Njettiness
-   Removed bare constructor for Njettiness to avoid incompatibility with enum choices, may reinstate later.  Also removed setMeasureFunction, setAxesFinder for same reason
-   NjettinessExtras now calls TauComponents
-2014-01-16 <TJ>
-   Moved minimization functions to OnePassMinimization, changed KMeansMinimization class to simply call OnePassMinimization a specified number of times
-   Added extra tau function in TauComponents for users to get tau directly
-   Changed radius parameter in AxesFinderFromExclusiveJet subclasses to use max_allowable_R
-   Updated example.ref to account for changes due to change in radius parameter
-2014-01-15 <TJ>
-   Changed NjettinessComponents to TauComponents
-   Updated MeasureFunction with "result" function that returns TauComponents object
-   TauComponents changed to calculate all tau components given subtaus_numerator and tau_denominator
-   Njettiness updated to return TauComponents object rather than individual components
-   Nsubjettiness and NjettinessPlugin updated to have option for 4th parameter
-2014-01-14 <TJ>
-   Added NjettinessComponents class so Njettiness does not recalculate tau values
-   Removed old Njettiness constructors, updated Nsubjettiness and NjettinessPlugin constructors to use new constructor
-   Added geometric minimization to OnePassAxesFinders
-   Created new Njettiness function to set OnePassAxesFinders to reduce code
-   Updated LightLikeAxis with ConvertToPseudoJet function
-   Updated README with new functionality of code
-2014-01-12 <TJ>
-   Removed NsubGeometricParameters in all functions/constructors, replaced with Rcutoff double
-   Added three new measure mode options where Rcutoff is declared explicitly in parameters
-   Added checks so minimization axes finders are not used for geometric measures
-   AxesFinderFromOnePassMinimization class created as child of AxesFinderFromKmeansMinimization
-   Added new NsubjettinessRatio constructor to include MeasureMode option
-   Moved AxesFinder and MeasureFunction declarations from AxesMode and MeasureMode into separate Njettiness function
-   Removed R0 from AxesFinderFromKmeansMinimization
-   Changed example.cc to get rid of use of NsubGeometricParameters
-2014-01-9 <TJ>
-   Removed NsubParameters in all functions/constructors, replaced with three separate parameters
-   Added checks for correct number of parameters in Njettiness constructor
-2014-01-8 <TJ>
-   Removed normalization information from Nsubjettiness
-   Added flag to MeasureFunction to give option of using the denominator
-   Split DefaultMeasure into separate normalized and unnormalized classes
-2014-01-7 <TJ>
-   Added capability of choosing a specific Measure in Njettiness
-   Added new Nsubjettiness constructor to allow choice of both AxesMode and MeasureMode
-2014-01-6 <TJ>
-   Updated copyright information
-   Fixed bug in WinnerTakeAllRecombiner
-   Moved KMeansParameters to AxesFinder
-   Updated README with descriptions of new header files
-2013-12-30 <TJ>
-   Changed name of MeasureFunctor to MeasureFunction
-   Created separate .hh/.cc files for MeasureFunction, AxesFinder, and WinnerTakeAllRecombiner
-   Updated Makefile to account for new files
-   Removed getMinimumAxes in AxesFinderFromKMeansMinimization, consolidated with getAxes
-   Updated comments on classes and major functions
-2013-12-22 <TJ>
-   Created .cc files and moved all function definitions into .cc files
-   Updated Makefile to account for new .cc files
-2013-11-12 <TJ>
-   Added to fjcontrib svn
-2013-11-12 <jthaler>
-   Debugging svn
-2013-11-11 <TJ>
-   Changed MeasureFunctor to separately treat tau numerator and denominator
-   Changed some of the function names in MeasureFunctor.  Should not affect users
-   Added more informative function names to Njettiness.
-   Njettiness now allows finding unnormalized tau values
-   Added WTARecombiner to define winner-take-all axes
-   Added various WTA options to AxesMode
-   Added setAxes to Nsubjettiness
-   Added NsubjettinessRatio function
-2013-08-26 <jthaler>
-   Added inlines to fix compile issue
-   Put some of the minimization code inside of the AxesFinderFromKmeansMinimization class
-2013-02-23 <jthaler>
-   Fixed dependency issue (now using make depend)
-2013-02-22 <jthaler>
-   Fixed memory management and failed make check issues.
-2013-02-21 <jthaler>
-   First version submitted to fjcontrib
-2013-02-20 <jthaler>
-   Initial creation based on previous plugin hosted at http://www.jthaler.net/jets/
-
-
-
Index: external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,103 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: ExtraRecombiners.cc 842 2015-08-20 13:44:31Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "ExtraRecombiners.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-  
-std::string GeneralEtSchemeRecombiner::description() const {
-   return "General Et-scheme recombination";
-}
-
-// recombine pa and pb according to a generalized Et-scheme parameterized by the power delta
-void GeneralEtSchemeRecombiner::recombine(const fastjet::PseudoJet & pa, const fastjet::PseudoJet & pb, fastjet::PseudoJet & pab) const {
-   
-   // Define new weights for recombination according to delta
-   // definition of ratio done so that we do not encounter issues about numbers being too large for huge values of delta
-   double ratio;
-   if (std::abs(_delta - 1.0) < std::numeric_limits<double>::epsilon()) ratio = pb.perp()/pa.perp(); // save computation time of pow()
-   else ratio = pow(pb.perp()/pa.perp(), _delta);
-   double weighta = 1.0/(1.0 + ratio);
-   double weightb = 1.0/(1.0 + 1.0/ratio);
-   
-   double perp_ab = pa.perp() + pb.perp();
-   // reweight the phi and rap sums according to the weights above
-   if (perp_ab != 0.0) {
-      double y_ab = (weighta * pa.rap() + weightb * pb.rap());
-      
-      double phi_a = pa.phi(), phi_b = pb.phi();
-      if (phi_a - phi_b > pi)  phi_b += twopi;
-      if (phi_a - phi_b < -pi) phi_b -= twopi;
-      double phi_ab = (weighta * phi_a + weightb * phi_b);
-      
-      pab.reset_PtYPhiM(perp_ab, y_ab, phi_ab);
-      
-   }
-   else {
-      pab.reset(0.0,0.0,0.0,0.0);
-   }
-}
-
-
-std::string WinnerTakeAllRecombiner::description() const {
-   return "Winner-Take-All recombination";
-}
-
-// recombine pa and pb by creating pab with energy of the sum of particle energies in the direction of the harder particle
-// updated recombiner to use more general form of a metric equal to E*(pT/E)^(alpha), which reduces to pT*cosh(rap)^(1-alpha)
-// alpha is specified by the user. The default is alpha = 1, which is the typical behavior. alpha = 2 provides a metric which more 
-// favors central jets
-void WinnerTakeAllRecombiner::recombine(const fastjet::PseudoJet & pa, const fastjet::PseudoJet & pb, fastjet::PseudoJet & pab) const {
-   double a_pt = pa.perp(), b_pt = pb.perp(), a_rap = pa.rap(), b_rap = pb.rap();
-   
-   // special case of alpha = 1, everything is just pt (made separate so that pow function isn't called)
-   if (_alpha == 1.0) {
-      if (a_pt >= b_pt) {
-         pab.reset_PtYPhiM(a_pt + b_pt, a_rap, pa.phi());
-      }
-      else if (b_pt > a_pt) {
-         pab.reset_PtYPhiM(a_pt + b_pt, b_rap, pb.phi());
-      }
-   }
-
-   // every other case uses additional cosh(rap) term
-   else {
-      double a_metric = a_pt*pow(cosh(a_rap), 1.0-_alpha);
-      double b_metric = b_pt*pow(cosh(b_rap), 1.0-_alpha);
-      if (a_metric >= b_metric) {
-   	  double new_pt = a_pt + b_pt*pow(cosh(b_rap)/cosh(a_rap), 1.0-_alpha);
-   	  pab.reset_PtYPhiM(new_pt, a_rap, pa.phi());
-      }
-      if (b_metric > a_metric) {
-   	  double new_pt = b_pt + a_pt*pow(cosh(a_rap)/cosh(b_rap), 1.0-_alpha);
-   	  pab.reset_PtYPhiM(new_pt, b_rap, pb.phi());
-      }
-   }
-}
-
-} //namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,103 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: ExtraRecombiners.hh 828 2015-07-20 14:52:06Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_WINNERTAKEALLRECOMBINER_HH__
-#define __FASTJET_CONTRIB_WINNERTAKEALLRECOMBINER_HH__
-
-#include "fastjet/PseudoJet.hh"
-#include "fastjet/JetDefinition.hh"
-
-#include <cmath>
-#include <vector>
-#include <list>
-#include <limits>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-///------------------------------------------------------------------------
-/// \class GeneralEtSchemeRecombiner
-/// \brief Recombination scheme with generalized Et weighting
-///
-/// GeneralEtSchemeRecombiner defines a new recombination scheme by inheriting from JetDefinition::Recombiner.
-/// This scheme compares the pT of two input particles, and then combines them into a particle with
-/// a pT equal to the sum of the two particle pTs and a direction (in rapidity/phi) weighted by the respective momenta of the
-/// particle. The weighting is dependent on the power delta. For delta = infinity, this should return the same result as the
-/// WinnerTakeAllRecombiner.
-///------------------------------------------------------------------------
-class GeneralEtSchemeRecombiner : public fastjet::JetDefinition::Recombiner {
-public:
-
-   /// Constructor takes delta weighting
-   /// (delta = 1.0 for Et-scheme, delta = infinity for winner-take-all scheme)
-   GeneralEtSchemeRecombiner(double delta) : _delta(delta) {}
-  
-   /// Description
-   virtual std::string description() const;
-  
-   /// Recombine pa and pb and put result into pab
-   virtual void recombine(const fastjet::PseudoJet & pa,
-                         const fastjet::PseudoJet & pb, 
-                         fastjet::PseudoJet & pab) const;
-
-private:
-  double _delta;  ///< Weighting exponent
-};
-
-///------------------------------------------------------------------------
-/// \class WinnerTakeAllRecombiner
-/// \brief Recombination scheme with winner-take-all weighting
-///
-/// WinnerTakeAllRecombiner defines a new recombination scheme by inheriting from JetDefinition::Recombiner.
-/// This scheme compares the pT of two input particles, and then combines them into a particle with
-/// a pT equal to the sum of the two particle pTs and a direction (in rapidity/phi) identical to that of the harder
-/// particle. This creates a jet with an axis guaranteed to align with a particle in the event.
-///------------------------------------------------------------------------
-class WinnerTakeAllRecombiner : public fastjet::JetDefinition::Recombiner {
-public:
-   
-	/// Constructor to choose value of alpha (defaulted to 1 for normal pT sum)
-   WinnerTakeAllRecombiner(double alpha = 1.0) : _alpha(alpha) {}
-
-   /// Description
-   virtual std::string description() const;
-   
-   /// recombine pa and pb and put result into pab
-   virtual void recombine(const fastjet::PseudoJet & pa,
-                          const fastjet::PseudoJet & pb,
-                          fastjet::PseudoJet & pab) const;
-
-private:
-	double _alpha; //power of (pt/E) term when recombining particles
-};
-
-} //namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_WINNERTAKEALLRECOMBINER_HH__
Index: external/fastjet/contribs/Nsubjettiness/MeasureDefinition.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/MeasureDefinition.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,628 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: MeasureDefinition.cc 943 2016-06-09 00:55:29Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-
-// #include "AxesRefiner.hh"
-#include "MeasureDefinition.hh"
-
-#include <iomanip>
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-///////
-//
-// Measure Function
-//
-///////
-
-
-//descriptions updated to include measure type
-std::string DefaultMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Default Measure (should not be used directly)";
-   return stream.str();
-};
-
-std::string NormalizedMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Normalized Measure (beta = " << _beta << ", R0 = " << _R0 << ")";
-   return stream.str();
-};
-
-std::string UnnormalizedMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Unnormalized Measure (beta = " << _beta << ", in GeV)";
-   return stream.str();
-};
-
-
-std::string NormalizedCutoffMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Normalized Cutoff Measure (beta = " << _beta << ", R0 = " << _R0 << ", Rcut = " << _Rcutoff << ")";
-   return stream.str();
-};
-
-std::string UnnormalizedCutoffMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Unnormalized Cutoff Measure (beta = " << _beta << ", Rcut = " << _Rcutoff << ", in GeV)";
-   return stream.str();
-};
-
-//std::string DeprecatedGeometricMeasure::description() const {
-//   std::stringstream stream;
-//   stream << std::fixed << std::setprecision(2)
-//   << "Deprecated Geometric Measure (beta = " << _jet_beta << ", in GeV)";
-//   return stream.str();
-//};
-   
-//std::string DeprecatedGeometricCutoffMeasure::description() const {
-//   std::stringstream stream;
-//   stream << std::fixed << std::setprecision(2)
-//   << "Deprecated Geometric Cutoff Measure (beta = " << _jet_beta << ", Rcut = " << _Rcutoff << ", in GeV)";
-//   return stream.str();
-//};
-   
-std::string ConicalMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Conical Measure (beta = " << _beta << ", Rcut = " << _Rcutoff << ", in GeV)";
-   return stream.str();
-};
-
-std::string OriginalGeometricMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Original Geometric Measure (Rcut = " << _Rcutoff << ", in GeV)";
-   return stream.str();
-}; 
-
-std::string ModifiedGeometricMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Modified Geometric Measure (Rcut = " << _Rcutoff << ", in GeV)";
-   return stream.str();
-}; 
-
-std::string ConicalGeometricMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "Conical Geometric Measure (beta = " << _jet_beta << ", gamma = " << _beam_gamma << ", Rcut = " << _Rcutoff << ", in GeV)";
-   return stream.str();
-}; 
-   
-
-std::string XConeMeasure::description() const {
-   std::stringstream stream;
-   stream << std::fixed << std::setprecision(2)
-   << "XCone Measure (beta = " << _jet_beta << ", Rcut = " << _Rcutoff << ", in GeV)";
-   return stream.str();
-}; 
-    
-// Return all of the necessary TauComponents for specific input particles and axes
-TauComponents MeasureDefinition::component_result(const std::vector<fastjet::PseudoJet>& particles,
-                                                  const std::vector<fastjet::PseudoJet>& axes) const {
-   
-   // first find partition
-   TauPartition partition = get_partition(particles,axes);
-   
-   // then return result calculated from partition
-   return component_result_from_partition(partition,axes);
-}
-
-TauPartition MeasureDefinition::get_partition(const std::vector<fastjet::PseudoJet>& particles,
-                                            const std::vector<fastjet::PseudoJet>& axes) const {
-   
-   TauPartition myPartition(axes.size());
-   
-   // Figures out the partiting of the input particles into the various jet pieces
-   // Based on which axis the parition is closest to
-   for (unsigned i = 0; i < particles.size(); i++) {
-      
-      // find minimum distance; start with beam (-1) for reference
-      int j_min = -1;
-      double minRsq;
-      if (has_beam()) minRsq = beam_distance_squared(particles[i]);
-      else minRsq = std::numeric_limits<double>::max(); // make it large value
-      
-      
-      // check to see which axis the particle is closest to
-      for (unsigned j = 0; j < axes.size(); j++) {
-         double tempRsq = jet_distance_squared(particles[i],axes[j]); // delta R distance
-         
-         if (tempRsq < minRsq) {
-            minRsq = tempRsq;
-            j_min = j;
-         }
-      }
-      
-      if (j_min == -1) {
-         assert(has_beam());  // should have beam for this to make sense.
-         myPartition.push_back_beam(particles[i],i);
-      } else {
-         myPartition.push_back_jet(j_min,particles[i],i);
-      }
-   }
-   
-   return myPartition;
-}
-
-// Uses existing partition and calculates result
-// TODO:  Can we cache this for speed up when doing area subtraction?
-TauComponents MeasureDefinition::component_result_from_partition(const TauPartition& partition,
-                                                     const std::vector<fastjet::PseudoJet>& axes) const {
-   
-   std::vector<double> jetPieces(axes.size(), 0.0);
-   double beamPiece = 0.0;
-   
-   double tauDen = 0.0;
-   if (!has_denominator()) tauDen = 1.0;  // if no denominator, then 1.0 for no normalization factor
-   
-   // first find jet pieces
-   for (unsigned j = 0; j < axes.size(); j++) {
-      std::vector<PseudoJet> thisPartition = partition.jet(j).constituents();
-      for (unsigned i = 0; i < thisPartition.size(); i++) {
-         jetPieces[j] += jet_numerator(thisPartition[i],axes[j]); //numerator jet piece
-         if (has_denominator()) tauDen += denominator(thisPartition[i]); // denominator
-      }
-   }
-   
-   // then find beam piece
-   if (has_beam()) {
-      std::vector<PseudoJet> beamPartition = partition.beam().constituents();
-
-      for (unsigned i = 0; i < beamPartition.size(); i++) {
-         beamPiece += beam_numerator(beamPartition[i]); //numerator beam piece
-         if (has_denominator()) tauDen += denominator(beamPartition[i]); // denominator
-      }
-   }
-   
-   // create jets for storage in TauComponents
-   std::vector<PseudoJet> jets = partition.jets();
-   
-   return TauComponents(_tau_mode, jetPieces, beamPiece, tauDen, jets, axes);
-}
-
-// new methods added to generalize energy and angle squared for different measure types
-double DefaultMeasure::energy(const PseudoJet& jet) const {
-   double energy;
-   switch (_measure_type) {
-      case pt_R : 
-      case perp_lorentz_dot : 
-         energy = jet.perp();
-         break;
-      case E_theta : 
-      case lorentz_dot : 
-         energy = jet.e();
-         break;
-      default : {
-         assert(_measure_type == pt_R || _measure_type == E_theta || _measure_type == lorentz_dot || _measure_type == perp_lorentz_dot);
-         energy = std::numeric_limits<double>::quiet_NaN();
-         break;
-      }
-   }
-   return energy;
-}
-   
-double DefaultMeasure::angleSquared(const PseudoJet& jet1, const PseudoJet& jet2) const {
-   double pseudoRsquared;
-   switch(_measure_type) {
-      case pt_R : {
-         pseudoRsquared = jet1.squared_distance(jet2);
-         break; 
-      }
-      case E_theta : {
-         // doesn't seem to be a fastjet built in for this
-         double dot = jet1.px()*jet2.px() + jet1.py()*jet2.py() + jet1.pz()*jet2.pz();
-         double norm1 = sqrt(jet1.px()*jet1.px() + jet1.py()*jet1.py() + jet1.pz()*jet1.pz());
-         double norm2 = sqrt(jet2.px()*jet2.px() + jet2.py()*jet2.py() + jet2.pz()*jet2.pz());
-        
-         double costheta = dot/(norm1 * norm2);
-         if (costheta > 1.0) costheta = 1.0; // Need to handle case of numerical overflow
-         double theta = acos(costheta);
-         pseudoRsquared = theta*theta;   
-         break;
-      }
-      case lorentz_dot : {
-         double dotproduct = dot_product(jet1,jet2);
-         pseudoRsquared = 2.0 * dotproduct / (jet1.e() * jet2.e());
-         break;
-      }
-      case perp_lorentz_dot : {
-         PseudoJet lightJet = lightFrom(jet2); // assuming jet2 is the axis
-         double dotproduct = dot_product(jet1,lightJet);
-         pseudoRsquared = 2.0 * dotproduct / (lightJet.pt() * jet1.pt());
-         break;
-      }
-      default : {
-         assert(_measure_type == pt_R || _measure_type == E_theta || _measure_type == lorentz_dot || _measure_type == perp_lorentz_dot);
-         pseudoRsquared = std::numeric_limits<double>::quiet_NaN();
-         break;
-      }
-   }
-
-   return pseudoRsquared;
-
-}
-
-
-///////
-//
-// Axes Refining
-//
-///////
-
-// uses minimization of N-jettiness to continually update axes until convergence.
-// The function returns the axes found at the (local) minimum
-// This is the general axes refiner that can be used for a generic measure (but is
-// overwritten in the case of the conical measure and the deprecated geometric measure)
-std::vector<fastjet::PseudoJet> MeasureDefinition::get_one_pass_axes(int n_jets,
-                                                                     const std::vector <fastjet::PseudoJet> & particles,
-                                                                     const std::vector<fastjet::PseudoJet>& currentAxes,
-                                                                     int nAttempts,
-                                                                     double accuracy) const {
-
-   assert(n_jets == (int)currentAxes.size());
-   
-   std::vector<fastjet::PseudoJet> seedAxes = currentAxes;
-
-   std::vector<fastjet::PseudoJet> temp_axes(seedAxes.size(),fastjet::PseudoJet(0,0,0,0));
-   for (unsigned int k = 0; k < seedAxes.size(); k++) {
-      seedAxes[k] = lightFrom(seedAxes[k]) * seedAxes[k].E(); // making light-like, but keeping energy
-   }
-   
-   double seedTau = result(particles, seedAxes);
-
-   std::vector<fastjet::PseudoJet> bestAxesSoFar = seedAxes;
-   double bestTauSoFar = seedTau;
-   
-   for (int i_att = 0; i_att < nAttempts; i_att++) {
-      
-      std::vector<fastjet::PseudoJet> newAxes(seedAxes.size(),fastjet::PseudoJet(0,0,0,0));
-      std::vector<fastjet::PseudoJet> summed_jets(seedAxes.size(), fastjet::PseudoJet(0,0,0,0));      
-      
-      // find closest axis and assign to that
-      for (unsigned int i = 0; i < particles.size(); i++) {
-         
-         // start from unclustered beam measure
-         int minJ = -1;
-         double minDist = beam_distance_squared(particles[i]);
-         
-         // which axis am I closest to?
-         for (unsigned int j = 0; j < seedAxes.size(); j++) {
-            double tempDist = jet_distance_squared(particles[i],seedAxes[j]);
-            if (tempDist < minDist) {
-               minDist = tempDist;
-               minJ = j;
-            }
-         }
-         
-         // if not unclustered, then cluster
-         if (minJ != -1) {
-            summed_jets[minJ] += particles[i]; // keep track of energy to use later.
-            if (_useAxisScaling) {
-               double pseudoMomentum = dot_product(lightFrom(seedAxes[minJ]),particles[i]) + accuracy; // need small offset to avoid potential divide by zero issues
-               double axis_scaling = (double)jet_numerator(particles[i], seedAxes[minJ])/pseudoMomentum;
-
-               newAxes[minJ] += particles[i]*axis_scaling;
-            }
-         }
-      }
-      if (!_useAxisScaling) newAxes = summed_jets;
-
-      // convert the axes to LightLike and then back to PseudoJet
-      for (unsigned int k = 0; k < newAxes.size(); k++) {
-         if (newAxes[k].perp() > 0) {
-            newAxes[k] = lightFrom(newAxes[k]);
-            newAxes[k] *= summed_jets[k].E(); // scale by energy to get sensible result
-         }
-      }
-
-      // calculate tau on new axes
-      double newTau = result(particles, newAxes);
-      
-      // find the smallest value of tau (and the corresponding axes) so far
-      if (newTau < bestTauSoFar) {
-         bestAxesSoFar = newAxes;
-         bestTauSoFar = newTau;
-      }
-
-      if (fabs(newTau - seedTau) < accuracy) {// close enough for jazz
-         seedAxes = newAxes;
-         seedTau = newTau;
-         break;
-      }
-
-      seedAxes = newAxes;
-      seedTau = newTau;
-
-}
-
-   // return the axes corresponding to the smallest tau found throughout all iterations
-   // this is to prevent the minimization from returning a non-minimized of tau due to potential oscillations around the minimum
-   return bestAxesSoFar;
-
-}
-
-
-// One pass minimization for the DefaultMeasure
-   
-// Given starting axes, update to find better axes by using Kmeans clustering around the old axes
-template <int N>
-std::vector<LightLikeAxis> DefaultMeasure::UpdateAxesFast(const std::vector <LightLikeAxis> & old_axes,
-                                                          const std::vector <fastjet::PseudoJet> & inputJets,
-                                                          double accuracy
-                                                          ) const {
-   assert(old_axes.size() == N);
-   
-   // some storage, declared static to save allocation/re-allocation costs
-   static LightLikeAxis new_axes[N];
-   static fastjet::PseudoJet new_jets[N];
-   for (int n = 0; n < N; ++n) {
-      new_axes[n].reset(0.0,0.0,0.0,0.0);
-      new_jets[n].reset_momentum(0.0,0.0,0.0,0.0);
-   }
-
-   double precision = accuracy;  //TODO: actually cascade this in
-   
-   /////////////// Assignment Step //////////////////////////////////////////////////////////
-   std::vector<int> assignment_index(inputJets.size()); 
-   int k_assign = -1;
-   
-   for (unsigned i = 0; i < inputJets.size(); i++){
-      double smallestDist = std::numeric_limits<double>::max();  //large number
-      for (int k = 0; k < N; k++) {
-         double thisDist = old_axes[k].DistanceSq(inputJets[i]);
-         if (thisDist < smallestDist) {
-            smallestDist = thisDist;
-            k_assign = k;
-         }
-      }
-      if (smallestDist > sq(_Rcutoff)) {k_assign = -1;}
-      assignment_index[i] = k_assign;
-   }
-   
-   //////////////// Update Step /////////////////////////////////////////////////////////////
-   double distPhi, old_dist;
-   for (unsigned i = 0; i < inputJets.size(); i++) {
-      int old_jet_i = assignment_index[i];
-      if (old_jet_i == -1) {continue;}
-
-      const fastjet::PseudoJet& inputJet_i = inputJets[i];
-      LightLikeAxis& new_axis_i = new_axes[old_jet_i];
-      double inputPhi_i = inputJet_i.phi();
-      double inputRap_i = inputJet_i.rap();
-            
-      // optimize pow() call
-      // add noise (the precision term) to make sure we don't divide by zero
-      if (_beta == 1.0) {
-         double DR = std::sqrt(sq(precision) + old_axes[old_jet_i].DistanceSq(inputJet_i));
-         old_dist = 1.0/DR;
-      } else if (_beta == 2.0) {
-         old_dist = 1.0;
-      } else if (_beta == 0.0) {
-         double DRSq = sq(precision) + old_axes[old_jet_i].DistanceSq(inputJet_i);
-         old_dist = 1.0/DRSq;
-      } else {
-         old_dist = sq(precision) + old_axes[old_jet_i].DistanceSq(inputJet_i);
-         old_dist = std::pow(old_dist, (0.5*_beta-1.0));
-      }
-      
-      // TODO:  Put some of these addition functions into light-like axes
-      // rapidity sum
-      new_axis_i.set_rap(new_axis_i.rap() + inputJet_i.perp() * inputRap_i * old_dist);
-      // phi sum
-      distPhi = inputPhi_i - old_axes[old_jet_i].phi();
-      if (fabs(distPhi) <= M_PI){
-         new_axis_i.set_phi( new_axis_i.phi() + inputJet_i.perp() * inputPhi_i * old_dist );
-      } else if (distPhi > M_PI) {
-         new_axis_i.set_phi( new_axis_i.phi() + inputJet_i.perp() * (-2*M_PI + inputPhi_i) * old_dist );
-      } else if (distPhi < -M_PI) {
-         new_axis_i.set_phi( new_axis_i.phi() + inputJet_i.perp() * (+2*M_PI + inputPhi_i) * old_dist );
-      }
-      // weights sum
-      new_axis_i.set_weight( new_axis_i.weight() + inputJet_i.perp() * old_dist );
-      // momentum magnitude sum
-      new_jets[old_jet_i] += inputJet_i;
-   }
-   // normalize sums
-   for (int k = 0; k < N; k++) {
-      if (new_axes[k].weight() == 0) {
-         // no particles were closest to this axis!  Return to old axis instead of (0,0,0,0)
-         new_axes[k] = old_axes[k];
-      } else {
-         new_axes[k].set_rap( new_axes[k].rap() / new_axes[k].weight() );
-         new_axes[k].set_phi( new_axes[k].phi() / new_axes[k].weight() );
-         new_axes[k].set_phi( std::fmod(new_axes[k].phi() + 2*M_PI, 2*M_PI) );
-         new_axes[k].set_mom( std::sqrt(new_jets[k].modp2()) );
-      }
-   }
-   std::vector<LightLikeAxis> new_axes_vec(N);
-   for (unsigned k = 0; k < N; ++k) new_axes_vec[k] = new_axes[k];
-   return new_axes_vec;
-}
-
-// Given N starting axes, this function updates all axes to find N better axes. 
-// (This is just a wrapper for the templated version above.)
-//  TODO:  Consider removing this in a future version
-std::vector<LightLikeAxis> DefaultMeasure::UpdateAxes(const std::vector <LightLikeAxis> & old_axes,
-                                                      const std::vector <fastjet::PseudoJet> & inputJets,
-                                                      double accuracy) const {
-   int N = old_axes.size();
-   switch (N) {
-      case 1: return UpdateAxesFast<1>(old_axes, inputJets, accuracy);
-      case 2: return UpdateAxesFast<2>(old_axes, inputJets, accuracy);
-      case 3: return UpdateAxesFast<3>(old_axes, inputJets, accuracy);
-      case 4: return UpdateAxesFast<4>(old_axes, inputJets, accuracy);
-      case 5: return UpdateAxesFast<5>(old_axes, inputJets, accuracy);
-      case 6: return UpdateAxesFast<6>(old_axes, inputJets, accuracy);
-      case 7: return UpdateAxesFast<7>(old_axes, inputJets, accuracy);
-      case 8: return UpdateAxesFast<8>(old_axes, inputJets, accuracy);
-      case 9: return UpdateAxesFast<9>(old_axes, inputJets, accuracy);
-      case 10: return UpdateAxesFast<10>(old_axes, inputJets, accuracy);
-      case 11: return UpdateAxesFast<11>(old_axes, inputJets, accuracy);
-      case 12: return UpdateAxesFast<12>(old_axes, inputJets, accuracy);
-      case 13: return UpdateAxesFast<13>(old_axes, inputJets, accuracy);
-      case 14: return UpdateAxesFast<14>(old_axes, inputJets, accuracy);
-      case 15: return UpdateAxesFast<15>(old_axes, inputJets, accuracy);
-      case 16: return UpdateAxesFast<16>(old_axes, inputJets, accuracy);
-      case 17: return UpdateAxesFast<17>(old_axes, inputJets, accuracy);
-      case 18: return UpdateAxesFast<18>(old_axes, inputJets, accuracy);
-      case 19: return UpdateAxesFast<19>(old_axes, inputJets, accuracy);
-      case 20: return UpdateAxesFast<20>(old_axes, inputJets, accuracy);
-      default: std::cout << "N-jettiness is hard-coded to only allow up to 20 jets!" << std::endl;
-         return std::vector<LightLikeAxis>();
-   }
-
-}
-
-// 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> DefaultMeasure::get_one_pass_axes(int n_jets,
-                                                                  const std::vector <fastjet::PseudoJet> & inputJets,
-                                                                  const std::vector<fastjet::PseudoJet>& seedAxes,
-                                                                  int nAttempts,
-                                                                  double accuracy
-                                                                  ) const {
-
-   // if the measure type doesn't use the pt_R metric, then the standard minimization scheme should be used   
-   if (_measure_type != pt_R) {
-      return MeasureDefinition::get_one_pass_axes(n_jets, inputJets, seedAxes, nAttempts, accuracy);
-   }
-
-   // convert from PseudoJets to LightLikeAxes
-   std::vector< LightLikeAxis > old_axes(n_jets, LightLikeAxis(0,0,0,0));
-   for (int k = 0; k < n_jets; k++) {
-      old_axes[k].set_rap( seedAxes[k].rap() );
-      old_axes[k].set_phi( seedAxes[k].phi() );
-      old_axes[k].set_mom( seedAxes[k].modp()  );
-   }
-   
-   // Find new axes by iterating (only one pass here)
-   std::vector< LightLikeAxis > new_axes(n_jets, LightLikeAxis(0,0,0,0));
-   double cmp = std::numeric_limits<double>::max();  //large number
-   int h = 0;
-
-   while (cmp > accuracy && h < nAttempts) { // Keep updating axes until near-convergence or too many update steps
-      cmp = 0.0;
-      h++;
-      new_axes = UpdateAxes(old_axes, inputJets,accuracy); // Update axes
-      for (int k = 0; k < n_jets; k++) {
-         cmp += old_axes[k].Distance(new_axes[k]);
-      }
-      cmp = cmp / ((double) n_jets);
-      old_axes = new_axes;
-   }
-      
-   // Convert from internal LightLikeAxes to PseudoJet
-   std::vector<fastjet::PseudoJet> outputAxes;
-   for (int k = 0; k < n_jets; k++) {
-      fastjet::PseudoJet temp = old_axes[k].ConvertToPseudoJet();
-      outputAxes.push_back(temp);
-   }
-   
-   // this is used to debug the minimization routine to make sure that it works.
-   bool do_debug = false;
-   if (do_debug) {
-      // get this information to make sure that minimization is working properly
-      double seed_tau = result(inputJets, seedAxes);
-      double outputTau = result(inputJets, outputAxes);
-      assert(outputTau <= seed_tau);
-   }
-   
-   return outputAxes;
-}
-   
-//// One-pass minimization for the Deprecated Geometric Measure
-//// Uses minimization of the geometric distance in order to find the minimum axes.
-//// 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> DeprecatedGeometricCutoffMeasure::get_one_pass_axes(int n_jets,
-//                                                                                    const std::vector <fastjet::PseudoJet> & particles,
-//                                                                                    const std::vector<fastjet::PseudoJet>& currentAxes,
-//                                                                                    int nAttempts,
-//                                                                                    double accuracy) const {
-//
-//   assert(n_jets == (int)currentAxes.size()); //added int casting to get rid of compiler warning
-//   
-//   std::vector<fastjet::PseudoJet> seedAxes = currentAxes;
-//   double seedTau = result(particles, seedAxes);
-//   
-//   for (int i = 0; i < nAttempts; i++) {
-//      
-//      std::vector<fastjet::PseudoJet> newAxes(seedAxes.size(),fastjet::PseudoJet(0,0,0,0));
-//      
-//      // find closest axis and assign to that
-//      for (unsigned int i = 0; i < particles.size(); i++) {
-//         
-//         // start from unclustered beam measure
-//         int minJ = -1;
-//         double minDist = beam_distance_squared(particles[i]);
-//         
-//         // which axis am I closest to?
-//         for (unsigned int j = 0; j < seedAxes.size(); j++) {
-//            double tempDist = jet_distance_squared(particles[i],seedAxes[j]);
-//            if (tempDist < minDist) {
-//               minDist = tempDist;
-//               minJ = j;
-//            }
-//         }
-//         
-//         // if not unclustered, then cluster
-//         if (minJ != -1) newAxes[minJ] += particles[i];
-//      }
-//
-//      // calculate tau on new axes
-//      seedAxes = newAxes;
-//      double tempTau = result(particles, newAxes);
-//      
-//      // close enough to stop?
-//      if (fabs(tempTau - seedTau) < accuracy) break;
-//      seedTau = tempTau;
-//   }
-//   
-//   return seedAxes;
-//}
-
-
-// Go from internal LightLikeAxis to PseudoJet
-fastjet::PseudoJet LightLikeAxis::ConvertToPseudoJet() {
-    double px, py, pz, E;
-    E = _mom;
-    pz = (std::exp(2.0*_rap) - 1.0) / (std::exp(2.0*_rap) + 1.0) * E;
-    px = std::cos(_phi) * std::sqrt( std::pow(E,2) - std::pow(pz,2) );
-    py = std::sin(_phi) * std::sqrt( std::pow(E,2) - std::pow(pz,2) );
-    return fastjet::PseudoJet(px,py,pz,E);
-}
-
-} //namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/MeasureDefinition.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/MeasureDefinition.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,853 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: MeasureDefinition.hh 828 2015-07-20 14:52:06Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_MEASUREDEFINITION_HH__
-#define __FASTJET_CONTRIB_MEASUREDEFINITION_HH__
-
-#include "fastjet/PseudoJet.hh"
-#include <cmath>
-#include <vector>
-#include <list>
-#include <limits>
-
-#include "TauComponents.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-
-
-// The following Measures are available (and their relevant arguments):
-// Recommended for usage as jet shapes
-class DefaultMeasure;               // Default measure from which next classes derive (should not be called directly)
-class NormalizedMeasure;            // (beta,R0)
-class UnnormalizedMeasure;          // (beta)
-class NormalizedCutoffMeasure;      // (beta,R0,Rcutoff)
-class UnnormalizedCutoffMeasure;    // (beta,Rcutoff)
-
-// New measures as of v2.2
-// Recommended for usage as event shapes (or for jet finding)
-class ConicalMeasure;               // (beta,R)
-class OriginalGeometricMeasure;     // (R)
-class ModifiedGeometricMeasure;     // (R)
-class ConicalGeometricMeasure;      // (beta, gamma, R)
-class XConeMeasure;                 // (beta, R)
-   
-// Formerly GeometricMeasure, now no longer recommended, kept commented out only for cross-check purposes
-//class DeprecatedGeometricMeasure;         // (beta)
-//class DeprecatedGeometricCutoffMeasure;   // (beta,Rcutoff)
-
-   
-///////
-//
-// MeasureDefinition
-//
-///////
-
-//This is a helper class for the Minimum Axes Finders. It is defined later.
-class LightLikeAxis;                                          
-   
-///------------------------------------------------------------------------
-/// \class MeasureDefinition
-/// \brief Base class for measure definitions
-///
-/// This is the base class for measure definitions.  Derived classes will calculate
-/// the tau_N of a jet given a specific measure and a set of axes.  The measure is
-/// determined by various jet and beam distances (and possible normalization factors).
-///------------------------------------------------------------------------
-class MeasureDefinition {
-   
-public:
-   
-   /// Description of measure and parameters
-   virtual std::string description() const = 0;
-   
-   /// In derived classes, this should return a copy of the corresponding derived class
-   virtual MeasureDefinition* create() const = 0;
-
-   //The following five functions define the measure by which tau_N is calculated,
-   //and are overloaded by the various measures below
-   
-   /// Distanes to jet axis.  This is called many times, so needs to be as fast as possible
-   /// Unless overloaded, it just calls jet_numerator
-   virtual double jet_distance_squared(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      return jet_numerator(particle,axis);
-   }
-
-   /// Distanes to beam.  This is called many times, so needs to be as fast as possible
-   /// Unless overloaded, it just calls beam_numerator
-   virtual double beam_distance_squared(const fastjet::PseudoJet& particle) const {
-      return beam_numerator(particle);
-   }
-   
-   /// The jet measure used in N-(sub)jettiness
-   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const = 0;
-   /// The beam measure used in N-(sub)jettiness
-   virtual double beam_numerator(const fastjet::PseudoJet& particle) const = 0;
-   
-   /// A possible normalization factor
-   virtual double denominator(const fastjet::PseudoJet& particle) const = 0;
-   
-   /// Run a one-pass minimization routine.  There is a generic one-pass minimization that works for a wide variety of measures.
-   /// This should be overloaded to create a measure-specific minimization scheme
-   virtual std::vector<fastjet::PseudoJet> get_one_pass_axes(int n_jets,
-                                                             const std::vector<fastjet::PseudoJet>& inputs,
-                                                             const std::vector<fastjet::PseudoJet>& seedAxes,
-                                                             int nAttempts = 1000,         // cap number of iterations
-                                                             double accuracy = 0.0001      // cap distance of closest approach
-   ) const;
-   
-public:
-   
-   /// Returns the tau value for a give set of particles and axes
-   double result(const std::vector<fastjet::PseudoJet>& particles, const std::vector<fastjet::PseudoJet>& axes) const {
-      return component_result(particles,axes).tau();
-   }
-   
-   /// Short-hand for the result() function
-   inline double operator() (const std::vector<fastjet::PseudoJet>& particles, const std::vector<fastjet::PseudoJet>& axes) const {
-      return result(particles,axes);
-   }
-   
-   /// Return all of the TauComponents for specific input particles and axes
-   TauComponents component_result(const std::vector<fastjet::PseudoJet>& particles, const std::vector<fastjet::PseudoJet>& axes) const;
-   
-   /// Create the partitioning according the jet/beam distances and stores them a TauPartition
-   TauPartition get_partition(const std::vector<fastjet::PseudoJet>& particles, const std::vector<fastjet::PseudoJet>& axes) const;
-
-   /// Calculate the tau result using an existing partition
-   TauComponents component_result_from_partition(const TauPartition& partition, const std::vector<fastjet::PseudoJet>& axes) const;
-
-   
-
-   /// virtual destructor
-   virtual ~MeasureDefinition(){}
-   
-protected:
-   
-   /// Flag set by derived classes to choose whether or not to use beam/denominator
-   TauMode _tau_mode;
-   
-   /// Flag set by derived classes to say whether cheap get_one_pass_axes method can be used (true by default)
-   bool _useAxisScaling;
-
-   /// This is the only constructor, which requires _tau_mode and _useAxisScaling to be manually set by derived classes.
-   MeasureDefinition() : _tau_mode(UNDEFINED_SHAPE), _useAxisScaling(true) {}
-
-   
-   /// Used by derived classes to set whether or not to use beam/denominator information
-   void setTauMode(TauMode tau_mode) {
-      _tau_mode = tau_mode;
-   }
-
-   /// Used by derived classes to say whether one can use cheap get_one_pass_axes
-   void setAxisScaling(bool useAxisScaling) {
-      _useAxisScaling = useAxisScaling;
-   }
-
-   /// Uses denominator information?
-   bool has_denominator() const { return (_tau_mode == NORMALIZED_JET_SHAPE || _tau_mode == NORMALIZED_EVENT_SHAPE);}
-   /// Uses beam information?
-   bool has_beam() const {return (_tau_mode == UNNORMALIZED_EVENT_SHAPE || _tau_mode == NORMALIZED_EVENT_SHAPE);}
-
-   /// Create light-like axis (used in default one-pass minimization routine)
-   fastjet::PseudoJet lightFrom(const fastjet::PseudoJet& input) const {
-      double length = sqrt(pow(input.px(),2) + pow(input.py(),2) + pow(input.pz(),2));
-      return fastjet::PseudoJet(input.px()/length,input.py()/length,input.pz()/length,1.0);
-   }
-   
-   /// Shorthand for squaring
-   static inline double sq(double x) {return x*x;}
-
-};
-   
-
-///////
-//
-// Default Measures
-//
-///////
-   
-   
-///------------------------------------------------------------------------
-/// \enum DefaultMeasureType
-/// \brief Options for default measure
-///
-/// Can be used to switch between pp and ee measure types in the DefaultMeasure
-///------------------------------------------------------------------------
-enum DefaultMeasureType {
-   pt_R,       ///  use transverse momenta and boost-invariant angles,
-   E_theta,    ///  use energies and angles,
-   lorentz_dot, ///  use dot product inspired measure
-   perp_lorentz_dot /// use conical geometric inspired measures
-};
-
-///------------------------------------------------------------------------
-/// \class DefaultMeasure
-/// \brief Base class for default N-subjettiness measure definitions
-///
-/// This class is the default measure as defined in the original N-subjettiness papers.
-/// Based on the conical measure, but with a normalization factor
-/// This measure is defined as the pT of the particle multiplied by deltaR
-/// to the power of beta. This class includes the normalization factor determined by R0
-///------------------------------------------------------------------------
-class DefaultMeasure : public MeasureDefinition {
-   
-public:
-
-   /// Description
-   virtual std::string description() const;
-   /// To allow copying around of these objects
-   virtual DefaultMeasure* create() const {return new DefaultMeasure(*this);}
-
-   /// fast jet distance
-   virtual double jet_distance_squared(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      return angleSquared(particle, axis);
-   }
-   
-   /// fast beam distance
-   virtual double beam_distance_squared(const fastjet::PseudoJet& /*particle*/) const {
-      return _RcutoffSq;
-   }
-   
-   /// true jet distance (given by general definitions of energy and angle)
-   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const{
-      double jet_dist = angleSquared(particle, axis);
-      if (jet_dist > 0.0) {
-         return energy(particle) * std::pow(jet_dist,_beta/2.0);
-      } else {
-         return 0.0;
-      }
-   }
-   
-   /// true beam distance
-   virtual double beam_numerator(const fastjet::PseudoJet& particle) const {
-      return energy(particle) * std::pow(_Rcutoff,_beta);
-   }
-   
-   /// possible denominator for normalization
-   virtual double denominator(const fastjet::PseudoJet& particle) const {
-      return energy(particle) * std::pow(_R0,_beta);
-   }
-
-   /// Special minimization routine (from v1.0 of N-subjettiness)
-   virtual std::vector<fastjet::PseudoJet> get_one_pass_axes(int n_jets,
-                                                             const std::vector<fastjet::PseudoJet>& inputs,
-                                                             const std::vector<fastjet::PseudoJet>& seedAxes,
-                                                             int nAttempts,   // cap number of iterations
-                                                             double accuracy  // cap distance of closest approach
-                                                             ) const;
-   
-protected:
-   double _beta;      ///< Angular exponent
-   double _R0;        ///< Normalization factor
-   double _Rcutoff;   ///< Cutoff radius
-   double _RcutoffSq; ///< Cutoff radius squared
-   DefaultMeasureType _measure_type;  ///< Type of measure used (i.e. pp style or ee style)
-   
-   
-   /// Constructor is protected so that no one tries to call this directly.
-   DefaultMeasure(double beta, double R0, double Rcutoff, DefaultMeasureType measure_type = pt_R)
-   : MeasureDefinition(), _beta(beta), _R0(R0), _Rcutoff(Rcutoff), _RcutoffSq(sq(Rcutoff)), _measure_type(measure_type)
-   {
-      if (beta <= 0) throw Error("DefaultMeasure:  You must choose beta > 0.");
-      if (R0 <= 0) throw Error("DefaultMeasure:  You must choose R0 > 0.");
-      if (Rcutoff <= 0) throw Error("DefaultMeasure:  You must choose Rcutoff > 0.");
-   }
-   
-   /// Added set measure method in case it becomes useful later
-   void setDefaultMeasureType(DefaultMeasureType measure_type) {
-      _measure_type = measure_type;
-   }
-
-   /// Generalized energy value (determined by _measure_type)
-   double energy(const PseudoJet& jet) const;
-   /// Generalized angle value (determined by _measure_type)
-   double angleSquared(const PseudoJet& jet1, const PseudoJet& jet2) const;
-
-   /// Name of _measure_type, so description will include the measure type
-   std::string measure_type_name() const {
-      if (_measure_type == pt_R) return "pt_R";
-      else if (_measure_type == E_theta) return "E_theta";
-      else if (_measure_type == lorentz_dot) return "lorentz_dot";
-      else if (_measure_type == perp_lorentz_dot) return "perp_lorentz_dot";
-      else return "Measure Type Undefined";
-   }      
-
-   /// templated for speed (TODO: probably should remove, since not clear that there is a speed gain)
-   template <int N> std::vector<LightLikeAxis> UpdateAxesFast(const std::vector <LightLikeAxis> & old_axes,
-                                                              const std::vector <fastjet::PseudoJet> & inputJets,
-                                                              double accuracy) const;
-   
-   /// called by get_one_pass_axes to update axes iteratively
-   std::vector<LightLikeAxis> UpdateAxes(const std::vector <LightLikeAxis> & old_axes,
-                                         const std::vector <fastjet::PseudoJet> & inputJets,
-                                         double accuracy) const;
-};
-   
-
-///------------------------------------------------------------------------
-/// \class NormalizedCutoffMeasure
-/// \brief Dimensionless default measure, with radius cutoff
-///
-/// This measure is just a wrapper for DefaultMeasure
-///------------------------------------------------------------------------
-class NormalizedCutoffMeasure : public DefaultMeasure {
-
-public:
-
-   /// Constructor
-   NormalizedCutoffMeasure(double beta, double R0, double Rcutoff, DefaultMeasureType measure_type = pt_R) 
-   : DefaultMeasure(beta, R0, Rcutoff, measure_type) {
-      setTauMode(NORMALIZED_JET_SHAPE);
-   }
-
-   /// Description
-   virtual std::string description() const;
-
-   /// For copying purposes
-   virtual NormalizedCutoffMeasure* create() const {return new NormalizedCutoffMeasure(*this);}
-
-};
-
-///------------------------------------------------------------------------
-/// \class NormalizedMeasure
-/// \brief Dimensionless default measure, with no cutoff
-///
-/// This measure is the same as NormalizedCutoffMeasure, with Rcutoff taken to infinity.
-///------------------------------------------------------------------------
-class NormalizedMeasure : public NormalizedCutoffMeasure {
-
-public:
-
-   /// Constructor
-   NormalizedMeasure(double beta, double R0, DefaultMeasureType measure_type = pt_R)
-   : NormalizedCutoffMeasure(beta, R0, std::numeric_limits<double>::max(), measure_type) {
-      _RcutoffSq = std::numeric_limits<double>::max();
-      setTauMode(NORMALIZED_JET_SHAPE);
-   }
-   
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual NormalizedMeasure* create() const {return new NormalizedMeasure(*this);}
-
-};
-   
-
-///------------------------------------------------------------------------
-/// \class UnnormalizedCutoffMeasure
-/// \brief Dimensionful default measure, with radius cutoff
-///
-/// This class is the unnormalized conical measure. The only difference from NormalizedCutoffMeasure
-/// is that the denominator is defined to be 1.0 by setting _has_denominator to false.
-/// class UnnormalizedCutoffMeasure : public NormalizedCutoffMeasure {
-///------------------------------------------------------------------------
-class UnnormalizedCutoffMeasure : public DefaultMeasure {
-   
-public:
-   
-   /// Since all methods are identical, UnnormalizedMeasure inherits directly
-   /// from NormalizedMeasure. R0 is a dummy value since the value of R0 is unecessary for this class,
-   /// and the "false" flag sets _has_denominator in MeasureDefinition to false so no denominator is used.
-   UnnormalizedCutoffMeasure(double beta, double Rcutoff, DefaultMeasureType measure_type = pt_R)
-   : DefaultMeasure(beta, std::numeric_limits<double>::quiet_NaN(), Rcutoff, measure_type) {
-      setTauMode(UNNORMALIZED_EVENT_SHAPE);
-   }
-
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual UnnormalizedCutoffMeasure* create() const {return new UnnormalizedCutoffMeasure(*this);}
-
-};
-
-   
-///------------------------------------------------------------------------
-/// \class UnnormalizedMeasure
-/// \brief Dimensionless default measure, with no cutoff
-///
-/// This measure is the same as UnnormalizedCutoffMeasure, with Rcutoff taken to infinity.
-///------------------------------------------------------------------------
-class UnnormalizedMeasure : public UnnormalizedCutoffMeasure {
-   
-public:
-   /// Since all methods are identical, UnnormalizedMeasure inherits directly
-   /// from NormalizedMeasure. R0 is a dummy value since the value of R0 is unecessary for this class,
-   /// and the "false" flag sets _has_denominator in MeasureDefinition to false so no denominator is used.
-   UnnormalizedMeasure(double beta, DefaultMeasureType measure_type = pt_R)
-   : UnnormalizedCutoffMeasure(beta, std::numeric_limits<double>::max(), measure_type) {
-      _RcutoffSq = std::numeric_limits<double>::max();
-      setTauMode(UNNORMALIZED_JET_SHAPE);
-   }
-
-   /// Description
-   virtual std::string description() const;
-   
-   /// For copying purposes
-   virtual UnnormalizedMeasure* create() const {return new UnnormalizedMeasure(*this);}
-   
-};
-
-
-///------------------------------------------------------------------------
-/// \class ConicalMeasure
-/// \brief Dimensionful event-shape measure, with radius cutoff
-///
-/// Very similar to UnnormalizedCutoffMeasure, but with different normalization convention
-/// and using the new default one-pass minimization algorithm.
-/// Axes are also made to be light-like to ensure sensible behavior
-/// Intended to be used as an event shape.
-///------------------------------------------------------------------------
-class ConicalMeasure : public MeasureDefinition {
-   
-public:
-   
-   /// Constructor
-   ConicalMeasure(double beta, double Rcutoff)
-   :   MeasureDefinition(), _beta(beta), _Rcutoff(Rcutoff), _RcutoffSq(sq(Rcutoff)) {
-      if (beta <= 0) throw Error("ConicalMeasure:  You must choose beta > 0.");
-      if (Rcutoff <= 0) throw Error("ConicalMeasure:  You must choose Rcutoff > 0.");
-      setTauMode(UNNORMALIZED_EVENT_SHAPE);
-   }
-   
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual ConicalMeasure* create() const {return new ConicalMeasure(*this);}
-   
-   /// fast jet distance
-   virtual double jet_distance_squared(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      PseudoJet lightAxis = lightFrom(axis);
-      return particle.squared_distance(lightAxis);
-   }
-   
-   /// fast beam distance
-   virtual double beam_distance_squared(const fastjet::PseudoJet&  /*particle*/) const {
-      return _RcutoffSq;
-   }
-   
-   
-   /// true jet distance
-   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      PseudoJet lightAxis = lightFrom(axis);
-      double jet_dist = particle.squared_distance(lightAxis)/_RcutoffSq;
-      double jet_perp = particle.perp();
-      
-      if (_beta == 2.0) {
-         return jet_perp * jet_dist;
-      } else {
-         return jet_perp * pow(jet_dist,_beta/2.0);
-      }
-   }
-   
-   /// true beam distance
-   virtual double beam_numerator(const fastjet::PseudoJet& particle) const {
-      return particle.perp();
-   }
-   
-   /// no denominator used for this measure
-   virtual double denominator(const fastjet::PseudoJet&  /*particle*/) const {
-      return std::numeric_limits<double>::quiet_NaN();
-   }
-   
-protected:
-   double _beta;     ///< angular exponent
-   double _Rcutoff;  ///< effective jet radius
-   double _RcutoffSq;///< effective jet radius squared
-};
-   
-
-
-///------------------------------------------------------------------------
-/// \class OriginalGeometricMeasure
-/// \brief Dimensionful event-shape measure, with dot-product distances
-///
-/// This class is the original (and hopefully now correctly coded) geometric measure.
-/// This measure is defined by the Lorentz dot product between
-/// the particle and the axis.  This class does not include normalization of tau_N.
-/// New in Nsubjettiness v2.2
-/// NOTE: This is defined differently from the DeprecatedGeometricMeasure which are now commented out.
-///------------------------------------------------------------------------
-class OriginalGeometricMeasure : public MeasureDefinition {
-
-public:
-   /// Constructor
-   OriginalGeometricMeasure(double Rcutoff)
-   : MeasureDefinition(), _Rcutoff(Rcutoff), _RcutoffSq(sq(Rcutoff)) {
-      if (Rcutoff <= 0) throw Error("OriginalGeometricMeasure:  You must choose Rcutoff > 0.");
-      setTauMode(UNNORMALIZED_EVENT_SHAPE);
-      setAxisScaling(false);  // No need to rescale axes (for speed up in one-pass minimization)
-   }
-
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual OriginalGeometricMeasure* create() const {return new OriginalGeometricMeasure(*this);}
-   
-   // This class uses the default jet_distance_squared and beam_distance_squared
-
-   /// true jet measure
-   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      return dot_product(lightFrom(axis), particle)/_RcutoffSq;
-   }
-
-   /// true beam measure
-   virtual double beam_numerator(const fastjet::PseudoJet& particle) const {
-      fastjet::PseudoJet beam_a(0,0,1,1);
-      fastjet::PseudoJet beam_b(0,0,-1,1);
-      double min_perp = std::min(dot_product(beam_a, particle),dot_product(beam_b, particle));
-      return min_perp;
-   }
-
-   /// no denominator needed for this measure.
-   virtual double denominator(const fastjet::PseudoJet&  /*particle*/) const {
-      return std::numeric_limits<double>::quiet_NaN();
-   }
-   
-protected:
-   double _Rcutoff;   ///< Effective jet radius (rho = R^2)
-   double _RcutoffSq; ///< Effective jet radius squared
-
-};
-
-
-///------------------------------------------------------------------------
-/// \class ModifiedGeometricMeasure
-/// \brief Dimensionful event-shape measure, with dot-product distances, modified beam measure
-///
-/// This class is the Modified geometric measure.  This jet measure is defined by the Lorentz dot product between
-/// the particle and the axis, as in the Original Geometric Measure. The beam measure is defined differently from
-/// the above OriginalGeometric to allow for more conical jets. New in Nsubjettiness v2.2
-///------------------------------------------------------------------------
-class ModifiedGeometricMeasure : public MeasureDefinition {
-
-public:
-   /// Constructor
-   ModifiedGeometricMeasure(double Rcutoff)
-   :  MeasureDefinition(), _Rcutoff(Rcutoff), _RcutoffSq(sq(Rcutoff)) {
-      if (Rcutoff <= 0) throw Error("ModifiedGeometricMeasure:  You must choose Rcutoff > 0.");
-      setTauMode(UNNORMALIZED_EVENT_SHAPE);
-      setAxisScaling(false);  // No need to rescale axes (for speed up in one-pass minimization)
-   }
-
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual ModifiedGeometricMeasure* create() const {return new ModifiedGeometricMeasure(*this);}
-   
-   // This class uses the default jet_distance_squared and beam_distance_squared
-
-   /// True jet measure
-   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      return dot_product(lightFrom(axis), particle)/_RcutoffSq;
-   }
-
-   /// True beam measure
-   virtual double beam_numerator(const fastjet::PseudoJet& particle) const {
-      fastjet::PseudoJet lightParticle = lightFrom(particle);
-      return 0.5*particle.mperp()*lightParticle.pt();
-   }
-
-   /// This measure does not require a denominator
-   virtual double denominator(const fastjet::PseudoJet&  /*particle*/) const {
-      return std::numeric_limits<double>::quiet_NaN();
-   }
-   
-protected:
-   double _Rcutoff;   ///< Effective jet radius (rho = R^2)
-   double _RcutoffSq; ///< Effective jet radius squared
-
-
-};
-
-///------------------------------------------------------------------------
-/// \class ConicalGeometricMeasure
-/// \brief Dimensionful event-shape measure, basis for XCone jet algorithm
-///
-/// This class is the Conical Geometric measure.  This measure is defined by the Lorentz dot product between
-/// the particle and the axis normalized by the axis and particle pT, as well as a factor of cosh(y) to vary
-/// the rapidity depepdence of the beam. New in Nsubjettiness v2.2, and the basis for the XCone jet algorithm
-///------------------------------------------------------------------------
-class ConicalGeometricMeasure : public MeasureDefinition {
-
-public:
-   
-   /// Constructor
-   ConicalGeometricMeasure(double jet_beta, double beam_gamma, double Rcutoff)
-   :  MeasureDefinition(),  _jet_beta(jet_beta), _beam_gamma(beam_gamma), _Rcutoff(Rcutoff), _RcutoffSq(sq(Rcutoff)){
-      if (jet_beta <= 0)   throw Error("ConicalGeometricMeasure:  You must choose beta > 0.");
-      if (beam_gamma <= 0) throw Error("ConicalGeometricMeasure:  You must choose gamma > 0.");
-      if (Rcutoff <= 0)   throw Error("ConicalGeometricMeasure:  You must choose Rcutoff > 0.");
-      setTauMode(UNNORMALIZED_EVENT_SHAPE);
-   }
-
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual ConicalGeometricMeasure* create() const {return new ConicalGeometricMeasure(*this);}
-   
-   /// fast jet measure
-   virtual double jet_distance_squared(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      fastjet::PseudoJet lightAxis = lightFrom(axis);
-      double pseudoRsquared = 2.0*dot_product(lightFrom(axis),particle)/(lightAxis.pt()*particle.pt());
-      return pseudoRsquared;
-   }
-
-   /// fast beam measure
-   virtual double beam_distance_squared(const fastjet::PseudoJet&  /*particle*/) const {
-      return _RcutoffSq;
-   }
-
-   /// true jet measure
-   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-      double jet_dist = jet_distance_squared(particle,axis)/_RcutoffSq;
-      if (jet_dist > 0.0) {
-         fastjet::PseudoJet lightParticle = lightFrom(particle);
-         double weight = (_beam_gamma == 1.0) ? 1.0 : std::pow(0.5*lightParticle.pt(),_beam_gamma - 1.0);
-         return particle.pt() * weight * std::pow(jet_dist,_jet_beta/2.0);
-      } else {
-         return 0.0;
-      }
-   }
-
-   /// true beam measure
-   virtual double beam_numerator(const fastjet::PseudoJet& particle) const {
-      fastjet::PseudoJet lightParticle = lightFrom(particle);
-      double weight = (_beam_gamma == 1.0) ? 1.0 : std::pow(0.5*lightParticle.pt(),_beam_gamma - 1.0);
-      return particle.pt() * weight;
-   }
-
-   /// no denominator needed
-   virtual double denominator(const fastjet::PseudoJet&  /*particle*/) const {
-      return std::numeric_limits<double>::quiet_NaN();
-   }
-      
-protected:
-   double _jet_beta;   ///< jet angular exponent
-   double _beam_gamma; ///< beam angular exponent (gamma = 1.0 is recommended)
-   double _Rcutoff;    ///< effective jet radius
-   double _RcutoffSq;  ///< effective jet radius squared
-   
-};
-
-///------------------------------------------------------------------------
-/// \class XConeMeasure
-/// \brief Dimensionful event-shape measure used in XCone jet algorithm
-///
-/// This class is the XCone Measure.  This is the default measure for use with the
-/// XCone algorithm. It is identical to the conical geometric measure but with gamma = 1.0.
-///------------------------------------------------------------------------
-class XConeMeasure : public ConicalGeometricMeasure {
-
-public:
-   /// Constructor
-   XConeMeasure(double jet_beta, double R)
-   :   ConicalGeometricMeasure(jet_beta,
-                               1.0, // beam_gamma, hard coded at gamma = 1.0 default
-                               R    // Rcutoff scale
-                               ) { }
-
-   /// Description
-   virtual std::string description() const;
-   /// For copying purposes
-   virtual XConeMeasure* create() const {return new XConeMeasure(*this);}
-
-};
-
-///------------------------------------------------------------------------
-/// \class LightLikeAxis
-/// \brief Helper class to define light-like axes directions
-///
-/// This is a helper class for the minimization routines.
-/// It creates a convenient way of defining axes in order to better facilitate calculations.
-///------------------------------------------------------------------------
-class LightLikeAxis {
-
-public:
-   /// Bare constructor
-   LightLikeAxis() : _rap(0.0), _phi(0.0), _weight(0.0), _mom(0.0) {}
-   /// Constructor
-   LightLikeAxis(double my_rap, double my_phi, double my_weight, double my_mom) :
-   _rap(my_rap), _phi(my_phi), _weight(my_weight), _mom(my_mom) {}
-   
-   /// Rapidity
-   double rap() const {return _rap;}
-   /// Azimuth
-   double phi() const {return _phi;}
-   /// weight factor
-   double weight() const {return _weight;}
-   /// pt momentum
-   double mom() const {return _mom;}
-   
-   /// set rapidity
-   void set_rap(double my_set_rap) {_rap = my_set_rap;}
-   /// set azimuth
-   void set_phi(double my_set_phi) {_phi = my_set_phi;}
-   /// set weight factor
-   void set_weight(double my_set_weight) {_weight = my_set_weight;}
-   /// set pt momentum
-   void set_mom(double my_set_mom) {_mom = my_set_mom;}
-   /// set all kinematics
-   void reset(double my_rap, double my_phi, double my_weight, double my_mom) {_rap=my_rap; _phi=my_phi; _weight=my_weight; _mom=my_mom;}
-
-   /// Return PseudoJet version
-   fastjet::PseudoJet ConvertToPseudoJet();
-   
-   /// Squared distance to PseudoJet
-   double DistanceSq(const fastjet::PseudoJet& input) const {
-      return DistanceSq(input.rap(),input.phi());
-   }
-
-   /// Distance to PseudoJet
-   double Distance(const fastjet::PseudoJet& input) const {
-      return std::sqrt(DistanceSq(input));
-   }
-
-   /// Squared distance to Lightlikeaxis
-   double DistanceSq(const LightLikeAxis& input) const {
-      return DistanceSq(input.rap(),input.phi());
-   }
-
-   /// Distance to Lightlikeaxis
-   double Distance(const LightLikeAxis& input) const {
-      return std::sqrt(DistanceSq(input));
-   }
-
-private:
-   double _rap;    ///< rapidity
-   double _phi;    ///< azimuth
-   double _weight; ///< weight factor
-   double _mom;    ///< pt momentum
-   
-   /// Internal squared distance calculation
-   double DistanceSq(double rap2, double phi2) const {
-      double rap1 = _rap;
-      double phi1 = _phi;
-      
-      double distRap = rap1-rap2;
-      double distPhi = std::fabs(phi1-phi2);
-      if (distPhi > M_PI) {distPhi = 2.0*M_PI - distPhi;}
-      return distRap*distRap + distPhi*distPhi;
-   }
-   
-   /// Internal distance calculation
-   double Distance(double rap2, double phi2) const {
-      return std::sqrt(DistanceSq(rap2,phi2));
-   }
-      
-};
-   
-   
-////------------------------------------------------------------------------
-///// \class DeprecatedGeometricCutoffMeasure
-//// This class is the old, incorrectly coded geometric measure.
-//// It is kept in case anyone wants to check old code, but should not be used for production purposes.
-//class DeprecatedGeometricCutoffMeasure : public MeasureDefinition {
-//
-//public:
-//
-//   // Please, please don't use this.
-//   DeprecatedGeometricCutoffMeasure(double jet_beta, double Rcutoff)
-//   :   MeasureDefinition(),
-//      _jet_beta(jet_beta),
-//      _beam_beta(1.0), // This is hard coded, since alternative beta_beam values were never checked.
-//      _Rcutoff(Rcutoff),
-//      _RcutoffSq(sq(Rcutoff)) {
-//         setTauMode(UNNORMALIZED_EVENT_SHAPE);
-//         setAxisScaling(false);
-//         if (jet_beta != 2.0) {
-//         throw Error("Geometric minimization is currently only defined for beta = 2.0.");
-//      }
-//   }
-//
-//   virtual std::string description() const;
-//
-//   virtual DeprecatedGeometricCutoffMeasure* create() const {return new DeprecatedGeometricCutoffMeasure(*this);}
-//
-//   virtual double jet_distance_squared(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-//      fastjet::PseudoJet lightAxis = lightFrom(axis);
-//      double pseudoRsquared = 2.0*dot_product(lightFrom(axis),particle)/(lightAxis.pt()*particle.pt());
-//      return pseudoRsquared;
-//   }
-//
-//   virtual double beam_distance_squared(const fastjet::PseudoJet&  /*particle*/) const {
-//      return _RcutoffSq;
-//   }
-//
-//   virtual double jet_numerator(const fastjet::PseudoJet& particle, const fastjet::PseudoJet& axis) const {
-//      fastjet::PseudoJet lightAxis = lightFrom(axis);
-//      double weight = (_beam_beta == 1.0) ? 1.0 : std::pow(lightAxis.pt(),_beam_beta - 1.0);
-//      return particle.pt() * weight * std::pow(jet_distance_squared(particle,axis),_jet_beta/2.0);
-//   }
-//
-//   virtual double beam_numerator(const fastjet::PseudoJet& particle) const {
-//      double weight = (_beam_beta == 1.0) ? 1.0 : std::pow(particle.pt()/particle.e(),_beam_beta - 1.0);
-//      return particle.pt() * weight * std::pow(_Rcutoff,_jet_beta);
-//   }
-//
-//   virtual double denominator(const fastjet::PseudoJet&  /*particle*/) const {
-//      return std::numeric_limits<double>::quiet_NaN();
-//   }
-//
-//   virtual std::vector<fastjet::PseudoJet> get_one_pass_axes(int n_jets,
-//                                                             const std::vector<fastjet::PseudoJet>& inputs,
-//                                                             const std::vector<fastjet::PseudoJet>& seedAxes,
-//                                                             int nAttempts,    // cap number of iterations
-//                                                             double accuracy   // cap distance of closest approach
-//                                                            ) const;
-//
-//protected:
-//   double _jet_beta;
-//   double _beam_beta;
-//   double _Rcutoff;
-//   double _RcutoffSq;
-//
-//};
-//
-//// ------------------------------------------------------------------------
-//// / \class DeprecatedGeometricMeasure
-//// Same as DeprecatedGeometricMeasureCutoffMeasure, but with Rcutoff taken to infinity.
-//// NOTE:  This class should not be used for production purposes.
-//class DeprecatedGeometricMeasure : public DeprecatedGeometricCutoffMeasure {
-//
-//public:
-//   DeprecatedGeometricMeasure(double beta)
-//   : DeprecatedGeometricCutoffMeasure(beta,std::numeric_limits<double>::max()) {
-//      _RcutoffSq = std::numeric_limits<double>::max();
-//      setTauMode(UNNORMALIZED_JET_SHAPE);
-//   }
-//
-//   virtual std::string description() const;
-//
-//   virtual DeprecatedGeometricMeasure* create() const {return new DeprecatedGeometricMeasure(*this);}
-//};
-
-
-} //namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_MEASUREDEFINITION_HH__
Index: external/fastjet/contribs/Nsubjettiness/NEWS
===================================================================
--- external/fastjet/contribs/Nsubjettiness/NEWS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,101 +1,0 @@
--------------------------
-Version 2
--------------------------
-
-This is a streamlining of the N-subjettiness code, developed mainly by TJ
-Wilkason.  The core functionality is unchanged, but classes have been
-dramatically reorganized to allow for later expansion.  Because the API for
-Njettiness has changed, we have called this v2 (http://semver.org).
-
-Note that we have maintain backwards compatibility for the typical ways that
-Nsubjettiness was used.  In particular, all of the Nsubjettiness class code in
-the example file from v1.0.3 still compiles, as does the NjettinessPlugin class
-code that uses the default measure.
-
-The key new features are:
-
-  * NsubjettinessRatio:  Direct access to tau_N / tau_M (the most requested
-    feature)
-  * MeasureDefinition to allow access to normalized and unnormalized measures
-  * AxesDefinition to allow for access to more general axes modes
-  * Winner-Take-All recombination axes:  a faster way to find axes than beta=1
-    minimization, but with comparable performance.
-  * TauComponents to get access to the pieces of the N-(sub)jettiness
-    calculation.
-  * TauExtras to get complete access to get partitioning and axes information.
-  * For clarity, split the example file into an example_basic_usage and
-    example_advanced_usage (and example_advanced_usage_ee for e+e- collisions).
-  * In Nsubjettiness, access to seedAxes() and currentAxes() to figure out the
-    axes used before and after minimization.
-  * In Nsubjettiness, access to currentSubjets() to get the subjet fourvectors.
-  * (v2.2)  XConePlugin, which improves on the previous NjettinessPlugin to use
-    N-jettiness as a jet finder using the new ConicalGeometric measure.
-
--- 2.2.5:  (June 6, 2018) Fixed bug involved undefined pointer for in
-           AxesDefinition (thanks Attila Krasznahorkay)
--- 2.2.4:  (Jun 14, 2016) Fixed bug where multi-pass minimization could yield
-           pathological axes (thanks Gregory Soyez) 
--- 2.2.3:  (Apr 4, 2016) Fixed bug where a jet with fewer than N constituents
-           could give random value for tau_N (thanks Nathan Hartland)
--- 2.2.2:  (Mar 29, 2016)  Updating SharedPtr interface for FJ 3.2
--- 2.2.1:  (Sept 28, 2015)  Fix of small Makefile bug
--- 2.2.0:  (Sept 7, 2015)  Inclusion of the XCone jet algorithm, as well as a
-           few new measures, including the "conical geometric" measure and
-           options for e+e- colliders.  Improvement of the
-           Measure/AxesDefinition interface to allow for direct
-           use in calculations.
-           * Fixed bug where MultiPass_Axes did not actually minimize
-           * Fixed floating point error with infinity^2 in various measures
-
--- 2.1.0:  (July 9, 2014) Inclusion of Measure/AxesDefinition interface.
-           This was the first publicly available version of Nsubjettiness v2.
--- 2.0.0:  Initial release of v2.0.  This was never officially made public.
-
--------------------------
-Version 1
--------------------------
-
-This was a new release using FastJet contrib framework, primary developed by
-Jesse Thaler.
-
--- 1.0.3:  Added inlines to fix compile issue (thanks Matthew Low)
--- 1.0.2:  Fixed potential dependency issue (thanks FJ authors)
--- 1.0.1:  Fixed memory leak in Njettiness.hh (thanks FJ authors)
--- 1.0.0:  New release using FastJet contrib framework.  This includes a new
-makefile and a simplified example program.
-
--------------------------
-Previous Versions
--------------------------
-
-The previous versions of this code were developed initially by Ken Van Tilburg,
-tweaked by Jesse Thaler, and made into a robust FastJet add on by Chris
-Vermilion.
-
-Previous versions available from:
-   http://jthaler.net/jets/Njettiness-0.5.1.tar.gz (Experimental Version)
-   http://jthaler.net/jets/Njettiness-0.4.1.tar.gz (Stable Version)
-
-Previous version history:
--- 0.5.1:  For Njettiness Plugin, added access to currentTau values and axes via
-           ClusterSequence::Extras class.  (thanks to Dinko Ferencek and John
-           Paul Chou)
--- 0.5.0:  Corrected fatal error in ConstituentTauValue (TauValue unaffected).
-           Started process of allowing for more general measures and alternative
-           minimization schemes. Extremely preliminary inclusion of alternative
-           "geometric" measure.
--- 0.4.1:  Corrected bug where a too-small value of Rcut would cause the
-           minimization procedure to fail (thanks Marat Freytsis, Brian Shuve)
--- 0.4.0:  Adding Nsubjettiness FunctionOfPseudoJet<float>.  Re-organizing file
-           structure and doing some re-naming to clarify Njettiness vs.
-           Nsubjettiness.  Some speedup in UpdateAxes code. (CKV)
--- 0.3.2:  Returns zero instead of a segmentation fault when the number of
-           particles in a jet is smaller than the N value in tau_N (thanks
-           Grigory Ovanesyan)
--- 0.3.2:  Fixed -Wshadow errors (thanks Grigory Ovanesyan)
--- 0.3.1:  Fixed stray comma/semicolon compiler error (thanks Grigory Ovanesyan)
--- 0.3.1:  Corrected tarbomb issue (thanks Jonathan Walsh)
--- 0.3.1:  Added anti-kT seeds as option
--- 0.3.1:  Fixed bug in minimization code with R_cutoff (thanks Chris Vermilion)
--- 0.3.1:  Added getPartition() and getJets() functions as helper functions for
-           Chris Vermilion. (JT)
Index: external/fastjet/contribs/Nsubjettiness/Njettiness.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/Njettiness.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,223 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: Njettiness.cc 933 2016-04-04 22:23:32Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "Njettiness.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-
-///////
-//
-// Main Njettiness Class
-//
-///////
-
-LimitedWarning Njettiness::_old_measure_warning;
-LimitedWarning Njettiness::_old_axes_warning;
-
-   
-// Constructor
-Njettiness::Njettiness(const AxesDefinition & axes_def, const MeasureDefinition & measure_def)
-: _axes_def(axes_def.create()), _measure_def(measure_def.create()) {}
-   
-// setAxes for Manual mode
-void Njettiness::setAxes(const std::vector<fastjet::PseudoJet> & myAxes) {
-   if (_axes_def->needsManualAxes()) {
-      _currentAxes = myAxes;
-   } else {
-      throw Error("You can only use setAxes for manual AxesDefinitions");
-   }
-}
-   
-// Calculates and returns all TauComponents that user would want.
-// This information is stored in _current_tau_components for later access as well.
-TauComponents Njettiness::getTauComponents(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const {
-   if (inputJets.size() <= n_jets) {  //if not enough particles, return zero
-      _currentAxes = inputJets;
-      _currentAxes.resize(n_jets,fastjet::PseudoJet(0.0,0.0,0.0,0.0));
-     
-     // Put in empty tau components
-     std::vector<double> dummy_jet_pieces;
-     _current_tau_components = TauComponents(UNDEFINED_SHAPE,
-                                             dummy_jet_pieces,
-                                             0.0,
-                                             1.0,
-                                             _currentAxes,
-                                             _currentAxes
-                                             );
-      _seedAxes = _currentAxes;
-      _currentPartition = TauPartition(n_jets); // empty partition
-   } else {
-      assert(_axes_def); // this should never fail.
-      
-      if (_axes_def->needsManualAxes()) { // if manual mode
-         // take current axes as seeds
-         _seedAxes = _currentAxes;
-         
-         // refine axes if requested
-         _currentAxes = _axes_def->get_refined_axes(n_jets,inputJets,_seedAxes, _measure_def.get());
-      } else { // non-manual axes
-         
-          //set starting point for minimization
-         _seedAxes = _axes_def->get_starting_axes(n_jets,inputJets,_measure_def.get());
-         
-         // refine axes as needed
-         _currentAxes = _axes_def->get_refined_axes(n_jets,inputJets,_seedAxes, _measure_def.get());
-         
-         // NOTE:  The above two function calls are combined in "AxesDefinition::get_axes"
-         // but are separated here to allow seed axes to be stored.
-      }
-      
-      // Find and store partition
-      _currentPartition = _measure_def->get_partition(inputJets,_currentAxes);
-      
-      // Find and store tau value
-      _current_tau_components = _measure_def->component_result_from_partition(_currentPartition, _currentAxes);  // sets current Tau Values
-   }
-   return _current_tau_components;
-}
-   
-
-///////
-//
-// Below is code for backward compatibility to use the old interface.
-// May be deleted in a future version
-//
-///////
-   
-Njettiness::Njettiness(AxesMode axes_mode, const MeasureDefinition & measure_def)
-: _axes_def(createAxesDef(axes_mode)), _measure_def(measure_def.create()) {}
-
-// Convert from MeasureMode enum to MeasureDefinition
-// This returns a pointer that will be claimed by a SharedPtr
-MeasureDefinition* Njettiness::createMeasureDef(MeasureMode measure_mode, int num_para, double para1, double para2, double para3) const {
-   
-   _old_measure_warning.warn("Njettiness::createMeasureDef:  You are using the old MeasureMode way of specifying N-subjettiness measures.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use MeasureDefinition instead.");
-   
-   // definition of maximum Rcutoff for non-cutoff measures, changed later by other measures
-   double Rcutoff = std::numeric_limits<double>::max();  //large number
-   // Most (but not all) measures have some kind of beta value
-   double beta = std::numeric_limits<double>::quiet_NaN();
-   // The normalized measures have an R0 value.
-   double R0 = std::numeric_limits<double>::quiet_NaN();
-   
-   // Find the MeasureFunction and set the parameters.
-   switch (measure_mode) {
-      case normalized_measure:
-         beta = para1;
-         R0 = para2;
-         if(num_para == 2) {
-            return new NormalizedMeasure(beta,R0);
-         } else {
-            throw Error("normalized_measure needs 2 parameters (beta and R0)");
-         }
-         break;
-      case unnormalized_measure:
-         beta = para1;
-         if(num_para == 1) {
-            return new UnnormalizedMeasure(beta);
-         } else {
-            throw Error("unnormalized_measure needs 1 parameter (beta)");
-         }
-         break;
-      case geometric_measure:
-         throw Error("This class has been removed. Please use OriginalGeometricMeasure, ModifiedGeometricMeasure, or ConicalGeometricMeasure with the new Njettiness constructor.");
-         break;
-      case normalized_cutoff_measure:
-         beta = para1;
-         R0 = para2;
-         Rcutoff = para3; //Rcutoff parameter is 3rd parameter in normalized_cutoff_measure
-         if (num_para == 3) {
-            return new NormalizedCutoffMeasure(beta,R0,Rcutoff);
-         } else {
-            throw Error("normalized_cutoff_measure has 3 parameters (beta, R0, Rcutoff)");
-         }
-         break;
-      case unnormalized_cutoff_measure:
-         beta = para1;
-         Rcutoff = para2; //Rcutoff parameter is 2nd parameter in normalized_cutoff_measure
-         if (num_para == 2) {
-            return new UnnormalizedCutoffMeasure(beta,Rcutoff);
-         } else {
-            throw Error("unnormalized_cutoff_measure has 2 parameters (beta, Rcutoff)");
-         }
-         break;
-      case geometric_cutoff_measure:
-         throw Error("This class has been removed. Please use OriginalGeometricMeasure, ModifiedGeometricMeasure, or ConicalGeometricMeasure with the new Njettiness constructor.");
-      default:
-         assert(false);
-         break;
-   }
-   return NULL;
-}
-
-// Convert from AxesMode enum to AxesDefinition
-// This returns a pointer that will be claimed by a SharedPtr
-AxesDefinition* Njettiness::createAxesDef(Njettiness::AxesMode axes_mode) const {
-   
-   _old_axes_warning.warn("Njettiness::createAxesDef:  You are using the old AxesMode way of specifying N-subjettiness axes.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use AxesDefinition instead.");
-   
-   
-   switch (axes_mode) {
-      case wta_kt_axes:
-         return new WTA_KT_Axes();
-      case wta_ca_axes:
-         return new WTA_CA_Axes();
-      case kt_axes:
-         return new KT_Axes();
-      case ca_axes:
-         return new CA_Axes();
-      case antikt_0p2_axes:
-         return new AntiKT_Axes(0.2);
-      case onepass_wta_kt_axes:
-         return new OnePass_WTA_KT_Axes();
-      case onepass_wta_ca_axes:
-         return new OnePass_WTA_CA_Axes();
-      case onepass_kt_axes:
-         return new OnePass_KT_Axes();
-      case onepass_ca_axes:
-         return new OnePass_CA_Axes();
-      case onepass_antikt_0p2_axes:
-         return new OnePass_AntiKT_Axes(0.2);
-      case onepass_manual_axes:
-         return new OnePass_Manual_Axes();
-      case min_axes:
-         return new MultiPass_Axes(100);
-      case manual_axes:
-         return new Manual_Axes();
-      default:
-         assert(false);
-         return NULL;
-   }
-}
-
-
-   
-   
-   
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/Njettiness.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/Njettiness.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,265 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: Njettiness.hh 822 2015-06-15 23:52:57Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_NJETTINESS_HH__
-#define __FASTJET_CONTRIB_NJETTINESS_HH__
-
-
-#include "MeasureDefinition.hh"
-#include "AxesDefinition.hh"
-#include "TauComponents.hh"
-
-#include "fastjet/PseudoJet.hh"
-#include "fastjet/SharedPtr.hh"
-#include <fastjet/LimitedWarning.hh>
-
-#include <cmath>
-#include <vector>
-#include <list>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-/** \mainpage Nsubjettiness Documentation
- *
- * These Doxygen pages provide automatically generated documentation for the
- * Nsubjettiness FastJet contrib.  This documentation is being slowly improved.
- *
- * \section core_classes Core Classes
- *
- * - Nsubjettiness:  Calculating N-subjettiness jet shapes
- * - NsubjettinessRatio:  Calculating N-subjettiness ratios
- * - XConePlugin:  Running the XCone jet algorithm
- * - NjettinessPlugin:  Running generic N-jettiness as a jet algorithm
- *
- * \subsection core_classes_helper Helper Classes for Core
- * - Njettiness:  Core code for all N-(sub)jettiness calculations
- * - NjettinessExtras:  Way to access additional N-jettiness information
- * - TauComponents:  Output format for all N-(sub)jettiness information
- * - TauPartition:  Access to N-(sub)jettiness partitioning information
- * - PseudoXConePlugin:  Testing code to compare to XConePlugin (doesn't use one-pass minimization)
- *
- * \section axes_classes Axes Definitions
- *
- * \subsection axes_classes_base Base Classes
- * - AxesDefinition:  Defines generic axes definition
- * - ExclusiveJetAxes:  Axes finder from exclusive jet algorithm
- * - ExclusiveCombinatorialJetAxes:  Axes finder from exclusive jet algorithm (with extra axes to test combinatoric options)
- * - HardestJetAxes:  Axes finder from inclusive jet algorithm
- *
- * \subsection axes_classes_derived Derived Classes
- *
- * \b OnePass means iterative improvement to a (local) N-(sub)jettiness minimum.
- *
- * \b MultiPass means using multiple random seed inputs
- *
- * \b Comb means checking N + Nextra choose N combinatorial options
- *
- * - KT_Axes / OnePass_KT_Axes:  Axes from exclusive kT
- * - CA_Axes / OnePass_CA_Axes:  Axes from exclusive Cambridge/Aachen
- * - AntiKT_Axes / OnePass_AntiKT_Axes:  Axes from inclusive anti-kT
- * - WTA_KT_Axes / OnePass_WTA_KT_Axes:  Axes from exclusive kT, using winner-take-all recombination
- * - WTA_CA_Axes / OnePass_WTA_CA_Axes:  Axes from exclusive CA, using winner-take-all recombination
- *
- * - GenET_GenKT_Axes / OnePass_GenET_GenKT_Axes / Comb_GenET_GenKT_Axes:  Axes from exclusive generalized kt, with generalized Et recombination
- * - WTA_GenKT_Axes / OnePass_WTA_GenKT_Axes / Comb_WTA_GenKT_Axes:  Axes from exclusive generalized kt, with winner-take-all recombination
- *
- * - Manual_Axes / OnePass_Manual_Axes / MultiPass_Manual_Axes:  Use manual axes
- * - MultiPass_Axes:  Multiple passes with random input seeds
- *
- * \subsection axes_classes_helper Helper Classes for Axes
- * - GeneralEtSchemeRecombiner:  Generalized Et-scheme recombiner
- * - WinnerTakeAllRecombiner:  Winner-take-all recombiner (similar functionality now in FastJet 3.1)
- * - JetDefinitionWrapper:  Wrapper for Jet Definitions to handle memory management
- *
- * \section measure_classes Measure Definitions
- *
- * \subsection measure_classes_bases Base Classes
- * - MeasureDefinition:  Defines generic measures
- * - DefaultMeasure:  Base class for the original N-subjettiness measures
- *
- * \subsection measure_classes_derived Derived Classes
- * - NormalizedMeasure / UnnormalizedMeasure / NormalizedCutoffMeasure / UnnormalizedCutoffMeasure : Variants on the default N-subjettiness measure.
- * - ConicalMeasure: Similar to default measure, but intended as N-jettiness event shape
- * - ConicalGeometricMeasure / XConeMeasure:  Measure used in XCone jet algorithm
- * - OriginalGeometricMeasure / ModifiedGeometricMeasure:  Dot product measures useful for theoretical calcualtions
- *
- * \subsection measure_classes_helper Helper Classes for Measures
- * - LightLikeAxis : Defines light-like axis
- */
-
-///////
-//
-// Main Njettiness Class
-//
-///////
-
-///------------------------------------------------------------------------
-/// \class Njettiness
-/// \brief Core class for N-(sub)jettiness calculations
-///
-/**
- * The N-jettiness event shape.
- *
- * This is the core class used to perform N-jettiness jet finding (via NjettinessPlugin or XConePluggin)
- * as well as find the N-subjettiness jet shape (via Nsubjettiness).
- *
- * In general, the user should never need to call this object.  In addition, its API should not be considered
- * fixed, since all code improvements effectively happen from reorganizing this class.
- *
- * Njettiness uses AxesDefinition and MeasureDefinition together in order to find tau_N for the event.
- * It also can return information about the axes and jets it used in the calculation, as well as
- * information about how the event was partitioned.
- */
-class Njettiness {
-public:
-   
-   /// Main constructor that uses AxesMode and MeasureDefinition to specify measure
-   /// Unlike Nsubjettiness or NjettinessPlugin, the value N is not chosen
-   Njettiness(const AxesDefinition & axes_def, const MeasureDefinition & measure_def);
-
-   /// Destructor
-   ~Njettiness() {};
-   
-   /// setAxes for Manual mode
-   void setAxes(const std::vector<fastjet::PseudoJet> & myAxes);
-   
-   /// Calculates and returns all TauComponents that user would want.
-   /// This information is stored in _current_tau_components for later access as well.
-   TauComponents getTauComponents(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const;
-
-   /// Calculates the value of N-subjettiness,
-   /// but only returns the tau value from _current_tau_components
-   double getTau(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const {
-      return getTauComponents(n_jets, inputJets).tau();
-   }
-
-   /// Return all relevant information about tau components
-   TauComponents currentTauComponents() const {return _current_tau_components;}
-   /// Return axes found by getTauComponents.
-   std::vector<fastjet::PseudoJet> currentAxes() const { return _currentAxes;}
-   /// Return seedAxes used if onepass minimization (otherwise, same as currentAxes)
-   std::vector<fastjet::PseudoJet> seedAxes() const { return _seedAxes;}
-   /// Return jet partition found by getTauComponents.
-   std::vector<fastjet::PseudoJet> currentJets() const {return _currentPartition.jets();}
-   /// Return beam partition found by getTauComponents.
-   fastjet::PseudoJet currentBeam() const {return _currentPartition.beam();}
-   /// Return beam partition found by getTauComponents.
-   TauPartition currentPartition() const {return _currentPartition;}
-   
-
-private:
-   
-   /// AxesDefinition to use.  Implemented as SharedPtrs to avoid memory management headaches
-   SharedPtr<const AxesDefinition> _axes_def;
-   /// MeasureDefinition to use.  Implemented as SharedPtrs to avoid memory management headaches
-   SharedPtr<const MeasureDefinition> _measure_def;
-
-   
-   // Information about the current information
-   // Defined as mutables, so user should be aware that these change when getTau is called.
-   // TODO:  These are not thread safe and should be fixed somehow
-   mutable TauComponents _current_tau_components; //automatically set to have components of 0; these values will be set by the getTau function call
-   mutable std::vector<fastjet::PseudoJet> _currentAxes; //axes found after minimization
-   mutable std::vector<fastjet::PseudoJet> _seedAxes; // axes used prior to minimization (if applicable)
-   mutable TauPartition _currentPartition; //partitioning information
-
-   /// Warning if the user tries to use v1.0.3 measure style.
-   static LimitedWarning _old_measure_warning;
-   /// Warning if the user tries to use v1.0.3 axes style.
-   static LimitedWarning _old_axes_warning;
-
-   
-public:
-   
-   // These interfaces are included for backwards compability, and will be deprecated in a future release (scheduled for deletion in v3.0)
-   
-   /// \deprecated
-   /// Deprecated enum to determine axes mode
-   /// The various axes choices available to the user
-   /// It is recommended to use AxesDefinition instead of these.
-   enum AxesMode {
-      kt_axes,             // exclusive kt axes
-      ca_axes,             // exclusive ca axes
-      antikt_0p2_axes,     // inclusive hardest axes with antikt-0.2
-      wta_kt_axes,         // Winner Take All axes with kt
-      wta_ca_axes,         // Winner Take All axes with CA
-      onepass_kt_axes,     // one-pass minimization from kt starting point
-      onepass_ca_axes,     // one-pass minimization from ca starting point
-      onepass_antikt_0p2_axes,  // one-pass minimization from antikt-0.2 starting point
-      onepass_wta_kt_axes, //one-pass minimization of WTA axes with kt
-      onepass_wta_ca_axes, //one-pass minimization of WTA axes with ca
-      min_axes,            // axes that minimize N-subjettiness (100 passes by default)
-      manual_axes,         // set your own axes with setAxes()
-      onepass_manual_axes  // one-pass minimization from manual starting point
-   };
-   
-   /// \deprecated
-   /// Deprecated enum to determine measure mode
-   /// The measures available to the user.
-   /// "normalized_cutoff_measure" was the default in v1.0 of Nsubjettiness
-   /// "unnormalized_measure" is now the recommended default usage
-   /// But it is recommended to use MeasureDefinition instead of these.
-   enum MeasureMode {
-      normalized_measure,           //default normalized measure
-      unnormalized_measure,         //default unnormalized measure
-      geometric_measure,            //geometric measure
-      normalized_cutoff_measure,    //default normalized measure with explicit Rcutoff
-      unnormalized_cutoff_measure,  //default unnormalized measure with explicit Rcutoff
-      geometric_cutoff_measure      //geometric measure with explicit Rcutoff
-   };
-   
-   /// \deprecated
-   /// Intermediate constructor (needed to enable v1.0.3 backwards compatibility?)
-   Njettiness(AxesMode axes_mode, const MeasureDefinition & measure_def);
-   
-   /// \deprecated
-   /// Old-style constructor which takes axes/measure information as enums with measure parameters
-   /// This version absolutely is not recommended
-   Njettiness(AxesMode axes_mode,
-              MeasureMode measure_mode,
-              int num_para,
-              double para1 = std::numeric_limits<double>::quiet_NaN(),
-              double para2 = std::numeric_limits<double>::quiet_NaN(),
-              double para3 = std::numeric_limits<double>::quiet_NaN())
-   : _axes_def(createAxesDef(axes_mode)), _measure_def(createMeasureDef(measure_mode, num_para, para1, para2, para3)) {
-   }
-  
-   /// \deprecated
-   /// Convert old style enums into new style MeasureDefinition
-   AxesDefinition* createAxesDef(AxesMode axes_mode) const;
-   
-   /// \deprecated
-   /// Convert old style enums into new style MeasureDefinition
-   MeasureDefinition* createMeasureDef(MeasureMode measure_mode, int num_para, double para1, double para2, double para3) const;
-
-};
-   
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_NJETTINESS_HH__
-
Index: external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,96 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: NjettinessPlugin.cc 821 2015-06-15 18:50:53Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "NjettinessPlugin.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-LimitedWarning NjettinessPlugin::_old_constructor_warning;
-
-std::string NjettinessPlugin::description() const {return "N-jettiness jet finder";}
-
-
-// Clusters the particles according to the Njettiness jet algorithm
-// Apologies for the complication with this code, but we need to make
-// a fake jet clustering tree.  The partitioning is done by getPartitionList
-void NjettinessPlugin::run_clustering(ClusterSequence& cs) const
-{
-   std::vector<fastjet::PseudoJet> particles = cs.jets();
-
-   // HACK: remove area information from particles (in case this is called by
-   // a ClusterSequenceArea.  Will be fixed in a future FastJet release)
-   for (unsigned i = 0; i < particles.size(); i++) {
-      particles[i].set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>());
-   }
-   
-   
-   TauComponents tau_components = _njettinessFinder.getTauComponents(_N, particles);
-   TauPartition tau_partition = _njettinessFinder.currentPartition();
-   std::vector<std::list<int> > partition = tau_partition.jets_list();
-   
-   std::vector<int> jet_indices_for_extras;
-
-   // output clusterings for each jet
-   for (size_t i0 = 0; i0 < partition.size(); ++i0) {
-      size_t i = partition.size() - 1 - i0; // reversed order of reading to match axes order
-      std::list<int>& indices = partition[i];
-      if (indices.size() == 0) continue;
-      while (indices.size() > 1) {
-         int merge_i = indices.back(); indices.pop_back();
-         int merge_j = indices.back(); indices.pop_back();
-         int newIndex;
-         double fakeDij = -1.0;
-      
-         cs.plugin_record_ij_recombination(merge_i, merge_j, fakeDij, newIndex);
-
-         indices.push_back(newIndex);
-      }
-      double fakeDib = -1.0;
-      
-      int finalJet = indices.back();
-      cs.plugin_record_iB_recombination(finalJet, fakeDib);
-      jet_indices_for_extras.push_back(cs.jets()[finalJet].cluster_hist_index());  // Get the four vector for the final jets to compare later.
-   }
-
-   //HACK:  Re-reverse order of reading to match CS order
-   reverse(jet_indices_for_extras.begin(),jet_indices_for_extras.end());
-
-   // Store extra information about jets 
-   NjettinessExtras * extras = new NjettinessExtras(tau_components,jet_indices_for_extras);
-
-#if FASTJET_VERSION_NUMBER>=30100
-   cs.plugin_associate_extras(extras);
-#else
-   // auto_ptr no longer supported, apparently
-   cs.plugin_associate_extras(std::auto_ptr<ClusterSequence::Extras>(extras));
-#endif
-  
-}
-
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,181 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: NjettinessPlugin.hh 822 2015-06-15 23:52:57Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_NJETTINESSPLUGIN_HH__
-#define __FASTJET_CONTRIB_NJETTINESSPLUGIN_HH__
-
-#include <fastjet/config.h>
-
-#include "Njettiness.hh"
-#include "MeasureDefinition.hh"
-#include "AxesDefinition.hh"
-#include "TauComponents.hh"
-
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/JetDefinition.hh"
-
-#include <string>
-#include <climits>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-namespace contrib {
-
-
-/// \class NjettinessPlugin
-/// \brief Implements the N-jettiness Jet Algorithm
-/**
- * An exclusive jet finder that identifies N jets; first N axes are found, then
- * particles are assigned to the nearest (DeltaR) axis and for each axis the
- * corresponding jet is simply the four-momentum sum of these particles.
- *
- * As of version 2.2, it is recommended to use the XConePlugin, which has
- * sensible default values for jet finding.
- *
- * Axes can be found in several ways, specified by the AxesDefinition argument.
- * The recommended AxesDefinitions for jet finding (different than for jet shapes)
- *    OnePass_AntiKT(R0)  :  one-pass minimization from anti-kT starting point
- *    OnePass_GenET_GenKT_Axes(delta, p, R0) : one-pass min. from GenET/KT
- *    OnePass_WTA_GenKT_Axes(p, R0)          : one-pass min from WTA/GenKT
- * For recommendations on which axes to use, please see the README file.
- * 
- * Jet regions are determined by the MeasureDefinition.  The recommended choices
- * for jet finding are
- *    ConicalMeasure(beta,R0) : perfect cones in rapidity/azimuth plane
- *    XConeMeasure(beta,R0)   : approximate cones based on dot product distances.
- *
- * Other measures introduced in version 2.2 include OriginalGeometricMeasure,
- * ModifiedGeometricMeasure, and ConicalGeometricMeasure, which define N-jettiness
- * through dot products of particle momenta with light-like axes. OriginalGeometricMeasure
- * produces football-shaped jets due to its central weighting of the beam measure,
- * but ModifiedGeometric and ConicalGeometric both deform the original geometric measure
- * to allow for cone-shaped jets. The size of these cones can be controlled through Rcutoff
- * just as in the other measures. See the README file or MeasureDefinition.hh for information
- * on how to call these measures.
- * 
- */
-class NjettinessPlugin : public JetDefinition::Plugin {
-public:
-
-   /// Constructor with same arguments as Nsubjettiness (N, AxesDefinition, MeasureDefinition)
-   NjettinessPlugin(int N,
-                    const AxesDefinition & axes_def,
-                    const MeasureDefinition & measure_def)
-   : _njettinessFinder(axes_def, measure_def), _N(N) {}
-   
-
-   /// Description
-   virtual std::string description () const;
-   /// Jet radius (this does not make sense yet)
-   virtual double R() const {return -1.0;} // TODO: make this not stupid
-
-   /// The actually clustering, which first called Njettiness and then creates a dummy ClusterSequence
-   virtual void run_clustering(ClusterSequence&) const;
-
-   /// For using manual axes with Njettiness Plugin
-   void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) {
-      // Cross check that manual axes are being used is in Njettiness
-      _njettinessFinder.setAxes(myAxes);
-   }
-
-   /// Destructor
-   virtual ~NjettinessPlugin() {}
-
-private:
-
-   Njettiness _njettinessFinder;  ///< The core Njettiness that does the heavy lifting
-   int _N;  ///< Number of exclusive jets to find.
-
-   /// Warning if the user tries to use v1.0.3 constructor.
-   static LimitedWarning _old_constructor_warning;
-   
-public:
-
-   // Alternative constructors that define the measure via enums and parameters
-   // These constructors are deprecated and will be removed in a future version.
-   
-   /// \deprecated
-   /// Old-style constructor with 0 arguments (DEPRECATED)
-   NjettinessPlugin(int N,
-                    Njettiness::AxesMode axes_mode,
-                    Njettiness::MeasureMode measure_mode)
-   : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {
-      _old_constructor_warning.warn("NjettinessPlugin:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-   /// \deprecated
-   /// Old-style constructor with 1 argument (DEPRECATED)
-      NjettinessPlugin(int N,
-                    Njettiness::AxesMode axes_mode,
-                    Njettiness::MeasureMode measure_mode,
-                    double para1)
-   : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {
-      _old_constructor_warning.warn("NjettinessPlugin:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead.");
-   
-   }
-   
-   /// \deprecated
-   /// Old-style constructor with 2 arguments (DEPRECATED)
-   NjettinessPlugin(int N,
-                    Njettiness::AxesMode axes_mode,
-                    Njettiness::MeasureMode measure_mode,
-                    double para1,
-                    double para2)
-   : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) {
-      _old_constructor_warning.warn("NjettinessPlugin:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead.");
-   
-   }
-   
-   /// \deprecated
-   /// Old-style constructor with 3 arguments (DEPRECATED)
-   NjettinessPlugin(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_warning.warn("NjettinessPlugin:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-   /// \deprecated
-   /// Old-style constructor for backwards compatibility with v1.0, when NormalizedCutoffMeasure was the only option
-   NjettinessPlugin(int N,
-                    Njettiness::AxesMode mode,
-                    double beta,
-                    double R0,
-                    double Rcutoff=std::numeric_limits<double>::max())
-   : _njettinessFinder(mode, NormalizedCutoffMeasure(beta, R0, Rcutoff)), _N(N) {
-      _old_constructor_warning.warn("NjettinessPlugin:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-
-
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_NJETTINESSPLUGIN_HH__
Index: external/fastjet/contribs/Nsubjettiness/Nsubjettiness.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/Nsubjettiness.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,54 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: Nsubjettiness.cc 821 2015-06-15 18:50:53Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "Nsubjettiness.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-LimitedWarning Nsubjettiness::_old_constructor_warning;
-   
-   
-//result returns tau_N with normalization dependent on what is specified in constructor
-double Nsubjettiness::result(const PseudoJet& jet) const {
-   std::vector<fastjet::PseudoJet> particles = jet.constituents();
-   return _njettinessFinder.getTau(_N, particles);
-}
-
-TauComponents Nsubjettiness::component_result(const PseudoJet& jet) const {
-   std::vector<fastjet::PseudoJet> particles = jet.constituents();
-   return _njettinessFinder.getTauComponents(_N, particles);
-}
-
-//ratio result uses Nsubjettiness result to find the ratio tau_N/tau_M, where N and M are specified by user
-double NsubjettinessRatio::result(const PseudoJet& jet) const {
-   double numerator = _nsub_numerator.result(jet);
-   double denominator = _nsub_denominator.result(jet);
-   return numerator/denominator;
-}
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,301 +1,0 @@
-// Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: Nsubjettiness.hh 822 2015-06-15 23:52:57Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_NSUBJETTINESS_HH__
-#define __FASTJET_CONTRIB_NSUBJETTINESS_HH__
-
-#include <fastjet/internal/base.hh>
-
-#include "Njettiness.hh"
-
-#include "fastjet/FunctionOfPseudoJet.hh"
-#include <string>
-#include <climits>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-// Classes defined in this file.
-class Nsubjettiness;
-class NsubjettinessRatio;
-   
-///------------------------------------------------------------------------
-/// \class Nsubjettiness
-/// \brief Implements the N-subjettiness jet shape
-///
-/**
- * The N-jettiness jet shape.
- *
- * Nsubjettiness extends the concept of Njettiness to a jet shape, but other
- * than the set of particles considered, they are identical.  This class
- * wraps the core Njettiness code to provide the fastjet::FunctionOfPseudoJet
- * interface for convenience in larger analyses.
- *
- * The recommended AxesDefinitions are:
- *   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
- * More AxesDefinitions are listed in the README and defined in AxesDefinition.hh
- *
- * The recommended MeasureDefinitions 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
- * More MeasureDefinitions are listed in the README and defined in MeasureDefinition.hh
- *
- * For example, for the UnnormalizedMeasure(beta), N-subjettiness is defined as:
- *
- * tau_N = Sum_{i in jet} p_T^i min((DR_i1)^beta, (DR_i2)^beta, ...)
- *
- *   DR_ij is the distance sqrt(Delta_phi^2 + Delta_rap^2) between particle i
- *   and jet j.
- *
- * The NormalizedMeausure include an extra parameter R0, and the various cutoff
- * measures include an Rcutoff, which effectively defines an angular cutoff
- * similar in effect to a cone-jet radius.
- */
-class Nsubjettiness : public FunctionOfPseudoJet<double> {
-
-public:
-   
-   /// Main constructor, which takes N, the AxesDefinition, and the MeasureDefinition.
-   /// The Definitions are given in AxesDefinition.hh and MeasureDefinition.hh
-   Nsubjettiness(int N,
-                 const AxesDefinition& axes_def,
-                 const MeasureDefinition& measure_def)
-   : _njettinessFinder(axes_def,measure_def), _N(N) {}
-   
-   /// Returns tau_N, measured on the constituents of this jet
-   double result(const PseudoJet& jet) const;
-
-   /// Returns components of tau_N, so that user can find individual tau values.
-   TauComponents component_result(const PseudoJet& jet) const;
-   
-   /// To set axes in manual mode
-   void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) {
-      // Note that cross check that manual mode has been set is in Njettiness
-    	_njettinessFinder.setAxes(myAxes);
-   }
-   
-   /// returns seed axes used for onepass minimization (otherwise same as currentAxes)
-   std::vector<fastjet::PseudoJet> seedAxes() const {
-      return _njettinessFinder.seedAxes();
-   }
-   
-   /// returns current axes found by result() calculation
-   std::vector<fastjet::PseudoJet> currentAxes() const {
-      return _njettinessFinder.currentAxes();
-   }
-
-   /// 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();
-   }
-
-   /// returns components of tau_N without recalculating anything
-   TauPartition currentPartition() const {
-      return _njettinessFinder.currentPartition();
-   }
-   
-private:
-   
-   /// Core Njettiness code that is called
-   Njettiness _njettinessFinder; // TODO:  should muck with this so result can be const without this mutable
-   /// Number of subjets to find
-   int _N;
-   
-   /// Warning if the user tries to use v1.0.3 constructor.
-   static LimitedWarning _old_constructor_warning;
-
-public:
-   
-   // The following interfaces are included for backwards compatibility, but no longer recommended.
-   // They may be deleted in a future release
-   
-   /// \deprecated
-   /// Alternative constructors that define the measure via enums and parameters
-   /// These constructors will be removed in v3.0
-   /// 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) {
-      _old_constructor_warning.warn("Nsubjettiness:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-   /// \deprecated
-   /// Construcotr for one parameter argument
-   /// (for unnormalized_measure, para1=beta)
-   Nsubjettiness(int N,
-                 Njettiness::AxesMode axes_mode,
-                 Njettiness::MeasureMode measure_mode,
-                 double para1)
-   : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {
-      _old_constructor_warning.warn("Nsubjettiness:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-   /// \deprecated
-   /// Constructor for 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) {
-      _old_constructor_warning.warn("Nsubjettiness:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-   /// \deprecated
-   /// Constructor for 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_warning.warn("Nsubjettiness:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-   /// \deprecated
-   /// Old constructor for backwards compatibility with v1.0,
-   /// where normalized_cutoff_measure was the only option
-   Nsubjettiness(int N,
-                 Njettiness::AxesMode axes_mode,
-                 double beta,
-                 double R0,
-                 double Rcutoff=std::numeric_limits<double>::max())
-   : _njettinessFinder(axes_mode, NormalizedCutoffMeasure(beta,R0,Rcutoff)), _N(N) {
-      _old_constructor_warning.warn("Nsubjettiness:  You are using the old style constructor.  This is deprecated as of v2.1 and will be removed in v3.0.  Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead.");
-   }
-   
-};
-
-
-///------------------------------------------------------------------------
-/// \class NsubjettinessRatio
-/// \brief Implements ratios of N-subjettiness jet shapes
-///
-/// NsubjettinessRatio uses the results from Nsubjettiness to calculate the ratio
-/// tau_N/tau_M, where N and M are specified by the user. The ratio of different tau values
-/// is often used in analyses, so this class is helpful to streamline code.  Note that
-/// manual axis mode is not supported
-class NsubjettinessRatio : public FunctionOfPseudoJet<double> {
-public:
-
-   /// Main constructor.  Apart from specifying both N and M, the same options as Nsubjettiness
-   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) {
-      if (axes_def.needsManualAxes()) {
-         throw Error("NsubjettinessRatio does not support ManualAxes mode.");
-      }
-   }
-
-   /// Returns tau_N/tau_M based off the input jet using result function from Nsubjettiness
-   double result(const PseudoJet& jet) const;
-
-private: 
-
-   Nsubjettiness _nsub_numerator;   ///< Function for numerator
-   Nsubjettiness _nsub_denominator; ///< Function for denominator
-
-public:
-   
-   // The following interfaces are included for backwards compatibility, but no longer recommended.
-   // They may be deprecated at some point.
-   
-   /// \deprecated
-   /// Old-style constructor for zero arguments
-   /// 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) {}
-   
-   /// \deprecated
-   /// Old-style constructor for one argument
-   NsubjettinessRatio(int N,
-                      int M,
-                      Njettiness::AxesMode axes_mode,
-                      Njettiness::MeasureMode measure_mode,
-                      double para1)
-   : _nsub_numerator(N, axes_mode, measure_mode, para1),
-   _nsub_denominator(M, axes_mode, measure_mode, para1) {}
-   
-   /// \deprecated
-   /// Old-style constructor for 2 arguments
-   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) {}
-   
-   /// \deprecated
-   /// Old-style constructor for 3 arguments
-   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) {}
-
-   
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_NSUBJETTINESS_HH__
Index: external/fastjet/contribs/Nsubjettiness/README
===================================================================
--- external/fastjet/contribs/Nsubjettiness/README	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,394 +1,0 @@
---------------------------------------------------------------------------------
-Nsubjettiness Package
---------------------------------------------------------------------------------
-
-The Nsubjettiness package is based on the physics described in:
-
-   Identifying Boosted Objects with N-subjettiness.
-   Jesse Thaler and Ken Van Tilburg.
-   JHEP 1103:015 (2011), arXiv:1011.2268.
-
-   Maximizing Boosted Top Identification by Minimizing N-subjettiness. 
-   Jesse Thaler and Ken Van Tilburg. 
-   JHEP 1202:093 (2012), arXiv:1108.2701.
-
-New in v2.0 is the winner-take-all axis, which is described in:
-
-   Jet Observables Without Jet Algorithms. 
-   Daniele Bertolini, Tucker Chan, and Jesse Thaler. 
-   JHEP 1404:013 (2014), arXiv:1310.7584.
-
-   Jet Shapes with the Broadening Axis. 
-   Andrew J. Larkoski, Duff Neill, and Jesse Thaler. 
-   JHEP 1404:017 (2014), arXiv:1401.2158.
-
-   Unpublished work by Gavin Salam
-
-New in v2.2 are new measures used in the XCone jet algorithm, described in:
-
-   XCone: N-jettiness as an Exclusive Cone Jet Algorithm.
-   Iain W. Stewart, Frank J. Tackmann, Jesse Thaler,
-   Christopher K. Vermilion, and Thomas F. Wilkason.
-   arXiv:1508.01516.
-
-   Resolving Boosted Jets with XCone.
-   Jesse Thaler and Thomas F. Wilkason.
-   arXiv:1508.01518.
-
---------------------------------------------------------------------------------
-Core Classes
---------------------------------------------------------------------------------
-
-There are various ways to access N-(sub)jettiness variables, described
-in more detail below:
-
-Nsubjettiness       [Nsubjettiness.hh]:
-   A FunctionOfPseudoJet<double> interface to measure the
-   N-subjettiness jet shape
-   (Recommended for most users)
-
-NsubjettinessRatio  [Nsubjettiness.hh]:
-   A FunctionOfPseudoJet<double> interface to measure ratios of
-   two different N-subjettiness (i.e. tau3/tau2)
-   (Recommended for most users)
-
-XConePlugin         [XConePlugin.hh]:
-   A FastJet plugin for using the XCone jet algorithm.
-   (Recommended for most users)
-
-NjettinessPlugin    [NjettinessPlugin.hh]:
-   A FastJet plugin for finding jets by minimizing N-jettiness.
-   Same basic philosophy as XCone, but many more options.
-   (Recommended for advanced users only.)
-
-Njettiness          [Njettiness.hh]:
-   Access to the core Njettiness code.
-   (Not recommended for users, since the interface might change)
-
-The code assumes that you have FastJet 3, but does not (yet) require FastJet 3.1
-
---------------------------------------------------------------------------------
-Basic Usage: Nsubjettiness and NsubjettinessRatio  [Nsubjettiness.hh]
---------------------------------------------------------------------------------
-
-Most users will only need to use the Nsubjettiness class.  The basic
-functionality is given by:
-
-   Nsubjettiness nSub(N, AxesDefinition, MeasureDefinition)
-   // N specifies the number of (sub) jets to measure
-   // AxesDefinition is WTA_KT_Axes, OnePass_KT_Axes, etc.
-   // MeasureDefinition is UnnormalizedMeasure(beta),
-   //                      NormalizedMeasure(beta,R0), etc.
-      
-   // get tau value
-   double tauN = nSub.result(PseudoJet);
-
-Also available are ratios of N-subjettiness values
-    NsubjettinessRatio nSubRatio(N, M, AxesDefinition,
-                                 MeasureDefinition)
-    // N and M give tau_N / tau_M, all other options the same
-
-For example, if you just want the tau_2/tau_1 value of a jet, using recommended
-parameter choices, do this:
-
-    PseudoJet this_jet = /*from your favorite jet algorithm*/;
-    double beta = 1.0;
-    NsubjettinessRatio nSub21(2,1,
-                              OnePass_WTA_KT_Axes(),
-                              UnnormalizedMeasure(beta));
-    double tau21 = nSub21(this_jet);
-
---------------------------------------------------------------------------------
-AxesDefinition  [NjettinessDefinition.hh]
---------------------------------------------------------------------------------
-
-N-(sub)jettiness requires choosing axes as well as a measure (see below). There
-are a number of axes choices available to the user, though modes with a (*) are
-recommended. Arguments in parentheses are parameters that the user must set.
-
-Axes can be found using standard recursive clustering procedures.  New in v2 is
-the option to use the "winner-take-all" recombination scheme:
-(*) KT_Axes          // exclusive kt axes
-    CA_Axes          // exclusive ca axes
-    AntiKT_Axes(R0)  // inclusive hardest axes with antikt, R0 = radius
-(*) WTA_KT_Axes      // exclusive kt with winner-take-all recombination
-    WTA_CA_Axes      // exclusive ca with winner-take-all recombination
-
-New in v2.2 are generalized recombination/clustering schemes:
-    GenET_GenKT_Axes(delta, p, R0 = inf)
-    WTA_GenKT_Axes(p, R0 = inf)
-    GenKT_Axes(p, R0 = inf)
-Here, delta > 0 labels the generalized ET recombination scheme (delta = 1 for
-standard ET scheme, delta = 2 for ET^2 scheme, delta = infinity for WTA scheme)
-p >= 0 labels the generalized KT clustering metric (p = 0 for ca, p = 1 for kt),
-R0 is the radius parameter, and the clustering is run in exclusive mode.  The
-GenKT_Axes mode uses standard E-scheme recombination.  By default the value of
-R0 is set to "infinity", namely fastjet::JetDefinition::max_allowable_R.
-
-Also new in v2.2 is option of identifying nExtra axes through exclusive
-clustering and then looking at all (N + nExtra) choose N axes and finding the 
-one that gives the smallest N-(sub)jettiness value:
-    Comb_GenET_GenKT_Axes(nExtra, delta, p, R0 = inf)
-    Comb_WTA_GenKT_Axes(nExtra, p, R0 = inf)
-    Comb_GenKT_Axes(nExtra, p, R0 = inf)
-These modes are not recommended for reasons of speed.
-
-Starting from any set of seed axes, one can run a minimization routine to find
-a (local) minimum of N-(sub)jettiness.  Note that the one-pass minimization
-routine is tied to the choice of MeasureDefinition.
-(*) OnePass_KT_Axes          // one-pass minimization from kt starting point
-    OnePass_CA_Axes          // one-pass min. from ca starting point
-    OnePass_AntiKT(R0)       // one-pass min. from antikt starting point,R0=rad
-(*) OnePass_WTA_KT_Axes      // one-pass min. from wta_kt starting point
-    OnePass_WTA_CA_Axes      // one-pass min. from wta_ca starting point
-    OnePass_GenET_GenKT_Axes(delta, p, R0 = inf) // one-pass min. from GenET/KT
-    OnePass_WTA_GenKT_Axes(p, R0 = inf)          // one-pass min from WTA/GenKT
-    OnePass_GenKT_Axes(p, R0 = inf)              // one-pass min from GenKT
-
-For one-pass minimization, OnePass_CA_Axes and OnePass_WTA_CA_Axes are not
-recommended as they provide a poor choice of seed axes.
-
-In general, it is difficult to find the global minimum, but this mode attempts
-to do so:
-    MultiPass_Axes(NPass) // axes that (attempt to) minimize N-subjettiness
-                          // (NPass = 100 is typical)
-This does multi-pass minimization from KT_Axes starting points.
-
-Finally, one can set manual axes:
-    Manual_Axes              // set your own axes with setAxes()
-    OnePass_Manual_Axes      // one-pass minimization from manual starting point
-    MultiPass_Manual_Axes(Npass) // multi-pass min. from manual
-
-If one wants to change the number of passes used by any of the axes finders, one
-can call the function
-    setNPass(NPass,nAttempts,accuracy,noise_range)
-where NPass = 0 only uses the seed axes, NPass = 1 is one-pass minimization, and
-NPass = 100 is the default multi-pass.  nAttempts is the number of iterations to
-use in each pass, accuracy is how close to the minimum one tries to get, and
-noise_range is how much in rapidity/azimuth the random axes are jiggled.
-
-For most cases, running with OnePass_KT_Axes or OnePass_WTA_KT_Axes gives
-reasonable results (and the results are IRC safe).  Because it uses random
-number seeds, MultiPass_Axes is not IRC safe (and the code is rather slow).
-Note that for the minimization routines, beta = 1.1 is faster than beta = 1,
-with comparable performance.
-
---------------------------------------------------------------------------------
-MeasureDefinition  [NjettinessDefinition.hh]
---------------------------------------------------------------------------------
-
-The value of N-(sub)jettiness depends crucially on the choice of measure.  Each
-measure has a different number of parameters, so one has to be careful when
-switching between measures  The one indicated by (*) is the one recommended for
-use by users new to Nsubjettiness.
-
-The original N-subjettiness measures are:
-    NormalizedMeasure(beta,R0)  //default normalized measure with
-                                //parameters beta and R0 (dimensionless)
-(*) UnnormalizedMeasure(beta)   //default unnormalized measure with just
-                                //parameter beta (dimensionful)
-
-There are also measures that incorporate a radial cutoff:
-    NormalizedCutoffMeasure(beta,R0,Rcutoff) //normalized measure with
-                                             //additional Rcutoff
-    UnnormalizedCutoffMeasure(beta,Rcutoff)  //unnormalized measure with
-                                             //additional Rcutoff
-                                             
-For all of the above measures, there is an optional argument to change from the
-ordinary pt_R distance measure recommended for pp collisions to an 
-E_theta distance measure recommended for ee collisions.  There are also
-lorentz_dot and perp_lorentz_dot distance measures recommended only for
-advanced users.
-
-New for v2.2 is a set of measures defined in arXiv:1508.01516.  First, there is
-the "conical measure":
-
-    ConicalMeasure(beta,R0) // same jets as UnnormalizedCutoffMeasure
-                            // but differs in normalization and specifics
-                            // of one-pass minimization
-
-Next, there is the geometric measure (as well as a modified version to yield
-more conical jet regions):
-
-    OriginalGeometricMeasure(R) // not recommended for analysis
-    ModifiedGeometricMeasure(R)
-
-(Prior to v2.2, there was a "GeometricMeasure" which unfortunately had the wrong
-definition.  These have been commented out in the code as
-"DeprecatedGeometricMeasure" and "DeprecatedGeometricCutoffMeasure", but they
-should not be used.)
-
-Next, there is a "conical geometric" measure:
-
-    ConicalGeometricMeasure(beta, gamma, Rcutoff)
-
-This is a hybrid between the conical and geometric measures and is the basis for
-the XCone jet algorithm.  Finally, setting to the gamma = 1 default gives the
-XCone default measure, which is used in the XConePlugin jet finder
-
-(*)  XConeMeasure(beta,Rcutoff)
-    
-where beta = 2 is the recommended default value and beta = 1 is the recoil-free
-default.
-
---------------------------------------------------------------------------------
-A note on beta dependence
---------------------------------------------------------------------------------
-
-The angular exponent in N-subjettiness is called beta.  The original
-N-subjettiness paper advocated beta = 1, but it is now understood that different
-beta values can be useful in different contexts.  The two main choices are:
-
-beta = 1:  aka broadening/girth/width measure
-   the axes behave like the "median" in that they point to the hardest cluster
-   wta_kt_axes are approximately the same as minimizing beta = 1 measure
-
-beta = 2:  aka thrust/mass measure
-   the axes behave like the "mean" in that they point along the jet momentum
-   kt_axes are approximately the same as minimizing beta = 2 measure
-
-N.B. The minimization routines are only valid for 1 < beta < 3.
-
-For quark/gluon discrimination with N = 1, beta~0.2 with wta_kt_axes appears
-to be a good choice. 
-
---------------------------------------------------------------------------------
-XConePlugin  [XConePlugin.hh]
---------------------------------------------------------------------------------
-
-The XCone FastJet plugin is an exclusive cone jet finder which yields a
-fixed N number of jets which approximately conical boundaries. The algorithm
-finds N axes, and jets are simply the sum of particles closest to a given axis
-(or unclustered if they are closest to the beam).  Unlike the NjettinessPlugin
-below, the user is restricted to using the XConeMeasure. 
-
-   XConePlugin plugin(N,R,beta=2);
-   JetDefinition def(&plugin);
-   ClusterSequence cs(vector<PseudoJet>,def);
-   vector<PseudoJet> jets = cs.inclusive_jets();
-
-Note that despite being an exclusive jet algorithm, one finds the jets using the
-inclusive_jets() call.
-
-The AxesDefinition and MeasureDefinition are defaulted in this measure to 
-OnePass_GenET_GenKT_Axes and XConeMeasure, respectively. The parameters chosen 
-for the OnePass_GenET_GenKT_Axes are defined according to the chosen value of
-beta as delta = 1/(beta - 1) and p = 1/beta. These have been shown to give the
-optimal choice of seed axes. The R value for finding the axes is chosen to be
-the same as the R for the jet algorithm, although in principle, these two radii
-could be different. 
-
-N.B.:  The order of the R, beta arguments is *reversed* from the XConeMeasure
-itself, since this ordering is the more natural one to use for Plugins.  We
-apologize in advance for any confusion this might cause.
-
---------------------------------------------------------------------------------
-Advanced Usage:  NjettinessPlugin  [NjettinessPlugin.hh]
---------------------------------------------------------------------------------
-
-Same as the XConePlugin, but the axes finding methods and measures are the same
-as for Nsubjettiness, allowing more flexibility.
-
-   NjettinessPlugin plugin(N, AxesDefinition, MeasureDefinition);
-   JetDefinition def(&plugin);
-   ClusterSequence cs(vector<PseudoJet>,def);
-   vector<PseudoJet> jets = cs.inclusive_jets();
-
---------------------------------------------------------------------------------
-Very Advanced Usage:  Njettiness  [Njettiness.hh]
---------------------------------------------------------------------------------
-
-Most users will want to use the Nsubjettiness or NjettinessPlugin classes to
-access N-(sub)jettiness information.  For direct access to the Njettiness class,
-one can use Njettiness.hh directly. This class is in constant evolution, so
-users who wish to extend its functionality should contact the authors first.
-
---------------------------------------------------------------------------------
-TauComponents  [MeasureDefinition.hh]
---------------------------------------------------------------------------------
-
-For most users, they will only need the value of N-subjettiness (i.e. tau)
-itself.  For advanced users, they can access individual tau components (i.e. 
-the individual numerator pieces, the denominator, etc.)  
-
-   TauComponents tauComp = nSub.component_result(jet);
-   vector<double> numer = tauComp.jet_pieces_numerator(); //tau for each subjet
-   double denom = tauComp.denominator();  //normalization factor
-
---------------------------------------------------------------------------------
-Extra Recombiners  [ExtraRecombiners.hh]
---------------------------------------------------------------------------------
-
-New in v2.0 are winner-take-all axes.  (These have now been included in 
-FastJet 3.1, but we have left the code here to allow the plugin to work under
-FJ 3.0).  These axes are found with the help of the WinnerTakeAllRecombiner.
-This class defines a new recombination scheme for clustering particles. This
-scheme recombines two PseudoJets into a PseudoJet with pT of the sum of the two
-input PseudoJet pTs and direction of the harder PseudoJet.  This is a
-"recoil-free" recombination scheme that guarantees that the axes is aligned with
-one of the input particles. It is IRC safe.  Axes found with the standard
-E-scheme recombiner at similar to the beta = 2 minimization, while
-winner-take-all is similar to the beta = 1 measure.
-
-New in v2.2 is the GeneralEtSchemeRecombiner, as defined in arxiv:1506.XXXX.
-This functions similarly to the Et-scheme defined in Fastjet, but the reweighting
-of the sum of rap and phi is parameterized by an exponent delta. Thus, delta = 1
-is the normal Et-scheme recombination, delta = 2 is Et^2 recombination, and
-delta = infinity is the winner-take-all recombination. This recombination scheme
-is used in GenET_GenKT_Axes, and we find that optimal seed axes for minimization
-can be found by using delta = 1/(beta - 1). 
-
-Note that the WinnerTakeAllRecombiner can be used outside of Nsubjettiness
-itself for jet finding.  For example, the direction of anti-kT jets found
-with the WinnerTakeAllRecombiner is particularly robust against soft jet
-contamination.  That said, this functionality is now included in FJ 3.1, so this
-code is likely to be deprecated in a future version.
-
---------------------------------------------------------------------------------
-Technical Details
---------------------------------------------------------------------------------
-
-In general, the user will never need access to these header files.  Here is a
-brief description about how they are used to help the calculation of
-N-(sub)jettiness:
-
-AxesDefinition.hh:
-
-The AxesDefinition class (and derived classes) defines the axes used in the
-calculation of N-(sub)jettiness.  These axes can be defined from the exclusive
-jets from a kT or CA algorithm, the hardest jets from an anti-kT algorithm,
-manually, or from minimization of N-jettiness.  In the future, the user will be
-able to write their own axes finder, though currently the interface is still
-evolving.  At the moment, the user should stick to the options allowed by
-AxesDefinition.
-
-MeasureDefinition.hh:
-
-The MeasureDefinition class (and derived classes) defines the measure by which
-N-(sub)jettiness is calculated. This measure is calculated between each
-particle and its corresponding axis, and then summed and normalized to
-produce N-(sub)jettiness. The default measure for this calculation is
-pT*dR^beta, where dR is the rapidity-azimuth distance between the particle
-and its axis, and beta is the angular exponent.  Again, in the future the user
-will be able to write their own measures, but for the time being, only the
-predefined MeasureDefinition values should be used.  Note that the one-pass
-minimization algorithms are defined within MeasureDefinition, since they are
-measure specific.
-
---------------------------------------------------------------------------------
-Known Issues
---------------------------------------------------------------------------------
-
--- The MultiPass_Axes mode gives different answers on different runs, since
-   random numbers are used.
--- For the default measures, in rare cases, one pass minimization can give a 
-   larger value of Njettiness than without minimization. The reason is due 
-   to the fact that axes in default measure are not defined as light-like
--- Nsubjettiness is not thread safe, since there are mutables in Njettiness.
--- If the AxesDefinition does not find N axes, then it adds zero vectors to the
-   list of axes to get the total up to N.  This can lead to unpredictable
-   results (including divide by zero issues), and a warning is thrown to alert
-   the user.
-
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Index: external/fastjet/contribs/Nsubjettiness/TauComponents.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/TauComponents.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,89 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: NjettinessDefinition.cc 704 2014-07-07 14:30:43Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "TauComponents.hh"
-#include "MeasureDefinition.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib {
-
-// This constructor takes input vector and double and calculates all necessary tau components
-TauComponents::TauComponents(TauMode tau_mode,
-              const std::vector<double> & jet_pieces_numerator,
-              double beam_piece_numerator,
-              double denominator,
-              const std::vector<PseudoJet> & jets,
-              const std::vector<PseudoJet> & axes
-              )
-:  _tau_mode(tau_mode),
-_jet_pieces_numerator(jet_pieces_numerator),
-_beam_piece_numerator(beam_piece_numerator),
-_denominator(denominator),
-_jets(jets),
-_axes(axes)
-{
-   
-   if (!has_denominator()) assert(_denominator == 1.0); //make sure no effect from _denominator if _has_denominator is false
-   if (!has_beam()) assert (_beam_piece_numerator == 0.0); //make sure no effect from _beam_piece_numerator if _has_beam is false
-   
-   // Put the pieces together
-   _numerator = _beam_piece_numerator;
-   _jet_pieces.resize(_jet_pieces_numerator.size(),0.0);
-   for (unsigned j = 0; j < _jet_pieces_numerator.size(); j++) {
-      _jet_pieces[j] = _jet_pieces_numerator[j]/_denominator;
-      _numerator += _jet_pieces_numerator[j];
-      
-      // Add structural information to jets
-      StructureType * structure = new StructureType(_jets[j]);
-      structure->_tau_piece = _jet_pieces[j];
-      _jets[j].set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-   }
-   
-   _beam_piece = _beam_piece_numerator/_denominator;
-   _tau = _numerator/_denominator;
-   
-   // Add total_jet with structural information
-   _total_jet = join(_jets);
-   StructureType * total_structure = new StructureType(_total_jet);
-   total_structure->_tau_piece = _tau;
-   _total_jet.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(total_structure));
-}
-   
-   
-   
-// test for denominator/beams
-bool TauComponents::has_denominator() const {
-   return (_tau_mode == NORMALIZED_JET_SHAPE
-           || _tau_mode == NORMALIZED_EVENT_SHAPE);
-}
-
-bool TauComponents::has_beam() const {
-   return (_tau_mode == UNNORMALIZED_EVENT_SHAPE
-           || _tau_mode == NORMALIZED_EVENT_SHAPE);
-}
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/TauComponents.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/TauComponents.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,352 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: MeasureFunction.hh 742 2014-08-23 15:43:29Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_TAUCOMPONENTS_HH__
-#define __FASTJET_CONTRIB_TAUCOMPONENTS_HH__
-
-#include "fastjet/PseudoJet.hh"
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/WrappedStructure.hh"
-
-
-#include <cmath>
-#include <vector>
-#include <list>
-#include <limits>
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-// Classes defined in this file.
-class TauComponents;
-class TauPartition;
-class NjettinessExtras;
-
-///------------------------------------------------------------------------
-/// \enum TauMode
-/// Specified whether tau value has beam region or denominators
-///------------------------------------------------------------------------
-enum TauMode {
-   UNDEFINED_SHAPE = -1, // Added so that constructor would default to some value
-   UNNORMALIZED_JET_SHAPE = 0,
-   NORMALIZED_JET_SHAPE = 1,
-   UNNORMALIZED_EVENT_SHAPE = 2,
-   NORMALIZED_EVENT_SHAPE = 3,
-};
-   
-///////
-//
-// TauComponents
-//
-///////
-
-///------------------------------------------------------------------------
-/// \class TauComponents
-/// \brief Output wrapper for supplemental N-(sub)jettiness information
-///
-/// This class creates a wrapper for the various tau/subtau values calculated in Njettiness. This class allows Njettiness access to these variables
-/// without ever having to do the calculation itself. It takes in subtau numerators and tau denominator from MeasureFunction
-/// and outputs tau numerator, and normalized tau and subtau.
-///------------------------------------------------------------------------
-class TauComponents {
-   
-public:
-   
-   /// empty constructor necessary to initialize tau_components in Njettiness
-   /// later set correctly in Njettiness::getTau function
-   TauComponents() {}
-   
-   /// This constructor takes input vector and double and calculates all necessary tau components
-   TauComponents(TauMode tau_mode,
-                 const std::vector<double> & jet_pieces_numerator,
-                 double beam_piece_numerator,
-                 double denominator,
-                 const std::vector<PseudoJet> & jets,
-                 const std::vector<PseudoJet> & axes
-                 );
-   
-   /// Test for denominator
-   bool has_denominator() const;
-   /// Test for beam region
-   bool has_beam() const;
-   
-   /// Return tau value
-   double tau() const { return _tau; }
-   /// Return jet regions
-   const std::vector<double>& jet_pieces() const { return _jet_pieces; }
-   /// Return beam region
-   double beam_piece() const { return _beam_piece; }
-   
-   /// Return jet regions (no denominator)
-   std::vector<double> jet_pieces_numerator() const { return _jet_pieces_numerator; }
-   /// Return beam regions (no denominator)
-   double beam_piece_numerator() const { return _beam_piece_numerator; }
-   /// Return numerator
-   double numerator() const { return _numerator; }
-   /// Return denominator
-   double denominator() const { return _denominator; }
-
-   /// Four-vector of total jet (sum of clustered regions)
-   PseudoJet total_jet() const { return _total_jet;}
-   /// Four-vector of jet regions
-   const std::vector<PseudoJet>& jets() const { return _jets;}
-   /// Four-vector of axes
-   const std::vector<PseudoJet>& axes() const { return _axes;}
-
-   class StructureType;
-   
-protected:
-   
-   /// Defines whether there is a beam or denominator
-   TauMode _tau_mode;
-   
-   std::vector<double> _jet_pieces_numerator;   ///< Constructor input (jet region numerator)
-   double _beam_piece_numerator;                ///< Constructor input (beam region numerator)
-   double _denominator;                         ///< Constructor input (denominator)
-   
-   std::vector<double> _jet_pieces;             ///< Derived value (jet regions)
-   double _beam_piece;                          ///< Derived value (beam region)
-   double _numerator;                           ///< Derived value (total numerator)
-   double _tau;                                 ///< Derived value (final value)
-   
-   PseudoJet _total_jet;                        ///< Total jet four-vector
-   std::vector<PseudoJet> _jets;                ///< Jet four-vectors
-   std::vector<PseudoJet> _axes;                ///< AXes four-vectors
-   
-};
-
-///////
-//
-// TauPartition
-//
-///////
-
-///------------------------------------------------------------------------
-/// \class TauPartition
-/// \brief Output wrapper for N-(sub)jettiness partitioning information
-///
-/// Class for storing partitioning information.
-///------------------------------------------------------------------------
-class TauPartition {
-
-public:
-   /// empty constructor
-   TauPartition() {}
-   
-   /// Make partition of size to hold n_jet partitions
-   TauPartition(int n_jet) {
-      _jets_list.resize(n_jet);
-      _jets_partition.resize(n_jet);
-   }
-   
-   /// add a particle to the jet
-   void push_back_jet(int jet_num, const PseudoJet& part_to_add, int part_index) {
-      _jets_list[jet_num].push_back(part_index);
-      _jets_partition[jet_num].push_back(part_to_add);
-   }
-   
-   /// add a particle to the beam
-   void push_back_beam(const PseudoJet& part_to_add, int part_index) {
-      _beam_list.push_back(part_index);
-      _beam_partition.push_back(part_to_add);
-   }
-   
-   /// return jet regions
-   PseudoJet jet(int jet_num) const { return join(_jets_partition.at(jet_num)); }
-   /// return beam region
-   PseudoJet beam() const { return join(_beam_partition);}
-   
-   /// return jets
-   std::vector<PseudoJet> jets() const {
-      std::vector<PseudoJet> jets;
-      for (unsigned int i = 0; i < _jets_partition.size(); i++) {
-         jets.push_back(jet(i));
-      }
-      return jets;
-   }
-   
-   /// jets in list form
-   const std::list<int> & jet_list(int jet_num) const { return _jets_list.at(jet_num);}
-   /// beam in list form
-   const std::list<int> & beam_list() const { return _beam_list;}
-   /// all jets in list form
-   const std::vector<std::list<int> > & jets_list() const { return _jets_list;}
-   
-private:
-   
-   std::vector<std::list<int> > _jets_list;   ///<  jets in list form
-   std::list<int> _beam_list;                 ///<  beam in list form
-  
-   std::vector<std::vector<PseudoJet> > _jets_partition;  ///< Partition in jet regions
-   std::vector<PseudoJet> _beam_partition;                ///< Partition in beam region
-   
-};
-
-   
-///////
-//
-// NjettinessExtras
-//
-///////
-   
-///------------------------------------------------------------------------
-/// \class NjettinessExtras
-/// \brief ClusterSequence add on for N-jettiness information
-///
-/// This class contains the same information as TauComponents, but adds additional ways of linking up
-/// the jets found in the ClusterSequence::Extras class.
-/// This is done in order to help improve the interface for the main NjettinessPlugin class.
-///------------------------------------------------------------------------
-class NjettinessExtras : public ClusterSequence::Extras, public TauComponents {
-   
-public:
-   /// Constructor
-   NjettinessExtras(TauComponents tau_components,
-                    std::vector<int> cluster_hist_indices)
-   : TauComponents(tau_components), _cluster_hist_indices(cluster_hist_indices) {}
-   
-   
-   
-   /// Ask for tau of the whole event, but by querying a jet
-   double tau(const fastjet::PseudoJet& /*jet*/) const {return _tau;}
-
-   /// Ask for tau of an individual jet
-   double tau_piece(const fastjet::PseudoJet& jet) const {
-      if (labelOf(jet) == -1) return std::numeric_limits<double>::quiet_NaN(); // nonsense
-      return _jet_pieces[labelOf(jet)];
-   }
-
-   /// Find axis associated with jet
-   fastjet::PseudoJet axis(const fastjet::PseudoJet& jet) const {
-      return _axes[labelOf(jet)];
-   }
-   
-   /// Check if extra information is available.
-   bool has_njettiness_extras(const fastjet::PseudoJet& jet) const {
-      return (labelOf(jet) >= 0);
-   }
-   
-private:
-   
-   /// Store cluster history indices to link up with ClusterSequence
-   std::vector<int> _cluster_hist_indices;
-   
-   /// Figure out which jet things belonged to
-   int labelOf(const fastjet::PseudoJet& jet) const {
-      int thisJet = -1;
-      for (unsigned int i = 0; i < _jets.size(); i++) {
-         if (_cluster_hist_indices[i] == jet.cluster_hist_index()) {
-            thisJet = i;
-            break;
-         }
-      }
-      return thisJet;
-   }
-
-public:
-   
-   // These are old methods for gaining this information
-   // The recommended interface is given in TauComponents
-   
-   /// Tau value
-   double totalTau() const {return _tau;}
-   /// Jet regions
-   std::vector<double> subTaus() const {return _jet_pieces;}
-   
-   /// Tau value
-   double totalTau(const fastjet::PseudoJet& /*jet*/) const {
-      return _tau;
-   }
-   
-   /// Jet region
-   double subTau(const fastjet::PseudoJet& jet) const {
-      if (labelOf(jet) == -1) return std::numeric_limits<double>::quiet_NaN(); // nonsense
-      return _jet_pieces[labelOf(jet)];
-   }
-   
-   /// beam region
-   double beamTau() const {
-      return _beam_piece;
-   }
-
-};
-   
-   
-/// Helper function to find out what njettiness_extras are (from jet)
-inline const NjettinessExtras * njettiness_extras(const fastjet::PseudoJet& jet) {
-   const ClusterSequence * myCS = jet.associated_cluster_sequence();
-   if (myCS == NULL) return NULL;
-   const NjettinessExtras* extras = dynamic_cast<const NjettinessExtras*>(myCS->extras());
-   return extras;
-}
-
-/// Helper function to find out what njettiness_extras are (from ClusterSequence)
-inline const NjettinessExtras * njettiness_extras(const fastjet::ClusterSequence& myCS) {
-   const NjettinessExtras* extras = dynamic_cast<const NjettinessExtras*>(myCS.extras());
-   return extras;   
-}
-
-///////
-//
-// TauComponents::StructureType
-//
-///////
-
-   
-///------------------------------------------------------------------------
-/// \class TauComponents::StructureType
-/// \brief Wrapped structure for jet-based N-(sub)jettiness information
-///
-/// Small wrapped structure to store tau information
-/// TODO:  Can these be auto-joined?
-///------------------------------------------------------------------------
-class TauComponents::StructureType : public WrappedStructure {
-
-public:
-   /// Constructor
-   StructureType(const PseudoJet& j) :
-      WrappedStructure(j.structure_shared_ptr())
-   {}
-   
-   /// tau associated with jet
-   double tau_piece() const { return _tau_piece; }
-
-   /// alternative call, though might be confusing
-   double tau() const { return _tau_piece; }
-
-private:
-   friend class TauComponents;
-   double _tau_piece;  ///< tau value associated with jet
-};
-   
-   
-   
-   
-} //namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_TAUCOMPONENTS_HH__
Index: external/fastjet/contribs/Nsubjettiness/XConePlugin.cc
===================================================================
--- external/fastjet/contribs/Nsubjettiness/XConePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,46 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: XConePlugin.cc 745 2014-08-26 23:51:48Z jthaler $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "XConePlugin.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-std::string XConePlugin::description() const {
-   std::stringstream stream;
-   stream << "XCone Jet Algorithm with N = " << _N << std::fixed << std::setprecision(2) << ", Rcut = " << _R0 << ", beta = " << _beta;
-   return stream.str();
-}
-
-std::string PseudoXConePlugin::description() const {
-   std::stringstream stream;
-   stream
-   << "PseudoXCone Jet Algorithm with N = " << _N << std::fixed << std::setprecision(2) << ", Rcut = " << _R0 << ", beta = " << _beta;
-   return stream.str();
-}
-   
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/Nsubjettiness/XConePlugin.hh
===================================================================
--- external/fastjet/contribs/Nsubjettiness/XConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,169 +1,0 @@
-//  Nsubjettiness Package
-//  Questions/Comments?  jthaler@jthaler.net
-//
-//  Copyright (c) 2011-14
-//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
-//
-//  $Id: XConePlugin.hh 748 2014-10-02 06:13:28Z tjwilk $
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_XCONEPLUGIN_HH__
-#define __FASTJET_CONTRIB_XCONEPLUGIN_HH__
-
-#include <fastjet/config.h>
-
-#include "NjettinessPlugin.hh"
-
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/JetDefinition.hh"
-
-#include <string>
-#include <climits>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-namespace contrib {
-
-///------------------------------------------------------------------------
-/// \class XConePlugin
-/// \brief Implements the XCone Jet Algorithm
-/**
- * An exclusive jet finder that identifies N jets.  First N axes are found, then
- * particles are assigned to the nearest (approximte DeltaR) axis and for each axis the
- * corresponding jet is simply the four-momentum sum of these particles.
- *
- * The XConePlugin is based on NjettinessPlugin, but with sensible default
- * values for the AxesDefinition and MeasureDefinition.  There are three arguments
- *
- *   int N:       number of exclusive jets to be found
- *   double R0:   approximate jet radius
- *   double beta: determines style of jet finding with the recommended values being:
- *                beta = 2:  standard "mean" jets where jet momentum/axis align approximately.
- *                beta = 1:  recoil-free "median" variant where jet axis points at hardest cluster.
- *
- * The AxesDefinition is OnePass_GenET_GenKT_Axes, which uses a generalized kT
- * clustering algorithm matched to the beta value.
- *
- * The MeasureDefinition is the XConeMeasure, which is based on the
- * ConicalGeometric measure.
- */
-class XConePlugin : public NjettinessPlugin {
-public:
-
-   /// Constructor with N, R0, and beta as the options.  beta = 2.0 is the default
-   /// All this does is use the NjettinessPlugin with OnePass_GenET_GenKT_Axes and the XConeMeasure.
-   /// For more advanced usage, call NjettinessPlugin directly
-   /// Note that the order of the R0 and beta values is reversed from the XConeMeasure to
-   /// standard usage for Plugins.
-   XConePlugin(int N, double R0, double beta = 2.0)
-   : NjettinessPlugin(N,
-                      OnePass_GenET_GenKT_Axes(calc_delta(beta), calc_power(beta), R0), // use recommended axes method only
-                      XConeMeasure(beta, R0)  // use recommended XCone measure.
-                      ),
-   _N(N), _R0(R0), _beta(beta)
-   {}
-   
-   // The things that are required by base class.
-   virtual std::string description () const;
-   virtual double R() const {return _R0;}
-   
-   // run_clustering is done by NjettinessPlugin
-
-   virtual ~XConePlugin() {}
-
-private:
-
-   /// Static call used within the constructor to set the recommended delta value
-   static double calc_delta(double beta) {
-      double delta;
-      if (beta > 1) delta = 1/(beta - 1);
-      else delta = std::numeric_limits<int>::max(); // use winner take all
-      return delta;
-   }
-
-   /// Static call used within the constructor to set the recommended p value
-   static double calc_power(double beta) {
-      return (double) 1.0/beta;
-   }
-
-   double _N;    ///< Number of desired jets
-   double _R0;   ///< Jet radius
-   double _beta; ///< Angular exponent (beta = 2.0 is dafault, beta = 1.0 is recoil-free)
-
-public:
-
-};
-
-   
-/// \class PseudoXConePlugin
-/// \brief Implements a faster, non-optimal version of the XCone Jet Algorithm
-///
-/// A "poor man's" version of XCone with no minimization step
-/// Right now, used just for testing purposes by the developers
-class PseudoXConePlugin : public NjettinessPlugin {
-public:
-   
-   /// Constructor with N, R0, and beta as the options.  beta = 2.0 is the default
-   /// All this does is use the NjettinessPlugin with GenET_GenKT_Axes and the XConeMeasure.
-   PseudoXConePlugin(int N, double R0, double beta = 2.0)
-   : NjettinessPlugin(N,
-                      GenET_GenKT_Axes(calc_delta(beta), calc_power(beta), R0), // poor man's axes
-                      XConeMeasure(beta, R0)  // use recommended XCone measure.
-                      ),
-   _N(N), _R0(R0), _beta(beta)
-   {}
-   
-   // The things that are required by base class.
-   virtual std::string description () const;
-   virtual double R() const {return _R0;}
-   
-   // run_clustering is done by NjettinessPlugin
-   
-   virtual ~PseudoXConePlugin() {}
-   
-private:
-   
-   /// Static call used within the constructor to set the recommended delta value
-   static double calc_delta(double beta) {
-      double delta;
-      if (beta > 1) delta = 1/(beta - 1);
-      else delta = std::numeric_limits<int>::max(); // use winner take all
-      return delta;
-   }
-   
-   /// Static call used within the constructor to set the recommended p value
-   static double calc_power(double beta) {
-      return (double) 1.0/beta;
-   }
-   
-   double _N;    ///< Number of desired jets
-   double _R0;   ///< Jet radius
-   double _beta; ///< Angular exponent (beta = 2.0 is dafault, beta = 1.0 is recoil-free)
-   
-public:
-   
-};
-
-   
-   
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_XConePlugin_HH__
Index: external/fastjet/contribs/RecursiveTools/AUTHORS
===================================================================
--- external/fastjet/contribs/RecursiveTools/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,31 +1,0 @@
-The RecursiveTools FastJet contrib is developed and maintained by:
-
-   Gavin P. Salam <gavin.salam@cern.ch>
-   Gregory Soyez <soyez@fastjet.fr>
-   Jesse Thaler <jthaler@jthaler.net>
-   Kevin Zhou <knzhou@mit.edu>
-   Frederic Dreyer <fdreyer@mit.edu>
-
-The physics is based on:
-
-   [ModifiedMassDropTagger]
-   Towards an understanding of jet substructure.
-   Mrinal Dasgupta, Alessandro Fregoso, Simone Marzani, and Gavin P. Salam.
-   JHEP 1309:029 (2013), arXiv:1307.0007.
-
-   [SoftDrop]
-   Soft Drop.
-   Andrew J. Larkoski, Simone Marzani, Gregory Soyez, and Jesse Thaler.
-   JHEP 1405:146 (2014), arXiv:1402.2657
-
-   [IteratedSoftDrop]
-   Casimir Meets Poisson: Improved Quark/Gluon Discrimination with Counting Observables.
-   Christopher Frye, Andrew J. Larkoski, Jesse Thaler, Kevin Zhou.
-   JHEP 1709:083 (2017), arXiv:1704.06266
-
-   [RecursiveSoftDrop]
-   [BottomUpSoftDrop]
-   Recursive Soft Drop.
-   Frederic A. Dreyer, Lina Necib, Gregory Soyez, and Jesse Thaler
-   JHEP 1806:093 (2018), arXiv:1804.03657
-   
Index: external/fastjet/contribs/RecursiveTools/BottomUpSoftDrop.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/BottomUpSoftDrop.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,324 +1,0 @@
-// $Id: BottomUpSoftDrop.cc 1064 2017-09-08 09:19:57Z gsoyez $
-//
-// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler,
-// Kevin Zhou, Frederic Dreyer
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "BottomUpSoftDrop.hh"
-#include <cassert>
-#include <algorithm>
-#include <sstream>
-#include <typeinfo>
-#include "fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh"
-#include "fastjet/Selector.hh"
-#include "fastjet/config.h"
-
-
-using namespace std;
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//----------------------------------------------------------------------
-// BottomUpSoftDrop class
-//----------------------------------------------------------------------
-  
-// action on a single jet
-PseudoJet BottomUpSoftDrop::result(const PseudoJet &jet) const{
-  // soft drop can only be applied to jets that have constituents
-  if (!jet.has_constituents()){
-    throw Error("BottomUpSoftDrop: trying to apply the Soft Drop transformer to a jet that has no constituents");
-  }
-
-  // if the jet has area support and there are explicit ghosts, we can
-  // transfer that support to the internal re-clustering
-  //
-  // Note that this is just meant to maintain the information since
-  // all the jes will have a 0 area
-  bool do_areas = jet.has_area() && _check_explicit_ghosts(jet);
-
-  // build the soft drop plugin
-  BottomUpSoftDropPlugin * softdrop_plugin;
-
-  // for some constructors, we get the recombiner from the 
-  // input jet -- some acrobatics are needed
-  if (_get_recombiner_from_jet) {
-    JetDefinition jet_def = _jet_def;
-
-    // if all the pieces have a shared recombiner, we'll use that
-    // one. Otherwise, use the one from _jet_def as a fallback.
-    JetDefinition jet_def_for_recombiner;
-    if (_check_common_recombiner(jet, jet_def_for_recombiner)){
-#if FASTJET_VERSION_NUMBER >= 30100
-      // Note that this is better than the option directly passing the
-      // recombiner (for cases where th ejet def own its recombiner)
-      // but it's only available in FJ>=3.1
-      jet_def.set_recombiner(jet_def_for_recombiner);
-#else
-      jet_def.set_recombiner(jet_def_for_recombiner.recombiner());
-#endif
-    }
-    softdrop_plugin = new BottomUpSoftDropPlugin(jet_def, _beta, _symmetry_cut, _R0);
-  } else {
-    softdrop_plugin = new BottomUpSoftDropPlugin(_jet_def, _beta, _symmetry_cut, _R0);
-  }
-
-  // now recluster the constituents of the jet with that plugin
-  JetDefinition internal_jet_def(softdrop_plugin);
-  // flag the plugin for automatic deletion _before_ we make
-  // copies (so that as long as the copies are also present
-  // it doesn't get deleted).
-  internal_jet_def.delete_plugin_when_unused();
-
-  ClusterSequence * cs;
-  if (do_areas){
-    vector<PseudoJet> particles, ghosts;
-    SelectorIsPureGhost().sift(jet.constituents(), ghosts, particles);
-    // determine the ghost area from the 1st ghost (if none, any value
-    // will do, as the area will be 0 and subtraction will have
-    // no effect!)
-    double ghost_area = (ghosts.size()) ? ghosts[0].area() : 0.01;
-    cs = new ClusterSequenceActiveAreaExplicitGhosts(particles, internal_jet_def, 
-  						     ghosts, ghost_area);
-  } else {
-    cs = new ClusterSequence(jet.constituents(), internal_jet_def);
-  }
-  
-  PseudoJet result_local = SelectorNHardest(1)(cs->inclusive_jets())[0];
-  BottomUpSoftDropStructure * s = new BottomUpSoftDropStructure(result_local);
-  s->_beta = _beta;
-  s->_symmetry_cut = _symmetry_cut;
-  s->_R0   = _R0;
-  result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
-  
-  // make sure things remain persistent -- i.e. tell the jet definition
-  // and the cluster sequence that it is their responsibility to clean 
-  // up memory once the "result" reaches the end of its life in the user's
-  // code. (The CS deletes itself when the result goes out of scope and
-  // that also triggers deletion of the plugin)
-  cs->delete_self_when_unused();
-
-  return result_local;  
-}
-
-// global grooming on a full event
-// note: does not support jet areas
-vector<PseudoJet> BottomUpSoftDrop::global_grooming(const vector<PseudoJet> & event) const {
-  // start by reclustering the event into one very large jet
-  ClusterSequence cs(event, _jet_def);
-  std::vector<PseudoJet> global_jet = SelectorNHardest(1)(cs.inclusive_jets());
-  // if the event is empty, do nothing
-  if (global_jet.size() == 0) return vector<PseudoJet>();
-  
-  // apply the groomer to the large jet
-  PseudoJet result = this->result(global_jet[0]);
-  return result.constituents();
-}
-  
-// check if the jet has explicit_ghosts (knowing that there is an
-// area support)
-bool BottomUpSoftDrop::_check_explicit_ghosts(const PseudoJet &jet) const {
-  // if the jet comes from a Clustering check explicit ghosts in that
-  // clustering
-  if (jet.has_associated_cluster_sequence())
-    return jet.validated_csab()->has_explicit_ghosts();
-
-  // if the jet has pieces, recurse in the pieces
-  if (jet.has_pieces()){
-    vector<PseudoJet> pieces = jet.pieces();
-    for (unsigned int i=0;i<pieces.size(); i++)
-      if (!_check_explicit_ghosts(pieces[i])) return false;
-    // never returned false, so we're OK.
-    return true;
-  }
-
-  // return false for any other (unknown) structure
-  return false;
-}
-
-// see if there is a common recombiner among the pieces; if there
-// is return true and set jet_def_for_recombiner so that the
-// recombiner can be taken from that JetDefinition. Otherwise,
-// return false. 'assigned' is initially false; when true, each
-// time we meet a new jet definition, we'll check it shares the
-// same recombiner as jet_def_for_recombiner.
-bool BottomUpSoftDrop::_check_common_recombiner(const PseudoJet &jet, 
-						JetDefinition &jet_def_for_recombiner,
-						bool assigned) const {
-  if (jet.has_associated_cluster_sequence()){
-    // if the jet def for recombination has already been assigned, check if we have the same
-    if (assigned)
-      return jet.validated_cs()->jet_def().has_same_recombiner(jet_def_for_recombiner);
-
-    // otherwise, assign it.
-    jet_def_for_recombiner = jet.validated_cs()->jet_def();
-    assigned = true;
-    return true;
-  }
-
-  // if the jet has pieces, recurse in the pieces
-  if (jet.has_pieces()){
-    vector<PseudoJet> pieces = jet.pieces();
-    if (pieces.size() == 0) return false;
-    for (unsigned int i=0;i<pieces.size(); i++)
-      if (!_check_common_recombiner(pieces[i], jet_def_for_recombiner, assigned)) return false;
-    // never returned false, so we're OK.
-    return true;
-  }
-  // return false for any other (unknown) structure
-  return false;
-}
-
-
-// description
-string BottomUpSoftDrop::description() const{
-  ostringstream oss;
-  oss << "BottomUpSoftDrop with jet_definition = (" << _jet_def.description() << ")"
-      << ", symmetry_cut = " << _symmetry_cut	<< ", beta = " << _beta << ", R0 = " << _R0;
-  return oss.str();
-}
-  
-//----------------------------------------------------------------------
-// BottomUpSoftDropRecombiner class
-//----------------------------------------------------------------------
-
-// perform a recombination taking into account the Soft Drop
-// conditions
-void BottomUpSoftDropRecombiner::recombine(const PseudoJet &pa, 
-                                           const PseudoJet &pb,
-                                           PseudoJet &pab) const {
-  PseudoJet p;
-  _recombiner->recombine(pa, pb, p);
-
-  // calculate symmetry parameter
-  double symmetry_cut_fn =_symmetry_cut * pow(pa.squared_distance(pb)/_R0sqr, 0.5*_beta);
-  double pta = pa.pt();
-  double ptb = pb.pt();
-  // make sure denominator is non-zero
-  double sym = pta + ptb;
-  if (sym == 0){
-    pab = p;
-    return;
-  }
-  sym = min(pta, ptb) / sym;
-    
-  // if the 2 particles pass the soft drop condition, do the
-  // recombination
-  if (sym > symmetry_cut_fn){
-    pab=p;
-    return;
-  }
-
-  // if the soft drop condition is not passed, return the particle
-  // with largest pt
-  if (pta < ptb) {
-    pab = pb;
-    _rejected.push_back(pa.cluster_hist_index());
-  } else {
-    pab = pa;
-    _rejected.push_back(pb.cluster_hist_index());
-  }
-}
-
-//----------------------------------------------------------------------
-// BottomUpSoftDropPlugin class
-//----------------------------------------------------------------------
-
-// the actual clustering work for the plugin
-void BottomUpSoftDropPlugin::run_clustering(ClusterSequence &input_cs) const {
-  // declare a soft drop recombiner
-  BottomUpSoftDropRecombiner softdrop_recombiner(_beta, _symmetry_cut, _R0, _jet_def.recombiner());
-  JetDefinition jet_def = _jet_def;
-  jet_def.set_recombiner(&softdrop_recombiner);
-
-  // cluster the particles using that recombiner
-  ClusterSequence internal_cs(input_cs.jets(), jet_def);
-  const vector<ClusterSequence::history_element> & internal_hist = internal_cs.history();
-
-  // transfer the list of "childless" elements into a bool vector
-  vector<bool> kept(internal_hist.size(), true);
-  const vector<unsigned int> &sd_rej = softdrop_recombiner.rejected();
-  for (unsigned int i=0;i<sd_rej.size(); i++) kept[sd_rej[i]]=false;
-
-  // browse the history, keeping only the elements that have not been
-  // vetoed.
-  //
-  // In the process we build a map for the history indices
-  vector<unsigned int> internal2input(internal_hist.size());
-  for (unsigned int i=0; i<input_cs.jets().size(); i++)
-    internal2input[i] = i;
-
-  for (unsigned int i=input_cs.jets().size(); i<internal_hist.size(); i++){
-    const ClusterSequence::history_element &he = internal_hist[i];
-
-    // deal with recombinations with the beam
-    if (he.parent2 == ClusterSequence::BeamJet){
-      int internal_jetp_index = internal_hist[he.parent1].jetp_index;
-      int internal_hist_index = internal_cs.jets()[internal_jetp_index].cluster_hist_index();
-
-      int input_jetp_index = input_cs.history()[internal2input[internal_hist_index]].jetp_index;
-
-      // cout << "Beam recomb for internal " << internal_hist_index
-      //            << " (input jet index=" << input_jetp_index << endl;
-
-      input_cs.plugin_record_iB_recombination(input_jetp_index, he.dij);
-      continue;
-    }
-
-    // now, deal with two-body recombinations
-    if (!kept[he.parent1]){ // 1 is rejected, we keep only 2
-      internal2input[i]=internal2input[he.parent2];
-      // cout << "rejecting internal " << he.parent1
-      //            << ", mapping internal " << i 
-      //            << " to internal " << he.parent2
-      //            << " i.e. " << internal2input[i] << endl;
-    } else if (!kept[he.parent2]){ // 2 is rejected, we keep only 1
-      internal2input[i]=internal2input[he.parent1];
-      // cout << "rejecting internal " << he.parent2 
-      //            << ", mapping internal " << i 
-      //            << " to internal " << he.parent1
-      //            << " i.e. " << internal2input[i] << endl;
-    } else { // do the recombination
-      int new_index;
-      input_cs.plugin_record_ij_recombination(input_cs.history()[internal2input[he.parent1]].jetp_index,
-					      input_cs.history()[internal2input[he.parent2]].jetp_index,
-					      he.dij, internal_cs.jets()[he.jetp_index], new_index);
-      internal2input[i]=input_cs.jets()[new_index].cluster_hist_index();
-      // cout << "merging " << internal2input[he.parent1] << " (int: " << he.parent1 << ")"
-      //      << " and "    << internal2input[he.parent2] << " (int: " << he.parent2 << ")"
-      //      << " into "   << internal2input[i] << " (int: " << i << ")" << endl;
-    }
-  }
-}
-
-// description of the plugin
-string BottomUpSoftDropPlugin::description() const {
-  ostringstream oss;
-  oss << "BottomUpSoftDropPlugin with jet_definition = (" << _jet_def.description()
-      <<"), symmetry_cut = " << _symmetry_cut << ", beta = "
-      << _beta << ", R0 = " << _R0;
-  return oss.str();
-}
-
-
-}
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/RecursiveTools/BottomUpSoftDrop.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/BottomUpSoftDrop.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,303 +1,0 @@
-// $Id: BottomUpSoftDrop.hh 1085 2017-10-11 02:16:59Z jthaler $
-//
-// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler,
-// Kevin Zhou, Frederic Dreyer
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __BOTTOMUPSOFTDROP_HH__
-#define __BOTTOMUPSOFTDROP_HH__
-
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/WrappedStructure.hh"
-#include "fastjet/tools/Transformer.hh"
-
-#include <iostream>
-#include <string>
-
-// TODO
-//
-//  - missing class description
-//
-//  - check what to do when pta=ptb=0
-//    for the moment, we recombine both for multiple reasons
-//     . this avois breakingteh symemtry between pa and pb
-//     . it would be groomed in later steps anyway
-//    Note that this is slightly inconsistent with our use of
-//    > (instead of >=) in the cdt 
-
-FASTJET_BEGIN_NAMESPACE
-
-namespace contrib{
-  
-// fwd declarations
-class BottomUpSoftDrop;
-class BottomUpSoftDropStructure;
-class BottomUpSoftDropRecombiner;
-class BottomUpSoftDropPlugin;
-
-//----------------------------------------------------------------------
-/// \class BottomUpSoftDrop
-/// Implementation of the BottomUpSoftDrop transformer
-///
-/// Bottom-Up Soft drop grooms a jet by applying a modified
-/// recombination scheme, where particles are recombined only if they
-/// pass the Soft Drop condition
-///
-/// \f[
-///   z < z_{\rm cut} (\theta/R0)^\beta
-/// \f]
-///
-/// the groomed jet contains the particles remaining after this
-/// pair-wise recombination
-///
-/// Note:
-///  - one can use BottomUpSoftDrop on a full event with the
-///    global_grooming(event) method.
-///  - if two recombined particles a and b have momentum pta=ptb=0,
-///    we recombine both.
-/// 
-
-  
-class BottomUpSoftDrop : public Transformer {
-public:
-  /// minimal constructor, which the jet algorithm to CA, sets the radius
-  /// to JetDefinition::max_allowable_R (practically equivalent to
-  /// infinity) and also tries to use a recombiner based on the one in
-  /// the jet definition of the particular jet being Soft Dropped.
-  ///
-  ///  \param beta           the value for beta
-  ///  \param symmetry_cut   the value for symmetry_cut
-  ///  \param R0             the value for R0
-  BottomUpSoftDrop(double beta, double symmetry_cut, double R0 = 1.0) 
-    : _jet_def(cambridge_algorithm, JetDefinition::max_allowable_R),
-      _beta(beta),_symmetry_cut(symmetry_cut), _R0(R0),
-      _get_recombiner_from_jet(true) {}
-
-  /// alternative constructor which takes a specified jet algorithm
-  ///
-  ///  \param jet_alg        the jet algorithm for the internal clustering (uses R=infty)
-  ///  \param symmetry_cut   the value of symmetry_cut
-  ///  \param beta           the value for beta
-  ///  \param R0             the value for R0
-  BottomUpSoftDrop(const JetAlgorithm jet_alg, double beta, double symmetry_cut,
-		   double R0 = 1.0) 
-    : _jet_def(jet_alg, JetDefinition::max_allowable_R),
-      _beta(beta), _symmetry_cut(symmetry_cut), _R0(R0),
-      _get_recombiner_from_jet(true) {}
-
-
-  /// alternative ctor in which the full reclustering jet definition can
-  /// be specified.
-  ///
-  ///  \param jet_def        the jet definition for the internal clustering
-  ///  \param symmetry_cut   the value of symmetry_cut
-  ///  \param beta           the value for beta
-  ///  \param R0             the value for R0
-  BottomUpSoftDrop(const JetDefinition &jet_def, double beta, double symmetry_cut,
-		   double R0 = 1.0)
-    : _jet_def(jet_def), _beta(beta), _symmetry_cut(symmetry_cut), _R0(R0),
-      _get_recombiner_from_jet(false) {}
-
-  /// action on a single jet
-  virtual PseudoJet result(const PseudoJet &jet) const;
-
-  /// global grooming on a full event
-  /// note: does not support jet areas
-  virtual std::vector<PseudoJet> global_grooming(const std::vector<PseudoJet> & event) const;
-  
-  /// description
-  virtual std::string description() const;
-  
-  // the type of the associated structure
-  typedef BottomUpSoftDropStructure StructureType;
-
-private:
-  /// check if the jet has explicit_ghosts (knowing that there is an
-  /// area support)
-  bool _check_explicit_ghosts(const PseudoJet &jet) const;
-  
-  /// see if there is a common recombiner among the pieces; if there
-  /// is return true and set jet_def_for_recombiner so that the
-  /// recombiner can be taken from that JetDefinition. Otherwise,
-  /// return false. 'assigned' is initially false; when true, each
-  /// time we meet a new jet definition, we'll check it shares the
-  /// same recombiner as jet_def_for_recombiner.
-  bool _check_common_recombiner(const PseudoJet &jet, 
-				JetDefinition &jet_def_for_recombiner,
-				bool assigned=false) const;
-
-
-  JetDefinition _jet_def; ///< the internal jet definition
-  double _beta;           ///< the value of beta
-  double _symmetry_cut;   ///< the value of symmetry_cut
-  double _R0;             ///< the value of R0
-  bool   _get_recombiner_from_jet; ///< true for minimal constructor,
-                                   ///< causes recombiner to be set equal 
-                                   ///< to that already used in the jet 
-                                   ///< (if it can be deduced)
-};
-
-//----------------------------------------------------------------------
-/// The structure associated with a PseudoJet thas has gone through a
-/// bottom/up SoftDrop transformer
-class BottomUpSoftDropStructure : public WrappedStructure{
-public:
-  /// default ctor
-  ///  \param result_jet  the jet for which we have to keep the structure
-  BottomUpSoftDropStructure(const PseudoJet & result_jet)
-    : WrappedStructure(result_jet.structure_shared_ptr()){}
-
-  /// description
-  virtual std::string description() const{
-    return "Bottom/Up Soft Dropped PseudoJet";
-  }
-
-  /// return the constituents that have been rejected
-  std::vector<PseudoJet> rejected() const{ 
-    return validated_cs()->childless_pseudojets();
-  }
-
-  /// return the other jets that may have been found along with the
-  /// result of the bottom/up Soft Drop
-  /// The resulting vector is sorted in pt
-  std::vector<PseudoJet> extra_jets() const {
-    return sorted_by_pt((!SelectorNHardest(1))(validated_cs()->inclusive_jets()));
-  }
-
-  /// return the value of beta that was used for this specific Soft Drop.
-  double beta() const {return _beta;}
-
-  /// return the value of symmetry_cut that was used for this specific Soft Drop.
-  double symmetry_cut() const {return _symmetry_cut;}
-
-  /// return the value of R0 that was used for this specific Soft Drop.
-  double R0() const {return _R0;}
-
-protected:
-  friend class BottomUpSoftDrop; ///< to allow setting the internal information
-
-private:
-  double _beta, _symmetry_cut, _R0;
-};
-
-//----------------------------------------------------------------------
-/// Class for Soft Drop recombination
-/// recombines the objects that are not vetoed by Bottom-Up SoftDrop
-///
-/// This recombiner only recombines, using the provided 'recombiner',
-/// objects (i and j) that pass the following SoftDrop criterion:
-///
-///   min(pti, ptj) > zcut (pti+ptj) (theta_ij/R0)^beta
-///
-/// If the criterion fail, the hardest of i and j is kept and the
-/// softest is rejected.
-///
-/// Note that this in not meant for standalone use [in particular
-/// because it could lead to memory issues due to the rejected indices
-/// stored internally].
-///
-/// This class is a direct adaptation of PruningRecombiner in Fastjet tools
-class BottomUpSoftDropRecombiner : public JetDefinition::Recombiner {
-public:
-  /// ctor
-  ///  \param symmetry_cut   value of cut on symmetry measure
-  ///  \param beta   avalue of beta parameter
-  ///  \param recomb pointer to a recombiner to use to cluster pairs
-  BottomUpSoftDropRecombiner(double beta, double symmetry_cut, double R0,
-                             const JetDefinition::Recombiner *recombiner)
-    : _beta(beta), _symmetry_cut(symmetry_cut), _R0sqr(R0*R0),
-      _recombiner(recombiner) {}
-
-  /// perform a recombination taking into account the Soft Drop
-  /// conditions
-  virtual void recombine(const PseudoJet &pa, 
-			 const PseudoJet &pb,
-			 PseudoJet &pab) const;
-
-  /// returns the description of the recombiner
-  virtual std::string description() const {
-    std::ostringstream oss;
-    oss << "SoftDrop recombiner with symmetry_cut = " << _symmetry_cut
-	<< ", beta = " << _beta
-	<< ", and underlying recombiner = " << _recombiner->description();
-    return oss.str();    
-  }
-
-  /// return the history indices that have been soft dropped away
-  const std::vector<unsigned int> & rejected() const{ return _rejected;}
-
-  /// clears the list of rejected indices
-  ///
-  /// If one decides to use this recombiner standalone, one has to
-  /// call this after each clustering in order for the rejected() vector
-  /// to remain sensible and not grow to infinite size.
-  void clear_rejected(){ _rejected.clear();}
-
-private:
-  double _beta;          ///< beta parameter
-  double _symmetry_cut;  ///< value of symmetry_cut
-  double _R0sqr;         ///< normalisation of the angular distance
-  const JetDefinition::Recombiner *_recombiner; ///< the underlying recombiner to use
-  mutable std::vector<unsigned int> _rejected;  ///< list of rejected history indices
-};
-
-//----------------------------------------------------------------------
-/// \class BottomUpSoftDropPlugin
-/// Class for a bottom/up Soft Drop algorithm, based on the Pruner plugin
-///
-/// This is an internal plugin that clusters the particles using the
-/// BottomUpRecombiner. 
-///
-/// See BottomUpRecombiner for a description of what bottom-up
-/// SoftDrop does.
-///
-/// Note that this is an internal class used by the BottomUpSoftDrop
-/// transformer and it is not meant to be used as a standalone
-/// clustering tool.
-class BottomUpSoftDropPlugin : public JetDefinition::Plugin {
-public:
-  /// ctor
-  ///  \param jet_def the jet definition to be used for the 
-  ///                 internal clustering
-  ///  \param symmetry_cut    value of cut on symmetry measure
-  ///  \param beta    value of beta parameter
-  BottomUpSoftDropPlugin(const JetDefinition &jet_def, double beta, double symmetry_cut,
-                         double R0 = 1.0)
-    : _jet_def(jet_def), _beta(beta), _symmetry_cut(symmetry_cut), _R0(R0) {}
-
-  /// the actual clustering work for the plugin
-  virtual void run_clustering(ClusterSequence &input_cs) const;
-
-  /// description of the plugin
-  virtual std::string description() const;
-
-  /// returns the radius
-  virtual double R() const {return _jet_def.R();}
-
-private:
-  JetDefinition _jet_def; ///< the internal jet definition
-  double _beta;           ///< beta parameter
-  double _symmetry_cut;   ///< value of symmetry_cut 
-  double _R0;             ///< normalisation of the angular distance
-};
-
-}
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-#endif // __BOTTOMUPSOFTDROP_HH__
Index: external/fastjet/contribs/RecursiveTools/COPYING
===================================================================
--- external/fastjet/contribs/RecursiveTools/COPYING	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,360 +1,0 @@
-The RecursiveTools contrib to FastJet is released 
-under the terms of the GNU General Public License v2 (GPLv2). 
-
-A copy of the GPLv2 is to be found at the end of this file.
-
-While the GPL license grants you considerable freedom, please bear in
-mind that this code's use falls under guidelines similar to those that
-are standard for Monte Carlo event generators
-(http://www.montecarlonet.org/GUIDELINES). In particular, if you use
-this code as part of work towards a scientific publication, whether
-directly or contained within another program you should include a
-citation to
-
-  arXiv:1307.0007
-  arXiv:1402.2657
-  arXiv:1704.06266
-
-======================================================================
-======================================================================
-======================================================================
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 2 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, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
Index: external/fastjet/contribs/RecursiveTools/ChangeLog
===================================================================
--- external/fastjet/contribs/RecursiveTools/ChangeLog	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,692 +1,0 @@
-2018-11-02  Jesse Thaler  <jthaler@jthaler.net>
-
-	* AUTHORS:  updated journal for RecursiveSoftDrop
-
-2018-10-30  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc:
-	fixed a few typos in comments
-
-	* RecursiveSoftDrop.hh:
-	used the native FJ Recluster tool when available (did create
-	conflicts in some cases)
-
-2018-06-18  Jesse Thaler  <jthaler@jthaler.net>
-
-	* README
-	Fixed incorrect order of zcut and beta in the README for SoftDrop example.
-
-2018-05-29  Jesse Thaler  <jthaler@jthaler.net>
-
-	* VERSION
-	* NEWS
-	Changed to 2.0.0-beta2, noted in news
-
-2018-04-21  Jesse Thaler  <jthaler@jthaler.net>
-
-	* AUTHORS: updated arxiv number for RecursiveSoftDrop
-
-2018-04-21  Gavin Salam  <gavin.salam@cern.ch>
-
-	* README: updated arxiv number for RecursiveSoftDrop & Bottom-up
-	Soft Drop.
-
-2018-04-04  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc (contrib):
-	fixed syntax of calls to structure_of<...>
-	(thanks to Attila Krasznahorkay)
-
-2018-01-24  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc:
-	for the (dafault) dynamical R0 implementation, the dynamical R0 is
-	evolved independently in each branch.
-
-2017-10-10  Jesse Thaler  <jthaler@jthaler.net>
-	* AUTHORS
-	Added mention of BUSD
-
-	* README
-	Some tweaks to the wording
-
-2017-10-11  Gregory Soyez  <soyez@fastjet.fr>
-
-	* IteratedSoftDrop.hh:
-	IteratedSoftDropInfo::size() and multiplicity() now return an
-	unsigned int instead of a double
-
-2017-10-10  Jesse Thaler  <jthaler@jthaler.net>
-	* AUTHORS
-	Updated journal reference for ISD
-
-	* example_isd.{cc,ref}:
-	Included soft drop multiplicity in example
-
-	* README
-	Added warning at top that documentation has not been updated
-
-	* VERSION
-	Changed to 2.0.0-beta1
-
-2017-10-10  Gregory Soyez  <soyez@fastjet.fr>
-
-	* example_isd.ref:
-	updated to reflect the bugfix below
-
-	* IteratedSoftDrop.cc:
-	fixed issue in description (was taking sqrt of -ve number when
-	there were no angular cut)
-
-	* NEWS:
-	drafted for RecursiveTools-2.0.0-beta1
-
-	* TODO:
-	updated list in view of a beta release
-
-	* example_isd.cc:
-	pointed to the right header for IteratedSoftDrop
-
-	* RecursiveSoftDrop.{hh,cc}:
-	* IteratedSoftDrop.{hh,cc}:
-	moved IteratedSoftDrop to its own file (replacing the old
-	implementation)
-
-	* example_advanced_usage.ref:
-	updated reference file following the fix below.
-
-2017-09-28  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSymmetryCutBase.cc:
-	when no substructure is found, keep the _symmetry, _delta_R and
-	_mu structure variables at -1.  This for example allows one to
-	trigger on substructure by checking if delta_R>=0.
-
-	Note: we could set it to 0 (as it was before) and trigger using
-	_delta_R>0 but there might be some genuine substructure exactly
-	collinear.
-
-2017-09-19  Gregory Soyez  <soyez@fastjet.fr>
-
-	* example_isd.ref:
-	updated to the latest version of the example
-
-2017-09-18  Gregory Soyez  <soyez@fastjet.fr>
-
-	* Makefile:
-	updating make check to use all the examples (failing on ISD as
-	expected, see below)
-
-	* example_bottomup_softdrop.cc:
-	fixed typo
-
-	* example_bottomup_softdrop.ref:
-	* example_recursive_softdrop.ref:
-	added reference output for this example
-
-	* RecursiveSoftDrop.{hh,cc}:
-	* RecursiveSymmetryCutBase.{cc,hh}:
-	moved the "all_prongs" method from the base structure t oa
-	standalone function in RecursiveSoftDrop.hh
-
-	In practice, this is irrelevant for mMDT and SD (since pieces()
-	gets the job done, and the substructure class does not have (as
-	is) reliable info to get the full structure)
-
-	* RecursiveSymmetryCutBase.cc:
-	revamped a series of requests for substructure info to better
-	handle possible recursion into deeper jet substructure.
-
-	* RecursiveSoftDrop.{hh,cc}:
-	updated "description" to reuse the info from the base class
-
-	* example_isd.cc:
-	updated to use the newer implementation of ISD. Checked that it
-	gives the same results as the former implementation.
-
-	Note: make check still needs fixing because the example now
-	      computes a different set of angularities
-
-	* RecursiveSoftDrop.hh:
-	added a few helpers to IteratedSoftDropInfo ([] operator and size,
-	meaning it can be used as a vector<pair<double,double> >)
-
-	* RecursiveSymmetryCutBase.cc:
-	. fixed bugs in the calculation of the geometric distances for ee
-	  coordinates
-	. fixed bug in the computation of the (zg,thetag) pairs [it was
-	  returning the groomed ones instead of the ones passing the
-	  condition]
-
-	* example_recursive_softdrop.cc:
-	set the R0 parameter to the original jet radius
-
-2017-09-13  Gregory Soyez  <soyez@fastjet.fr>
-
-	* example_recursive_softdrop.cc:
-	tied up a few comments and the code output
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	removed the unneeded _is_composite
-
-	* RecursiveSoftDrop.cc:
-	fixed issue with "verbose" dropped info on branches with no
-	further substructure
-
-2017-09-11  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.{hh,cc}:
-	have IteratedSoftDDrop returning by default an object of type
-	IteratedSoftDropInfo; added several helpers
-
-2017-09-08  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.{hh,cc}:
-	updated IteratedSoftDrop to give it the flexibility of
-	RecursiveSoftDrop
-
-	* RecursiveSymmetryCutBase.hh:
-	fixed typo in comment
-
-	* example_mmdt_ee.cc:     *** ADDED ***
-	added an example to illustrat usage in ee collisions
-
-	* example_isd.cc:
-	* BottomUpSoftDrop.cc:
-	* IteratedSoftDrop.cc:
-	* RecursiveSoftDrop.cc:
-	Fixed compilation issues with FJ 3.0 (mostly the usage of features
-	introduced only in FJ3.1)
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	used the internal Recluster class for FJ<3.1.0 and the FJ antive
-	one for FJ>=3.1.0
-
-	* BottomUpSoftDrop.{hh,cc}:
-	moved the implementation of global_grooming to the source file and
-	fixed a few trivial compilation errors
-
-2017-09-08  FrÃ©dÃ©ric Dreyer  <frederic.dreyer@gmail.com>
-
-	* BottomUpSoftDrop.hh:
-	added the global_grooming method to process full event
-
-2017-09-07  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc:
-	cleaned (mostly by removing older commented-out code)
-
-	* RecursiveSoftDrop.{hh,cc}:
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	* SoftDrop.cc:
-
-	added support for ee coordinates.  For that, the symmetry measure
-	has to be set to either theta_E (which uses the 3-vector angle
-	theta) or to cos_theta_E which uses sqrt(2*[1-cos(theta)])
-
-	Accordingly, the recursion_choice can be set to larger_E to
-	recurse into the branch with the largest energy. The larger_m
-	mode, recorsing into the larger-mass branch is also possible but
-	not advised (for the same reason as the pp version).
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	switched to the Recluster class provided with FastJet. ASlso
-	included the recluster description to RecursiveSymmetryCutBase
-	when it is user-defined.
-
-2017-09-06  Gregory Soyez  <soyez@fastjet.fr>
-
-	* BottomUpSoftDrop.{hh,cc}:
-	. renamed SoftDropStructure  -> BottomUpSoftDropStructure
-	          SoftDropRecombiner -> BottomUpSoftDropRecombiner
-	          SoftDropPlugin     -> BottomUpSoftDropPlugin
-	. moved 'description' to source file (instead of header)
-	. kept the "area" information when available (jets will just
-	appear as having a 0 area)
-	. added most class description (main class still missing)
-
-	* RecursiveSoftDrop.cc:
-	. put internal classes to handle CS history in an internal namespace
-	. replaced the "switch" in the mail loop by a series of if (allows
-	  us a few simplificatins/cleaning)
-	. more uniform treatment of issues in the presence of an angular cut
-	  (as part of the above reorganisation)
-
-	* example_advanced_usage.ref:
-	updated reference output file following the bugfix (missing
-	"grooming mode" initialisation in one of the SoftDrop ctors) on
-	2017-08-01
-
-	* RecursiveSymmetryCutBase.cc:
-	removed redundent code
-
-2017-08-10  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc:
-	fixed trivial typo in variable name
-
->>>>>>> .r1071
-2017-08-04  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc:
-	do not impose an angular cut in IterativeSD if it is -ve.
-
-2017-08-01  Gregory Soyez  <soyez@fastjet.fr>
-
-	* example_recursive_softdrop.cc:
-	added a series of optional flags
-
-	* RecursiveSoftDrop.cc:
-	fixed a few issues with the fixed depth version
-
-	* RecursiveSymmetryCutBase.hh:
-	a jet is now considered as havig substructure if deltaR>0
-	(coherent with released version)
-
-	* SoftDrop.hh:
-	bugfix: set the "grooming mode" by default in all ctors
-	EDIT: caused issue with make check, fixed on 2017-09-069 (see
-	      above)
-
-	* RecursiveSoftDrop.{hh,cc}:
-	added support for the "same depth" variant
-
-	* RecursiveSymmetryCutBase.cc:
-	also associate a RecursiveSymmetryCutBase::StructureType structure
-	to the result jet in case it is just a single particle (in
-	grooming mode)
-
-2017-07-31  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	added the option to pass an extra parameter to the symmetry cut
-	function
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	* ModifiedMassDropTagger.hh
-	* SoftDrop.hh:
-	minor adaptions due to the above change + added a few methods to
-	query the class information (symmetry cut, beta, ...)
-
-	* RecursiveSoftDrop.{hh,cc}:
-	Added support for
-	- a dynamical R0
-	- recursing only in the hardest branch
-	- imposing a min deltaR cut
-
-	Added a tentative IterativeSoftDrop class
-
-2017-07-28  Gregory Soyez  <soyez@fastjet.fr>
-
-	* RecursiveSoftDrop.cc:
-	adapted to the latest changes in RecursiveSymmetryCutBase
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	reorganised the output of the recursion step (recurse_one_step)
-	using an enum to make iot more readable (and to fix issues where
-	the dropped prong is actually 0, e.g. after subtraction)
-
-2017-07-26  Gregory Soyez  <soyez@fastjet.fr>
-
-	* example_recursive_softdrop.cc:   *** ADDED ***
-	added a draft example for the use of RecursiveSoftDrop
-
-	* RecursiveSoftDrop.{hh,cc}:       *** ADDED ***
-	added a first pass at an implementation of RecursiveSoftDrop.
-
-	This is based on Frederic's initial version but keeps the
-	branching structure of the jet. Some of the features, like
-	dynamical R0, direct access to the substructure or the same depth
-	variant, are still unsupported.
-
-	* SoftDrop.hh:
-	declared _beta, _symmetry_cut and _R0sqr as protected (was
-	private) so they ca n be used by RecursiveSoftDrop
-
-	* RecursiveSymmetryCutBase.{hh,cc}:
-	extracted from result() the part that performs one step of the
-	resursion (implemented as recurse_one_step()). This is repeatedly
-	called by result(). It has specific conventions to indicate
-	whether or not some substructure has been found or if one ran into
-	some issue.
-
-2017-04-25  Kevin Zhou  <knzhou@mit.edu>
-
-	* IteratedSoftDrop.hh
-	  . Added Doxygen documentation
-
-	* RecursiveSymmetryCutBase.hh
-	  . Added references to ISD
-
-2017-04-25  Jesse Thaler  <jthaler@jthaler.net>
-	* AUTHORS, COPYING:
-	  . Added ISD arXiv number
-
-	* example_isd.{cc,ref}
-	  . Added ISD arXiv number
-	  . Changing z_cut to be optimal value (with Lambda = 1 GeV)
-	  . Tweaked formatting
-
-	* IteratedSoftDrop.{hh,cc}
-	  . Added ISD arXiv number
-	  . Assert added if recluster does not return one jet.
-
-	* README
-	  . Added ISD arXiv number and tweaked wording
-
-
-2017-04-20  Kevin Zhou  <knzhou@mit.edu>
-
-	* example_isd.{cc,ref}      ** ADDED **
-	* IteratedSoftDrop.{cc,hh}  ** ADDED **
-
-	* Makefile
-	  . Added IteratedSoftDrop (ISD) as appropriate
-
-	* AUTHORS
-	  . Added myself to author list
-          . Added placeholder for ISD paper
-
-	* COPYING
-	  . Added placeholder for ISD paper
-
-	* README
-	  . Added description of ISD
-
-	* TODO
-	  . Added tasks to integrate ISD with other classes, e.g. SD, 
-	    Recluster, and the future RecursiveSoftDrop (RSD)
-
-	* NEWS
-	  . Added dummy for release of 1.1.0
-
-	* VERSION:
-	  . Switched version number to 1.1.0-dev
-
-	* example_advanced_usage.cc:
-	  . Added $Id$ tag, didn't change anything else
-
-2014-07-30  Gregory Soyez  <soyez@fastjet.fr>
-
-	* Recluster.hh: fixed the name of the #define for the header
-
-2014-07-09  Gregory Soyez  <soyez@fastjet.fr> + Jesse
-
-	* NEWS:
-	release of RecursiveTools v1.0.0
-
-	* VERSION:
-	switched version number to 1.0.0
-
-2014-07-08  Gavin Salam  <gavin.salam@cern.ch>
-
-	* README (RecursionChoice): 
-	added ref to .hh for constness specs of virtual functions (to
-	reduce risk of failed overloading due to wrong constness).
-
-2014-07-08  Gregory Soyez  <soyez@fastjet.fr> + Jesse
-
-	* README:
-	partially rewrote the description of set_subtractor
-
-2014-07-07  Gregory Soyez  <soyez@fastjet.fr> + Jesse
-
-	* example_advanced_usage.cc:
-	* example_softdrop.cc:
-	a few small fixed in the header of the files
-
-	* VERSION:
-	switched over to 1.0.0-alpha2-devel
-
-	* README:
-	Reordered a few things and added a few details.
-
-	* Makefile (check):
-	Be quiter during "make check"
-
-	* Recluster.cc (contrib):
-	Documented the "single" ctor argument
-
-	* RecursiveSymmetryCutBase.cc (contrib):
-	If the user sets himself the reclustering, disable the "non-CA"
-	warning (we assume that he knows what he is doing). Mentioned in
-	the comments that non-CA reclustering has to be used at the user's
-	risk. Also throw when th input jet has no constituents or when
-	there is no cluster sequence after reclustering.
-
-	* Recluster.cc (contrib):
-	replaced a remaining mention to "filtering" by reclustering
-
-2014-07-04  Jesse Thaler  <jthaler@jthaler.net>
-	* VERSION
-	  . Ready for alpha release
-
-2014-06-17  Jesse Thaler  <jthaler@jthaler.net>
-	* example_advanced_usage.{cc,ref}  ** ADDED **
-	* Makefile
-	  . New example file to test a bunch of soft drop options
-	  . Put in makefile as well
-	  . Fixed nasty memory bug with pointers to Recluster
-
-	* RecursiveSymmetryCutBase.cc
-	* example_softdrop.ref 
-	  . description() now says Groomer vs. Tagger
-
-	* RecursiveSymmetryCutBase.{cc,hh}
-	  . Added optional verbose logging information about
-	    kinematics of dropped branches
-	
-	* example_softdrop.cc
-	* example_advanced_usage.cc
-	  . Fixed 
-
-
-2014-06-16  Gregory Soyez  <soyez@fastjet.fr>
-
-	* Makefile:
-	also install the RecursiveSymmetryuCutBase.hh header
-
-2014-06-13  Jesse Thaler  <jthaler@jthaler.net>
-	* AUTHORS
-	  . Added myself to author list
-          . Put complete bibliographic details on papers
-
-	* COPYING
-	  . Added boilerplate MC/GPLv2 statement 
-
-        * example.cc:  ** REMOVED **  renamed to...
-        * example_mmdt.cc   ** ADDED **
-        * Makefile
-          . Made name change for consistency
-	  . Made corresponding changes in Makefile
-
-	* example_mmdt_sub.cc:
-	* example_mmdt.cc:
-	* example_recluster.cc:
-	  . light editing of comments
-
-	* example_softdrop.cc:
-	  . light editing of comments
-          . added assert for sdjet != 0, since SoftDrop is a groomer
-
-	* ModifiedMassDropTagger.hh
-	* Recluster.{cc,hh}
-	* RecursiveSymmetryCutBase.{cc,hh}
-	* SoftDrop.hh
-	  . Updated some comments
-
-	* README
-	  . Updated to include basic usage description and some 
-	    technical details
-
-	* TODO:
-	  . Added some discussion points.
-          
-2014-06-13  Gregory Soyez  <soyez@fastjet.fr>
-
-	* example_softdrop.{cc,ref}:
-	added an example for SoftDrop
-
-	* SoftDrop.{hh,cc}:
-	* ModifiedMassDropTagger.{hh,cc}:
-	* RecursiveSymmetryCutBase.{hh,cc}:        *** ADDED ***
-	  . added a base class for both the mMDT and SoftDrop
-	  . made mMDT and SoftDrop inherit from RecursiveSymmetryCutBase
-	  . moved the reclustering to the base class. By default, both
-	    mMDT and SoftDrop now recluster the jet with C/A
-	  . added set_grooming_mode and set_tagging_mode methods to the
-	    base class
-
-	* Merging the development branch 1.0-beta1-softdrop-addition back
-	into the trunk (will correspond to revision 682)
-
-	* VERSION:
-	switched back to 1.0.0-devel
-
-	* SoftDrop.{hh,cc}:
-	added support for re-clustering through set_reclustering(bool,
-	Recluster*). By default, reclustering is done with
-	Cambridge/Aachen.
-
-	* example_recluster.{cc,ref}:              *** ADDED ***
-	added an example of reclustering
-
-	* Recluster.{hh,cc}:
-	added a 'single' ctor argument [true by default]. When true, the
-	hardest jet after reclustering is returned, otherwise, the result
-	is a composite jet with all the subjets as its pieces.
-
-2014-05-15  Gregory Soyez  <soyez@fastjet.fr>
-
-	* VERSION:
-	set version number to 1.0-alpha-PUWS14.1 in preparation for a
-	fastjet-contrib release for the pileup-workshop at CERN on May
-	2014.
-
-2014-04-25  Gregory Soyez  <soyez@fastjet.fr>
-
-	* ModifiedMassDropTagger.hh:
-	* ModifiedMassDropTagger.cc:
-	  Added comments at various places
-
-	* AUTHORS:
-	* README:
-	Updated info about what is now included in this contrib
-
-	* SoftDrop.hh:                *** ADDED ***
-	* SoftDrop.cc:	              *** ADDED ***
-	* Recluster.hh:	              *** ADDED ***
-	* Recluster.cc;               *** ADDED ***
-	Added tools for reclustering and softDrop
-
-2014-04-25  Gregory Soyez  <soyez@fastjet.fr>
-
-	branch started at revision 611 to start including SoftDrop in the
-	Recursivetols contrib
-
-2014-04-24  Gregory Soyez  <soyez@fastjet.fr>
-
-	* ModifiedMassDropTagger.hh:
-	added a mention of the fact that when result is called in the
-	presence of a subtractor, then the output is a subtracted
-	PseudoJet.
-
-	* ModifiedMassDropTagger.hh:
-	declared _symmetry_cut as protected (rather than provate) so it
-	can be accessed if symmetry_cut_description() is overloaded.
-
-	* example.cc:
-	trivial typo fixed in a comment
-
-2014-02-04  Gavin Salam  <gavin.salam@cern.ch>
-
-	* VERSION: 
-	upped it to 1.0-beta1
-
-	* example_mmdt_sub.cc (main): 
-	added an #if to make sure FJ3.1 features are only used if FJ3.1
-	is available. (Currently FJ3.1 is only available to FJ developers).
-
-2014-01-26  Gavin Salam  <gavin.salam@cern.ch>
-
-	* VERSION:
-	renamed to 1.0-beta0
-
-	* ModifiedMassDropTagger.hh:
-	* README:
-	added info on author names
-
-	* example_mmdt_sub.ref: *** ADDED ***
-	added reference output for the pileup test.
-
-2014-01-25  Gavin Salam  <gavin.salam@cern.ch>
-
-	* example_mmdt_sub.cc:
-	* Makefile:
-	added an extra example illustrating functionality with pileup
-	subtraction.
-
-2014-01-24  Gavin Salam  <gavin.salam@cern.ch>
-
-	* ModifiedMassDropTagger.cc:
-
-	Reorganised code so that (sub)jet.m2()>0 check is only used when
-	absolutely necessary: so if using a scalar_z symmetry measure,
-	whenever scalar_z < zcut, then there is no point checking the mu
-	condition. This means that there's no issue if the (sub)jet mass
-	is negative, and one simply recurses down into the jet. (Whereas
-	before it would bail out, reducing the tagging efficiency).
-
-	Also removed the verbose code.
-
-2014-01-23  Gavin Salam  <gavin.salam@cern.ch>
-
-	* ModifiedMassDropTagger.cc|hh:
-	* example.cc
-	replaced "asymmetry" with "symmetry" in a number of places;
-	implemented the structural information and added it to the example;
-	added a new simplified constructor;
-	improved doxygen documentation;
-	started renaming -> RecursiveTools
-
-	* README
-	some tidying
-
-	* VERSION
-	1.0-b0
-
-2014-01-22  Gavin Salam <gavin.salam@cern.ch>
-
-	* ModifiedMassDropTagger.cc (contrib):
-	-ve mass now bails out also when using the "y" asymmetry measure.
-	Also, default my is now infinite.
-
-2014-01-20  Gavin Salam <gavin.salam@cern.ch> + Gregory
-
-
-	* ModifiedMassDropTagger.cc|hh:
-	introduced a virtual asymmetry_cut_fn (essentially a
-	dummy function returning a constant), to allow for derived classes
-	to do fancier things.
-
-	added warning about non-C/A clustering.
-	explicitly labelled some (inherited) virtual functions as
-	virtual. 
-
-2014-01-20  Gavin Salam  <gavin.salam@cern.ch>
-
-	* example.ref:
-	* example.cc (main):
-	got a first working example and make check setup.
-
-	* ModifiedMassDropTagger.cc|hh:
-	improved doxygen comments;
-	added option whereby input jet is assumed already subtracted
-
-2014-01-19  Gavin Salam  <gavin.salam@cern.ch>
-
-	* ModifiedMassDropTagger.cc|hh:
-	* many other files
-
-        Initial creation, with basic code for MMDT
-
Index: external/fastjet/contribs/RecursiveTools/IteratedSoftDrop.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/IteratedSoftDrop.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,128 +1,0 @@
-// $Id: IteratedSoftDrop.cc 1084 2017-10-10 20:36:50Z gsoyez $
-//
-// Copyright (c) 2017-, Jesse Thaler, Kevin Zhou, Gavin P. Salam
-// andGregory Soyez
-//
-// based on arXiv:1704.06266 by Christopher Frye, Andrew J. Larkoski, 
-// Jesse Thaler, Kevin Zhou
-// 
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "IteratedSoftDrop.hh"
-#include <sstream>
-#include <cmath>
-#include <fastjet/ClusterSequence.hh>
-
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//========================================================================
-// implementation of IteratedSoftDropInfo
-//========================================================================
-
-// returns the angularity with angular exponent alpha and z
-// exponent kappa calculated on the zg's and thetag's found by
-// iterated SoftDrop
-//
-// returns 0 if no substructure was found
-double IteratedSoftDropInfo::angularity(double alpha, double kappa) const{
-  double sum = 0.0;
-  for (unsigned int i=0; i< _all_zg_thetag.size(); ++i)
-    sum += pow(_all_zg_thetag[i].first, kappa) * pow(_all_zg_thetag[i].second, alpha);
-  return sum;    
-}
-  
-//========================================================================
-// implementation of IteratedSoftDrop
-//========================================================================
-
-// Constructor. Takes in the standard Soft Drop parameters, an angular cut \f$\theta_{\rm cut}\f$, 
-// and a choice of angular and symmetry measure. 
-//
-//  - beta           the Soft Drop beta parameter
-//  - symmetry_cut   the Soft Drop symmetry cut
-//  - angular_cut    the angular cutoff to halt Iterated Soft Drop
-//  - R0             the angular distance normalization
-IteratedSoftDrop::IteratedSoftDrop(double beta, double symmetry_cut, double angular_cut, double R0,
-                                   const FunctionOfPseudoJet<PseudoJet> * subtractor) :
-  _rsd(beta, symmetry_cut, -1, R0, subtractor){
-  _rsd.set_hardest_branch_only(true);
-  if (angular_cut>0)
-    _rsd.set_min_deltaR_squared(angular_cut*angular_cut);
-}
-
-
-// Full constructor, which takes the following parameters:
-//
-// \param beta               the value of the beta parameter
-// \param symmetry_cut       the value of the cut on the symmetry measure
-// \param symmetry_measure   the choice of measure to use to estimate the symmetry
-// \param angular_cut        the angular cutoff to halt Iterated Soft Drop
-// \param R0                 the angular distance normalisation [1 by default]
-// \param mu_cut             the maximal allowed value of mass drop variable mu = m_heavy/m_parent 
-// \param recursion_choice   the strategy used to decide which subjet to recurse into
-// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-IteratedSoftDrop::IteratedSoftDrop(double  beta,
-                                   double  symmetry_cut, 
-                                   RecursiveSoftDrop::SymmetryMeasure  symmetry_measure,
-                                   double  angular_cut,
-                                   double  R0,
-                                   double  mu_cut, 
-                                   RecursiveSoftDrop::RecursionChoice  recursion_choice,
-                                   const FunctionOfPseudoJet<PseudoJet> * subtractor)
-  : _rsd(beta, symmetry_cut, symmetry_measure, -1, R0, mu_cut, recursion_choice, subtractor){
-  _rsd.set_hardest_branch_only(true);
-  if (angular_cut>0)
-    _rsd.set_min_deltaR_squared(angular_cut*angular_cut);
-}
-
-  
-// returns vector of ISD symmetry factors and splitting angles
-IteratedSoftDropInfo IteratedSoftDrop::result(const PseudoJet& jet) const{
-  PseudoJet rsd_jet = _rsd(jet);
-  if (! rsd_jet.has_structure_of<RecursiveSoftDrop>())
-    return IteratedSoftDropInfo();
-  return IteratedSoftDropInfo(rsd_jet.structure_of<RecursiveSoftDrop>().sorted_zg_and_thetag());
-}
-
-
-std::string IteratedSoftDrop::description() const{
-  std::ostringstream oss;
-  oss << "IteratedSoftDrop with beta =" << _rsd.beta()
-      << ", symmetry_cut=" << _rsd.symmetry_cut()
-      << ", R0=" << _rsd.R0();
-  
-  if (_rsd.min_deltaR_squared() >= 0){
-    oss << " and angular_cut=" << sqrt(_rsd.min_deltaR_squared());
-  } else {
-    oss << " and no angular_cut";
-  }
-  
-  if (_rsd.subtractor()){
-    oss << ", and with internal subtraction using [" << _rsd.subtractor()->description() << "]";
-  }
-  return oss.str();
-}
-
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/RecursiveTools/IteratedSoftDrop.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/IteratedSoftDrop.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,219 +1,0 @@
-// $Id: IteratedSoftDrop.hh 1086 2017-10-11 08:07:26Z gsoyez $
-//
-// Copyright (c) 2017-, Jesse Thaler, Kevin Zhou, Gavin P. Salam,
-// Gregory Soyez
-//
-// based on arXiv:1704.06266 by Christopher Frye, Andrew J. Larkoski,
-// Jesse Thaler, Kevin Zhou
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__
-#define __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__
-
-#include "RecursiveSoftDrop.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//------------------------------------------------------------------------
-/// \class IteratedSoftDropInfo
-/// helper class that carries all the relevant information one can get
-/// from running IteratedSoftDrop on a given jet (or vector of jets)
-///
-class IteratedSoftDropInfo{
-public:
-  /// ctor without initialisation
-  IteratedSoftDropInfo(){}
-
-  /// ctor with initialisation
-  IteratedSoftDropInfo(std::vector<std::pair<double,double> > zg_thetag_in)
-    : _all_zg_thetag(zg_thetag_in){}
-
-  /// get the raw list of (angular-ordered) zg and thetag
-  const std::vector<std::pair<double,double> > &all_zg_thetag() const{
-    return _all_zg_thetag;
-  }
-
-  /// overloadd the () operator so that it also returns the full (zg,thetag) list
-  const std::vector<std::pair<double,double> > & operator()() const{
-    return _all_zg_thetag;
-  }
-
-  /// overloadd the [] operator to access the ith (zg,thetag) pair
-  const std::pair<double,double> & operator[](unsigned int i) const{
-    return _all_zg_thetag[i];
-  }
-
-  /// returns the angularity with angular exponent alpha and z
-  /// exponent kappa calculated on the zg's and thetag's found by
-  /// iterated SoftDrop
-  ///
-  /// returns 0 if no substructure was found
-  double angularity(double alpha, double kappa=1.0) const;
-
-  /// returns the Iterated SoftDrop multiplicity
-  unsigned int multiplicity() const{ return _all_zg_thetag.size(); }  
-
-  /// returns the Iterated SoftDrop multiplicity (i.e. size)
-  unsigned int size() const{ return _all_zg_thetag.size(); }  
-  
-protected:
-  /// the real information: angular-ordered list of all the zg and
-  /// thetag that passed the (recursive) SD conddition
-  std::vector<std::pair<double,double> > _all_zg_thetag;
-};
-  
-
-  
-//------------------------------------------------------------------------
-/// \class IteratedSoftDrop
-/// implementation of the IteratedSoftDrop procedure
-/// 
-/// This class provides an implementation of the IteratedSoftDrop
-/// procedure.  It is based on the SoftDrop procedure can be used to
-/// define a 'groomed symmetry factor', equal to the symmetry factor
-/// of the two subjets of the resulting groomed jet.  The Iterated
-/// Soft Drop procedure recursively performs Soft Drop on the harder
-/// branch of the groomed jet, halting at a specified angular cut
-/// \f$\theta_{\rm cut}\f$, returning a list of symmetry factors which
-/// can be used to define observables.
-///
-/// Like SoftDrop, the cut applied recursively is 
-///   \f[
-///      z > z_{\rm cut} (\theta/R_0)^\beta
-///   \f]
-/// with z the asymmetry measure and \f$\theta\f$ the geometrical
-/// distance between the two subjets. The procedure halts when
-/// \f$\theta < \theta_{\rm cut}\f$.
-///
-/// By default, this implementation returs the IteratedSoftDropInfo
-/// obtained after running IteratedSoftDrop on a jet
-///
-/// Although all these quantities can be obtained from the returned
-/// IteratedSoftDropInfo, we also provide helpers to directly get the
-/// multiplicity, some (generalised) angularity, or the raw list of
-/// (angular-ordered) (zg, thetag) pairs that passed the (recursive)
-/// SoftDrop condition.
-///
-/// We stress the fact that IteratedSoftDrop is _not_ a Transformer
-/// since it returns an IteratedSoftDropInfo and not a modified
-/// PseudoJet
-///
-class IteratedSoftDrop : public FunctionOfPseudoJet<IteratedSoftDropInfo> {
-public:
-  /// Constructor. Takes in the standard Soft Drop parameters, an angular cut \f$\theta_{\rm cut}\f$, 
-  /// and a choice of angular and symmetry measure. 
-  ///
-  /// \param beta               the Soft Drop beta parameter
-  /// \param symmetry_cut       the Soft Drop symmetry cut
-  /// \param angular_cut        the angular cutoff to halt Iterated Soft Drop
-  /// \param R0                 the angular distance normalization
-  /// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-  IteratedSoftDrop(double beta, double symmetry_cut, double angular_cut, double R0 = 1.0,
-                   const FunctionOfPseudoJet<PseudoJet> * subtractor = 0);
-  
-  /// Full constructor, which takes the following parameters:
-  ///
-  /// \param beta               the value of the beta parameter
-  /// \param symmetry_cut       the value of the cut on the symmetry measure
-  /// \param symmetry_measure   the choice of measure to use to estimate the symmetry
-  /// \param angular_cut        the angular cutoff to halt Iterated Soft Drop
-  /// \param R0                 the angular distance normalisation [1 by default]
-  /// \param mu_cut             the maximal allowed value of mass drop variable mu = m_heavy/m_parent 
-  /// \param recursion_choice   the strategy used to decide which subjet to recurse into
-  /// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-  ///
-  /// Notes: 
-  ///
-  /// - by default, SoftDrop will recluster the jet with the
-  ///   Cambridge/Aachen algorithm if it is not already the case. This
-  ///   behaviour can be changed using the "set_reclustering" method
-  ///   defined below
-  ///
-  IteratedSoftDrop(double  beta,
-                   double  symmetry_cut, 
-                   RecursiveSoftDrop::SymmetryMeasure  symmetry_measure,
-                   double  angular_cut,
-                   double  R0 = 1.0,
-                   double  mu_cut = std::numeric_limits<double>::infinity(), 
-                   RecursiveSoftDrop::RecursionChoice  recursion_choice = RecursiveSoftDrop::larger_pt,
-                   const FunctionOfPseudoJet<PseudoJet> * subtractor = 0);
-
-  /// default destructor
-  virtual ~IteratedSoftDrop(){}
-
-  //----------------------------------------------------------------------
-  // behaviour tweaks (inherited from RecursiveSoftDrop and RecursiveSymmetryCutBase)
-
-  /// switch to using a dynamical R0 (see RecursiveSoftDrop)
-  void set_dynamical_R0(bool value=true) { _rsd.set_dynamical_R0(value); }
-  bool use_dynamical_R0() const { return _rsd.use_dynamical_R0(); }
-
-  /// an alternative way to set the subtractor (see RecursiveSymmetryCutBase)
-  void set_subtractor(const FunctionOfPseudoJet<PseudoJet> * subtractor_) {_rsd.set_subtractor(subtractor_);}
-  const FunctionOfPseudoJet<PseudoJet> * subtractor() const {return _rsd.subtractor();}
-  
-  /// returns the IteratedSoftDropInfo associated with the jet "jet"
-  IteratedSoftDropInfo result(const PseudoJet& jet) const;
-
-  /// Tells the tagger whether to assume that the input jet has
-  /// already been subtracted (relevant only with a non-null
-  /// subtractor, see RecursiveSymmetryCutBase)
-  void set_input_jet_is_subtracted(bool is_subtracted) { _rsd.set_input_jet_is_subtracted(is_subtracted);}
-  bool input_jet_is_subtracted() const {return _rsd.input_jet_is_subtracted();}
-  
-  /// configure the reclustering prior to the recursive de-clustering
-  void set_reclustering(bool do_reclustering=true, const Recluster *recluster=0){
-    _rsd.set_reclustering(do_reclustering, recluster);
-  }
-  
-  //----------------------------------------------------------------------
-  // actions on jets
-  /// returns vector of ISD symmetry factors and splitting angles
-  std::vector<std::pair<double,double> > all_zg_thetag(const PseudoJet& jet) const{
-    return result(jet).all_zg_thetag();
-  }
-
-  /// returns the angularity with angular exponent alpha and z
-  /// exponent kappa calculated on the zg's and thetag's found by
-  /// iterated SoftDrop
-  ///
-  /// returns 0 if no substructure was found
-  double angularity(const PseudoJet& jet, double alpha, double kappa=1.0) const{
-    return result(jet).angularity(alpha, kappa);
-  }
-  
-  /// returns the Iterated SoftDrop multiplicity
-  double multiplicity(const PseudoJet& jet) const{ return result(jet).multiplicity(); }
-
-  /// description of the class
-  std::string description() const;
-
-protected:
-  RecursiveSoftDrop _rsd;
-};
-
-  
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_ITERATEDSOFTDROP_HH__
Index: external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,43 +1,0 @@
-// $Id: ModifiedMassDropTagger.cc 683 2014-06-13 14:38:38Z gsoyez $
-//
-// Copyright (c) 2014-, Gavin P. Salam
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "ModifiedMassDropTagger.hh"
-#include "fastjet/JetDefinition.hh"
-#include "fastjet/ClusterSequenceAreaBase.hh"
-#include <algorithm> 
-#include <cstdlib> 
-
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//----------------------------------------------------------------------
-string ModifiedMassDropTagger::symmetry_cut_description() const {
-  ostringstream ostr;
-  ostr << _symmetry_cut << " [ModifiedMassDropTagger]";
-  return ostr.str();
-}
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/ModifiedMassDropTagger.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,128 +1,0 @@
-// $Id: ModifiedMassDropTagger.hh 1032 2017-07-31 14:20:03Z gsoyez $
-//
-// Copyright (c) 2014-, Gavin P. Salam
-// based on arXiv:1307.007 by Mrinal Dasgupta, Simone Marzani and Gavin P. Salam
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_MODIFIEDMASSDROPTAGGER_HH__
-#define __FASTJET_CONTRIB_MODIFIEDMASSDROPTAGGER_HH__
-
-#include "RecursiveSymmetryCutBase.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//------------------------------------------------------------------------
-/// \class ModifiedMassDropTagger
-/// An implementation of the modified Mass-Drop Tagger from arXiv:1307.0007.
-///
-class ModifiedMassDropTagger : public RecursiveSymmetryCutBase {
-public:
-  
-  /// Simplified constructor, which takes just a symmetry cut (applied
-  /// on the scalar_z variable) and an optional subtractor.
-  ///
-  /// In this incarnation the ModifiedMassDropTagger is a bit of a
-  /// misnomer, because there is no mass-drop condition
-  /// applied. Recursion into the jet structure chooses the prong with
-  /// largest pt. (Results from arXiv:1307.0007 were based on the
-  /// largest mt, but this only makes a difference for values of the
-  /// symmetry_cut close to 1/2).
-  ///
-  /// If the (optional) pileup subtractor can be supplied, then see
-  /// also the documentation for the set_input_jet_is_subtracted() member
-  /// function.
-  ///
-  /// NB: The configuration of MMDT provided by this constructor is
-  /// probably the most robust for use with subtraction.
-  ModifiedMassDropTagger(double symmetry_cut, 
-                         const FunctionOfPseudoJet<PseudoJet> * subtractor = 0
-                         ) :
-    RecursiveSymmetryCutBase(scalar_z,  // the default SymmetryMeasure
-                             std::numeric_limits<double>::infinity(), // the default is no mass drop
-                             larger_pt, // the default RecursionChoice
-                             subtractor),
-    _symmetry_cut(symmetry_cut)
-  {}
-
-  /// Full constructor, which takes the following parameters:
-  ///
-  /// \param symmetry_cut       the value of the cut on the symmetry measure
-  /// \param symmetry_measure   the choice of measure to use to estimate the symmetry
-  /// \param mu_cut             the maximal allowed value of mass drop variable mu = m_heavy/m_parent 
-  /// \param recursion_choice   the strategy used to decide which subjet to recurse into
-  /// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-  ///
-  /// To obtain the mMDT as discussed in arXiv:1307.0007, use an
-  /// symmetry_measure that's one of the following
-  ///
-  /// - RecursiveSymmetryCutBase::y         (for a cut on y)
-  /// - RecursiveSymmetryCutBase::scalar_z  (for a cut on z)
-  ///
-  /// and use the default recursion choice of
-  /// RecursiveSymmetryCutBase::larger_pt (larger_mt will give something
-  /// very similar, while larger_m will give the behaviour of the
-  /// original, but now deprecated MassDropTagger)
-  ///
-  /// Notes: 
-  ///
-  /// - By default the ModifiedMassDropTagger will relcuster the jets
-  ///   with the C/A algorithm (if needed).
-  ///
-  /// - the mu_cut parameter is mostly irrelevant when it's taken
-  ///   larger than about 1/2: the tagger is then one that cuts
-  ///   essentially on the (a)symmetry of the jet's momentum
-  ///   sharing. The default value of infinity turns off its use
-  ///   entirely
-  ModifiedMassDropTagger(double           symmetry_cut, 
-                         SymmetryMeasure  symmetry_measure,
-                         double           mu_cut = std::numeric_limits<double>::infinity(), 
-                         RecursionChoice  recursion_choice = larger_pt,
-                         const FunctionOfPseudoJet<PseudoJet> * subtractor = 0
-                         ) : 
-    RecursiveSymmetryCutBase(symmetry_measure, mu_cut, recursion_choice, subtractor),
-    _symmetry_cut(symmetry_cut)
-  {}
-
-  /// default destructor
-  virtual ~ModifiedMassDropTagger(){}
-
-  //----------------------------------------------------------------------
-  // access to class info
-  double symmetry_cut() const { return _symmetry_cut; }
-  
-protected:
-
-  /// The symmetry cut function for MMDT returns just a constant, since the cut value
-  /// has no dependence on the subjet kinematics
-  virtual double symmetry_cut_fn(const PseudoJet & /* p1 */, 
-                                 const PseudoJet & /* p2 */,
-                                 void *extra_parameters = 0
-                                 ) const {return _symmetry_cut;}
-  virtual std::string symmetry_cut_description() const;
-
-  double           _symmetry_cut;
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_MODIFIEDMASSDROPTAGGER_HH__
Index: external/fastjet/contribs/RecursiveTools/NEWS
===================================================================
--- external/fastjet/contribs/RecursiveTools/NEWS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,13 +1,0 @@
-2020/03/03: release of version 2.0.0 with updated readme
-
-2018/05/31: release of version 2.0.0-beta2 with corrected syntax
-
-2017/10/10: release of version 2.0.0-beta1 including implementations of
-
-* RecursiveSoftDrop (see example_rsd.hh for usage)
-* IteratedSoftDrop (see example_isd.hh for usage)
-* e+e- version of the recursive tools (see example_mmdt_ee.hh for usage)
-* BottomUpSoftDrop (see example_bottomup_softdrop.cc for usage)
-
-2014/07/09: release of version 1.0.0 of RecursiveTools including
-            ModifiedMassDropTagger and SoftDrop (as well as Recluster)
Index: external/fastjet/contribs/RecursiveTools/README
===================================================================
--- external/fastjet/contribs/RecursiveTools/README	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,358 +1,0 @@
-------------------------------------------------------------------------
-RecursiveTools FastJet contrib
-------------------------------------------------------------------------
-
-The RecursiveTools FastJet contrib aims to provide a common contrib
-for a number of tools that involve recursive reclustering/declustering
-of a jet for tagging or grooming purposes.
-
-Currently it contains:
-
-- ModifiedMassDropTagger
-  This corresponds to arXiv:1307.0007 by Mrinal Dasgupta, Alessandro
-  Fregoso, Simone Marzani and Gavin P. Salam
-
-- SoftDrop
-  This corresponds to arXiv:1402.2657 by Andrew J. Larkoski, Simone
-  Marzani, Gregory Soyez, Jesse Thaler
-
-- RecursiveSoftDrop
-- BottomUpSoftDrop
-  This corresponds to arXiv:1804.03657 by Frederic Dreyer, Lina
-  Necib, Gregory Soyez and Jesse Thaler
-
-- IteratedSoftDrop
-  This corresponds to arXiv:1704.06266 by Christopher Frye, Andrew J.
-  Larkoski, Jesse Thaler, Kevin Zhou
-
-- Recluster
-  A generic tool to recluster a given jet into subjets
-  Note: a Recluster class is available natively in FastJet since v3.1.
-        Users are therefore encouraged to use the FastJet version
-        rather than this one which is mostly provided for
-        compatibility of this contrib with older versions of FastJet.
-
-The interface for these tools is described in more detail below, with
-all of the available options documented in the header files.
-
-One note about nomenclature.  A groomer is a procedure that takes a
-PseudoJet and always returns another (non-zero) PseudoJet.  A tagger is
-a procedure that takes a PseudoJet, and either returns another PseudoJet
-(i.e. tags it) or returns an empty PseudoJet (i.e. doesn't tag it).
-
-------------------------------------------------------------------------
-ModifiedMassDropTagger
-------------------------------------------------------------------------
-
-The Modified Mass Drop Tagger (mMDT) recursively declusters a jet,
-following the largest pT subjet until a pair of subjets is found that
-satisfy the symmetry condition on the energy sharing
-
-   z > z_cut
-
-where z_cut is a predetermined value.  By default, z is calculated as
-the scalar pT fraction of the softest subjet.  Note that larger values
-of z_cut correspond to a more restrictive tagging criteria.
-
-By default, mMDT will first recluster the jet using the CA clustering
-algorithm, which means that mMDT can be called on any jet, regardless
-of the original jet finding measure.
-
-A default mMDT can be created via
-
-   double z_cut = 0.10;
-   ModifiedMassDropTagger mMDT(z_cut);
-
-More options are available in the full constructor.  To apply mMDT,
-one simply calls it on the jet of interest.
-
-   PseudoJet tagged_jet = mMDT(original_jet);
-
-Note that mMDT is a tagger, such that tagged_jet will only be non-zero
-if the symmetry cut z > z_cut is satisfied by some branching of the
-clustering tree.  
-
-To gain additional information about the mMDT procedure, one can use
-
-   tagged_jet.structure_of<ModifiedMassDropTagger>()
-
-which gives access to information about the delta_R between the tagged
-subjets, their z value, etc.
-
-------------------------------------------------------------------------
-SoftDrop
-------------------------------------------------------------------------
-
-The SoftDrop procedure is very similar to mMDT, albeit with a 
-generalised symmetry condition:
- 
-   z > z_cut * (R / R0)^beta
-
-Note that larger z_cut and smaller beta correspond to more aggressive
-grooming of the jet.
-
-SoftDrop is intended to be used as a groomer (instead of as a tagger),
-such that if the symmetry condition fails throughout the whole
-clustering tree, SoftDrop will still return a single particle in the
-end.  Apart from the tagger/groomer distinction, SoftDrop with beta=0 is
-the same as mMDT.
-
-A default SoftDrop groomer can be created via:
-
-   double beta  = 2.0;
-   double z_cut = 0.10;
-   double R0    = 1.0; // this is the default value
-   SoftDrop sd(beta,z_cut,R0);
-
-and acts on a desired jet as
-
-   PseudoJet groomed_jet = sd(original_jet);
-
-and additional information can be obtained via
-
-   groomed_jet.structure_of<SoftDrop>()
-
-SoftDrop is typically called with beta > 0, though beta < 0 is still a
-viable option.  Because beta < 0 is infrared-collinear unsafe in
-grooming mode, one probably wants to switch to tagging mode for negative
-beta, via set_tagging_mode().
-
-------------------------------------------------------------------------
-RecursiveSoftDrop
-------------------------------------------------------------------------
-
-The RecursiveSoftDrop procedure applies the Soft Drop procedure N times 
-in a jet in order to find up to N+1 prongs.  N=0 makes no modification
-to the jet, and N=1 is equivalent to the original SoftDrop.
-
-Once one has more than one prong, one has to decide which will be
-declustered next.  At each step of the declustering procedure, one
-undoes the clustering which has the largest declustering angle
-(amongst all the branches that are searched for substructure). [see
-"set_fixed_depth" below for an alternative]
-
-Compared to SoftDrop, RecursiveSoftDrop takes an extra argument N
-specifying the number of times the SoftDrop procedure is recursively
-applied. Negative N means that the procedure is applied until no
-further substructure is found (i.e. corresponds to taking N=infinity).
-
-   double beta  = 2.0;
-   double z_cut = 0.10;
-   double R0    = 1.0; // this is the default value
-   int N        = -1;  
-   RecursiveSoftDrop rsd(beta, z_cut, N, R0);
-
-One then acts on a jet as
-
-   PseudoJet groomed_jet = rsd(jet)
-
-and get additional information via
-
-   groomed_jet.structure_of<RecursiveSoftDrop>()
-
-------------------------------------------------------------------------
-IteratedSoftDrop
-------------------------------------------------------------------------
-
-Iterated Soft Drop (ISD) is a repeated variant of SoftDrop.  After
-performing the Soft Drop procedure once, it logs the groomed symmetry
-factor, then recursively performs Soft Drop again on the harder
-branch.  This procedure is repeated down to an (optional) angular cut
-theta_cut, yielding a set of symmetry factors from which observables
-can be built.
-
-An IteratedSoftDrop tool can be created as follows:
-
-  double beta = -1.0;
-  double z_cut = 0.005;
-  double theta_cut = 0.0;
-  double R0 = 0.5;        // characteristic radius of jet algorithm
-  IteratedSoftDrop isd(beta, z_cut, double theta_cut, R0);
-
-By default, ISD applied on a jet gives a result of type
-IteratedSoftDropInfo that can then be probed to obtain physical
-observables
-
-  IteratedSoftDropInfo isd_info = isd(jet);
-
-  unsigned int multiplicity = isd_info.multiplicity();
-  double kappa = 1.0;     // changes angular scale of ISD angularity
-  double isd_width = isd_info.angularity(kappa);
-  vector<pair<double,double> > zg_thetags = isd_info.all_zg_thetag();
-  vector<pair<double,double> > zg_thetags = isd_info();
-  for (unsigned int i=0; i< isd_info.size(); ++i){
-    cout << "(zg, theta_g)_" << i << " = "
-         << isd_info[i].first << " " <<  isd_info[i].second << endl;
-  }
-
-Alternatively, one can directly get the multiplicity, angularity, and
-(zg,thetag) pairs from the IteratedSoftDrop class, at the expense of
-re-running the declustering procedure:
-
-  unsigned int multiplicity = isd.multiplicity(jet);
-  double isd_width = isd.angularity(jet, 1.0);
-  vector<pair<double,double> > zg_thetags = isd.all_zg_thetag(jet);
-
-
-Note: the iterative declustering procedure is the same as what one
-  would obtain with RecursiveSoftDrop with an (optional) angular cut
-  and recursing only in the hardest branch [see the "Changing
-  behaviour" section below for details], except that it returns some
-  information about the jet instead of a modified jet as RSD does.
-
-
-------------------------------------------------------------------------
-BottomUpSoftDrop
-------------------------------------------------------------------------
-
-This is a bottom-up version of the RecursiveSoftDrop procedure, in a
-similar way as Pruning can be seen as a bottom-up version of Trimming.
-
-In practice, the jet is reclustered and at each step of the clustering
-one checks the SoftDrop condition
-
-   z > z_cut * (R / R0)^beta
-
-If the condition is met, the pair is recombined. If the condition is
-not met, only the hardest of the two objects is kept for further
-clustering and the softest is rejected.
-
-BottomUpSoftDrop takes the same arguments as SoftDrop, and a groomer
-can be created with:
-
-   double beta  = 2.0;
-   double z_cut = 0.10;
-   double R0    = 1.0; // this is the default value
-   BottomUpSoftDrop busd(beta,z_cut,R0);
-
-One then acts on a jet as
-
-   PseudoJet groomed_jet = busd(jet)
-
-------------------------------------------------------------------------
-Recluster
-------------------------------------------------------------------------
-
-  *** NOTE: this is provided only for backwards compatibility ***
-  *** with FastJet <3.1. For FastJet >=3.1, the native        ***
-  *** fastjet::Recluster is used instead                      ***
-
-The Recluster class allows the constituents of a jet to be reclustered
-with a different recursive clustering algorithm.  This is used
-internally in the mMDT/SoftDrop/RecursiveSoftDrop/IteratedSoftDrop
-code in order to recluster the jet using the CA algorithm.  This is
-achieved via
-
-  Recluster ca_reclusterer(cambridge_algorithm,
-                        JetDefinition::max_allowable_R);
-  PseudoJet reclustered_jet = ca_reclusterer(original_jet);
-
-Note that reclustered_jet creates a new ClusterSequence that knows to
-delete_self_when_unused.
-
-------------------------------------------------------------------------
-Changing behaviour
-------------------------------------------------------------------------
-
-The behaviour of the all the tools provided here
-(ModifiedMassDropTagger, SoftDrop, RecursiveSoftDrop and
-IteratedSoftDrop) can be tweaked using the following options:
-
-SymmetryMeasure = {scalar_z, vector_z, y, theta_E, cos_theta_E}
-  [constructor argument]
-  : The definition of the energy sharing between subjets, with 0
-    corresponding to the most asymmetric.
-    . scalar_z = min(pt1,pt2)/(pt1+pt2)   [default]
-    . vector_z = min(pt1,pt2)/pt_{1+2}
-    . y = min(pt1^2,pt2^2)/m_{12}^2  (original y from MDT)
-    . theta_E     = min(E1,E2)/(E1+E2),
-           with angular measure theta_{12}^2
-    . cos_theta_E = min(E1,E2)/(E1+E2),
-           with angular measure 2[1-cos(theta_{12})]
-    The last two variants are meant for use in e+e- collisions,
-    together with the "larger_E" recursion choice (see below)
-
-RecursionChoice = {larger_pt, larger_mt, larger_m, larger_E}
-  [constructor argument]
-  : The path to recurse through the tree after the symmetry condition
-    fails. Options refer to transverse momentum (pt), transverse mass
-    (mt=sqrt(pt^2+m^2), mass (m) or energy (E). the latter is meant
-    for use in e+e- collisions
-
-mu_cut   [constructor argument]
-  : An optional mass drop condition
-
-set_subtractor(subtractor*) [or subtractor as a constructor argument]
-  : provide a subtractor. When a subtractor is supplied, the
-    kinematic constraints are applied on subtracted 4-vectors. In
-    this case, the result of the ModifiedMassDropTagger/SoftDrop is a
-    subtracted PseudoJet, and it is assumed that
-    ModifiedMassDropTagger/SoftDrop is applied to an unsubtracted jet.
-    The latter default can be changed by calling
-    set_input_jet_is_subtracted().
-
-set_reclustering(bool, Recluster*)
-  : An optional setting to recluster a jet with a different jet
-    recursive jet algorithm.  The code is only designed to give sensible
-    results with the CA algorithm, but other reclustering algorithm
-    (especially kT) may be appropriate in certain contexts. 
-    Use at your own risk.
-
-set_grooming_mode()/set_tagging_mode()
-  : In grooming mode, the algorithm will return a single particle if the
-    symmetry condition fails for the whole tree.  In tagging mode, the
-    algorithm will return an zero PseudoJet if no symmetry conditions
-    passes.  Note that ModifiedMassDropTagger defaults to tagging mode
-    and SoftDrop defaults to grooming mode.
-
-set_verbose_structure(bool)
-  : when set to true, additional information will be stored in the jet
-    structure. This includes in particular values of symmetry,
-    delta_R, and mu of dropped branches
-
-For the specific case of RecursiveSoftDrop, additional tweaking is
-possible via the following methods
-
-set_fixed_depth_mode(bool)
-  : when this is true, RSD will recurse (N times) into all the
-    branches found during the previous iteration [instead of recursing
-    through the largest declustering angle until N prongs have been
-    found]. This yields at most 2^N prong. For infinite N, the two
-    options are equivalent.
-
-set_dynamical_R0(bool)
-  : By default the angles in the SD condition are normalised to the
-    parameter R0. With "dynamical R0", RSD will dynamically adjust R0
-    to be the angle between the two prongs found during the previous
-    iteration.
-
-set_hardest_branch_only(bool)
-  : When substructure is found, only recurse into the hardest of the
-    two branches for further substructure search. This uses the class
-    RecursionChoice.
-
-set_min_deltaR_squared(double):
-  : set a minimal angle (squared) at which we stop the declustering
-    procedure.  This cut is ineffective for negative values of the
-    argument.
-
-------------------------------------------------------------------------
-Technical Details
-------------------------------------------------------------------------
-
-Both ModifiedMassDropTagger and SoftDrop inherit from
-RecursiveSymmetryCutBase, which provides a common codebase for recursive
-declustering of a jet with a symmetry cut condition.  A generic 
-RecursiveSymmetryCutBase depends on the following (virtual) functions
-(see header file for exact full specs, including constness):
-
-double symmetry_cut_fn(PseudoJet &, PseudoJet &)
-  : The function that defines the symmetry cut. This is what actually 
-    defines different recursive declustering schemes, and all classes
-    that inherit from RecursiveSymmetryCutBase must define this
-    function.
-
-string symmetry_cut_description() 
-  : the string description of the symmetry cut.
-
-------------------------------------------------------------------------
Index: external/fastjet/contribs/RecursiveTools/Recluster.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/Recluster.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,390 +1,0 @@
-// $Id: Recluster.cc 699 2014-07-07 09:58:12Z gsoyez $
-//
-// Copyright (c) 2014-, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "Recluster.hh"
-#include <fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh>
-#include <sstream>
-#include <typeinfo>
-
-using namespace std;
-
-// Comments:
-//
-//  - If the jet comes from a C/A clustering (or is a composite jet
-//    made of C/A clusterings) and we recluster it with a C/A
-//    algorithm, we just use exclusive jets instead of doing the
-//    clustering explicitly. In this specific case, we need to make
-//    sure that all the pieces share the same cluster sequence.
-//
-//  - If the recombiner has to be taken from the original jet and that
-//    jet is composite, we need to check that all the pieces were
-//    obtained with the same recombiner.
-//
-// TODO:
-//
-//  - check this actually works!!!
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-LimitedWarning Recluster::_explicit_ghost_warning;
-
-// class description
-string Recluster::description() const {
-  ostringstream ostr;
-  ostr << "Recluster with subjet_def = ";
-  if (_use_full_def) {
-    ostr << _subjet_def.description();
-  } else {
-    if (_subjet_alg == kt_algorithm) {
-      ostr << "Longitudinally invariant kt algorithm with R = " << _subjet_radius;
-    } else if (_subjet_alg == cambridge_algorithm) {
-      ostr << "Longitudinally invariant Cambridge/Aachen algorithm with R = " << _subjet_radius;
-    } else if (_subjet_alg == antikt_algorithm) {
-      ostr << "Longitudinally invariant anti-kt algorithm with R = " << _subjet_radius;
-    } else if (_subjet_alg == genkt_algorithm) {
-      ostr << "Longitudinally invariant generalised kt algorithm with R = " << _subjet_radius
-           << ", p = " << _subjet_extra;
-    } else if (_subjet_alg == cambridge_for_passive_algorithm) {
-      ostr << "Longitudinally invariant Cambridge/Aachen algorithm with R = " << _subjet_radius
-           << " and a special hack whereby particles with kt < " 
-           << _subjet_extra << "are treated as passive ghosts";
-    } else if (_subjet_alg == ee_kt_algorithm) {
-      ostr << "e+e- kt (Durham) algorithm";
-    } else if (_subjet_alg == ee_genkt_algorithm) {
-      ostr << "e+e- generalised kt algorithm with R = " << _subjet_radius
-           << ", p = " << _subjet_extra;
-    } else if (_subjet_alg == undefined_jet_algorithm) {
-      ostr << "uninitialised JetDefinition (jet_algorithm=undefined_jet_algorithm)" ;
-    } else {
-      ostr << "unrecognized jet_algorithm";
-    }
-    ostr << ", a recombiner obtained from the jet being reclustered";
-  }
-
-  if (_single)
-    ostr << " and keeping the hardest subjet";
-  else
-    ostr << " and joining all subjets in a composite jet";
-
-  return ostr.str();
-}
-
-// return a vector of subjets, which are the ones that would be kept
-// by the filtering
-PseudoJet Recluster::result(const PseudoJet &jet) const {
-  // generic sanity checks
-  //-------------------------------------------------------------------
-  // make sure that the jet has constituents
-  if (! jet.has_constituents())
-    throw Error("Filter can only be applied on jets having constituents");
-
-  // tests particular to certain configurations
-  //-------------------------------------------------------------------
-
-  // for a whole variety of checks, we shall need the "recursive"
-  // pieces of the jet (the jet itself or recursing down to its most
-  // fundamental pieces). So we do compute these once and for all.
-  //
-  // Note that the pieces are always needed (either for C/A or for the
-  // area checks)
-  vector<PseudoJet> all_pieces; //.clear();
-  if ((!_get_all_pieces(jet, all_pieces)) || (all_pieces.size()==0)){
-    throw Error("Recluster: failed to retrieve all the pieces composing the jet.");
-  }
-
-  // decide which jet definition to use
-  //-------------------------------------------------------------------
-  JetDefinition subjet_def;
-  if (_use_full_def){
-    subjet_def = _subjet_def;
-  } else {
-    _build_jet_def_with_recombiner(all_pieces, subjet_def);
-  }
-
-
-  // the vector that will ultimately hold the subjets
-  vector<PseudoJet> subjets;
-
-  // check if we can apply the simplification for C/A jets reclustered
-  // with C/A
-  //
-  // we apply C/A clustering iff
-  //  - the request subjet_def is C/A
-  //  - the jet is either directly coming from C/A or if it is a
-  //    superposition of C/A jets from the same cluster sequence
-  //  - the pieces agree with the recombination scheme of subjet_def
-  //
-  // Note that in this case area support will be automatically
-  // inherted so we can only worry about this later
-  //-------------------------------------------------------------------
-  if (_check_ca(all_pieces, subjet_def)){
-    _recluster_cafilt(all_pieces, subjets, subjet_def.R());
-    subjets = sorted_by_pt(subjets);
-    return _single
-      ? subjets[0]
-      : join(subjets, *(subjet_def.recombiner()));
-  }
-
-  // decide if area support has to be kept
-  //-------------------------------------------------------------------
-  bool include_area_support = jet.has_area();
-  if ((include_area_support) &&  (!_check_explicit_ghosts(all_pieces))){
-    _explicit_ghost_warning.warn("Recluster: the original cluster sequence is lacking explicit ghosts; area support will no longer be available after re-clustering");
-    include_area_support = false;
-  }
-
-  // extract the subjets
-  //-------------------------------------------------------------------
-  _recluster_generic(jet, subjets, subjet_def, include_area_support);
-  subjets = sorted_by_pt(subjets);
-
-  return _single
-    ? subjets[0]
-    : join(subjets, *(subjet_def.recombiner()));
-}
-
-//----------------------------------------------------------------------
-// the parts that really do the reclustering
-//----------------------------------------------------------------------
-
-// get the subjets in the simple case of C/A+C/A
-void Recluster::_recluster_cafilt(const vector<PseudoJet> & all_pieces, 
-                                  vector<PseudoJet> & subjets, 
-                                  double Rfilt) const{
-  subjets.clear();
-
-  // each individual piece should have a C/A cluster sequence
-  // associated to it. So a simple loop would do the job
-  for (vector<PseudoJet>::const_iterator piece_it = all_pieces.begin(); 
-       piece_it!=all_pieces.end(); piece_it++){
-    // just extract the exclusive subjets of 'jet'
-    const ClusterSequence *cs = piece_it->associated_cluster_sequence(); 
-    vector<PseudoJet> local_subjets;
-
-    double dcut = Rfilt / cs->jet_def().R();
-    if (dcut>=1.0){
-      local_subjets.push_back(*piece_it);
-    } else {
-      local_subjets = piece_it->exclusive_subjets(dcut*dcut);
-    }
-
-    copy(local_subjets.begin(), local_subjets.end(), back_inserter(subjets));
-  }
-}
-
-
-// set the filtered elements in the generic re-clustering case (w/o
-// subtraction)
-void Recluster::_recluster_generic(const PseudoJet & jet, 
-                                   vector<PseudoJet> & subjets,
-                                   const JetDefinition & subjet_def,
-                                   bool do_areas) const{
-  // create a new, internal, ClusterSequence from the jet constituents
-  // get the subjets directly from there
-  //
-  // If the jet has area support then we separate the ghosts from the
-  // "regular" particles so the subjets will also have area
-  // support. Note that we do this regardless of whether rho is zero
-  // or not.
-  //
-  // Note that to be able to separate the ghosts, one needs explicit
-  // ghosts!!
-  // ---------------------------------------------------------------
-  if (do_areas){
-    vector<PseudoJet> all_constituents = jet.constituents();
-    vector<PseudoJet> regular_constituents, ghosts;  
-
-    for (vector<PseudoJet>::iterator it = all_constituents.begin(); 
-         it != all_constituents.end(); it++){
-      if (it->is_pure_ghost())
-        ghosts.push_back(*it);
-      else
-        regular_constituents.push_back(*it);
-    }
-
-    // figure out the ghost area from the 1st ghost (if none, any value
-    // would probably do as the area will be 0 and subtraction will have
-    // no effect!)
-    double ghost_area = (ghosts.size()) ? ghosts[0].area() : 0.01;
-    ClusterSequenceActiveAreaExplicitGhosts * csa
-      = new ClusterSequenceActiveAreaExplicitGhosts(regular_constituents, 
-                                                    subjet_def, 
-                                                    ghosts, ghost_area);
-
-    subjets = csa->inclusive_jets();
-
-    // allow the cs to be deleted when it's no longer used
-    // 
-    // Note that there is at least one constituent in the jet so there
-    // is in principle at least one subjet But one may have used a
-    // nasty recombiner that left an empty set of subjets, so we'd
-    // rather play it safe
-    if (subjets.size())
-      csa->delete_self_when_unused();
-    else
-      delete csa;
-  } else {
-    ClusterSequence * cs = new ClusterSequence(jet.constituents(), subjet_def);
-    subjets = cs->inclusive_jets();
-    // allow the cs to be deleted when it's no longer used (again, we
-    // add an extra safety check)
-    if (subjets.size())
-      cs->delete_self_when_unused();
-    else 
-      delete cs;
-  }
-}
-
-
-//----------------------------------------------------------------------
-// various checks and internal constructs
-//----------------------------------------------------------------------
-
-// fundamental info for CompositeJets
-//----------------------------------------------------------------------
- 
-// get the pieces down to the fundamental pieces
-// 
-// Note that this just checks that there is an associated CS to the
-// fundamental pieces, not that it is still valid
-bool Recluster::_get_all_pieces(const PseudoJet &jet, vector<PseudoJet> &all_pieces) const{
-  if (jet.has_associated_cluster_sequence()){
-    all_pieces.push_back(jet);
-    return true;
-  }
-
-  if (jet.has_pieces()){
-    const vector<PseudoJet> pieces = jet.pieces();
-    for (vector<PseudoJet>::const_iterator it=pieces.begin(); it!=pieces.end(); it++)
-      if (!_get_all_pieces(*it, all_pieces)) return false;
-    return true;
-  }
-
-  return false;
-}
-
-// treatment of recombiners
-//----------------------------------------------------------------------
-// get the common recombiner to all pieces (NULL if none)
-//
-// Note that if the jet has an associated cluster sequence that is no
-// longer valid, an error will be thrown (needed since it could be the
-// 1st check called after the enumeration of the pieces)
-const JetDefinition::Recombiner* Recluster::_get_common_recombiner(const vector<PseudoJet> &all_pieces) const{
-  const JetDefinition & jd_ref = all_pieces[0].validated_cs()->jet_def();
-  for (unsigned int i=1; i<all_pieces.size(); i++)
-    if (!all_pieces[i].validated_cs()->jet_def().has_same_recombiner(jd_ref)) return NULL;
-
-  return jd_ref.recombiner();
-}
-  
-void Recluster::_build_jet_def_with_recombiner(const vector<PseudoJet> &all_pieces, 
-                                               JetDefinition &subjet_def) const{
-  // the recombiner has to be guessed from the pieces
-  const JetDefinition::Recombiner * common_recombiner = _get_common_recombiner(all_pieces);
-  if (common_recombiner) {
-    if (typeid(*common_recombiner) == typeid(JetDefinition::DefaultRecombiner)) {
-      RecombinationScheme scheme = 
-        static_cast<const JetDefinition::DefaultRecombiner *>(common_recombiner)->scheme();
-      if (_has_subjet_extra)
-        subjet_def = JetDefinition(_subjet_alg, _subjet_radius, _subjet_extra, scheme);
-      else if (_has_subjet_radius)
-        subjet_def = JetDefinition(_subjet_alg, _subjet_radius, scheme);
-      else 
-        subjet_def = JetDefinition(_subjet_alg, scheme);
-    } else {
-      if (_has_subjet_extra)
-        subjet_def = JetDefinition(_subjet_alg, _subjet_radius, _subjet_extra, common_recombiner);
-      else if (_has_subjet_radius)
-        subjet_def = JetDefinition(_subjet_alg, _subjet_radius, common_recombiner);
-      else 
-        subjet_def = JetDefinition(_subjet_alg, common_recombiner);
-    }
-  } else {
-    throw Error("Recluster: requested to guess the recombination scheme (or recombiner) from the original jet but an inconsistency was found between the pieces constituing that jet.");
-  }
-}
-
-// area support
-//----------------------------------------------------------------------
-
-// check if the jet (or all its pieces) have explicit ghosts
-// (assuming the jet has area support).
-//
-// Note that if the jet has an associated cluster sequence that is no
-// longer valid, an error will be thrown (needed since it could be the
-// 1st check called after the enumeration of the pieces)
-bool Recluster::_check_explicit_ghosts(const vector<PseudoJet> &all_pieces) const{
-  for (vector<PseudoJet>::const_iterator it=all_pieces.begin(); it!=all_pieces.end(); it++)
-    if (! it->validated_csab()->has_explicit_ghosts()) return false;
-  return true;
-}
-
-// C/A specific tests
-//----------------------------------------------------------------------
-
-// check if one can apply the simplification for C/A subjets
-//
-// This includes:
-//  - the subjet definition asks for C/A subjets
-//  - all the pieces share the same CS
-//  - that CS is C/A with the same recombiner as the subjet def
-//  - the filtering radius is not larger than any of the pairwise
-//    distance between the pieces
-//
-// Note that if the jet has an associated cluster sequence that is no
-// longer valid, an error will be thrown (needed since it could be the
-// 1st check called after the enumeration of the pieces)
-bool Recluster::_check_ca(const vector<PseudoJet> &all_pieces, 
-                          const JetDefinition &subjet_def) const{
-  if (subjet_def.jet_algorithm() != cambridge_algorithm) return false;
-
-  // check that the 1st of all the pieces (we're sure there is at
-  // least one) is coming from a C/A clustering. Then check that all
-  // the following pieces share the same ClusterSequence
-  const ClusterSequence * cs_ref = all_pieces[0].validated_cs();
-  if (cs_ref->jet_def().jet_algorithm() != cambridge_algorithm) return false;
-  for (unsigned int i=1; i<all_pieces.size(); i++)
-    if (all_pieces[i].validated_cs() != cs_ref) return false;
-
-  // check that the 1st peice has the same recombiner as the one used
-  // for the subjet clustering
-  // Note that since they share the same CS, checking the 1st one is enough
-  if (!cs_ref->jet_def().has_same_recombiner(subjet_def)) return false;
-
-  // we also have to make sure that the reclustering radius is not larger
-  // than any of the inter-pieces distance
-  double Rsub2 = subjet_def.R();
-  Rsub2 *= Rsub2;
-  for (unsigned int i=0; i<all_pieces.size()-1; i++){
-    for (unsigned int j=i+1; j<all_pieces.size(); j++){
-      if (all_pieces[i].squared_distance(all_pieces[j]) <  Rsub2) return false;
-    }
-  }
-
-  return true;
-}
-
-} // contrib namespace
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/contribs/RecursiveTools/Recluster.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/Recluster.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,183 +1,0 @@
-#ifndef __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__
-#define __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__
-
-// $Id: Recluster.hh 723 2014-07-30 09:11:01Z gsoyez $
-//
-// Copyright (c) 2014-, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include <fastjet/JetDefinition.hh>
-#include <fastjet/CompositeJetStructure.hh> // to derive the ReclusterStructure from CompositeJetStructure
-#include <fastjet/tools/Transformer.hh>     // to derive Recluster from Transformer
-#include <iostream>
-#include <string>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//----------------------------------------------------------------------
-/// \class Recluster
-/// Class that helps reclustering a jet with a new jet definition
-///
-/// The result of the reclustering is returned as a single PseudoJet
-/// with a CompositeJet structure. The pieces of that PseudoJet will
-/// be the individual subjets
-///
-/// When constructed from a JetDefinition, that definition will be
-/// used to obtain the subjets.  When constructed from a JetAlgorithm
-/// and parameters (0 parameters for e+e-, just R or R and an extra
-/// parameter for others) the recombination scheme will be taken as
-/// the same one used to initially cluster the original jet.
-///
-/// The result of this transformer depends on its usage. There are two
-/// typical use-cases: either we recluster one fat jet into subjets,
-/// OR, we recluster the jet with a different jet alg. When Recluster
-/// is created from a full jet definition. The last parameter of the
-/// constructors below dicatate that behaviour: if "single" is true
-/// (the default), a single jet, issued from a regular clustering is
-/// returned (if there are more than one, the hardest is taken);
-/// otherwise (single==false), the result will be a composite jet with
-/// each subjet as pieces
-/// 
-/// Open points for discussion:
-///
-///  - do we add an option to force area support? [could be useful
-///    e.g. for the filter with a subtractor where area support is
-///    mandatory]
-///
-class Recluster : public Transformer {
-public:
-  /// define a recluster that decomposes a jet into subjets using a
-  /// generic JetDefinition
-  ///
-  ///  \param subjet_def   the jet definition applied to obtain the subjets
-  ///  \param single       when true, cluster the jet in a single jet (the
-  ///                      hardest one) with an associated ClusterSequence, 
-  ///                      otherwise return a composite jet with subjets
-  ///                      as pieces.
-  Recluster(const JetDefinition & subjet_def, bool single=true)
-    : _subjet_def(subjet_def), _use_full_def(true), _single(single) {}
-
-  /// define a recluster that decomposes a jet into subjets using a
-  /// JetAlgorithm and its parameters
-  ///
-  ///  \param subjet_alg    the jet algorithm applied to obtain the subjets
-  ///  \param subjet_radius the jet radius if required
-  ///  \param subjet_extra  optional extra parameters for the jet algorithm (only when needed)
-  ///  \param single        when true, cluster the jet in a single jet (the
-  ///                       hardest one) with an associated ClusterSequence, 
-  ///                       otherwise return a composite jet with subjets
-  ///                       as pieces.
-  /// 
-  /// Typically, for e+e- algoriothm you should use the third version
-  /// below with no parameters, for "standard" pp algorithms, just the
-  /// clustering radius has to be specified and for genkt-type of
-  /// algorithms, both the radius and the extra parameter have to be
-  /// specified.
-  Recluster(JetAlgorithm subjet_alg, double subjet_radius, double subjet_extra,
-            bool single=true)
-    : _subjet_alg(subjet_alg), _use_full_def(false), 
-      _subjet_radius(subjet_radius), _has_subjet_radius(true), 
-      _subjet_extra(subjet_extra), _has_subjet_extra(true), _single(single) {}
-  Recluster(JetAlgorithm subjet_alg, double subjet_radius, bool single=true)
-    : _subjet_alg(subjet_alg), _use_full_def(false), 
-      _subjet_radius(subjet_radius), _has_subjet_radius(true),
-      _has_subjet_extra(false), _single(single) {}
-  Recluster(JetAlgorithm subjet_alg, bool single=true)
-    : _subjet_alg(subjet_alg), _use_full_def(false), 
-      _has_subjet_radius(false), _has_subjet_extra(false), _single(single) {}
-
-  /// default dtor
-  virtual ~Recluster(){};
-
-  //----------------------------------------------------------------------
-  // standard Transformer behaviour inherited from the base class
-  // (i.e. result(), description() and structural info)
-
-  /// runs the reclustering and sets kept and rejected to be the jets of interest
-  /// (with non-zero rho, they will have been subtracted).
-  ///
-  /// \param jet    the jet that gets reclustered
-  /// \return the reclustered jet
-  virtual PseudoJet result(const PseudoJet & jet) const;
-
-  /// class description
-  virtual std::string description() const;
-
-  // the type of the associated structure
-  typedef CompositeJetStructure StructureType;
-
-private:
-  /// set the reclustered elements in the simple case of C/A+C/A
-  void _recluster_cafilt(const std::vector<PseudoJet> & all_pieces,
-                         std::vector<PseudoJet> & subjets,
-                         double Rfilt) const;
-
-  /// set the reclustered elements in the generic re-clustering case
-  void _recluster_generic(const PseudoJet & jet, 
-                          std::vector<PseudoJet> & subjets,
-                          const JetDefinition & subjet_def,
-                          bool do_areas) const;
-  
-  // a series of checks
-  //--------------------------------------------------------------------
-  /// get the pieces down to the fundamental pieces
-  bool _get_all_pieces(const PseudoJet &jet, std::vector<PseudoJet> &all_pieces) const;
-
-  /// get the common recombiner to all pieces (NULL if none)
-  const JetDefinition::Recombiner* _get_common_recombiner(const std::vector<PseudoJet> &all_pieces) const;
-
-  /// construct the proper jet definition ensuring that the recombiner
-  /// is taken from the underlying pieces (an error is thrown if the
-  /// pieces do no share a common recombiner)
-  void _build_jet_def_with_recombiner(const std::vector<PseudoJet> &all_pieces, 
-                                      JetDefinition &subjet_def) const;
-
-  /// check if one can apply the simplified trick for C/A subjets
-  bool _check_ca(const std::vector<PseudoJet> &all_pieces, 
-                 const JetDefinition &subjet_def) const;
-
-  /// check if the jet (or all its pieces) have explicit ghosts
-  /// (assuming the jet has area support
-  ///
-  /// Note that if the jet has an associated cluster sequence that is no
-  /// longer valid, an error will be thrown
-  bool _check_explicit_ghosts(const std::vector<PseudoJet> &all_pieces) const;
-
-  JetDefinition _subjet_def;   ///< the jet definition to use to extract the subjets
-  JetAlgorithm  _subjet_alg;   ///< the jet algorithm to be used
-  bool _use_full_def;          ///< true when the full JetDefinition is supplied to the ctor
-  double _subjet_radius;       ///< the jet radius (only if needed for the jet alg)
-  bool _has_subjet_radius;     ///< the subjet radius has been specified
-  double _subjet_extra;        ///< the jet alg extra param (only if needed)
-  bool _has_subjet_extra;      ///< the extra param has been specified
-
-  bool _single;                ///< (true) return a single jet with a
-                               ///< regular clustering or (false) a
-                               ///< composite jet with subjets as pieces
-
-  static LimitedWarning   _explicit_ghost_warning;
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-
-#endif   // __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__
Index: external/fastjet/contribs/RecursiveTools/RecursiveSoftDrop.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/RecursiveSoftDrop.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,475 +1,0 @@
-// $Id: RecursiveSoftDrop.cc 1192 2018-10-30 16:08:36Z gsoyez $
-//
-// Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler,
-// Kevin Zhou, Frederic Dreyer
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "RecursiveSoftDrop.hh"
-#include "fastjet/ClusterSequence.hh"
-
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-namespace internal_recursive_softdrop{
-  
-//========================================================================
-/// \class RSDHistoryElement
-/// a helper class to help keeping track od the RSD tree
-///
-/// The element is created at the top of a branch and updated each
-/// time one grooms something away.
-class RSDHistoryElement{
-public:
-  RSDHistoryElement(const PseudoJet &jet, const RecursiveSoftDrop* rsd_ptr, double R0sqr) :
-    R0_squared(R0sqr),
-    child1_in_history(-1), child2_in_history(-1), symmetry(-1.0), mu2(-1.0){
-    reset(jet, rsd_ptr);
-  }
-
-  void reset(const PseudoJet &jet, const RecursiveSoftDrop* rsd_ptr){
-    current_in_ca_tree = jet.cluster_hist_index();
-    PseudoJet piece1, piece2;
-    theta_squared = (jet.has_parents(piece1, piece2))
-      ? rsd_ptr->squared_geometric_distance(piece1,piece2) : 0.0;
-  }
-  
-  int current_in_ca_tree;  ///< (history) index of the current particle in the C/A tree 
-  double theta_squared;    ///< squared angle at which this decays
-  double R0_squared;       ///< squared angle at the top of the branch
-                           ///< (used for RSD with dynamic_R0)
-  int child1_in_history;   ///< hardest of the 2 decay products (-1 if untagged)
-  int child2_in_history;   ///< softest of the 2 decay products (-1 if untagged)
-
-  // info about what has been dropped and the local substructure
-  vector<double> dropped_delta_R;
-  vector<double> dropped_symmetry;
-  vector<double> dropped_mu;
-  double symmetry, mu2;
-};
-
-
-/// \class OrderRSDHistoryElements
-/// angular ordering of (pointers to) the history elements
-///
-/// our priority queue will use pointers to these elements that are
-/// ordered in angle (of the objects they point to)
-class OrderRSDHistoryElements{
-public:
-  bool operator()(const RSDHistoryElement *e1, const RSDHistoryElement *e2) const {
-    return e1->theta_squared < e2->theta_squared;
-  }
-};
-
-} // internal_recursive_softdrop
-  
-//========================================================================
-
-// initialise all the flags and parameters to their default value
-void RecursiveSoftDrop::set_defaults(){
-  set_fixed_depth_mode(false);
-  set_dynamical_R0(false);
-  set_hardest_branch_only(false);
-  set_min_deltaR_squared(-1.0);
-}
-
-// description of the tool
-string RecursiveSoftDrop::description() const{
-  ostringstream res;
-  res << "recursive application of ["
-      << RecursiveSymmetryCutBase::description()
-      << "]";
-  
-  if (_fixed_depth){
-    res << ", recursively applied down to a maximal depth of N=";
-    if (_n==-1) res << "infinity"; else res << _n;
-  } else {
-    res << ", applied N=";
-    if (_n==-1) res << "infinity"; else res << _n;
-    res << " times";
-  }
-  
-  if (_dynamical_R0)
-    res << ", with R0 dynamically scaled";
-  else
-    res << ", with R0 kept fixed";
-    
-  if (_hardest_branch_only)
-    res << ", following only the hardest branch";
-
-  if (_min_dR2>0)
-    res << ", with minimal angle (squared) = " << _min_dR2;
-
-  return res.str();
-}
-  
-  
-// action on a single jet with RecursiveSoftDrop.
-//
-// uses "result_fixed_tags" by default (i.e. recurse from R0 to
-// smaller angles until n SD conditions have been met), or
-// "result_fixed_depth" where each of the previous SD branches are
-// recirsed into down to a depth of n.
-PseudoJet RecursiveSoftDrop::result(const PseudoJet &jet) const{
-  return _fixed_depth ? result_fixed_depth(jet) : result_fixed_tags(jet);
-}
-
-// this routine applies the Soft Drop criterion recursively on the
-// CA tree until we find n subjets (or until it converges), and
-// adds them together into a groomed PseudoJet
-PseudoJet RecursiveSoftDrop::result_fixed_tags(const PseudoJet &jet) const {
-  // start by reclustering jet with C/A algorithm
-  PseudoJet ca_jet = _recluster_if_needed(jet);
-
-  if (! ca_jet.has_valid_cluster_sequence()){
-    throw Error("RecursiveSoftDrop can only be applied to jets associated to a (valid) cluster sequence");
-  }
-  
-  const ClusterSequence *cs = ca_jet.validated_cluster_sequence();
-  const vector<ClusterSequence::history_element> &cs_history = cs->history();
-  const vector<PseudoJet> &cs_jets = cs->jets();
-
-  // initialise counter to 1 subjet (i.e. the full ca_jet)
-  int n_tagged = 0;
-  int max_njet = ca_jet.constituents().size();
-
-  // create the list of branches
-  unsigned int max_history_size = 2*max_njet;
-  if ((_n>0) && (_n<max_njet-1)){ max_history_size = 2*(_n+1); }
-
-  // we need to pre-allocate the space for the vector so that the
-  // pointers are not invalidated
-  vector<internal_recursive_softdrop::RSDHistoryElement> history;
-  history.reserve(max_history_size);  // could be one shorter
-  history.push_back(internal_recursive_softdrop::RSDHistoryElement(ca_jet, this, _R0sqr));
-  
-  // create a priority queue containing the subjets and a comparison definition
-  priority_queue<internal_recursive_softdrop::RSDHistoryElement*, vector<internal_recursive_softdrop::RSDHistoryElement*>, internal_recursive_softdrop::OrderRSDHistoryElements> active_branches;
-  active_branches.push(& (history[0]));
-
-  PseudoJet parent, piece1, piece2;
-  double sym, mu2;
-  
-  // loop over C/A tree until we reach the appropriate number of subjets
-  while ((continue_grooming(n_tagged)) && (active_branches.size())) {
-    // get the element corresponding to the max dR and the associated PJ
-    internal_recursive_softdrop::RSDHistoryElement * elm = active_branches.top();
-    PseudoJet parent = cs_jets[cs_history[elm->current_in_ca_tree].jetp_index];
-    
-    // do one step of SD
-    RecursionStatus status = recurse_one_step(parent, piece1, piece2, sym, mu2, &elm->R0_squared);
-
-    // check if we passed the SD condition
-    if (status==recursion_success){
-      // check for the optional angular cut
-      if ((_min_dR2 > 0) && (squared_geometric_distance(piece1,piece2) < _min_dR2))
-        break;
-
-      // both subjets are kept in the list for potential further de-clustering
-      elm->child1_in_history = history.size();
-      elm->child2_in_history = history.size()+1;
-      elm->symmetry = sym;
-      elm->mu2      = mu2;
-      active_branches.pop();
-
-      // update the history
-      double next_R0_squared = (_dynamical_R0)
-        ? piece1.squared_distance(piece2) : elm->R0_squared;
-
-      internal_recursive_softdrop::RSDHistoryElement elm1(piece1, this, next_R0_squared);
-      history.push_back(elm1);
-      active_branches.push(&(history.back()));
-      internal_recursive_softdrop::RSDHistoryElement elm2(piece2, this, next_R0_squared);
-      history.push_back(elm2);
-      if (!_hardest_branch_only){
-        active_branches.push(&(history.back()));
-      }
-      
-      ++n_tagged;
-    } else if (status==recursion_dropped){
-       // check for the optional angular cut
-      if ((_min_dR2 > 0) && (squared_geometric_distance(piece1,piece2) < _min_dR2))
-        break;
-
-      active_branches.pop();
-      // tagging failed and the softest branch should be dropped
-      // keep track of what has been groomed away
-      max_njet -= piece2.constituents().size();
-      elm->dropped_delta_R .push_back((elm->theta_squared >= 0) ? sqrt(elm->theta_squared) : -sqrt(elm->theta_squared));
-      elm->dropped_symmetry.push_back(sym);
-      elm->dropped_mu      .push_back((mu2>=0) ? sqrt(mu2) : -sqrt(mu2));
-      
-      // keep the hardest branch in the recursion
-      elm->reset(piece1, this);
-      active_branches.push(elm);
-    } else if (status==recursion_no_parents){
-      if (_min_dR2 > 0) break;
-      active_branches.pop();
-      // nothing specific to do: we just keep the curent jet as a "leaf"
-    } else { // recursion_issue
-      active_branches.pop();
-      // we've met an issue
-      // if the piece2 is null as well, it means we've had a critical problem.
-      // In that case, return an empty PseudoJet
-      if (piece2 == 0) return PseudoJet();
-
-      // otherwise, we should consider "piece2" as a final particle
-      // not to be recursed into
-      if (_min_dR2 > 0) break;
-      max_njet -= (piece2.constituents().size()-1);
-      break;
-    }
-    
-    // If the missing number of tags is exactly the number of objects
-    // we have left in the recursion, stop
-    if (n_tagged == max_njet) break;
-  }
-
-  // now we have a bunch of history elements that we can use to build the final jet
-  vector<PseudoJet> mapped_to_history(history.size());
-  unsigned int history_index = history.size();
-  do {
-    --history_index;
-    const internal_recursive_softdrop::RSDHistoryElement & elm = history[history_index];
-
-    // two kinds of events: either just a final leave, potentially with grooming
-    // or a brandhing (also with potential grooming at the end)
-    if (elm.child1_in_history<0){
-      // this is a leaf, i.e. with no further substructure
-      PseudoJet & subjet = mapped_to_history[history_index]
-        = cs_jets[cs_history[elm.current_in_ca_tree].jetp_index];
-
-      StructureType * structure = new StructureType(subjet);
-      if (has_verbose_structure()){
-        structure->set_verbose(true);
-        structure->set_dropped_delta_R (elm.dropped_delta_R);
-        structure->set_dropped_symmetry(elm.dropped_symmetry);
-        structure->set_dropped_mu      (elm.dropped_mu);
-      }
-      subjet.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-    } else {
-      PseudoJet & subjet = mapped_to_history[history_index]
-        = join(mapped_to_history[elm.child1_in_history], mapped_to_history[elm.child2_in_history]);
-      StructureType * structure = new StructureType(subjet, sqrt(elm.theta_squared), elm.symmetry, sqrt(elm.mu2));
-      if (has_verbose_structure()){
-        structure->set_verbose(true);
-        structure->set_dropped_delta_R (elm.dropped_delta_R);
-        structure->set_dropped_symmetry(elm.dropped_symmetry);
-        structure->set_dropped_mu      (elm.dropped_mu);
-      }
-      subjet.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-    }    
-  } while (history_index>0);
-
-  return mapped_to_history[0];
-}
-
-// this routine applies the Soft Drop criterion recursively on the
-// CA tree, recursing into all the branches found during the previous iteration
-// until n layers have been found (or until it converges)
-PseudoJet RecursiveSoftDrop::result_fixed_depth(const PseudoJet &jet) const {
-  // start by reclustering jet with C/A algorithm
-  PseudoJet ca_jet = _recluster_if_needed(jet);
-
-  if (! ca_jet.has_valid_cluster_sequence()){
-    throw Error("RecursiveSoftDrop can only be applied to jets associated to a (valid) cluster sequence");
-  }
-  
-  const ClusterSequence *cs = ca_jet.validated_cluster_sequence();
-  const vector<ClusterSequence::history_element> &cs_history = cs->history();
-  const vector<PseudoJet> &cs_jets = cs->jets();
-
-  // initialise counter to 1 subjet (i.e. the full ca_jet)
-  int n_depth = 0;
-  int max_njet = ca_jet.constituents().size();
-
-  // create the list of branches
-  unsigned int max_history_size = 2*max_njet;
-  //if ((_n>0) && (_n<max_njet-1)){ max_history_size = 2*(_n+1); }
-
-  // we need to pre-allocate the space for the vector so that the
-  // pointers are not invalidated
-  vector<internal_recursive_softdrop::RSDHistoryElement> history;
-  history.reserve(max_history_size);  // could be one shorter
-  history.push_back(internal_recursive_softdrop::RSDHistoryElement(ca_jet, this, _R0sqr));
-  history.back().theta_squared = _R0sqr;
-  
-  // create a priority queue containing the subjets and a comparison definition
-  list<internal_recursive_softdrop::RSDHistoryElement*> active_branches;
-  active_branches.push_back(& (history[0]));
-
-  PseudoJet parent, piece1, piece2;
-  
-  while ((continue_grooming(n_depth)) && (active_branches.size())) {
-    // loop over all the branches and look for substructure
-    list<internal_recursive_softdrop::RSDHistoryElement*>::iterator hist_it=active_branches.begin();
-    while (hist_it!=active_branches.end()){
-      // get the element corresponding to the max dR and the associated PJ
-      internal_recursive_softdrop::RSDHistoryElement * elm = (*hist_it);
-      PseudoJet parent = cs_jets[cs_history[elm->current_in_ca_tree].jetp_index];
-
-      // we need to iterate this branch until we find some substructure
-      PseudoJet result_sd;
-      if (_dynamical_R0){
-        SoftDrop sd(_beta, _symmetry_cut, symmetry_measure(), sqrt(elm->theta_squared),
-                    mu_cut(), recursion_choice(), subtractor());
-        sd.set_reclustering(false);
-        sd.set_verbose_structure(has_verbose_structure());
-        result_sd = sd(parent);
-      } else {
-        result_sd = SoftDrop::result(parent);
-      }
-
-      // if we had an empty PJ, that means we ran into some problems.
-      // just return an empty PJ ourselves
-      if (result_sd == 0) return PseudoJet();
-      
-      // update the history element to reflect our iteration
-      elm->current_in_ca_tree = result_sd.cluster_hist_index();
-      
-      if (has_verbose_structure()){
-        elm->dropped_delta_R    = result_sd.structure_of<SoftDrop>().dropped_delta_R();
-        elm->dropped_symmetry   = result_sd.structure_of<SoftDrop>().dropped_symmetry();
-        elm->dropped_mu         = result_sd.structure_of<SoftDrop>().dropped_mu();
-      }
-
-      // if some substructure was found:
-      if (result_sd.structure_of<SoftDrop>().has_substructure()){
-        // update the history element to reflect our iteration
-        elm->child1_in_history  = history.size();
-        elm->child2_in_history  = history.size()+1;
-        elm->theta_squared      = result_sd.structure_of<SoftDrop>().delta_R();
-        elm->theta_squared     *= elm->theta_squared;
-        elm->symmetry           = result_sd.structure_of<SoftDrop>().symmetry();
-        elm->mu2                = result_sd.structure_of<SoftDrop>().mu();
-        elm->mu2               *= elm->mu2;
-             
-        // the next iteration will have to handle 2 new history
-        // elements (the R0squared argument here is unused)
-        result_sd.has_parents(piece1, piece2);
-        internal_recursive_softdrop::RSDHistoryElement elm1(piece1, this, _R0sqr);
-        history.push_back(elm1);
-        // insert it in the active branches if needed
-        if (elm1.theta_squared>0)
-          active_branches.insert(hist_it,&(history.back())); // insert just before
-
-        internal_recursive_softdrop::RSDHistoryElement elm2(piece2, this, _R0sqr);
-        history.push_back(elm2);
-        if ((!_hardest_branch_only) && (elm2.theta_squared>0)){
-          active_branches.insert(hist_it,&(history.back())); // insert just before
-        }
-      }
-      // otherwise we've just reached the end of the recursion the
-      // history information has been updated above
-      //
-      // we just need to make sure that we do not recurse into that
-      // element any longer
-
-      list<internal_recursive_softdrop::RSDHistoryElement*>::iterator current = hist_it;
-      ++hist_it;
-      active_branches.erase(current);
-    } // loop over branches at current depth
-    ++n_depth;
-  } // loop over depth
-
-  // now we have a bunch of history elements that we can use to build the final jet
-  vector<PseudoJet> mapped_to_history(history.size());
-  unsigned int history_index = history.size();
-  do {
-    --history_index;
-    const internal_recursive_softdrop::RSDHistoryElement & elm = history[history_index];
-
-    // two kinds of events: either just a final leave, poteitially  with grooming
-    // or a brandhing (also with potential grooming at the end)
-    if (elm.child1_in_history<0){
-      // this is a leaf, i.e. with no further sustructure
-      PseudoJet & subjet = mapped_to_history[history_index]
-        = cs_jets[cs_history[elm.current_in_ca_tree].jetp_index];
-
-      StructureType * structure = new StructureType(subjet);
-      if (has_verbose_structure()){
-        structure->set_verbose(true);
-      }
-      subjet.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-    } else {
-      PseudoJet & subjet = mapped_to_history[history_index]
-        = join(mapped_to_history[elm.child1_in_history], mapped_to_history[elm.child2_in_history]);
-      StructureType * structure = new StructureType(subjet, sqrt(elm.theta_squared), elm.symmetry, sqrt(elm.mu2));
-      if (has_verbose_structure()){
-        structure->set_verbose(true);
-        structure->set_dropped_delta_R (elm.dropped_delta_R);
-        structure->set_dropped_symmetry(elm.dropped_symmetry);
-        structure->set_dropped_mu      (elm.dropped_mu);
-      }
-      subjet.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-    }    
-  } while (history_index>0);
-
-  return mapped_to_history[0];
-}
-
-
-//========================================================================
-// implementation of the helpers
-//========================================================================
-
-// helper to get all the prongs in a jet that has been obtained using
-// RecursiveSoftDrop (instead of recursively parsing the 1->2
-// composite jet structure)
-vector<PseudoJet> recursive_soft_drop_prongs(const PseudoJet & rsd_jet){
-  // make sure that the jet has the appropriate RecursiveSoftDrop structure
-  if (!rsd_jet.has_structure_of<RecursiveSoftDrop>())
-    return vector<PseudoJet>();
-
-  // if this jet has no substructure, just return a 1-prong object
-  if (!rsd_jet.structure_of<RecursiveSoftDrop>().has_substructure())
-    return vector<PseudoJet>(1, rsd_jet);
-  
-  // otherwise fill a vector with all the prongs (no specific ordering)
-  vector<PseudoJet> prongs;
-
-  // parse the list of PseudoJet we still need to deal with
-  vector<PseudoJet> to_parse = rsd_jet.pieces();  // valid both for a C/A recombination step or a RSD join
-  unsigned int i_parse = 0;
-  while (i_parse<to_parse.size()){
-    const PseudoJet &current = to_parse[i_parse];
-
-    if ((current.has_structure_of<RecursiveSymmetryCutBase>()) &&
-        (current.structure_of<RecursiveSymmetryCutBase>().has_substructure())){
-      // if this has some deeper substructure, add it to the list of
-      // things to further process
-      vector<PseudoJet> pieces = current.pieces();
-      assert(pieces.size() == 2);
-      to_parse[i_parse] = pieces[0];
-      to_parse.push_back(pieces[1]);
-    } else {
-      // no further substructure, just add this as a branch
-      prongs.push_back(current);
-      ++i_parse;
-    }
-  }
-   
-  return prongs;
-}
-    
-}
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/RecursiveTools/RecursiveSoftDrop.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/RecursiveSoftDrop.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,212 +1,0 @@
-// $Id: RecursiveSoftDrop.hh 1192 2018-10-30 16:08:36Z gsoyez $
-//
-// Copyright (c) 2014-, Gavin P. Salam, Gregory Soyez, Jesse Thaler,
-// Kevin Zhou, Frederic Dreyer
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __RECURSIVESOFTDROP_HH__
-#define __RECURSIVESOFTDROP_HH__
-
-// we'll use the native FJ class for reculstering if available
-#if FASTJET_VERSION_NUMBER >= 30100
-#include "fastjet/tools/Recluster.hh"
-#else
-#include "Recluster.hh"
-#endif
-#include "SoftDrop.hh"
-#include "fastjet/WrappedStructure.hh"
-
-#include <iostream>
-#include <queue>
-#include <vector>
-
-FASTJET_BEGIN_NAMESPACE
-
-namespace contrib{
-
-//------------------------------------------------------------------------
-/// \class RecursiveSoftDrop
-/// An implementation of the RecursiveSoftDrop.
-///
-/// Recursive Soft Drop will recursively groom a jet, removing
-/// particles that fail the criterion
-/// \f[
-///     z > z_{\rm cut} (\theta/R0)^\beta
-/// \f]
-/// until n subjets have been found.
-///
-/// Several variants are supported:
-///  - set_fixed_depth_mode() switches to fixed depth on all branches
-///    of the clustering tree
-///  - set_dynamical_R0() switches to dynamical R0 implementation of
-///    RSD
-///  - set_hardest_branch_only() switches to following only the
-///    hardest branch (e.g. for Iterated Soft Drop)
-///  - set_min_deltaR_square(val) sets a minimum angle considered for
-///    substructure (e.g. for Iterated Soft Drop)
-///
-/// Notes:
-///
-///  - Even though the calls to "set_tagging_mode()" or
-///    "set_grooming_mode(false)" are allowed, they should not be used
-///    with n=-1, and the default grooming_mode has to remain
-///    untouched (except for beta<0 and finite n).
-///
-//----------------------------------------------------------------------
-class RecursiveSoftDrop : public SoftDrop {
-public:
-  /// Simplified constructor. This takes the value of the "beta"
-  /// parameter and the symmetry cut (applied by default on the
-  /// scalar_z variable, as for the mMDT). It also takes an optional
-  /// subtractor.
-  ///
-  /// n is the number of times we require the SoftDrop condition to be
-  /// satisfied. n=-1 means infinity, i.e. we recurse into the jet
-  /// until individual constituents
-  ///
-  /// If the (optional) pileup subtractor can be supplied, then see
-  /// also the documentation for the set_input_jet_is_subtracted() member
-  /// function.
-  ///
-  /// \param beta               the value of the beta parameter
-  /// \param symmetry_cut       the value of the cut on the symmetry measure
-  /// \param n                  the requested number of iterations
-  /// \param R0                 the angular distance normalisation [1 by default]
-  RecursiveSoftDrop(double beta,
-                    double symmetry_cut,
-                    int n = -1,
-                    double R0 = 1,
-                    const FunctionOfPseudoJet<PseudoJet> * subtractor = 0) : 
-    SoftDrop(beta, symmetry_cut, R0, subtractor), _n(n) { set_defaults(); }
-
-  /// Full constructor, which takes the following parameters:
-  ///
-  /// \param beta               the value of the beta parameter
-  /// \param symmetry_cut       the value of the cut on the symmetry measure
-  /// \param symmetry_measure   the choice of measure to use to estimate the symmetry
-  /// \param n                  the requested number of iterations
-  /// \param R0                 the angular distance normalisation [1 by default]
-  /// \param mu_cut             the maximal allowed value of mass drop variable mu = m_heavy/m_parent 
-  /// \param recursion_choice   the strategy used to decide which subjet to recurse into
-  /// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-  RecursiveSoftDrop(double           beta,
-                    double           symmetry_cut, 
-                    SymmetryMeasure  symmetry_measure,
-                    int              n = -1,
-                    double           R0 = 1.0,
-                    double           mu_cut = std::numeric_limits<double>::infinity(), 
-                    RecursionChoice  recursion_choice = larger_pt,
-                    const FunctionOfPseudoJet<PseudoJet> * subtractor = 0) : 
-    SoftDrop(beta, symmetry_cut, symmetry_measure, R0, mu_cut, recursion_choice, subtractor),
-    _n(n) { set_defaults(); }
-
-  /// default destructor
-  virtual ~RecursiveSoftDrop(){}
-
-  //----------------------------------------------------------------------
-  // access to class info
-  int n() const { return _n; }
-  
-  //----------------------------------------------------------------------
-  // on top of the tweaks that we inherit from SoftDrop (via
-  // RecursiveSymmetryBase):
-  //  - set_verbose_structure()
-  //  - set_subtractor()
-  //  - set_input_jet_is_subtracted()
-  // we provide several other knobs, given below
-
-  /// initialise all the flags below to their default value
-  void set_defaults();
-  
-  /// switch to using the "same depth" variant where instead of
-  /// recursing from large to small angles and requiring n SD
-  /// conditions to be met (our default), we recurse simultaneously in
-  /// all the branches found during the previous iteration, up to a
-  /// maximum depth of n.
-  /// default: false
-  void set_fixed_depth_mode(bool value=true) { _fixed_depth = value; }
-  bool fixed_depth_mode() const { return _fixed_depth; }
-  
-  /// switch to using a dynamical R0 (used for the normalisation of
-  /// the symmetry measure) set by the last deltaR at which some
-  /// substructure was found.
-  /// default: false
-  void set_dynamical_R0(bool value=true) { _dynamical_R0 = value; }
-  bool use_dynamical_R0() const { return _dynamical_R0; }
-
-  /// when finding some substructure, only follow the hardest branch
-  /// for the recursion
-  /// default: false (i.e. recurse in both branches)
-  void set_hardest_branch_only(bool value=true) { _hardest_branch_only = value; }
-  bool use_hardest_branch_only() const { return _hardest_branch_only; }
-
-  /// set the minimum angle (squared) that we should consider for
-  /// substructure
-  /// default: -1.0 (i.e. no minimum)
-  void set_min_deltaR_squared(double value=-1.0) { _min_dR2 = value; }
-  double   min_deltaR_squared() const { return _min_dR2; }
-
-  /// description of the tool
-  virtual std::string description() const;
-
-  //----------------------------------------------------------------------
-  /// action on a single jet with RecursiveSoftDrop.
-  ///
-  /// uses "result_fixed_tags" by default (i.e. recurse from R0 to
-  /// smaller angles until n SD conditions have been met), or
-  /// "result_fixed_depth" where each of the previous SD branches are
-  /// recirsed into down to a depth of n.
-  virtual PseudoJet result(const PseudoJet &jet) const;
-
-  /// this routine applies the Soft Drop criterion recursively on the
-  /// CA tree until we find n subjets (or until it converges), and
-  /// adds them together into a groomed PseudoJet
-  PseudoJet result_fixed_tags(const PseudoJet &jet) const;
-
-  /// this routine applies the Soft Drop criterion recursively on the
-  /// CA tree, recursing into all the branches found during the previous iteration
-  /// until n layers have been found (or until it converges)
-  PseudoJet result_fixed_depth(const PseudoJet &jet) const;
-    
-protected:  
-  /// return false if we reached desired layer of grooming _n
-  bool continue_grooming(int current_n) const {
-    return ((_n < 0) or (current_n < _n));
-  }
-  
-private:
-  int    _n;            ///< the value of n
-
-  // behaviour tweaks
-  bool _fixed_depth;         ///< look in parallel into each all branches until depth n
-  bool _dynamical_R0;        ///< when true, use the last deltaR with substructure as D0
-  bool _hardest_branch_only; ///< recurse only in the hardest branch
-                             ///  when substructure is found
-  double _min_dR2;           ///< the min allowed angle to search for substructure
-};
-
-// helper to get the (linear) list of prongs inside a jet resulting
-// from RecursiveSoftDrop. This would avoid having amnually to go
-// through the successive pairwise compositeness
-std::vector<PseudoJet> recursive_soft_drop_prongs(const PseudoJet & rsd_jet);
-
-}
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-#endif // __RECURSIVESOFTDROP_HH__
Index: external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,642 +1,0 @@
-// $Id: RecursiveSymmetryCutBase.cc 1080 2017-09-28 07:51:37Z gsoyez $
-//
-// Copyright (c) 2014-, Gavin P. Salam, Gregory Soyez, Jesse Thaler
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "RecursiveSymmetryCutBase.hh"
-#include "fastjet/JetDefinition.hh"
-#include "fastjet/ClusterSequenceAreaBase.hh"
-#include <cassert>
-#include <algorithm> 
-#include <cstdlib> 
-
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-LimitedWarning RecursiveSymmetryCutBase::_negative_mass_warning;
-LimitedWarning RecursiveSymmetryCutBase::_mu2_gt1_warning;
-//LimitedWarning RecursiveSymmetryCutBase::_nonca_warning;
-LimitedWarning RecursiveSymmetryCutBase::_explicit_ghost_warning;
-
-bool RecursiveSymmetryCutBase::_verbose = false;
-
-//----------------------------------------------------------------------
-PseudoJet RecursiveSymmetryCutBase::result(const PseudoJet & jet) const {
-  // construct the input jet (by default, recluster with C/A)
-  if (! jet.has_constituents()){
-    throw Error("RecursiveSymmetryCutBase can only be applied to jets with constituents");
-  }
-
-  PseudoJet j = _recluster_if_needed(jet);
-
-  // sanity check: the jet must have a valid CS
-  if (! j.has_valid_cluster_sequence()){
-    throw Error("RecursiveSymmetryCutBase can only be applied to jets associated to a (valid) cluster sequence");
-  }
-
-  // check that area information is there in case we have a subtractor
-  // GS: do we really need this since subtraction may not require areas?
-  if (_subtractor) {
-    const ClusterSequenceAreaBase * csab = 
-      dynamic_cast<const ClusterSequenceAreaBase *>(j.associated_cs());
-    if (csab == 0 || (!csab->has_explicit_ghosts()))
-      _explicit_ghost_warning.warn("RecursiveSymmetryCutBase: there is no clustering sequence, or it lacks explicit ghosts: subtraction is not guaranteed to function properly");
-  }
-
-  // establish the first subjet and optionally subtract it
-  PseudoJet subjet = j;
-  if (_subtractor && (!_input_jet_is_subtracted)) {
-    subjet = (*_subtractor)(subjet);
-  }
-
-  // variables for tracking what will happen
-  PseudoJet piece1, piece2;
- 
-  // vectors for storing optional verbose structure
-  // these hold the deltaR, symmetry, and mu values of dropped branches
-  std::vector<double> dropped_delta_R;
-  std::vector<double> dropped_symmetry;
-  std::vector<double> dropped_mu;
-
-  double sym, mu2;
-  
-  // now recurse into the jet's structure
-  RecursionStatus status;
-  while ((status=recurse_one_step(subjet, piece1, piece2, sym, mu2)) != recursion_success) {
-    // start with sanity checks:
-    if ((status == recursion_issue) || (status == recursion_no_parents)) {
-      // we should return piece1 by our convention for recurse_one_step
-      PseudoJet result;
-      if (status == recursion_issue){
-        result = piece1;
-        if (_verbose) cout << "reached end; returning null jet " << endl;
-      } else {
-        result = _result_no_substructure(piece1);
-        if (_verbose) cout << "no parents found; returning last PJ or empty jet" << endl;
-      }
-      
-      if (result != 0) {
-        // if in grooming mode, add dummy structure information
-        StructureType * structure = new StructureType(result);
-        // structure->_symmetry = 0.0;
-        // structure->_mu       = 0.0;
-        // structure->_delta_R  = 0.0;
-        if (_verbose_structure) { // still want to store verbose information about dropped branches
-          structure->_has_verbose = true;
-          structure->_dropped_symmetry = dropped_symmetry;
-          structure->_dropped_mu = dropped_mu;
-          structure->_dropped_delta_R = dropped_delta_R;
-        }
-        result.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-      }
-  
-      return result;
-    }
-
-    assert(status == recursion_dropped);
-    
-    // if desired, store information about dropped branches before recursing
-    if (_verbose_structure) {
-      dropped_delta_R.push_back(piece1.delta_R(piece2));
-      dropped_symmetry.push_back(sym);
-      dropped_mu.push_back((mu2 >= 0) ? sqrt(mu2) : -sqrt(-mu2));
-    }
-
-    subjet = piece1;
-  }
-  
-
-  // we've tagged the splitting, return the jet with its substructure
-  StructureType * structure = new StructureType(subjet);
-  structure->_symmetry = sym;
-  structure->_mu       = (mu2 >= 0) ? sqrt(mu2) : -sqrt(-mu2);
-  structure->_delta_R  = sqrt(squared_geometric_distance(piece1, piece2));
-  if (_verbose_structure) {
-    structure->_has_verbose = true;
-    structure->_dropped_symmetry = dropped_symmetry;
-    structure->_dropped_mu = dropped_mu;
-    structure->_dropped_delta_R = dropped_delta_R;
-  }
-  subjet.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(structure));
-  return subjet;
-}
-
-
-  
-//----------------------------------------------------------------------
-// the method below is the one actually performing one step of the
-// recursion.
-//
-// It returns a status code (defined above)
-//
-// In case of success, all the information is filled
-// In case of "no parents", piee1 is the same subjet
-// In case of trouble, piece2 will be a 0 PJ and piece1 is the PJ we
-//   should return (either 0 itself if the issue was critical, or
-//   non-wero in case of a minor issue just causing the recursion to
-//   stop)
-RecursiveSymmetryCutBase::RecursionStatus
-      RecursiveSymmetryCutBase::recurse_one_step(const PseudoJet & subjet,
-                                                 PseudoJet &piece1, PseudoJet &piece2,
-                                                 double &sym, double &mu2,
-                                                 void *extra_parameters) const {
-  if (!subjet.has_parents(piece1, piece2)){
-    piece1 = subjet;    
-    piece2 = PseudoJet();
-    return recursion_no_parents;
-  }
-
-  // first sanity check: 
-  // - zero or negative pts are not allowed for the input subjet
-  // - zero or negative masses are not allowed for configurations
-  //   in which the mass will effectively appear in a denominator
-  //   (The masses will be checked later)
-  if (subjet.pt2() <= 0){ // this is a critical problem, return an empty PJ
-    piece1 = piece2 = PseudoJet();
-    return recursion_issue;
-  }
-
-  if (_subtractor) {
-    piece1 = (*_subtractor)(piece1);
-    piece2 = (*_subtractor)(piece2);
-  }
-    
-  // determine the symmetry parameter
-  if        (_symmetry_measure == y) {
-    // the original d_{ij}/m^2 choice from MDT
-    // first make sure the mass is sensible
-    if (subjet.m2() <= 0) { 
-      _negative_mass_warning.warn("RecursiveSymmetryCutBase: cannot calculate y, because (sub)jet mass is negative; bailing out");
-      // since rounding errors can give -ve masses, be a it more
-      // tolerant and consider that no substructure has been found
-      piece1 = _result_no_substructure(subjet);
-      piece2 = PseudoJet();
-      return recursion_issue;
-    }
-    sym = piece1.kt_distance(piece2) / subjet.m2();
-    
-  } else if (_symmetry_measure == vector_z) {
-    // min(pt1, pt2)/(pt), where the denominator is a vector sum
-    // of the two subjets
-    sym = min(piece1.pt(), piece2.pt()) / subjet.pt();    
-  } else if (_symmetry_measure == scalar_z) {
-    // min(pt1, pt2)/(pt1+pt2), where the denominator is a scalar sum
-    // of the two subjets
-    double pt1 = piece1.pt();
-    double pt2 = piece2.pt();
-    // make sure denominator is non-zero
-    sym = pt1 + pt2;
-    if (sym == 0){ // this is a critical problem, return an empty PJ
-      piece1 = piece2 = PseudoJet();
-      return recursion_issue;
-    }
-    sym = min(pt1, pt2) / sym;
-  } else if ((_symmetry_measure == theta_E) || (_symmetry_measure == cos_theta_E)){
-    // min(E1, E2)/(E1+E2)
-    double E1 = piece1.E();
-    double E2 = piece2.E();
-    // make sure denominator is non-zero
-    sym = E1 + E2;
-    if (sym == 0){ // this is a critical problem, return an empty PJ
-      piece1 = piece2 = PseudoJet();
-      return recursion_issue;
-    }
-    sym = min(E1, E2) / sym;
-  } else {
-    throw Error ("Unrecognized choice of symmetry_measure");
-  }
-  
-  // determine the symmetry cut
-  // (This function is specified in the derived classes)
-  double this_symmetry_cut = symmetry_cut_fn(piece1, piece2, extra_parameters);
-  
-  // and make a first tagging decision based on symmetry cut
-  bool tagged = (sym > this_symmetry_cut);
-
-  // if tagged based on symmetry cut, then check the mu cut (if relevant)
-  // and update the tagging decision. Calculate mu^2 regardless, for cases
-  // of users not cutting on mu2, but still interested in its value.
-  bool use_mu_cut = (_mu_cut != numeric_limits<double>::infinity());
-  mu2 = max(piece1.m2(), piece2.m2())/subjet.m2();
-  if (tagged && use_mu_cut) {
-    // first a sanity check -- mu2 won't be sensible if the subjet mass 
-    // is negative, so we can't then trust the mu cut - bail out
-    if (subjet.m2() <= 0) {
-      _negative_mass_warning.warn("RecursiveSymmetryCutBase: cannot trust mu, because (sub)jet mass is negative; bailing out");
-      piece1 = piece2 = PseudoJet();
-      return recursion_issue;
-    }
-    if (mu2 > 1) _mu2_gt1_warning.warn("RecursiveSymmetryCutBase encountered mu^2 value > 1");
-    if (mu2 > pow(_mu_cut,2)) tagged = false;
-  }
-
-  // we'll continue unclustering, allowing for the different
-  // ways of choosing which parent to look into
-  if        (_recursion_choice == larger_pt) {
-    if (piece1.pt2() < piece2.pt2()) std::swap(piece1, piece2);    
-  } else if (_recursion_choice == larger_mt) {
-    if (piece1.mt2() < piece2.mt2()) std::swap(piece1, piece2);    
-  } else if (_recursion_choice == larger_m)  {
-    if (piece1.m2() < piece2.m2()) std::swap(piece1, piece2);    
-  } else if (_recursion_choice == larger_E)  {
-    if (piece1.E()  < piece2.E())  std::swap(piece1, piece2);    
-  } else {
-    throw Error ("Unrecognized value for recursion_choice");
-  }    
-
-  return tagged ? recursion_success : recursion_dropped;
-}
-
-  
-//----------------------------------------------------------------------
-string RecursiveSymmetryCutBase::description() const {
-  ostringstream ostr;
-  ostr << "Recursive " << (_grooming_mode ? "Groomer" : "Tagger") << " with a symmetry cut ";
-
-  switch(_symmetry_measure) {
-  case y:
-    ostr << "y"; break;
-  case scalar_z:
-    ostr << "scalar_z"; break;
-  case vector_z:
-    ostr << "vector_z"; break;
-  case theta_E:
-    ostr << "theta_E"; break;
-  case cos_theta_E:
-    ostr << "cos_theta_E"; break;
-  default:
-    cerr << "failed to interpret symmetry_measure" << endl; exit(-1);
-  }
-  ostr << " > " << symmetry_cut_description();
-
-  if (_mu_cut != numeric_limits<double>::infinity()) {
-    ostr << ", mass-drop cut mu=max(m1,m2)/m < " << _mu_cut;
-  } else {
-    ostr << ", no mass-drop requirement";
-  }
-
-  ostr << ", recursion into the subjet with larger ";
-  switch(_recursion_choice) {
-  case larger_pt:
-    ostr << "pt"; break;
-  case larger_mt:
-    ostr << "mt(=sqrt(m^2+pt^2))"; break;
-  case larger_m:
-    ostr << "mass"; break;
-  case larger_E:
-    ostr << "energy"; break;
-  default:
-    cerr << "failed to interpret recursion_choice" << endl; exit(-1);
-  }
-
-  if (_subtractor) {
-    ostr << ", subtractor: " << _subtractor->description();
-    if (_input_jet_is_subtracted) {ostr << " (input jet is assumed already subtracted)";}
-  }
-
-  if (_recluster) {
-    ostr << " and reclustering using " << _recluster->description();
-  }
-  
-  return ostr.str();
-}
-
-//----------------------------------------------------------------------
-// helper for handling the reclustering
-PseudoJet RecursiveSymmetryCutBase::_recluster_if_needed(const PseudoJet &jet) const{
-  if (! _do_reclustering) return jet;
-  if (_recluster) return (*_recluster)(jet);
-  if (is_ee()){
-#if FASTJET_VERSION_NUMBER >= 30100
-    return Recluster(JetDefinition(ee_genkt_algorithm, JetDefinition::max_allowable_R, 0.0), true)(jet);
-#else
-    return Recluster(JetDefinition(ee_genkt_algorithm, JetDefinition::max_allowable_R, 0.0))(jet);
-#endif
-  }
-
-  return Recluster(cambridge_algorithm, JetDefinition::max_allowable_R)(jet);
-}  
-  
-//----------------------------------------------------------------------
-// decide what to return when no substructure has been found
-double RecursiveSymmetryCutBase::squared_geometric_distance(const PseudoJet &j1,
-                                                            const PseudoJet &j2) const{
-  if (_symmetry_measure == theta_E){
-    double dot_3d = j1.px()*j2.px() + j1.py()*j2.py() + j1.pz()*j2.pz();
-    double cos_theta = max(-1.0,min(1.0, dot_3d/sqrt(j1.modp2()*j2.modp2())));
-    double theta = acos(cos_theta);
-    return theta*theta;
-  } else if (_symmetry_measure == cos_theta_E){
-    double dot_3d = j1.px()*j2.px() + j1.py()*j2.py() + j1.pz()*j2.pz();
-    return max(0.0, 2*(1-dot_3d/sqrt(j1.modp2()*j2.modp2())));
-  }
-
-  return j1.squared_distance(j2);
-}
-
-//----------------------------------------------------------------------
-PseudoJet RecursiveSymmetryCutBase::_result_no_substructure(const PseudoJet &last_parent) const{
-  if (_grooming_mode){
-    // in grooming mode, return the last parent
-    return last_parent;
-  } else {
-    // in tagging mode, return an empty PseudoJet
-    return PseudoJet();
-  }
-}
-
-
-//========================================================================
-// implementation of the details of the structure
-  
-// the number of dropped subjets
-int RecursiveSymmetryCutBase::StructureType::dropped_count(bool global) const {
-  check_verbose("dropped_count()");
-
-  // if this jet has no substructure, just return an empty vector
-  if (!has_substructure()) return _dropped_delta_R.size();
-
-  // deal with the non-global case
-  if (!global) return _dropped_delta_R.size();
-
-  // for the global case, we've unfolded the recursion (likely more
-  // efficient as it requires less copying)
-  unsigned int count = 0;
-  vector<const RecursiveSymmetryCutBase::StructureType*> to_parse;
-  to_parse.push_back(this);
-
-  unsigned int i_parse = 0;
-  while (i_parse<to_parse.size()){
-    const RecursiveSymmetryCutBase::StructureType *current = to_parse[i_parse];
-    count += current->_dropped_delta_R.size();
-
-    // check if we need to recurse deeper in the substructure
-    //
-    // we can have 2 situations here for the underlying structure (the
-    // one we've wrapped around):
-    //  - it's of the clustering type
-    //  - it's a composite jet
-    // only in the 2nd case do we have to recurse deeper
-    const CompositeJetStructure *css = dynamic_cast<const CompositeJetStructure*>(current->_structure.get());
-    if (css == 0){ ++i_parse; continue; }
-    
-    vector<PseudoJet> prongs = css->pieces(PseudoJet()); // argument irrelevant
-    assert(prongs.size() == 2);
-    for (unsigned int i_prong=0; i_prong<2; ++i_prong){
-      if (prongs[i_prong].has_structure_of<RecursiveSymmetryCutBase>()){
-        RecursiveSymmetryCutBase::StructureType* prong_structure
-          = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr();
-        if (prong_structure->has_substructure())
-          to_parse.push_back(prong_structure);
-      }
-    }
-
-    ++i_parse;
-  }
-  return count;
-}
-
-// the delta_R of all the dropped subjets
-vector<double> RecursiveSymmetryCutBase::StructureType::dropped_delta_R(bool global) const {
-  check_verbose("dropped_delta_R()");
-
-  // if this jet has no substructure, just return an empty vector
-  if (!has_substructure()) return vector<double>();
-
-  // deal with the non-global case
-  if (!global) return _dropped_delta_R;
-
-  // for the global case, we've unfolded the recursion (likely more
-  // efficient as it requires less copying)
-  vector<double> all_dropped;
-  vector<const RecursiveSymmetryCutBase::StructureType*> to_parse;
-  to_parse.push_back(this);
-
-  unsigned int i_parse = 0;
-  while (i_parse<to_parse.size()){
-    const RecursiveSymmetryCutBase::StructureType *current = to_parse[i_parse];
-    all_dropped.insert(all_dropped.end(), current->_dropped_delta_R.begin(), current->_dropped_delta_R.end());
-
-    // check if we need to recurse deeper in the substructure
-    //
-    // we can have 2 situations here for the underlying structure (the
-    // one we've wrapped around):
-    //  - it's of the clustering type
-    //  - it's a composite jet
-    // only in the 2nd case do we have to recurse deeper
-    const CompositeJetStructure *css = dynamic_cast<const CompositeJetStructure*>(current->_structure.get());
-    if (css == 0){ ++i_parse; continue; }
-    
-    vector<PseudoJet> prongs = css->pieces(PseudoJet()); // argument irrelevant
-    assert(prongs.size() == 2);
-    for (unsigned int i_prong=0; i_prong<2; ++i_prong){
-      if (prongs[i_prong].has_structure_of<RecursiveSymmetryCutBase>()){
-        RecursiveSymmetryCutBase::StructureType* prong_structure
-          = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr();
-        if (prong_structure->has_substructure())
-          to_parse.push_back(prong_structure);
-      }
-    }
-
-    ++i_parse;
-  }
-  return all_dropped;
-}
-
-// the symmetry of all the dropped subjets
-vector<double> RecursiveSymmetryCutBase::StructureType::dropped_symmetry(bool global) const {
-  check_verbose("dropped_symmetry()");
-
-  // if this jet has no substructure, just return an empty vector
-  if (!has_substructure()) return vector<double>();
-
-  // deal with the non-global case
-  if (!global) return _dropped_symmetry;
-
-  // for the global case, we've unfolded the recursion (likely more
-  // efficient as it requires less copying)
-  vector<double> all_dropped;
-  vector<const RecursiveSymmetryCutBase::StructureType*> to_parse;
-  to_parse.push_back(this);
-
-  unsigned int i_parse = 0;
-  while (i_parse<to_parse.size()){
-    const RecursiveSymmetryCutBase::StructureType *current = to_parse[i_parse];
-    all_dropped.insert(all_dropped.end(), current->_dropped_symmetry.begin(), current->_dropped_symmetry.end());
-
-    // check if we need to recurse deeper in the substructure
-    //
-    // we can have 2 situations here for the underlying structure (the
-    // one we've wrapped around):
-    //  - it's of the clustering type
-    //  - it's a composite jet
-    // only in the 2nd case do we have to recurse deeper
-    const CompositeJetStructure *css = dynamic_cast<const CompositeJetStructure*>(current->_structure.get());
-    if (css == 0){ ++i_parse; continue; }
-    
-    vector<PseudoJet> prongs = css->pieces(PseudoJet()); // argument irrelevant
-    assert(prongs.size() == 2);
-    for (unsigned int i_prong=0; i_prong<2; ++i_prong){
-      if (prongs[i_prong].has_structure_of<RecursiveSymmetryCutBase>()){
-        RecursiveSymmetryCutBase::StructureType* prong_structure
-          = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr();
-        if (prong_structure->has_substructure())
-          to_parse.push_back(prong_structure);
-      }
-    }
-
-    ++i_parse;
-  }
-  return all_dropped;
-}
-
-// the mu of all the dropped subjets
-vector<double> RecursiveSymmetryCutBase::StructureType::dropped_mu(bool global) const {
-  check_verbose("dropped_mu()");
-
-  // if this jet has no substructure, just return an empty vector
-  if (!has_substructure()) return vector<double>();
-
-  // deal with the non-global case
-  if (!global) return _dropped_mu;
-
-  // for the global case, we've unfolded the recursion (likely more
-  // efficient as it requires less copying)
-  vector<double> all_dropped;
-  vector<const RecursiveSymmetryCutBase::StructureType*> to_parse;
-  to_parse.push_back(this);
-
-  unsigned int i_parse = 0;
-  while (i_parse<to_parse.size()){
-    const RecursiveSymmetryCutBase::StructureType *current = to_parse[i_parse];
-    all_dropped.insert(all_dropped.end(), current->_dropped_mu.begin(), current->_dropped_mu.end());
-
-    // check if we need to recurse deeper in the substructure
-    //
-    // we can have 2 situations here for the underlying structure (the
-    // one we've wrapped around):
-    //  - it's of the clustering type
-    //  - it's a composite jet
-    // only in the 2nd case do we have to recurse deeper
-    const CompositeJetStructure *css = dynamic_cast<const CompositeJetStructure*>(current->_structure.get());
-    if (css == 0){ ++i_parse; continue; }
-    
-    vector<PseudoJet> prongs = css->pieces(PseudoJet()); // argument irrelevant
-    assert(prongs.size() == 2);
-    for (unsigned int i_prong=0; i_prong<2; ++i_prong){
-      if (prongs[i_prong].has_structure_of<RecursiveSymmetryCutBase>()){
-        RecursiveSymmetryCutBase::StructureType* prong_structure
-          = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr();
-        if (prong_structure->has_substructure())
-          to_parse.push_back(prong_structure);
-      }
-    }
-
-    ++i_parse;
-  }
-  return all_dropped;
-}
-
-// the maximum of the symmetry over the dropped subjets
-double RecursiveSymmetryCutBase::StructureType::max_dropped_symmetry(bool global) const {
-  check_verbose("max_dropped_symmetry()");
-
-  // if there is no substructure, just exit
-  if (!has_substructure()){ return 0.0; }
-
-  // local value of the max_dropped_symmetry
-  double local_max = (_dropped_symmetry.size() == 0)
-    ? 0.0 : *max_element(_dropped_symmetry.begin(),_dropped_symmetry.end());
-
-  // recurse down the structure if instructed to do so
-  if (global){
-    // we can have 2 situations here for the underlying structure (the
-    // one we've wrapped around):
-    //  - it's of the clustering type
-    //  - it's a composite jet
-    // only in the 2nd case do we have to recurse deeper
-    const CompositeJetStructure *css = dynamic_cast<const CompositeJetStructure*>(_structure.get());
-    if (css == 0) return local_max;
-    
-    vector<PseudoJet> prongs = css->pieces(PseudoJet()); // argument irrelevant
-    assert(prongs.size() == 2);
-    for (unsigned int i_prong=0; i_prong<2; ++i_prong){
-      // check if the prong has further substructure
-      if (prongs[i_prong].has_structure_of<RecursiveSymmetryCutBase>()){
-        RecursiveSymmetryCutBase::StructureType* prong_structure
-          = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr();
-        local_max = max(local_max, prong_structure->max_dropped_symmetry(true));
-      }
-    }
-  }
-
-  return local_max;
-}
-
-//------------------------------------------------------------------------
-// helper class to sort by decreasing thetag
-class SortRecursiveSoftDropStructureZgThetagPair{
-public:
-  bool operator()(const pair<double, double> &p1, const pair<double, double> &p2) const{
-    return p1.second > p2.second;
-  }
-};
-//------------------------------------------------------------------------
-
-// the (zg,thetag) pairs of all the splitting that were found and passed the SD condition
-vector<pair<double,double> > RecursiveSymmetryCutBase::StructureType::sorted_zg_and_thetag() const {
-  //check_verbose("sorted_zg_and_thetag()");
-
-  // if this jet has no substructure, just return an empty vector
-  if (!has_substructure()) return vector<pair<double,double> >();
-  
-  // otherwise fill a vector with all the prongs (no specific ordering)
-  vector<pair<double,double> > all;
-  vector<const RecursiveSymmetryCutBase::StructureType*> to_parse;
-  to_parse.push_back(this);
-
-  unsigned int i_parse = 0;
-  while (i_parse<to_parse.size()){
-    const RecursiveSymmetryCutBase::StructureType *current = to_parse[i_parse];
-    all.push_back(pair<double,double>(current->_symmetry, current->_delta_R));
-
-    vector<PseudoJet> prongs = current->pieces(PseudoJet());
-    assert(prongs.size() == 2);
-    for (unsigned int i_prong=0; i_prong<2; ++i_prong){
-      if (prongs[i_prong].has_structure_of<RecursiveSymmetryCutBase>()){
-        RecursiveSymmetryCutBase::StructureType* prong_structure
-          = (RecursiveSymmetryCutBase::StructureType*) prongs[i_prong].structure_ptr();
-        if (prong_structure->has_substructure())
-          to_parse.push_back(prong_structure);
-      }
-    }
-
-    ++i_parse;
-  }
-
-  sort(all.begin(), all.end(), SortRecursiveSoftDropStructureZgThetagPair());
-  return all;
-}
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/RecursiveSymmetryCutBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,387 +1,0 @@
-// $Id: RecursiveSymmetryCutBase.hh 1074 2017-09-18 15:15:20Z gsoyez $
-//
-// Copyright (c) 2014-, Gavin P. Salam, Gregory Soyez, Jesse Thaler
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_RECURSIVESYMMETRYCUTBASE_HH__
-#define __FASTJET_CONTRIB_RECURSIVESYMMETRYCUTBASE_HH__
-
-#include <limits>
-#include <cassert>
-#include <fastjet/internal/base.hh>
-#include "fastjet/tools/Transformer.hh"
-#include "fastjet/WrappedStructure.hh"
-#include "fastjet/CompositeJetStructure.hh"
-
-#include "fastjet/config.h"
-
-// we'll use the native FJ class for reculstering if available
-#if FASTJET_VERSION_NUMBER >= 30100
-#include "fastjet/tools/Recluster.hh"
-#else
-#include "Recluster.hh"
-#endif
-
-/** \mainpage RecursiveTools contrib 
-
-    The RecursiveTools contrib provides a set of tools for
-    recursive investigation jet substructure. Currently it includes:
-    - fastjet::contrib::ModifiedMassDropTagger
-    - fastjet::contrib::SoftDrop
-    - fastjet::contrib::RecursiveSymmetryCutBase (from which the above two classes derive)
-    - fastjet::contrib::IteratedSoftDropSymmetryFactors (defines ISD procedure)
-    - fastjet::contrib::IteratedSoftDropMultiplicity (defines a useful observable using ISD)  
-    - example*.cc provides usage examples
- */
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//------------------------------------------------------------------------
-/// \class RecursiveSymmetryCutBase
-/// A base class for all the tools that de-cluster a jet until a
-/// sufficiently symmetric configuration if found.
-///
-/// Derived classes (so far, ModifiedMassDropTagger and SoftDrop) have to
-/// implement the symmetry cut and its description
-///
-/// Note that by default, the jet will be reculstered with
-/// Cambridge/Aachen before applying the de-clustering procedure. This
-/// behaviour can be changed using set_clustering (see below).
-///
-/// By default, this class behaves as a tagger, i.e. returns an empty
-/// PseudoJet if no substructure is found.  While the derived
-/// ModifiedMassDropTagger is a tagger, the derived SoftDrop is a groomer
-/// (i.e. it returns a non-zero jet even if no substructure is found).
-///
-/// This class provides support for
-///  - an optional mass-drop cut (see ctor)
-///  - options to select which symmetry measure should be used (see ctor)
-///  - options to select how the recursion proceeds (see ctor)
-///  - options for reclustering the jet before running the de-clustering
-///    (see set_reclustering)
-///  - an optional subtractor (see ctor and other methods below)
-class RecursiveSymmetryCutBase : public Transformer {
-public:
-  // ctors and dtors
-  //----------------------------------------------------------------------
-
-  /// an enum of the different (a)symmetry measures that can be used
-  enum SymmetryMeasure{scalar_z,   ///< \f$ \min(p_{ti}, p_{tj})/(p_{ti} + p_{tj}) \f$
-                       vector_z,   ///< \f$ \min(p_{ti}, p_{tj})/p_{t(i+j)} \f$
-                       y,          ///< \f$ \min(p_{ti}^2,p_{tj}^2) \Delta R_{ij}^2 / m_{ij}^2 \f$
-                       theta_E,    ///< \f$ \min(E_i,E_j)/(E_i+E_j) \f$ with 3d angle (ee collisions)
-                       cos_theta_E ///< \f$ \min(E_i,E_j)/(E_i+E_j) \f$ with
-                                   ///  \f$ \sqrt{2[1-cos(theta)]}\f$ for angles (ee collisions)
-  };
-
-  /// an enum for the options of how to choose which of two subjets to recurse into
-  enum RecursionChoice{larger_pt, ///< choose the subjet with larger \f$ p_t \f$
-                       larger_mt, ///< choose the subjet with larger \f$ m_t \equiv (m^2+p_t^2)^{\frac12}] \f$
-                       larger_m,  ///< choose the subjet with larger mass (deprecated)
-                       larger_E   ///< choose the subjet with larger energy (meant for ee collisions)
-  }; 
-
-  /// Full constructor, which takes the following parameters:
-  ///
-  /// \param symmetry_measure   the choice of measure to use to estimate the symmetry
-  /// \param mu_cut             the maximal allowed value of mass drop variable mu = m_heavy/m_parent 
-  /// \param recursion_choice   the strategy used to decide which subjet to recurse into
-  /// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-  ///
-  /// If the (optional) pileup subtractor is supplied, then, by
-  /// default, the input jet is assumed unsubtracted and the
-  /// RecursiveSymmetryCutBase returns a subtracted 4-vector. [see
-  /// also the set_input_jet_is_subtracted() member function].
-  ///
-  RecursiveSymmetryCutBase(SymmetryMeasure  symmetry_measure = scalar_z,
-			   double           mu_cut = std::numeric_limits<double>::infinity(), 
-			   RecursionChoice  recursion_choice = larger_pt,
-			   const FunctionOfPseudoJet<PseudoJet> * subtractor = 0
-			   ) : 
-    _symmetry_measure(symmetry_measure),
-    _mu_cut(mu_cut),
-    _recursion_choice(recursion_choice),
-    _subtractor(subtractor), _input_jet_is_subtracted(false),
-    _do_reclustering(true), _recluster(0),
-    _grooming_mode(false),
-    _verbose_structure(false) // by default, don't story verbose information
-  {}
-    
-  /// default destructor
-  virtual ~RecursiveSymmetryCutBase(){}
-
-  // access to class info
-  //----------------------------------------------------------------------
-  SymmetryMeasure symmetry_measure() const { return _symmetry_measure; }
-  double mu_cut() const { return _mu_cut; }
-  RecursionChoice recursion_choice() const { return _recursion_choice; }
-
-  // internal subtraction configuration
-  //----------------------------------------------------------------------
-
-  /// This tells the tagger whether to assume that the input jet has
-  /// already been subtracted. This is relevant only if a non-null
-  /// subtractor pointer has been supplied, and the default assymption
-  /// is that the input jet is passed unsubtracted.
-  /// 
-  /// Note: given that subtractors usually change the momentum of the
-  /// main jet, but not that of the subjets, subjets will continue to
-  /// have subtraction applied to them.
-  void set_input_jet_is_subtracted(bool is_subtracted) {_input_jet_is_subtracted = is_subtracted;}
-
-  /// returns a bool to indicate if the input jet is assumed already subtracted
-  bool input_jet_is_subtracted() const {return _input_jet_is_subtracted;}
-
-  /// an alternative way to set the subtractor
-  ///
-  /// Note that when a subtractor is provided, the result of the
-  /// RecursiveSymmetryCutBase will be a subtracted jet.
-  void set_subtractor(const FunctionOfPseudoJet<PseudoJet> * subtractor_) {_subtractor = subtractor_;}
-
-  /// returns a pointer to the subtractor
-  const FunctionOfPseudoJet<PseudoJet> * subtractor() const {return _subtractor;}
-
-  // reclustering behaviour
-  //----------------------------------------------------------------------
-
-  /// configure the reclustering prior to the recursive de-clustering
-  ///  \param do_reclustering   recluster the jet or not?
-  ///  \param recluster         how to recluster the jet 
-  ///                           (only if do_recluster is true; 
-  ///                           Cambridge/Aachen used if NULL)
-  ///
-  /// Note that the ModifiedMassDropTagger and SoftDrop are designed
-  /// to work with a Cambridge/Aachen clustering. Use any other option
-  /// at your own risk!
-  void set_reclustering(bool do_reclustering=true, const Recluster *recluster=0){
-    _do_reclustering = do_reclustering;
-    _recluster = recluster;
-  }
-
-  // what to do when no substructure is found
-  //----------------------------------------------------------------------
-  /// specify the behaviour adopted when no substructure is found
-  ///  - in tagging  mode, an empty PseudoJet will be returned
-  ///  - in grooming mode, a single particle is returned
-  /// for clarity, we provide both function although they are redundant
-  void set_grooming_mode(bool enable=true){ _grooming_mode = enable;}
-  void set_tagging_mode(bool enable=true){ _grooming_mode = !enable;}
-
-  
-  /// Allows access to verbose information about recursive declustering,
-  /// in particular values of symmetry, delta_R, and mu of dropped branches
-  void set_verbose_structure(bool enable=true) { _verbose_structure = enable; }
-  bool has_verbose_structure() const { return _verbose_structure; }
-  
-  
-  // inherited from the Transformer base
-  //----------------------------------------------------------------------
-
-  /// the function that carries out the tagging; if a subtractor is
-  /// being used, then this function assumes that input jet is
-  /// unsubtracted (unless set_input_jet_is_subtracted(true) has been
-  /// explicitly called before) and the result of the MMDT will be a
-  /// subtracted jet.
-  virtual PseudoJet result(const PseudoJet & j) const;
-  
-  /// description of the tool
-  virtual std::string description() const;
-
-  /// returns the gepometrical distance between the two particles
-  /// depending on the symmetry measure used
-  double squared_geometric_distance(const PseudoJet &j1,
-                                    const PseudoJet &j2) const;
-  
-
-  class StructureType;
-
-  /// for testing 
-  static bool _verbose;
-
-protected:
-  // the methods below have to be defined by deerived classes
-  //----------------------------------------------------------------------
-  /// the cut on the symmetry measure (typically z) that one need to
-  /// apply for a given pair of subjets p1 and p2
-  virtual double symmetry_cut_fn(const PseudoJet & /* p1 */, 
-                                 const PseudoJet & /* p2 */,
-                                 void *extra_parameters = 0) const = 0;
-  /// the associated dwescription
-  virtual std::string symmetry_cut_description() const = 0;
-
-  //----------------------------------------------------------------------
-  /// this defines status codes when checking for substructure
-  enum RecursionStatus{
-    recursion_success=0,   //< found some substructure
-    recursion_dropped,     //< dropped softest prong; recursion continues
-    recursion_no_parents,  //< down to constituents; bottom of recursion
-    recursion_issue        //< something went wrong; recursion stops
-  };
-  
-  //----------------------------------------------------------------------
-  /// the method below is the one actually performing one step of the
-  /// recursion.
-  ///
-  /// It returns a status code (defined above)
-  ///
-  /// In case of success, all the information is filled
-  /// In case of "no parents", piee1 is the same subjet
-  /// In case of trouble, piece2 will be a 0 PJ and piece1 is the PJ we
-  ///   should return (either 0 itself if the issue was critical, or
-  ///   non-wero in case of a minor issue just causing the recursion to
-  ///   stop)
-  ///
-  /// The extra_parameter argument allows one to pass extra agruments
-  /// to the symmetry condition
-  RecursionStatus recurse_one_step(const PseudoJet & subjet,
-                                   PseudoJet &piece1, PseudoJet &piece2,
-                                   double &sym, double &mu2,
-                                   void *extra_parameters = 0) const;
-
-  //----------------------------------------------------------------------
-  /// helper for handling the reclustering
-  PseudoJet _recluster_if_needed(const PseudoJet &jet) const;
-  
-  //----------------------------------------------------------------------
-  // helpers for selecting between ee and pp cases
-  bool is_ee() const{
-    return ((_symmetry_measure==theta_E) || (_symmetry_measure==cos_theta_E));
-  }
-
-private:
-  SymmetryMeasure  _symmetry_measure;
-  double           _mu_cut;
-  RecursionChoice  _recursion_choice;
-  const FunctionOfPseudoJet<PseudoJet> * _subtractor;
-  bool             _input_jet_is_subtracted;
-
-  bool _do_reclustering;       ///< start with a reclustering
-  const Recluster *_recluster; ///< how to recluster the jet
-
-  bool _grooming_mode;  ///< grooming or tagging mode
-
-  static LimitedWarning   _negative_mass_warning;
-  static LimitedWarning   _mu2_gt1_warning;
-  //static LimitedWarning   _nonca_warning;
-  static LimitedWarning   _explicit_ghost_warning;
-
-  // additional verbose structure information
-  bool _verbose_structure;
-  
-  /// decide what to return when no substructure has been found
-  PseudoJet _result_no_substructure(const PseudoJet &last_parent) const;
-};
-
-  
-  
-//----------------------------------------------------------------------
-/// class to hold the structure of a jet tagged by RecursiveSymmetryCutBase.
-class RecursiveSymmetryCutBase::StructureType : public WrappedStructure {
-public:
-  StructureType(const PseudoJet & j) :
-    WrappedStructure(j.structure_shared_ptr()), _delta_R(-1.0), _symmetry(-1.0), _mu(-1.0),
-    _is_composite(false), _has_verbose(false) // by default, do not store verbose structure
-  {}
-
-  /// construct a structure with
-  ///  - basic info inherited from the reference jet "j"
-  ///  - a given deltaR       for substructure
-  ///  - a given symmetry     for substructure
-  ///  - a given mu parameter for substructure
-  /// If j is a "copmposite jet", it means that it has further
-  /// substructure to potentially recurse  into
-  StructureType(const PseudoJet & j, double delta_R_in, double symmetry_in, double mu_in=-1.0) :
-    WrappedStructure(j.structure_shared_ptr()), _delta_R(delta_R_in), _symmetry(symmetry_in), _mu(mu_in),
-    _is_composite(dynamic_cast<const CompositeJetStructure*>(j.structure_ptr()) != NULL),
-    _has_verbose(false) // by default, do not store verbose structure
-  {}
-  
-  // information about kept branch
-  double delta_R()  const {return _delta_R;}
-  double thetag()   const {return _delta_R;}  // alternative name
-  double symmetry() const {return _symmetry;}
-  double zg()       const {return _symmetry;} // alternative name
-  double mu()       const {return _mu;}
-  
-  // additional verbose information about dropped branches
-  bool has_verbose() const { return _has_verbose;}
-  void set_verbose(bool value) { _has_verbose = value;}
-
-  /// returns true if the current jet has some substructure (i.e. has
-  /// been tagged by the resursion) or not
-  ///
-  /// Note that this should include deltaR==0 (e.g. a perfectly
-  /// collinear branching with SoftDrop)
-  bool has_substructure() const { return _delta_R>=0; }
-  
-  /// number of dropped branches
-  int dropped_count(bool global=true) const;
-  
-  /// delta_R of dropped branches
-  /// when "global" is set, recurse into possile further substructure
-  std::vector<double> dropped_delta_R(bool global=true) const;
-  void set_dropped_delta_R(const std::vector<double> &v) { _dropped_delta_R = v; }
-
-  /// symmetry values of dropped branches
-  std::vector<double> dropped_symmetry(bool global=true) const;
-  void set_dropped_symmetry(const std::vector<double> &v) { _dropped_symmetry = v; }
-
-  /// mass drop values of dropped branches
-  std::vector<double> dropped_mu(bool global=true) const;
-  void set_dropped_mu(const std::vector<double> &v) { _dropped_mu = v; }
-  
-  /// maximum symmetry value dropped
-  double max_dropped_symmetry(bool global=true) const;
-
-  /// (global) list of groomed away elements as zg and thetag
-  /// sorted from largest to smallest anlge
-  std::vector<std::pair<double,double> > sorted_zg_and_thetag() const;
-
-private:
-  double _delta_R, _symmetry, _mu;
-  friend class RecursiveSymmetryCutBase;
-
-  bool _is_composite;
-  
-  // additional verbose information
-  bool _has_verbose;
-  // information about dropped values
-  std::vector<double> _dropped_delta_R;
-  std::vector<double> _dropped_symmetry;
-  std::vector<double> _dropped_mu;
-
-  bool check_verbose(const std::string &what) const{
-    if (!_has_verbose){
-      throw Error("RecursiveSymmetryCutBase::StructureType: Verbose structure must be turned on to get "+what+".");
-      return false;
-    }
-    return true;
-  }
-    
-  
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_RECURSIVESYMMETRYCUTBASE_HH__
Index: external/fastjet/contribs/RecursiveTools/SoftDrop.cc
===================================================================
--- external/fastjet/contribs/RecursiveTools/SoftDrop.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,74 +1,0 @@
-// $Id: SoftDrop.cc 1059 2017-09-07 20:48:00Z gsoyez $
-//
-// Copyright (c) 2014-, Gregory Soyez, Jesse. Thaler
-// based on arXiv:1402.2657 by Andrew J. Larkoski, Simone Marzani,
-// Gregory Soyez, Jesse Thaler
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "SoftDrop.hh"
-#include <cmath>
-#include <sstream>
-
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//----------------------------------------------------------------------
-// TODO:
-//
-// - implement reclustering (at the moment we assume it's C/A as for mMDT
-//
-// - what is returned if no substructure is found? [and for negativeve
-//   pt, m2 or other situations where mMDT currentlty returns an empty
-//   PseudoJet]
-//
-//   GS.: mMDT seeks substructure so it makes sense for it to return
-//   an empry PseudoJet when no substructure is found (+ it is the
-//   original behaviour). For SoftDrop, in grooming mode (beta>0), if
-//   would make sense to return a jet with a single particle. In
-//   tagging mode (beta<0), the situation is less clear. At the level
-//   of the implementation, having a virtual function could work
-//   (with a bit of care to cover the -ve pt or m2 cases)
-//
-// - Do we include Andrew and Simone in the "contrib-author" list
-//   since they are on the paper? Do we include Gavin in the author's
-//   list since he started this contrib?
-//
-//----------------------------------------------------------------------
-
-//----------------------------------------------------------------------
-double SoftDrop::symmetry_cut_fn(const PseudoJet & p1, 
-                                 const PseudoJet & p2,
-                                 void *optional_R0sqr_ptr) const{
-  double R0sqr = (optional_R0sqr_ptr == 0) ? _R0sqr : *((double*) optional_R0sqr_ptr);
-  return _symmetry_cut * pow(squared_geometric_distance(p1,p2)/R0sqr, 0.5*_beta);
-}
-
-//----------------------------------------------------------------------
-string SoftDrop::symmetry_cut_description() const {
-  ostringstream ostr;
-  ostr << _symmetry_cut << " (theta/" << sqrt(_R0sqr) << ")^" << _beta << " [SoftDrop]";
-  return ostr.str();
-}
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/RecursiveTools/SoftDrop.hh
===================================================================
--- external/fastjet/contribs/RecursiveTools/SoftDrop.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,149 +1,0 @@
-// $Id: SoftDrop.hh 1034 2017-08-01 10:03:53Z gsoyez $
-//
-// Copyright (c) 2014-, Gregory Soyez, Jesse Thaler
-// based on arXiv:1402.2657 by Andrew J. Larkoski, Simone Marzani,
-// Gregory Soyez, Jesse Thaler
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_SOFTDROP_HH__
-#define __FASTJET_CONTRIB_SOFTDROP_HH__
-
-#include "RecursiveSymmetryCutBase.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-namespace contrib{
-
-//------------------------------------------------------------------------
-/// \class SoftDrop
-/// An implementation of the SoftDrop from arXiv:1402.2657.
-///
-/// For the basic functionalities, we refer the reader to the
-/// documentation of the RecursiveSymmetryCutBase from which SoftDrop
-/// inherits. Here, we mostly put the emphasis on things specific to
-/// SoftDrop:
-///
-///  - the cut applied recursively is 
-///     \f[
-///        z > z_{\rm cut} (\theta/R0)^\beta
-///     \f]
-///    with z the asymmetry measure and \f$\theta\f$ the geometrical
-///    distance between the two subjets. R0 is set to 1 by default.
-///
-///  - by default, we work in "grooming mode" i.s. if no substructure
-///    is found, we return a jet made of a single parton. Note that
-///    this behaviour differs from the mMDT (and can be a source of
-///    differences when running SoftDrop with beta=0.)
-///
-class SoftDrop : public RecursiveSymmetryCutBase {
-public:
-  /// Simplified constructor. This takes the value of the "beta"
-  /// parameter and the symmetry cut (applied by default on the
-  /// scalar_z variable, as for the mMDT). It also takes an optional
-  /// subtractor.
-  ///
-  /// If the (optional) pileup subtractor can be supplied, then see
-  /// also the documentation for the set_input_jet_is_subtracted() member
-  /// function.
-  ///
-  /// \param beta               the value of the beta parameter
-  /// \param symmetry_cut       the value of the cut on the symmetry measure
-  /// \param R0                 the angular distance normalisation [1 by default]
-  SoftDrop(double beta,
-           double symmetry_cut,
-           double R0 = 1,
-           const FunctionOfPseudoJet<PseudoJet> * subtractor = 0) : 
-    RecursiveSymmetryCutBase(scalar_z,  // the default SymmetryMeasure
-                             std::numeric_limits<double>::infinity(), // default is no mass drop
-                             larger_pt, // the default RecursionChoice
-                             subtractor),
-    _beta(beta), _symmetry_cut(symmetry_cut), _R0sqr(R0*R0) {
-    // change the default: use grooming mode
-    set_grooming_mode();
-  }
-
-  /// Full constructor, which takes the following parameters:
-  ///
-  /// \param beta               the value of the beta parameter
-  /// \param symmetry_cut       the value of the cut on the symmetry measure
-  /// \param symmetry_measure   the choice of measure to use to estimate the symmetry
-  /// \param R0                 the angular distance normalisation [1 by default]
-  /// \param mu_cut             the maximal allowed value of mass drop variable mu = m_heavy/m_parent 
-  /// \param recursion_choice   the strategy used to decide which subjet to recurse into
-  /// \param subtractor         an optional pointer to a pileup subtractor (ignored if zero)
-  ///
-  /// The default values provided for this constructor are suited to
-  /// obtain the SoftDrop as discussed in arXiv:1402.2657:
-  ///  - no mass drop is requested
-  ///  - recursion follows the branch with the largest pt
-  /// The symmetry measure has to be specified (scalar_z is the recommended value)
-  ///
-  /// Notes: 
-  ///
-  /// - by default, SoftDrop will recluster the jet with the
-  ///   Cambridge/Aachen algorithm if it is not already the case. This
-  ///   behaviour can be changed using the "set_reclustering" method
-  ///   defined below
-  ///
-  SoftDrop(double           beta,
-           double           symmetry_cut, 
-           SymmetryMeasure  symmetry_measure,
-           double           R0 = 1.0,
-           double           mu_cut = std::numeric_limits<double>::infinity(), 
-           RecursionChoice  recursion_choice = larger_pt,
-           const FunctionOfPseudoJet<PseudoJet> * subtractor = 0) : 
-     RecursiveSymmetryCutBase(symmetry_measure, mu_cut, recursion_choice, subtractor),
-     _beta(beta), _symmetry_cut(symmetry_cut), _R0sqr(R0*R0)
-  {
-    // change the default: use grooming mode
-    set_grooming_mode();
-  }
-
-  /// default destructor
-  virtual ~SoftDrop(){}
-
-  //----------------------------------------------------------------------
-  // access to class info
-  double beta()         const { return _beta; }
-  double symmetry_cut() const { return _symmetry_cut; }
-  double R0()           const { return sqrt(_R0sqr); }
-  
-protected:
-
-  // Unlike MMDT, the SoftDrop symmetry_cut_fn depends on the subjet kinematics
-  // since the symmetry condition depends on the DeltaR between subjets.
-  virtual double symmetry_cut_fn(const PseudoJet & p1, 
-                                 const PseudoJet & p2,
-                                 void * optional_R0sqr_ptr = 0) const;
-  virtual std::string symmetry_cut_description() const;
-
-  //private:
-  double _beta;         ///< the power of the angular distance to be used
-                        ///< in the symmetry condition
-  double _symmetry_cut; ///< the value of zcut (the prefactor in the asymmetry cut)
-  double _R0sqr;        ///< normalisation of the angular distance
-                        ///< (typically set to the jet radius, 1 by default)
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_SOFTDROP_HH__
Index: external/fastjet/contribs/RecursiveTools/TODO
===================================================================
--- external/fastjet/contribs/RecursiveTools/TODO	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,26 +1,0 @@
-For v2.0
---------
-
-- CHECK: lines 100-102 of RecursiveSymmetryCutBase.hh: this was
-  initially setting the structure members to 0. I think it's highly
-  preferable to set them to their default of -1, signalling the
-  absence of substructure. [0 dR might happen with a perfectly
-  collinear splitting]
-
-- CHECK: are we happy with how the structure info is stored and the
-  recursive_soft_drop_prongs(...) function in RecursiveSoftDrop.hh?
-
-- QUESTION: do we move set_min_deltaR_squared in the base class?
-
-- Add option to define z wrt to original jet?
-
-For future releases?
---------------------
-- JDT:  In Recluster, change "single" to an enum for user clarity?
-  [do we have any other option that "sungle" or "subjets"]
-- JDT:  Should we have a FASTJET_CONTRIB_BEGIN_NAMESPACE?  It would
-  help those of us who use XCode to edit, which is aggressive about
-  auto-indenting. [Consider this for the full contrib??]
-- More generic kinematic cuts?
-- KZ: common base class for IteratedSoftDrop and RecursiveSoftDrop?
-- KZ: make IteratedSoftDrop use Recluster
Index: external/fastjet/contribs/SoftKiller/AUTHORS
===================================================================
--- external/fastjet/contribs/SoftKiller/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,9 +1,0 @@
-The SoftKiller FastJet contrib was written and is maintained 
-and developed by
-
-  Matteo Cacciari <cacciari@lpthe.jussieu.fr>
-  Gavin P. Salam  <gavin.salam@cern.ch>
-  Gregory Soyez   <soyez@fastjet.fr>
-
-See http://arxiv.org/abs/1407.0408 for all the details about the
-physics. 
Index: external/fastjet/contribs/SoftKiller/COPYING
===================================================================
--- external/fastjet/contribs/SoftKiller/COPYING	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,343 +1,0 @@
-======================================================================
-======================================================================
-======================================================================
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 2 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, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
Index: external/fastjet/contribs/SoftKiller/ChangeLog
===================================================================
--- external/fastjet/contribs/SoftKiller/ChangeLog	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,99 +1,0 @@
-2014-08-17  Gavin Salam  <gavin.salam@cern.ch>
-
-	* NEWS:
-	* VERSION:
-	release of version 1.0.0
-
-2014-08-16  Matteo Cacciari <cacciari@lpthe.jusssieu.fr>
-
-        * AUTHORS
-        * README
-        Some typos fixed and small tweaks
-
-2014-08-11  Gavin Salam  <gavin.salam@cern.ch> + Gregory (later)
-
-	* SoftKiller.hh|cc:
-	replaced index()->tile_index() and is_good() -> tile_is_good() in
-	line with name changes in RectangularGrid
-
-2014-08-11  Gavin Salam  <gavin.salam@cern.ch>
-
-	* SoftKiller.cc:
-	added a constructor that takes a RectangularGrid and implemented
-	support for the is_good(itile) aspect of RectangularGrid.
-
-	Rather than doing a direct push_back of the PJs that pass the cut,
-	introduced an intermediate stage of a vector of indices; gains
-	about a factor of two in that part of the code; 
-
-	For both above changes, see
-	issue-tracker/2014-08-08-testing-rect-grid/README
-
-2014-08-08  Gavin Salam  <gavin.salam@cern.ch>
-
-	* SoftKiller.cc: 
-	added check for all_tiles_equal_area(), in view of possible future
-	cases where they don't (some thought would then be needed).
-
-2014-08-04  Gavin Salam  <gavin.salam@cern.ch>
-
-	* SoftKiller.hh|cc:
-	started experimenting with using a rectangular grid that is being
-	developed in FJ3.1. Still preliminary, and controlled through a
-	symbol FJC_SOFTKILLER_USEFJGRID that is set in the header
-
-2014-07-16  Gavin Salam  <gavin.salam@cern.ch>
-
-	* Makefile:
-	added dependencies
-
-	* example.cc:
-	added output of the pt threshold.
-
-	* SoftKiller.hh|cc:
-	added a constructor that allows the user to specify separate
-	rapmin, rapmax, as well as different requested rapidity and
-	azimuth cell spacing.
-
-	added an apply(...) member, which enables access also to the
-	pt_threshold.
-
-	sifter is now by default an uninitialised Selector (and the
-	description and code simply ignore it if it's uninitialised).
-
-	grid contents now stored in a C++ vector rather than a C-style
-	array. 
-
-	+ various mods to comments
-
-	* example.ref:
-	updated this to reflect new output of pt threshold info.
-
-	* NEWS:
-	added a draft entry for the 1.0.0 release
-
-2014-07-10  Gregory Soyez  <soyez@fastjet.fr>
-
-	* README:
-	added a desctription of the contrib
-
-2014-07-09  Gregory Soyez  <soyez@fastjet.fr>
-
-	* AUTHORS:
-	included the arXiv number
-
-2014-05-15  Gregory Soyez  <soyez@fastjet.fr>
-
-	* VERSION:
-	set version number to 1.0.0-alpha-PUWS14.1 in preparation for a
-	fastjet-contrib release for the pileup-workshop at CERN on May
-	2014.
-
-2014-04-29  Gregory Soyez  <soyez@fastjet.fr>
-
-	* Imported the soft killer code from the fast implementation we've
-	  used for the results in the paper.
-
-2014-04-29  Gregory Soyez  <soyez@fastjet.fr>
-
-	* Initial creation
Index: external/fastjet/contribs/SoftKiller/NEWS
===================================================================
--- external/fastjet/contribs/SoftKiller/NEWS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,2 +1,0 @@
-2014/08/17: initial release, version 1.0.0
-
Index: external/fastjet/contribs/SoftKiller/README
===================================================================
--- external/fastjet/contribs/SoftKiller/README	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,70 +1,0 @@
-------------------------------------------------------------------------
-SoftKiller FastJet contrib
-------------------------------------------------------------------------
-
-The SoftKiller FastJet contrib aims to provide an implementation of
-the pileup removal technique introduced in
-	
-  SoftKiller, a particle-level pileup removal method
-  Matteo Cacciari, Gavin P. Salam, Gregory Soyez
-  arXiv:1407.0408
-
-The SoftKiller class progressively kills soft particles in order of
-increasing pt until half of the event is empty (i.e. rho is zero). 
-It is constructed using
-
-  SoftKiller soft_killer(double rapmax, double grid_spacing,
-                         Selector sifter = Selector());
-
-with
-
-  rapmax        the maximal (absolute) rapidity extent of the grid
-  tile_size     the requested grid spacing (or equivalent tile size)
-  sifter        when provided, the soft killer is applied
-                only to particles that pass the sifter (the
-                others are kept untouched)
-
-For a given event, the SoftKiller is then applied to an event as follows
-
-  vector<PseudoJet> event;
-  vector<PseudoJet> killed_event = soft_killer(event);
-
-For an explicit illustration of how this works, see the example.cc
-file which can be built using
-
-    make example
-
-and should be run with
-
-   ./example < ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat
- 
-The expected output can be found in example.ref
-
-----------------------------------------------------------------------
-More advanced usage
-===================
-
-If you have FastJet 3.1, then you can use its RectangularGrid to have
-obtain control over the grid; for example to apply a soft killer
-separately to central and forward particles you might have:
-
-   double central_rapmax = 2.5, forward_rapmax = 5.0, tile_size = 0.5;
-
-   // the central SK runs from -central_rapmax to central_rapmax; we
-   // can have separate rapidity and phi tile sizes, but here keep
-   // them the same
-   RectangularGrid central_grid(-central_rapmax, central_rapmax, tile_size, tile_size);
-   SoftKiller central_killer(central_grid);
-   Selector central_selector = SelectorAbsRapMax(central_rapmax); // for later use
-   
-   // for the forward SK, we have a grid from -5.0 to 5.0 but then use
-   // only grid tiles whose central point passes the forward selector
-   Selector forward_selector = SelectorAbsRapRange(central_rapmax, forward_rapmax);
-   RectangularGrid forward_grid(-forward_rapma, forward_rapmax, tile_size, tile_size, forward_selector);
-   SoftKiller central_killer(forward_grid);
-
-   // now process central and forward particles separately
-   vector<PseudoJet> central_kept_particles = central_killer(central_selector(particles));
-   vector<PseudoJet> forward_kept_particles = forward_killer(forward_selector(particles));
-
-
Index: external/fastjet/contribs/SoftKiller/SoftKiller.cc
===================================================================
--- external/fastjet/contribs/SoftKiller/SoftKiller.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,345 +1,0 @@
-// $Id$
-//
-// Copyright (c) 2014-, Matteo Cacciari, Gavin. P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "SoftKiller.hh"
-#include <sstream>
-
-using namespace std;
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-/// ctor with simple initialisation
-///  \param rapmax     the maximal absolute rapidity extent of the grid
-///  \param cell_size  the grid spacing (equivalently, cell size)
-///  \param sifter     when provided, the soft killer is applied
-///                    only to particles that pass the sifter (the
-///                    others are kept untouched)
-SoftKiller::SoftKiller(double rapmax, double cell_size,
-                       Selector sifter) :
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-  RectangularGrid(rapmax, cell_size), _sifter(sifter) {}
-#else // not FJCONTRIB_SOFTKILLER_USEFJGRID
-  _ymax(rapmax), _ymin(-rapmax), 
-  _requested_drap(cell_size), _requested_dphi(cell_size),
-  _sifter(sifter) {
-    _setup_grid();
-}
-#endif
-
-/// ctor with more control over initialisation
-///  \param rapmin     the minimum rapidity extent of the grid
-///  \param rapmax     the maximum rapidity extent of the grid
-///  \param drap       the grid spacing in rapidity
-///  \param dphi       the grid spacing in azimuth
-///  \param sifter     when provided, the soft killer is applied
-///                    onyl to particles that pass the sifter (the
-///                    others are kept untouched)
-SoftKiller::SoftKiller(double rapmin, double rapmax, double drap, double dphi,
-                       Selector sifter) :
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-  RectangularGrid(rapmin, rapmax, drap, dphi), _sifter(sifter) {}
-#else
-   _ymax(rapmax), _ymin(rapmin), 
-    _requested_drap(drap), _requested_dphi(dphi),
-    _sifter(sifter) {
-  _setup_grid();
-}
-#endif
-
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-SoftKiller::SoftKiller(const RectangularGrid & grid, Selector sifter) : 
-            RectangularGrid(grid), _sifter(sifter) {}
-#endif 
-
-/// dummy ctor (will give an unusable SoftKiller)
-SoftKiller::SoftKiller() 
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-  {}  
-#else
-  : _ymax(-1.0), _ymin(1.0), _requested_drap(-1.0), _requested_dphi(-1.0) {
-  _ntotal = 0;
-}
-#endif // FJCONTRIB_SOFTKILLER_USEFJGRID
-
-
-//------------------------------------------------------------------------
-// description of the soft killer
-std::string SoftKiller::description() const{
-  ostringstream oss;
-
-
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-  oss << "SoftKiller with " << RectangularGrid::description();
-#else
-  if (_requested_drap < 0 || _requested_dphi < 0)
-    return "Uninitialised SoftKiller";
-
-  oss << "SoftKiller with rapidity extent " << _ymin << " < rap < " << _ymax
-      << ", cell size drap x dphi = " << _dy << " x " << _dphi;
-#endif
-  if (_sifter.worker()) {
-    oss << " and applied to particles passing the selection (" 
-        << _sifter.description() << ")";
-  }
-  return oss.str();
-}
-
-//------------------------------------------------------------------------
-// similarly to Transformers in FastJet, introduce a 'result'
-// method equivalent to the () operator, i.e. returns the event
-// after the soft killer has been applied
-//vector<PseudoJet> SoftKiller::result(const vector<PseudoJet> & event) const {
-void SoftKiller::apply(const vector<PseudoJet> & event, 
-                       vector<PseudoJet> & reduced_event, 
-                         double & pt_threshold) const {
-  // a safety check: we impose at least 2 cells (otherwise, this is
-  // equivalent to asking an empty event and there are more
-  // efficient ways to do that)
-  if (n_tiles()<2){
-    throw Error("SoftKiller not properly initialised.");
-  }
-
-  // we're not set up to handle the case where the event and reduced
-  // event are the same vector; so crash in that case.
-  assert(&event != &reduced_event);
-  // currently we can only handle the case where all tiles have equal
-  // area; that is the case for Rectangular tilings, but in the future
-  // one might imagine having non-rectangular tilings.
-  assert(all_tiles_equal_area());
-
-  //profiling: CPUTimer t;
-  //profiling: t.start();
-
-  // init an array to hold the max pt in each grid cell
-  //
-  // This is better (stack) but only C99 (fails with pedantic):
-  //   double max_pt2[n_tiles()];
-  // See 
-  //   http://binglongx.wordpress.com/2011/05/08/create-variable-length-array-on-the-stack-in-c/
-  // for a possible workaround
-  vector<double> max_pt2(n_tiles(), 0.0);
-  //double max_pt2[n_tiles()];
-  //memset(max_pt2, 0, n_tiles()*sizeof(double));
-  //double *max_pt2 = new double[n_tiles()]; // if this is reinstated, reinstate also the delete, below
-  //for (int i = 0; i < n_tiles(); i++) {max_pt2[i] = 0;}
-
-  //profiling: t.stop();
-  //profiling: cout << "   copy ptrs: " << t.total() << endl;
-  //profiling: t.start();
-
-  // leave away particles that are sifted
-  // vector<PseudoJet> reduced_event, saved_particles;
-  // _sifter.sift(event, reduced_event, saved_particles);
-
-  vector<const PseudoJet *> event_ptrs(event.size());
-  for (unsigned i = 0; i < event.size(); i++) {
-    event_ptrs[i] = & event[i];
-  }
-  // only run the sifter if it serves a purpose
-  if (_sifter.worker()) _sifter.nullify_non_selected(event_ptrs);
-    
-  //profiling: t.stop();
-  //profiling: cout << "   sifter   : " << t.total() << endl;
-  //profiling: t.start();
-    
-  //vector<PseudoJet> reduced_event = event;
-
-  // browse the particles and figure which is the min pt in each cell
-  for(unsigned int i=0;i<event.size(); i++){
-    if (event_ptrs[i] == 0) continue;
-    int idx = tile_index(event[i]);
-    if (idx<0) continue;
-    max_pt2[idx] = max(max_pt2[idx], event[i].pt2());
-  }
-    
-  //profiling: t.stop();
-  //profiling: cout << "   browsing : " << t.total() << endl;
-  //profiling: t.start();
-  
-  
-  // if there are some "bad" tiles, then we need to exclude them from
-  // the calculation of the median. We'll do this by condensing the
-  // max_pt2 vector down to just the values for the tiles that are
-  // good.
-  //
-  // tested answers look right in "issue" 2014-08-08-testing-rect-grid
-  if (n_good_tiles() != n_tiles()) {
-    int newn = 0;
-    for (unsigned i = 0; i < max_pt2.size(); i++) {
-      if (tile_is_good(i)) {
-        // clang gets confused with the SharedPtr swap if we don't
-        // have std:: here
-        std::swap(max_pt2[i],max_pt2[newn]);
-        newn++;
-      }
-    }
-    max_pt2.resize(newn);
-  }
-
-  // sort the list of max values (sort works with arrays)
-  //sort(max_pt2, max_pt2+n_tiles()); // use this one if we have the allocated C-style array above
-  sort(max_pt2.begin(), max_pt2.end());
-
-  // Note that if we ask that half of the event is empty that means
-  // that we need at least half of the cells empty... so we need to
-  // round up
-  //
-  // For a potentially faster median search, see
-  //
-  //   http://ndevilla.free.fr/median/median/index.html?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+hnycombinator+%28HN+-+hnycombinator%29
-  int int_median_pos = max_pt2.size()/2;
-
-  //--------------------------------------------------------------
-  // alternative to what is below:
-  //
-  // apply the pt cut manually (always on pt^2): first get a vector of
-  // indices that we'll want to keep and then when we know the size of
-  // the resulting vector we actually do the transfer of the
-  // PseudoJets.  
-  //
-  // This is almost a factor of two faster than doing a
-  // push_back on the PseudoJets themselves (which is logical, since a
-  // push_back probably averages out as doing the copy twice).
-  // (2014-08-11, also tried it with pointers, which seemed 
-  // marginally slower).
-  double pt2cut = (1+1e-12)*max_pt2[int_median_pos];
-
-  vector<int> indices;
-  for(unsigned int i=0;i<event.size(); i++){
-    if ((event_ptrs[i] == 0) || (event[i].pt2() >= pt2cut))
-      indices.push_back(i);
-  }
-  reduced_event.reserve(indices.size());
-  for(unsigned int i=0;i<indices.size(); i++){
-    reduced_event.push_back(event[indices[i]]);
-  }
-  
-  // //vector<PseudoJet> reduced_event;
-  // reduced_event.clear();
-  // for(unsigned int i=0;i<event.size(); i++){
-  //   if ((event_ptrs[i] == 0) ||
-  //       (event[i].pt2() >= pt2cut))
-  //     reduced_event.push_back(event[i]);
-  // }
-
-  // free memory: reinstate this is max_pt2 becomes an allocated variable again
-  //delete max_pt2;
-
-  //return reduced_event;
-  pt_threshold = sqrt(pt2cut);
-    
-  // end of alternative
-  //--------------------------------------------------------------
-    
-  // double median_maxpt = sqrt(max_pt2[int_median_pos]);
-  // 
-  // //profiling: t.stop();
-  // //profiling: cout << "   median   : " << t.total() << endl;
-  // //profiling: t.start();
-  // 
-  // // apply a cut on pt using a selector
-  // //
-  // // Watch out that the Selector checks pt >= ptcut, and, since it
-  // // uses pt2 to perform the comparison, may lead to rounding
-  // // errors. By multiplying the ptcut by a small amount, we make
-  // // sure the particle with pt=ptcut is killed.
-  // //
-  // // We're actually going to set to null the ones that will be kept
-  // SelectorPtMax((1+1e-12)*median_maxpt).nullify_non_selected(event_ptrs);
-  // 
-  // // basic information
-  // _ptcut = median_maxpt; // a good first start
-  // 
-  // //profiling: t.stop();
-  // //profiling: cout << "   cutting  : " << t.total() << endl;
-  // //profiling: t.start();
-  // 
-  // // then put back in the saved particles
-  // //
-  // // Note that here we may want to use the killer independently on
-  // // the 2 sets of particles but then the best woulb be to move most
-  // // of the above in a separate method and call it twice (left for
-  // // future experimentation)
-  // //copy(saved_particles.begin(), saved_particles.end(), back_inserter(reduced_event));
-  // 
-  // vector<PseudoJet> reduced_event;
-  // // no sizeable speed gain: reduced_event.reserve(event.size());
-  // for (unsigned int i=0;i<event.size();i++)
-  //   if (event_ptrs[i] == 0) reduced_event.push_back(event[i]);
-  // 
-  // // free memory
-  // delete max_pt2;
-  // 
-  // //profiling: t.stop();
-  // //profiling: cout << "   finishing: " << t.total() << endl;
-  // 
-  // return reduced_event;
-}
-
-#ifndef FJCONTRIB_SOFTKILLER_USEFJGRID
-
-// configure the grid
-void SoftKiller::_setup_grid() {
-  // this grid-definition code is becoming repetitive -- it should
-  // probably be moved somewhere central...
-  double ny_double = (_ymax-_ymin) / _requested_drap;
-  _ny = max(int(ny_double+0.5),1);
-  _dy = (_ymax-_ymin) / _ny;
-  _inverse_dy = _ny/(_ymax-_ymin);
-  
-  _nphi = int (twopi / _requested_dphi + 0.5);
-  _dphi = twopi / _nphi;
-  _inverse_dphi = _nphi/twopi;
-
-  // some sanity checking (could throw a fastjet::Error)
-  assert(_ny >= 1 && _nphi >= 1);
-
-  _ntotal = _nphi * _ny;
-  //_max_pt.resize(_ntotal);
-  _cell_area = _dy * _dphi;
-}
-
-// retrieve the grid cell index for a given PseudoJet
-inline int SoftKiller::tile_index(const PseudoJet & p) const {
-  // writing it as below gives a huge speed gain (factor two!). Even
-  // though answers are identical and the routine here is not the
-  // speed-critical step. It's not at all clear why.
-  int iy = int(floor( (p.rap() - _ymin) * _inverse_dy ));
-  if (iy < 0 || iy >= _ny) return -1;
-
-  int iphi = int( p.phi() * _inverse_dphi );
-  //assert(iphi >= 0 && iphi <= _nphi);
-  if (iphi == _nphi) iphi = 0; // just in case of rounding errors
-
-  //int igrid_res = iy*_nphi + iphi;
-  //assert (igrid_res >= 0 && igrid_res < _ny*_nphi);
-  return iy*_nphi + iphi; //igrid_res;
-}
-
-#endif // not FJCONTRIB_SOFTKILLER_USEFJGRID
-
-
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/SoftKiller/SoftKiller.hh
===================================================================
--- external/fastjet/contribs/SoftKiller/SoftKiller.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,157 +1,0 @@
-// $Id$
-//
-// Copyright (c) 2014-, Matteo Cacciari, Gavin. P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_SOFTKILLER_HH__
-#define __FASTJET_CONTRIB_SOFTKILLER_HH__
-
-#include <fastjet/internal/base.hh>
-#include <fastjet/Selector.hh>
-#include "fastjet/config.h"
-
-#if FASTJET_VERSION_NUMBER >= 30100
-#define FJCONTRIB_SOFTKILLER_USEFJGRID
-#endif
-
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-#include "fastjet/RectangularGrid.hh"
-#endif
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-
-namespace contrib{
-
-//------------------------------------------------------------------------
-/// \class SoftKiller
-/// Progressively kills soft particles in order of increasing pt until
-/// half of the event is empty.
-///
-/// More precisely, the event up to |rap|=rapmax is split into grid
-/// cells of size "cell_size". Soft particles are removed from the
-/// event in order of increasing pt until half the cells are empty.
-/// By default, that same pt cut is applied to _all_ the particles in
-/// the event, not just those in the grid region.
-///
-/// If a sifter is provided, then only particles that pass the selector
-/// are put onto the grid, and the pt threshold is then applied just 
-/// to those particles, while all other particles are left untouched.
-///
-/// This is convenient, for example, if you want to apply SK just to
-/// neutral particles.
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-class SoftKiller : public RectangularGrid {
-#else 
-class SoftKiller {
-#endif
-public:
-  /// ctor with simple initialisation
-  ///  \param rapmax     the maximal absolute rapidity extent of the grid
-  ///  \param tile_size  the requested grid spacing (equivalently, tile size)
-  ///  \param sifter     when provided, the soft killer is applied
-  ///                    only to particles that pass the sifter (the
-  ///                    others are kept untouched)
-  SoftKiller(double rapmax, double tile_size,
-	     Selector sifter = Selector());
-
-  /// ctor with more control over initialisation
-  ///  \param rapmin     the minimum rapidity extent of the grid
-  ///  \param rapmax     the maximum rapidity extent of the grid
-  ///  \param drap       the grid spacing in rapidity
-  ///  \param dphi       the grid spacing in azimuth
-  ///  \param sifter     when provided, the soft killer is applied
-  ///                    only to particles that pass the sifter (the
-  ///                    others are kept untouched)
-  SoftKiller(double rapmin, double rapmax, double drap, double dphi,
-	     Selector sifter = Selector());
-
-#ifdef FJCONTRIB_SOFTKILLER_USEFJGRID
-  /// constructor that takes RectangularGrid object to flexibly
-  /// specify the details of the grid (works only with FJ3.1)
-  SoftKiller(const RectangularGrid & grid, Selector sifter = Selector());
-#endif 
-
-  /// dummy ctor (will give an unusable SoftKiller)
-  SoftKiller();
-
-  /// returns description of the soft killer
-  std::string description() const;
-  
-  /// applies the soft killer to a given event. The result is the
-  /// "reduced" event.
-  std::vector<PseudoJet> operator()(const std::vector<PseudoJet> & event) const{
-    return result(event);
-  }
-  
-  /// similarly to Transformers in FastJet, introduce a 'result'
-  /// method equivalent to the () operator.
-  //std::vector<PseudoJet> result(const std::vector<PseudoJet> & event) const;
-  std::vector<PseudoJet> result(const std::vector<PseudoJet> & event) const {
-    double pt_threshold;
-    std::vector<PseudoJet> reduced_event;
-    apply(event, reduced_event, pt_threshold);
-    return reduced_event;
-  }
-
-  /// alternative invocation that puts the resulting SK "reduced" event
-  /// into the reduced_event vector, and also provides information about the
-  /// pt threshold that was applied.
-  ///
-  /// The event and reduced_event must _not_ be the same variable.
-  void apply(const std::vector<PseudoJet> & event, 
-             std::vector<PseudoJet> & reduced_event,
-             double & pt_threshold) const;
-
-private:
-
-#ifndef FJCONTRIB_SOFTKILLER_USEFJGRID
-  /// initial setup of the grid 
-  void _setup_grid();
-
-  // retrieve the grid cell index for a given PseudoJet
-  inline int tile_index(const PseudoJet & p) const;
-
-  inline int n_tiles() const {return _ntotal;}
-  inline int n_good_tiles() const {return n_tiles();}
-  inline bool tile_is_good(int itile) const {return true;}
-  
-  inline bool all_tiles_equal_area() const {return true;}
-
-  // ctor arguments
-  double _ymax, _ymin;  ///< maximal and minimal rapidity coverage of the grid
-  //double _cell_size;    ///< grid cell size
-  double _requested_drap; ///< requested rapidity spacing
-  double _requested_dphi; ///< requested phi spacing
-
-  // information about the grid
-  double _dy, _dphi, _cell_area, _inverse_dy, _inverse_dphi;
-  int _ny, _nphi, _ntotal;
-
-#endif // FJCONTRIB_SOFTKILLER_USEFJGRID
-
-  Selector _sifter;     ///< optional sifter
-
-};
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_SOFTKILLER_HH__
Index: external/fastjet/contribs/ValenciaPlugin/AUTHORS
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,8 +1,0 @@
-The ValenciaPlugin FastJet contrib was written and is maintained and developed by: Ignacio Garcia Garcia, Marcel Vos, IFIC (UVEG/CSIC) Valencia, Spain
-
-The first incarnation of the Valencia algorithm (with two parameters R and beta) was proposed "A robust jet reconstruction algorithm for high-energy lepton colliders", PLB 750 (2015) 95-99, arXiv:1404.4294
-The authors acknowledge suggestions by Gavin P. Salam (CERN) and his help in assessing the IR safety of the algorithm
-
-The VLC algorithm (with three parameters R, beta and gamma) is described in "Jet reconstruction at high-energy electron-positron colliders", EPJC 78 (2018) no. 2, 144. The addition of the gamma parameter was suggested by J. Thaler (MIT). The performance of the algorithm is evaluated in detail in this paper, in collaboration with Ph. Roloff, R. Simoniello (CERN) and M. Boronat, J. Fuster (IFIC)  
-
-Please contact: marcel.vos@ific.uv.es for questions, queries and comments
Index: external/fastjet/contribs/ValenciaPlugin/COPYING
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/COPYING	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,343 +1,0 @@
-======================================================================
-======================================================================
-======================================================================
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 2 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, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
Index: external/fastjet/contribs/ValenciaPlugin/ChangeLog
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/ChangeLog	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,50 +1,0 @@
-22-12-2018: Gavin Salam <gavin.salam@cern.ch>
-        * VERSION:
-	* NEWS:
-	updated version to 2.0.2
-
-2018-12-18: Marcel Vos <marcel.vos@ific.uv.es>a
-        * ValenciaPlugin.cc:
-	Incorporates a modification suggested by
-	Filip Zarnecki (Warsaw) to make sure the behaviour for negative
-	beta is correct (added to trunk in june 2017 but left out of
-	2.0.1)
-
-2018-12-04: Marcel Vos <marcel.vos@ific.uv.es>
-	* VERSION
-	* NEWS
-	updated version to 2.0.1
-
-	* ValenciaPlugin.cc:
-	Bug fix: a bug was discovered in the plugin by Matthias Weber (CERN)
- 	the calculation of the distance diB assumed massless constituents.
- 	The impact on the results - jet energy and mass - is typically small,
-	but can be non-negligible
-
-24-02-2015  Marcel Vos <marcel.vos@ific.uv.es>
-
-	*VERSION 2.0.0
-	Releasing first production version
-	
-21-02-2015  Marcel Vos <marcel.vos@ific.uv.es>
-	
-	*VERSION 2.0-devel
-
-	*ValenciaPlugin.cc 
-	changed diB filled after in NNH record after discussion with FJ team
-	released 2.0-devel
-	
-27-01-2015  Marcel Vos <marcel.vos@ific.uv.es>
-	
-	*VERSION creating version 2.0-devel 
-	ValenciaPlugin.cc
-	The algorithm now accepts three parameters:
-	R, the usual radius parameter
-	beta, the exponent of the energy in dij
-	gamma, the exponent of sin(theta) in diB
-	
-13-03-2014  Marcel Vos <marcel.vos@ific.uv.es>
-
-	*VERSION first development version 1.0-devel
-	ValenciaPlugin.cc
-	Implements the algorithm described in arXiv:1404.4294
Index: external/fastjet/contribs/ValenciaPlugin/NEWS
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/NEWS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,7 +1,0 @@
-22 December 2018: bug-fix release 2.0.2, for negative beta
-04 December 2018: bug-fix release 2.0.1, for massive constituents
-24 February 2015: version 2.0.0
-21 February 2015: released 2.0-devel
-27 January 2015: creating version 2.0-devel 
-13 March 2014: first development version 1.0-devel
-
Index: external/fastjet/contribs/ValenciaPlugin/README
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/README	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,2 +1,0 @@
-The Valencia Jet algorithm provides robust performance at future lepton colliders with non-negligible background, while maintaining an inter-particle distance criterion based on energy and angle that matches closely the experimental practice at lepton colliders.
-
Index: external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.cc
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,134 +1,0 @@
-// $Id: ValenciaPlugin.cc 1209 2018-12-05 16:18:01Z vos $
-//
-// Copyright (c) 2014, Marcel Vos and Ignacio Garcia 
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "ValenciaPlugin.hh"
-#include "fastjet/NNH.hh"
-
-// strings and streams
-#include <sstream>
-#include <limits>
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//----------------------------------------------------------------------
-/// class that contains the algorithm parameters R and beta
-//  needed to run the Valencia algorithm
-class ValenciaInfo {
-
-public: 
-  ValenciaInfo(double Ri, double betai, double gammai) 
-  { R_ = Ri; beta_ = betai; gamma_ = gammai;}
-
-  double beta() { return beta_; }
-  double gamma() { return gamma_; }
-  double R() { return R_; }
-
-private:
-
-  double R_, beta_, gamma_;
-};
-
-class ValenciaBriefJet {
-public:
-  void init(const PseudoJet & jet, ValenciaInfo * info) {
-   double norm = 1.0/sqrt(jet.modp2());
-   // pseudo-jet information needed to calculate distance
-    nx = jet.px() * norm;
-    ny = jet.py() * norm;
-    nz = jet.pz() * norm;
-    E = jet.E();
-   
-    // algorithm parameters needed in distance calculation
-    R = info->R();
-    beta = info->beta();
-
-    // beam distance
-    // E-to-the-2*beta times sin(polar angle)-to-the-2*gamma
-    if (E==0. || jet.perp()==0.) diB=0.;
-    // modified diB in release 2.0.1    
-    diB = pow(E,2*beta) * pow(jet.perp()/sqrt(jet.perp2()+jet.pz()*jet.pz()),2*info->gamma());
-  }
-
-  double distance(const ValenciaBriefJet * jet) const {
-    // inter-particle distance is similar to Durham and e+e- kt
-    // two differences: 
-    //              R is redefined for greater flexibility
-    //              the energy is elevated to 2*beta
-    double dij = 1 - nx*jet->nx
-                   - ny*jet->ny
-                   - nz*jet->nz;
-
-    if (pow(jet->E,2*beta) < pow(E,2*beta))
-      dij *= 2 * pow(jet->E,2*beta);
-    else 
-      dij *= 2 * pow(E,2*beta);
-
-    dij/=pow(R,2);
-
-    return dij;
-  }
-
-  double beam_distance() const {
-    return diB;
-  }
-
-
-  double E, nx, ny, nz;
-  double diB;
-  double R, beta;
-};
-
-
-std::string ValenciaPlugin::description () const {
-  std::ostringstream desc;
-  desc << "Valencia plugin with R = " << R() << ", beta = " << beta() << " and gamma = " << gamma();
-  return desc.str();
-}
-
-void ValenciaPlugin::run_clustering(fastjet::ClusterSequence & cs) const {
-  int njets = cs.jets().size();
-  ValenciaInfo vinfo(R(),beta(),gamma());
-  
-  NNH<ValenciaBriefJet,ValenciaInfo> nnh(cs.jets(),&vinfo);
-
-  while (njets > 0) {
-    int i, j, k;
-    double dij = nnh.dij_min(i, j); 
-
-    if (j >= 0) { 
-      cs.plugin_record_ij_recombination(i, j, dij, k);
-      nnh.merge_jets(i, j, cs.jets()[k], k);    
-    } else {
- 
-      cs.plugin_record_iB_recombination(i, dij); 
-      nnh.remove_jet(i);
-    }
-
-    njets--;
-  } 
-}
-
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
Index: external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh
===================================================================
--- external/fastjet/contribs/ValenciaPlugin/ValenciaPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,101 +1,0 @@
-// $Id: ValenciaPlugin.hh 771 2015-02-21 16:40:07Z vos $
-//
-// Copyright (c) 2014, Marcel Vos and Ignacio Garcia 
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#ifndef __FASTJET_CONTRIB_VALENCIAJETALGORITHM_HH__
-#define __FASTJET_CONTRIB_VALENCIAJETALGORITHM_HH__
-
-#include <fastjet/internal/base.hh>
-#include "fastjet/JetDefinition.hh"
-#include "fastjet/ClusterSequence.hh"
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-namespace contrib{
-
-//----------------------------------------------------------------------
-//
-/// ValenciaPlugin is a plugin for fastjet (v2.4 upwards)
-///
-/// It implements the Valencia algorithm, as defined in 
-/// Boronat, Garcia, Vos, 
-/// A new jet reconstruction algorithm for lepton colliders
-/// 
-/// 
-class ValenciaPlugin : public JetDefinition::Plugin {
-public:
-
-  /// Constructor for the Valencia Plugin class.  
-  /// Three floating point arguments are specified to set the parameters
-  /// the radius parameter R has the usual meaning,
-  /// the clustering order beta (beta = 1 yields kt-style clustering,
-  /// beta = 0 purely angular clustering a la C/A and beta = -1
-  /// clusters hard, collinear radiation first, like anti-kt),
-  /// and gamma, that governs the shrinking jet size in the forward region
-  ValenciaPlugin (double R, double beta, double gamma) : _R(R), _beta(beta), _gamma(gamma){}
-
-  /// Constructor for the Valencia Plugin class.  
-  /// If two arguments are specified to set the parameters
-  /// the gamma exponent is set equal to beta
-  ValenciaPlugin (double R, double beta) : _R(R), _beta(beta), _gamma(beta){}
-
-  /// copy constructor
-  ValenciaPlugin (const ValenciaPlugin & plugin) {
-    *this = plugin;
-  }
-
-  // the things that are required by base class
-  virtual std::string description () const;
-  virtual void run_clustering(ClusterSequence &) const;
-
-  /// the plugin mechanism's standard way of accessing the jet radius.
-  /// This must be set to return something sensible, even if R
-  /// does not make sense for this algorithm!
-  virtual double R() const {return _R;}
-  
-  // the Valencia algorithm has a second parameter beta that governs
-  // the exponent of the energy in the inter-particle and beam distance 
-  // criteria, and thus determines the clustering order
-  virtual double beta() const {return _beta;}
-  
-  // the Valencia algorithm has a third parameter gamma that governs
-  // the exponent of the sin(theta) in the beam distance
-  // and thus the shrinking of the jet size in the forward region
-   virtual double gamma() const {return _gamma;}
- 
-  
-
-  /// avoid the warning whenever the user requests "exclusive" jets
-  /// from the cluster sequence
-  virtual bool exclusive_sequence_meaningful() const {return true;}
-
-private:
-  double _R;
-  double _beta;
-  double _gamma;
-};
-
-
-
-
-} // namespace contrib
-
-FASTJET_END_NAMESPACE
-
-#endif  // __FASTJET_CONTRIB_VALENCIAJETALGORITHM_HH__
Index: external/fastjet/internal/ClosestPair2D.hh
===================================================================
--- external/fastjet/internal/ClosestPair2D.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/ClosestPair2D.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClosestPair2D.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: ClosestPair2D.hh 2577 2011-09-13 15:11:38Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLOSESTPAIR2D__HH__
@@ -38,5 +36,4 @@
 #include "fastjet/internal/SearchTree.hh"
 #include "fastjet/internal/MinHeap.hh"
-#include "fastjet/SharedPtr.hh"
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -135,6 +132,6 @@
 
 
-  triplet<SharedPtr<Tree> >  _trees;
-  SharedPtr<MinHeap>     _heap;
+  triplet<std::auto_ptr<Tree> >  _trees;
+  std::auto_ptr<MinHeap> _heap;
   std::vector<Point>     _points;
   std::stack<Point *>    _available_points;
Index: external/fastjet/internal/ClosestPair2DBase.hh
===================================================================
--- external/fastjet/internal/ClosestPair2DBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/ClosestPair2DBase.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ClosestPair2DBase.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ClosestPair2DBase.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_CLOSESTPAIR2DBASE__HH__
@@ -48,5 +46,5 @@
   double x, y;
 
-  Coord2D() : x(0.0), y(0.0) {};
+  Coord2D() {};
 
   Coord2D(double a, double b): x(a), y(b) {};
Index: external/fastjet/internal/ClusterSequence_N2.icc
===================================================================
--- external/fastjet/internal/ClusterSequence_N2.icc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/ClusterSequence_N2.icc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,11 +1,11 @@
 // -*- C++ -*-
-#ifndef __FASTJET_CLUSTERQUENCE_N2_ICC__
-#define __FASTJET_CLUSTERQUENCE_N2_ICC__
+#ifndef __CLUSTERQUENCE_N2_ICC__
+#define __CLUSTERQUENCE_N2_ICC__
 #include "fastjet/ClusterSequence.hh"
 
-//FJSTARTHEADER
+//STARTHEADER
 // $Id: ClusterSequence_N2.cc 1351 2009-01-09 18:03:03Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2009, Matteo Cacciari, Gavin Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -18,9 +18,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,7 +28,9 @@
 //
 //  You should have received a copy of the GNU General Public License
-//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
+//  along with FastJet; if not, write to the Free Software
+//  Foundation, Inc.:
+//      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 //----------------------------------------------------------------------
@@ -196,5 +196,5 @@
 FASTJET_END_NAMESPACE
 
-#endif // __FASTJET_CLUSTERQUENCE_N2_ICC__
-
-
+#endif // __CLUSTERQUENCE_N2_ICC__
+
+
Index: external/fastjet/internal/Dnn2piCylinder.hh
===================================================================
--- external/fastjet/internal/Dnn2piCylinder.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/Dnn2piCylinder.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Dnn2piCylinder.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: Dnn2piCylinder.hh 2577 2011-09-13 15:11:38Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -75,14 +73,14 @@
   /// Returns the index of  the nearest neighbour of point labelled
   /// by ii (assumes ii is valid)
-  int NearestNeighbourIndex(const int ii) const ;
+  int NearestNeighbourIndex(const int & ii) const ;
 
   /// Returns the distance to the nearest neighbour of point labelled
   /// by index ii (assumes ii is valid)
-  double NearestNeighbourDistance(const int ii) const ;
+  double NearestNeighbourDistance(const int & ii) const ;
 
   /// Returns true iff the given index corresponds to a point that
   /// exists in the DNN structure (meaning that it has been added, and
   /// not removed in the meantime)
-  bool Valid(const int index) const;
+  bool Valid(const int & index) const;
 
   void RemoveAndAddPoints(const std::vector<int> & indices_to_remove,
@@ -218,5 +216,5 @@
 /// initialised the class with instructions to ignore this problem the
 /// program will detect and ignore it, or crash.
-inline int Dnn2piCylinder::NearestNeighbourIndex(const int current) const {
+inline int Dnn2piCylinder::NearestNeighbourIndex(const int & current) const {
   int main_index = _mirror_info[current].main_index;
   int mirror_index = _mirror_info[current].mirror_index;
@@ -243,5 +241,5 @@
 }
 
-inline double Dnn2piCylinder::NearestNeighbourDistance(const int current) const {
+inline double Dnn2piCylinder::NearestNeighbourDistance(const int & current) const {
   int main_index = _mirror_info[current].main_index;
   int mirror_index = _mirror_info[current].mirror_index;
@@ -258,5 +256,5 @@
 }
 
-inline bool Dnn2piCylinder::Valid(const int index) const {
+inline bool Dnn2piCylinder::Valid(const int & index) const {
   return (_DNN->Valid(_mirror_info[index].main_index));
 }
Index: external/fastjet/internal/Dnn3piCylinder.hh
===================================================================
--- external/fastjet/internal/Dnn3piCylinder.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/Dnn3piCylinder.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Dnn3piCylinder.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: Dnn3piCylinder.hh 2577 2011-09-13 15:11:38Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -72,14 +70,14 @@
   /// Returns the index of  the nearest neighbour of point labelled
   /// by ii (assumes ii is valid)
-  int NearestNeighbourIndex(const int ii) const ;
+  int NearestNeighbourIndex(const int & ii) const ;
 
   /// Returns the distance to the nearest neighbour of point labelled
   /// by index ii (assumes ii is valid)
-  double NearestNeighbourDistance(const int ii) const ;
+  double NearestNeighbourDistance(const int & ii) const ;
 
   /// Returns true iff the given index corresponds to a point that
   /// exists in the DNN structure (meaning that it has been added, and
   /// not removed in the meantime)
-  bool Valid(const int index) const;
+  bool Valid(const int & index) const;
 
   void RemoveAndAddPoints(const std::vector<int> & indices_to_remove,
@@ -206,5 +204,5 @@
 /// initialised the class with instructions to ignore this problem the
 /// program will detect and ignore it, or crash.
-inline int Dnn3piCylinder::NearestNeighbourIndex(const int current) const {
+inline int Dnn3piCylinder::NearestNeighbourIndex(const int & current) const {
   int main_index = _mirror_info[current].main_index;
   int mirror_index = _mirror_info[current].mirror_index;
@@ -231,5 +229,5 @@
 }
 
-inline double Dnn3piCylinder::NearestNeighbourDistance(const int current) const {
+inline double Dnn3piCylinder::NearestNeighbourDistance(const int & current) const {
   int main_index = _mirror_info[current].main_index;
   int mirror_index = _mirror_info[current].mirror_index;
@@ -246,5 +244,5 @@
 }
 
-inline bool Dnn3piCylinder::Valid(const int index) const {
+inline bool Dnn3piCylinder::Valid(const int & index) const {
   return (_DNN->Valid(_mirror_info[index].main_index));
 }
Index: external/fastjet/internal/Dnn4piCylinder.hh
===================================================================
--- external/fastjet/internal/Dnn4piCylinder.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/Dnn4piCylinder.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Dnn4piCylinder.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: Dnn4piCylinder.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -59,14 +57,14 @@
   /// Returns the index of  the nearest neighbour of point labelled
   /// by ii (assumes ii is valid)
-  int NearestNeighbourIndex(const int ii) const ;
+  int NearestNeighbourIndex(const int & ii) const ;
 
   /// Returns the distance to the nearest neighbour of point labelled
   /// by index ii (assumes ii is valid)
-  double NearestNeighbourDistance(const int ii) const ;
+  double NearestNeighbourDistance(const int & ii) const ;
 
   /// Returns true iff the given index corresponds to a point that
   /// exists in the DNN structure (meaning that it has been added, and
   /// not removed in the meantime)
-  bool Valid(const int index) const;
+  bool Valid(const int & index) const;
 
   void RemoveAndAddPoints(const std::vector<int> & indices_to_remove,
@@ -100,5 +98,5 @@
 // functions defined above
 
-inline int Dnn4piCylinder::NearestNeighbourIndex(const int current) const {
+inline int Dnn4piCylinder::NearestNeighbourIndex(const int & current) const {
   return (_DNN1->NearestNeighbourDistance(current) < 
 	  _DNN2->NearestNeighbourDistance(current)) ? 
@@ -107,5 +105,5 @@
 }
 
-inline double Dnn4piCylinder::NearestNeighbourDistance(const int current) const {
+inline double Dnn4piCylinder::NearestNeighbourDistance(const int & current) const {
   return (_DNN1->NearestNeighbourDistance(current) < 
 	  _DNN2->NearestNeighbourDistance(current)) ? 
@@ -114,5 +112,5 @@
 }
 
-inline bool Dnn4piCylinder::Valid(const int index) const {
+inline bool Dnn4piCylinder::Valid(const int & index) const {
   return (_DNN1->Valid(index) && _DNN2->Valid(index));
 }
Index: external/fastjet/internal/DnnPlane.hh
===================================================================
--- external/fastjet/internal/DnnPlane.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/DnnPlane.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: DnnPlane.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: DnnPlane.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -46,11 +44,4 @@
 /// class derived from DynamicNearestNeighbours that provides an
 /// implementation for the Euclidean plane
-///
-/// This class that uses CGAL Delaunay triangulation for most of the
-/// work (it allows for easy and efficient removal and addition of
-/// points and circulation over a point's neighbours). The treatment
-/// of coincident points is not supported by CGAL and is implemented
-/// according to the method specified in
-/// issue-tracker/2012-02-CGAL-coincident/METHOD
 /// \endif
 class DnnPlane : public DynamicNearestNeighbours {
@@ -66,14 +57,14 @@
   /// Returns the index of  the nearest neighbour of point labelled
   /// by ii (assumes ii is valid)
-  int NearestNeighbourIndex(const int ii) const ;
+  int NearestNeighbourIndex(const int & ii) const ;
 
   /// Returns the distance to the nearest neighbour of point labelled
   /// by index ii (assumes ii is valid)
-  double NearestNeighbourDistance(const int ii) const ;
+  double NearestNeighbourDistance(const int & ii) const ;
 
   /// Returns true iff the given index corresponds to a point that
   /// exists in the DNN structure (meaning that it has been added, and
   /// not removed in the meantime)
-  bool Valid(const int index) const;
+  bool Valid(const int & index) const;
 
   void RemoveAndAddPoints(const std::vector<int> & indices_to_remove,
@@ -89,5 +80,5 @@
   double phi(const int i) const;
 
-private:
+ private:
 
   /// Structure containing a vertex_handle and cached information on
@@ -97,6 +88,4 @@
     double NNdistance;
     int NNindex;
-    int coincidence;  // ==vertex->info.val() if no coincidence
-                      // points to the coinciding SV in case of coincidence
     // later on for cylinder put a second vertex?
   };
@@ -106,6 +95,6 @@
   bool _verbose;
 
-  //static const bool _crash_on_coincidence = true;
-  static const bool _crash_on_coincidence = false;
+  static const bool _crash_on_coincidence = true;
+  //static const bool _crash_on_coincidence = false;
 
   Triangulation _TR; /// CGAL object for dealing with triangulations
@@ -122,5 +111,5 @@
   /// Determines the index and distance of the nearest neighbour to 
   /// point j and puts the information into the _supervertex entry for j
-  void _SetNearest(const int j);
+  void _SetNearest(const int & j);
 
   //----------------------------------------------------------------------
@@ -134,110 +123,13 @@
   /// Note that j is NOT pushed onto indices_of_updated_neighbours --
   /// if you want it there, put it there yourself.
-  void _SetAndUpdateNearest(const int j, 
+  void _SetAndUpdateNearest(const int & j, 
 			    std::vector<int> & indices_of_updated_neighbours);
 
   /// given a vertex_handle returned by CGAL on insertion of a new
-  /// points, returns the coinciding vertex's value if it turns out
-  /// that it corresponds to a vertex that we already knew about
-  /// (usually because two points coincide)
-  int _CheckIfVertexPresent(const Vertex_handle & vertex, 
-			    const int its_index);
+  /// points, crash if it turns out that it corresponds to a vertex
+  /// that we already knew about (usually because two points coincide)
+  void _CrashIfVertexPresent(const Vertex_handle & vertex, 
+			     const int & its_index);
 
-  //----------------------------------------------------------------------
-  /// if the distance between 'pref' and 'candidate' is smaller (or
-  /// equal) than the one between 'pref' and 'near', return true and
-  /// set 'mindist' to that distance. Note that it is assumed that
-  /// 'mindist' is the euclidian distance between 'pref' and 'near'
-  ///
-  /// Note that the 'near' point is passed through its vertex rather
-  /// than as a point. This allows us to handle cases where we have no min
-  /// yet (near is the infinite vertex)
-  inline bool _is_closer_to(const Point &pref, 
-			    const Point &candidate,
-			    const Vertex_handle &near,
-			    double & dist,
-			    double & mindist){
-    dist = _euclid_distance(pref, candidate);
-    return _is_closer_to_with_hint(pref, candidate, near, dist, mindist);
-  }
-
-  /// same as '_is_closer_to' except that 'dist' already contains the
-  /// distance between 'pref' and 'candidate'
-  inline bool _is_closer_to_with_hint(const Point &pref, 
-				      const Point &candidate,
-				      const Vertex_handle &near,
-				      const double & dist,
-				      double & mindist){
-    
-    // check if 'dist', the pre-computed distance between 'candidate'
-    // and 'pref' is smaller than the distance between 'pref' and its
-    // currently registered nearest neighbour 'near' (and update
-    // things if it is)
-    //
-    // Interestingly enough, it has to be pointed out that the use of
-    // 'abs' instead of 'std::abs' returns wrong results (apparently
-    // ints without any compiler warning)
-    //
-    // The (near != NULL) test is there for one single reason: when
-    // checking that a newly inserted point is not closer than a
-    // previous NN, if that distance comparison involves a "nearly
-    // degenerate" distance we need to access near->point. But
-    // sometimes, in the course of RemoveAndAddPoints, its previous NN
-    // has been deleted and its vertex (corresponding to 'near') set
-    // to NULL. This is not a problem as all points having a deleted
-    // point as NN will have their NN explicitly recomputed at the end
-    // of RemoveAndAddPoints so here we should just make sure there is
-    // no crash... that's done by checking (near != NULL)
-    if ((std::abs(dist-mindist)<DISTANCE_FOR_CGAL_CHECKS) &&
-	_is_not_null(near) && // GPS cf. note below about != NULL with clang/CGAL
-	(_euclid_distance(candidate, near->point())<DISTANCE_FOR_CGAL_CHECKS)){
-      // we're in a situation where there might be a rounding issue,
-      // use CGAL's distance computation to get it right
-      //
-      // Note that in the test right above,
-      // (abs(dist-mindist)<1e-12) guarantees that the current
-      // nearest point is not the infinite vertex and thus
-      // nearest->point() is not ill-defined
-      if (_verbose) std::cout << "using CGAL's distance ordering" << std::endl;
-      if (CGAL::compare_distance_to_point(pref, candidate, near->point())!=CGAL::LARGER){
-	mindist = dist;
-	return true;
-      }
-    } else if (dist <= mindist) {
-      // Note that the use of a <= in the above expression (instead of
-      // a strict ordering <) is important in one case: when checking
-      // if a new point is the new NN of one of the points in its
-      // neighbourhood, in case of distances being ==, we are sure
-      // that 'candidate' is in a cell adjacent to 'pref' while it may
-      // no longer be the case for 'near'
-      mindist = dist;
-      return true;
-    } 
-    
-    return false;
-  }
-
-  /// if a distance between a point and 2 others is smaller than this
-  /// and the distance between the two points is also smaller than this
-  /// then use CGAL to compare the distances. 
-  static const double DISTANCE_FOR_CGAL_CHECKS;  
-
-
-  /// small routine to check if if a vertex handle is not null.
-  ///
-  /// This is centralised here because of the need for a not-very
-  /// readable workaround for certain CGAL/clang++ compiler
-  /// combinations.
-  inline static bool _is_not_null(const Vertex_handle & vh) {
-    // as found in issue 2015-07-clang61+CGAL, the form
-    //   vh != NULL
-    // appears to be broken with CGAL-3.6 and clang-3.6.0/.1
-    //
-    // The not very "readable"
-    //   vh.operator->()
-    // does the job instead
-    return vh.operator->();
-  }
-  
 };
 
@@ -246,19 +138,13 @@
 // functions defined above
 
-inline int DnnPlane::NearestNeighbourIndex(const int ii) const {
+inline int DnnPlane::NearestNeighbourIndex(const int & ii) const {
   return _supervertex[ii].NNindex;}
 
-inline double DnnPlane::NearestNeighbourDistance(const int ii) const {
+inline double DnnPlane::NearestNeighbourDistance(const int & ii) const {
   return _supervertex[ii].NNdistance;}
 
-inline bool DnnPlane::Valid(const int index) const {
+inline bool DnnPlane::Valid(const int & index) const {
   if (index >= 0 && index < static_cast<int>(_supervertex.size())) {
-    return _is_not_null(_supervertex[index].vertex);
-  }
-  else {
-    return false;
-  }
-}
-
+    return (_supervertex[index].vertex != NULL);} else {return false;} }
 
 inline EtaPhi DnnPlane::etaphi(const int i) const {
Index: external/fastjet/internal/DynamicNearestNeighbours.hh
===================================================================
--- external/fastjet/internal/DynamicNearestNeighbours.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/DynamicNearestNeighbours.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: DynamicNearestNeighbours.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: DynamicNearestNeighbours.hh 2687 2011-11-14 11:17:51Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -39,5 +37,4 @@
 #include<cassert>
 #include "fastjet/internal/numconsts.hh"
-#include "fastjet/Error.hh"
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -71,9 +68,15 @@
 /// Nearest Neighbours code
 /// \endif
-class DnnError : public Error {
+class DnnError {
 public:
   // constructors
-  //DnnError() {}
-  DnnError(const std::string & message_in) : Error(message_in) {}
+  DnnError() {;};
+  DnnError(const std::string & message_in) {
+    _message = message_in; std::cerr << message_in << std::endl;};
+
+  std::string message() const {return _message;};
+
+private:
+  std::string _message;
 };
 
@@ -109,14 +112,14 @@
   /// Returns the index of the nearest neighbour of point labelled
   /// by ii (assumes ii is valid)
-  virtual int NearestNeighbourIndex(const int ii) const = 0;
+  virtual int NearestNeighbourIndex(const int & ii) const = 0;
 
   /// Returns the distance to the nearest neighbour of point labelled
   /// by index ii (assumes ii is valid)
-  virtual double NearestNeighbourDistance(const int ii) const = 0;
+  virtual double NearestNeighbourDistance(const int & ii) const = 0;
 
   /// Returns true iff the given index corresponds to a point that
   /// exists in the DNN structure (meaning that it has been added, and
   /// not removed in the meantime)
-  virtual bool Valid(const int index) const = 0;
+  virtual bool Valid(const int & index) const = 0;
 
   /// remove the points labelled by the std::vector indices_to_remove, and
@@ -138,5 +141,5 @@
   /// Remove the point labelled by index and return the list of
   /// points whose nearest neighbours have changed in the process
-  inline void RemovePoint (const int index,
+  inline void RemovePoint (const int & index,
 			   std::vector<int> & indices_of_updated_neighbours) {
     std::vector<int> indices_added;
@@ -155,5 +158,5 @@
   /// point).
   inline void RemoveCombinedAddCombination(
-			const int index1, const int index2,
+			const int & index1, const int & index2,
 			const EtaPhi & newpoint,
 			int & index3,
Index: external/fastjet/internal/IsBase.hh
===================================================================
--- external/fastjet/internal/IsBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/IsBase.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: IsBase.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: IsBase.hh 2622 2011-10-05 22:13:23Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_INTERNAL_IS_BASE_HH__
@@ -165,5 +163,5 @@
 template<class B, class D>
 B* cast_if_derived(D* d){
-  return IsBaseAndDerived<B,D>::value ? (B*)(d) : 0;
+  return IsBaseAndDerived<B,D>::value ? (B*)(d) : NULL;
 }
 
Index: external/fastjet/internal/LazyTiling25.hh
===================================================================
--- external/fastjet/internal/LazyTiling25.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,195 +1,0 @@
-#ifndef __FASTJET_LAZYTILING25_HH__
-#define __FASTJET_LAZYTILING25_HH__
-
-// #define INSTRUMENT2 1
-
-//FJSTARTHEADER
-// $Id: LazyTiling25.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-//#include "fastjet/PseudoJet.hh"
-#include "fastjet/internal/MinHeap.hh"
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/internal/LazyTiling9Alt.hh"
-#include "fastjet/internal/LazyTiling9.hh"
-
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-typedef Tile2Base<25> Tile25;
-
-
-// class Tile25 {
-// public:
-//   /// pointers to neighbouring tiles, including self
-//   Tile25 *   begin_tiles[25];
-//   /// neighbouring tiles, excluding self
-//   Tile25 **  surrounding_tiles; 
-//   /// half of neighbouring tiles, no self
-//   Tile25 **  RH_tiles;  
-//   /// just beyond end of tiles
-//   Tile25 **  end_tiles; 
-//   /// start of list of BriefJets contained in this tile
-//   TiledJet * head;    
-//   /// sometimes useful to be able to tag a tile
-//   bool     tagged;    
-//   /// for all particles in the tile, this stores the largest of the
-//   /// (squared) nearest-neighbour distances.
-//   double max_NN_dist;
-//   double eta_centre, phi_centre;
-// 
-//   bool is_near_zero_phi(double tile_size_phi) const {
-//     return phi_centre < 2*tile_size_phi || (twopi-phi_centre) < 2*tile_size_phi;
-//   }
-// };
-
-
-//----------------------------------------------------------------------
-class LazyTiling25 {
-public:
-  LazyTiling25(ClusterSequence & cs);
-
-  void run();
-
-protected:
-  ClusterSequence & _cs;
-  const std::vector<PseudoJet> & _jets;
-  std::vector<Tile25> _tiles;
-
-#ifdef INSTRUMENT2
-  int _ncall; // GPS tmp
-  int _ncall_dtt; // GPS tmp
-#endif // INSTRUMENT2
-
-  double _Rparam, _R2, _invR2;
-  double _tiles_eta_min, _tiles_eta_max;
-  double _tile_size_eta, _tile_size_phi;
-  double _tile_half_size_eta, _tile_half_size_phi;
-  int    _n_tiles_phi,_tiles_ieta_min,_tiles_ieta_max;
-
-  std::vector<TiledJet *> _jets_for_minheap;
-  
-  //MinHeap _minheap;
-
-  void _initialise_tiles();
-
-  // reasonably robust return of tile index given ieta and iphi, in particular
-  // it works even if iphi is negative
-  inline int _tile_index (int ieta, int iphi) const {
-    // note that (-1)%n = -1 so that we have to add _n_tiles_phi
-    // before performing modulo operation
-    return (ieta-_tiles_ieta_min)*_n_tiles_phi
-                  + (iphi+_n_tiles_phi) % _n_tiles_phi;
-  }
-
-  void  _bj_remove_from_tiles(TiledJet * const jet);
-
-  /// returns the tile index given the eta and phi values of a jet
-  int _tile_index(const double eta, const double phi) const;
-
-  // sets up information regarding the tiling of the given jet
-  void _tj_set_jetinfo(TiledJet * const jet, const int _jets_index);
-
-  void _print_tiles(TiledJet * briefjets ) const;
-  void _add_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles) const;
-  void _add_untagged_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  void _add_untagged_neighbours_to_tile_union_using_max_info(const TiledJet * const jet, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  double _distance_to_tile(const TiledJet * bj, const Tile25 *) 
-#ifdef INSTRUMENT2
-    ;
-#else
-    const;
-#endif 
-  void _update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
-
-  void _set_NN(TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
-
-  // return the diJ (multiplied by _R2) for this jet assuming its NN
-  // info is correct
-  template <class J> double _bj_diJ(const J * const jet) const {
-    double kt2 = jet->kt2;
-    if (jet->NN != NULL) {if (jet->NN->kt2 < kt2) {kt2 = jet->NN->kt2;}}
-    return jet->NN_dist * kt2;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline void _bj_set_jetinfo(
-                            J * const jetA, const int _jets_index) const {
-    jetA->eta  = _jets[_jets_index].rap();
-    jetA->phi  = _jets[_jets_index].phi_02pi();
-    jetA->kt2  = _cs.jet_scale_for_algorithm(_jets[_jets_index]);
-    jetA->_jets_index = _jets_index;
-    // initialise NN info as well
-    jetA->NN_dist = _R2;
-    jetA->NN      = NULL;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist(
-                const J * const jetA, const J * const jetB) 
-#ifdef INSTRUMENT2
-    {
-    _ncall++; // GPS tmp
-#else
-    const {
-#endif 
-    double dphi = std::abs(jetA->phi - jetB->phi);
-    double deta = (jetA->eta - jetB->eta);
-    if (dphi > pi) {dphi = twopi - dphi;}
-    return dphi*dphi + deta*deta;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist_not_periodic(
-                const J * const jetA, const J * const jetB)
-#ifdef INSTRUMENT2
-    {
-    _ncall++; // GPS tmp
-#else
-    const {
-#endif 
-    //_ncall++; // GPS tmp
-    double dphi = jetA->phi - jetB->phi;
-    double deta = (jetA->eta - jetB->eta);
-    return dphi*dphi + deta*deta;
-  }
-
-};
-
-
-FASTJET_END_NAMESPACE
-
-#endif // __FASTJET_LAZYTILING25_HH__
Index: external/fastjet/internal/LazyTiling9.hh
===================================================================
--- external/fastjet/internal/LazyTiling9.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,240 +1,0 @@
-#ifndef __FASTJET_LAZYTILING9_HH__
-#define __FASTJET_LAZYTILING9_HH__
-
-//#define INSTRUMENT2 1
-
-//FJSTARTHEADER
-// $Id: LazyTiling9.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-//#include "fastjet/PseudoJet.hh"
-#include "fastjet/internal/MinHeap.hh"
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/internal/LazyTiling9Alt.hh"
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-template<int NN>
-class Tile2Base {
-public:
-  /// pointers to neighbouring tiles, including self
-  Tile2Base *   begin_tiles[NN]; 
-  /// neighbouring tiles, excluding self
-  Tile2Base **  surrounding_tiles; 
-  /// half of neighbouring tiles, no self
-  Tile2Base **  RH_tiles;  
-  /// just beyond end of tiles
-  Tile2Base **  end_tiles; 
-  /// start of list of BriefJets contained in this tile
-  TiledJet * head;    
-  /// sometimes useful to be able to tag a tile
-  bool     tagged;    
-  /// true for tiles where the delta phi calculation needs
-  /// potentially to account for periodicity in phi
-  bool     use_periodic_delta_phi;
-  /// for all particles in the tile, this stores the largest of the
-  /// (squared) nearest-neighbour distances.
-  double max_NN_dist;
-  double eta_centre, phi_centre;
-
-  /// returns the number of jets in the tile; useful principally for
-  /// diagnostics
-  int jet_count() const {
-    int count = 0;
-    const TiledJet * jet = head;
-    while (jet != 0) {
-      count++;
-      jet = jet->next;
-    }
-    return count;
-  }
-};
-
-
-typedef Tile2Base<9> Tile2;
-
-// class Tile2 : public Tile2Base {
-// public:
-//   /// pointers to neighbouring tiles, including self
-//   Tile2 *   begin_tiles[n_tile_neighbours]; 
-//   bool is_near_zero_phi(double tile_size_phi) const {
-//     return phi_centre < tile_size_phi || (twopi-phi_centre) < tile_size_phi;
-//   }
-// };
-
-// class Tile2  {
-// public:
-//   /// pointers to neighbouring tiles, including self
-//   Tile2 *   begin_tiles[n_tile_neighbours]; 
-//   /// neighbouring tiles, excluding self
-//   Tile2 **  surrounding_tiles; 
-//   /// half of neighbouring tiles, no self
-//   Tile2 **  RH_tiles;  
-//   /// just beyond end of tiles
-//   Tile2 **  end_tiles; 
-//   /// start of list of BriefJets contained in this tile
-//   TiledJet * head;    
-//   /// sometimes useful to be able to tag a tile
-//   bool     tagged;    
-//   /// for all particles in the tile, this stores the largest of the
-//   /// (squared) nearest-neighbour distances.
-//   double max_NN_dist;
-//   double eta_centre, phi_centre;
-//   bool is_near_zero_phi(double tile_size_phi) const {
-//     return phi_centre < tile_size_phi || (twopi-phi_centre) < tile_size_phi;
-//   }
-// };
-
-
-
-//----------------------------------------------------------------------
-class LazyTiling9 {
-public:
-  LazyTiling9(ClusterSequence & cs);
-
-  void run();
-
-  //void get_next_clustering(int & jetA_index, int & jetB_index, double & dij);
-  
-
-protected:
-  ClusterSequence & _cs;
-  const std::vector<PseudoJet> & _jets;
-  std::vector<Tile2> _tiles;
-
-#ifdef INSTRUMENT2
-  int _ncall; // GPS tmp
-  int _ncall_dtt; // GPS tmp
-#endif // INSTRUMENT2
-
-  double _Rparam, _R2, _invR2;
-  double _tiles_eta_min, _tiles_eta_max;
-  double _tile_size_eta, _tile_size_phi;
-  double _tile_half_size_eta, _tile_half_size_phi;
-  int    _n_tiles_phi,_tiles_ieta_min,_tiles_ieta_max;
-
-  std::vector<TiledJet *> _jets_for_minheap;
-  
-  //MinHeap _minheap;
-
-  void _initialise_tiles();
-
-  // reasonably robust return of tile index given ieta and iphi, in particular
-  // it works even if iphi is negative
-  inline int _tile_index (int ieta, int iphi) const {
-    // note that (-1)%n = -1 so that we have to add _n_tiles_phi
-    // before performing modulo operation
-    return (ieta-_tiles_ieta_min)*_n_tiles_phi
-                  + (iphi+_n_tiles_phi) % _n_tiles_phi;
-  }
-
-  void  _bj_remove_from_tiles(TiledJet * const jet);
-
-  /// returns the tile index given the eta and phi values of a jet
-  int _tile_index(const double eta, const double phi) const;
-
-  // sets up information regarding the tiling of the given jet
-  void _tj_set_jetinfo(TiledJet * const jet, const int _jets_index);
-
-  void _print_tiles(TiledJet * briefjets ) const;
-  void _add_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles) const;
-  void _add_untagged_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  void _add_untagged_neighbours_to_tile_union_using_max_info(const TiledJet * const jet, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  double _distance_to_tile(const TiledJet * bj, const Tile2 *) 
-#ifdef INSTRUMENT2
-    ;
-#else
-    const;
-#endif 
-  void _update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
-
-  void _set_NN(TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
-
-  // return the diJ (multiplied by _R2) for this jet assuming its NN
-  // info is correct
-  template <class J> double _bj_diJ(const J * const jet) const {
-    double kt2 = jet->kt2;
-    if (jet->NN != NULL) {if (jet->NN->kt2 < kt2) {kt2 = jet->NN->kt2;}}
-    return jet->NN_dist * kt2;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline void _bj_set_jetinfo(
-                            J * const jetA, const int _jets_index) const {
-    jetA->eta  = _jets[_jets_index].rap();
-    jetA->phi  = _jets[_jets_index].phi_02pi();
-    jetA->kt2  = _cs.jet_scale_for_algorithm(_jets[_jets_index]);
-    jetA->_jets_index = _jets_index;
-    // initialise NN info as well
-    jetA->NN_dist = _R2;
-    jetA->NN      = NULL;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist(
-                const J * const jetA, const J * const jetB) 
-#ifdef INSTRUMENT2
-    {
-    _ncall++; // GPS tmp
-#else
-    const {
-#endif 
-    double dphi = std::abs(jetA->phi - jetB->phi);
-    double deta = (jetA->eta - jetB->eta);
-    if (dphi > pi) {dphi = twopi - dphi;}
-    return dphi*dphi + deta*deta;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist_not_periodic(
-                const J * const jetA, const J * const jetB)
-#ifdef INSTRUMENT2
-    {
-    _ncall++; // GPS tmp
-#else
-    const {
-#endif 
-    //_ncall++; // GPS tmp
-    double dphi = jetA->phi - jetB->phi;
-    double deta = (jetA->eta - jetB->eta);
-    return dphi*dphi + deta*deta;
-  }
-
-};
-
-
-FASTJET_END_NAMESPACE
-
-#endif // __FASTJET_LAZYTILING9_HH__
Index: external/fastjet/internal/LazyTiling9Alt.hh
===================================================================
--- external/fastjet/internal/LazyTiling9Alt.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,259 +1,0 @@
-#ifndef __FASTJET_LAZYTILING9ALT_HH__
-#define __FASTJET_LAZYTILING9ALT_HH__
-
-//FJSTARTHEADER
-// $Id: LazyTiling9Alt.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-//#include "fastjet/PseudoJet.hh"
-#include "fastjet/internal/MinHeap.hh"
-#include "fastjet/ClusterSequence.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-/// Rounding errors in the Lazy strategies may cause the following
-/// problem: when browsing tiles in the vicinity of the particles
-/// being clustered in order to decide which of these tiles may
-/// contain particles that need to be updated (because theit NN is one
-/// of the particles that are currently clustered), we discard tiles
-/// that are deemed "too far from the cell" by the "max_NN_dist"
-/// criterion. Because of rounding error, this condition can sometimes
-/// miss cases where an update is needed.
-///
-/// An example of this happens if a particle '1' is, say, at the lower
-/// edge of the rapidity of a given tile, with a particle '2' in the
-/// tile directly on its left at the same rapidity. Assume also that
-/// max_NN_dist in 2's tile corresponds to the distance between 2 and
-/// teh tile of 1. If 2 is 1's NN then in case 2 gets clustered, 1's
-/// NN needs to be updated. However, rounding errors in the
-/// calculation of the distance between 1 and 2 may result is
-/// something slightly larger than the max_NN_dist in 2's tile.
-///
-/// This situation corresponds to the bug reported by Jochen Olt on
-/// February 12 2015 [see issue-tracker/2015-02-infinite-loop],
-/// causing an infinite loop.
-///
-/// To prevent this, the simplest solution is, when looking at tiles
-/// to browse for updateds, to add a margin of security close to the
-/// edges of the cell, i.e. instead of updating only tiles for which
-/// distance<=max_NN_dist, we will update tiles for which
-/// distance<=max_NN_dist+tile_edge_security_margin.
-///
-/// Note that this does not need to be done when computing nearest
-/// neighbours [rounding errors are tolerated there] but it is
-/// critical when tracking points that have to be updated.
-const double tile_edge_security_margin=1.0e-7;
-
-/// structure analogous to BriefJet, but with the extra information
-/// needed for dealing with tiles
-class TiledJet {
-public:
-  double     eta, phi, kt2, NN_dist;
-  TiledJet * NN, *previous, * next; 
-  int        _jets_index, tile_index;
-  bool _minheap_update_needed;
-
-  // indicate whether jets need to have their minheap entries
-  // updated).
-  inline void label_minheap_update_needed() {_minheap_update_needed = true;}
-  inline void label_minheap_update_done()   {_minheap_update_needed = false;}
-  inline bool minheap_update_needed() const {return _minheap_update_needed;}
-};
-
-const int n_tile_neighbours = 9;
-
-class Tile {
-public:
-  typedef double (Tile::*DistToTileFn)(const TiledJet*) const;
-  typedef std::pair<Tile *, DistToTileFn> TileFnPair;
-  /// pointers to neighbouring tiles, including self
-  TileFnPair begin_tiles[n_tile_neighbours]; 
-  /// neighbouring tiles, excluding self
-  TileFnPair *  surrounding_tiles; 
-  /// half of neighbouring tiles, no self
-  TileFnPair *  RH_tiles;  
-  /// just beyond end of tiles
-  TileFnPair *  end_tiles; 
-  /// start of list of BriefJets contained in this tile
-  TiledJet * head;    
-  /// sometimes useful to be able to tag a tile
-  bool     tagged;    
-  /// true for tiles where the delta phi calculation needs
-  /// potentially to account for periodicity in phi
-  bool     use_periodic_delta_phi;
-  /// for all particles in the tile, this stores the largest of the
-  /// (squared) nearest-neighbour distances.
-  double max_NN_dist;
-  double eta_min, eta_max, phi_min, phi_max;
-
-  double distance_to_centre(const TiledJet *) const {return 0;}
-  double distance_to_left(const TiledJet * jet) const {
-    double deta = jet->eta - eta_min;
-    return deta*deta;
-  }
-  double distance_to_right(const TiledJet * jet) const {
-    double deta = jet->eta - eta_max;
-    return deta*deta;
-  }
-  double distance_to_bottom(const TiledJet * jet) const {
-    double dphi = jet->phi - phi_min;
-    return dphi*dphi;
-  }
-  double distance_to_top(const TiledJet * jet) const {
-    double dphi = jet->phi - phi_max;
-    return dphi*dphi;
-  }
-
-  double distance_to_left_top(const TiledJet * jet) const {
-    double deta = jet->eta - eta_min;
-    double dphi = jet->phi - phi_max;
-    return deta*deta + dphi*dphi;
-  }
-  double distance_to_left_bottom(const TiledJet * jet) const {
-    double deta = jet->eta - eta_min;
-    double dphi = jet->phi - phi_min;
-    return deta*deta + dphi*dphi;
-  }
-  double distance_to_right_top(const TiledJet * jet) const {
-    double deta = jet->eta - eta_max;
-    double dphi = jet->phi - phi_max;
-    return deta*deta + dphi*dphi;
-  }
-  double distance_to_right_bottom(const TiledJet * jet) const {
-    double deta = jet->eta - eta_max;
-    double dphi = jet->phi - phi_min;
-    return deta*deta + dphi*dphi;
-  }
-
-  
-};
-
-//----------------------------------------------------------------------
-class LazyTiling9Alt {
-public:
-  LazyTiling9Alt(ClusterSequence & cs);
-
-  void run();
-
-  //void get_next_clustering(int & jetA_index, int & jetB_index, double & dij);
-  
-
-protected:
-  ClusterSequence & _cs;
-  const std::vector<PseudoJet> & _jets;
-  std::vector<Tile> _tiles;
-
-
-  double _Rparam, _R2, _invR2;
-  double _tiles_eta_min, _tiles_eta_max;
-  double _tile_size_eta, _tile_size_phi;
-  double _tile_half_size_eta, _tile_half_size_phi;
-  int    _n_tiles_phi,_tiles_ieta_min,_tiles_ieta_max;
-
-  std::vector<TiledJet *> _jets_for_minheap;
-  
-  //MinHeap _minheap;
-
-  void _initialise_tiles();
-
-  // reasonably robust return of tile index given ieta and iphi, in particular
-  // it works even if iphi is negative
-  inline int _tile_index (int ieta, int iphi) const {
-    // note that (-1)%n = -1 so that we have to add _n_tiles_phi
-    // before performing modulo operation
-    return (ieta-_tiles_ieta_min)*_n_tiles_phi
-                  + (iphi+_n_tiles_phi) % _n_tiles_phi;
-  }
-
-  void  _bj_remove_from_tiles(TiledJet * const jet);
-
-  /// returns the tile index given the eta and phi values of a jet
-  int _tile_index(const double eta, const double phi) const;
-
-  // sets up information regarding the tiling of the given jet
-  void _tj_set_jetinfo(TiledJet * const jet, const int _jets_index);
-
-  void _print_tiles(TiledJet * briefjets ) const;
-  void _add_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles) const;
-  void _add_untagged_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  void _add_untagged_neighbours_to_tile_union_using_max_info(const TiledJet * const jet, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  //double _distance_to_tile(const TiledJet * bj, const Tile *) const;
-  void _update_jetX_jetI_NN(TiledJet * jetX, TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
-
-  void _set_NN(TiledJet * jetI, std::vector<TiledJet *> & jets_for_minheap);
-
-  // return the diJ (multiplied by _R2) for this jet assuming its NN
-  // info is correct
-  template <class J> double _bj_diJ(const J * const jet) const {
-    double kt2 = jet->kt2;
-    if (jet->NN != NULL) {if (jet->NN->kt2 < kt2) {kt2 = jet->NN->kt2;}}
-    return jet->NN_dist * kt2;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline void _bj_set_jetinfo(
-                            J * const jetA, const int _jets_index) const {
-    jetA->eta  = _jets[_jets_index].rap();
-    jetA->phi  = _jets[_jets_index].phi_02pi();
-    jetA->kt2  = _cs.jet_scale_for_algorithm(_jets[_jets_index]);
-    jetA->_jets_index = _jets_index;
-    // initialise NN info as well
-    jetA->NN_dist = _R2;
-    jetA->NN      = NULL;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist(
-                const J * const jetA, const J * const jetB) const {
-    double dphi = std::abs(jetA->phi - jetB->phi);
-    double deta = (jetA->eta - jetB->eta);
-    if (dphi > pi) {dphi = twopi - dphi;}
-    return dphi*dphi + deta*deta;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist_not_periodic(
-                const J * const jetA, const J * const jetB) const {
-    double dphi = jetA->phi - jetB->phi;
-    double deta = (jetA->eta - jetB->eta);
-    return dphi*dphi + deta*deta;
-  }
-
-};
-
-
-FASTJET_END_NAMESPACE
-
-#endif // __FASTJET_LAZYTILING9ALT_HH__
Index: external/fastjet/internal/LazyTiling9SeparateGhosts.hh
===================================================================
--- external/fastjet/internal/LazyTiling9SeparateGhosts.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,195 +1,0 @@
-#ifndef __FASTJET_LAZYTILING9SEPARATEGHOSTS_HH__
-#define __FASTJET_LAZYTILING9SEPARATEGHOSTS_HH__
-
-//FJSTARTHEADER
-// $Id: LazyTiling9SeparateGhosts.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-//#include "fastjet/PseudoJet.hh"
-#include "fastjet/internal/MinHeap.hh"
-#include "fastjet/ClusterSequence.hh"
-#include "fastjet/internal/LazyTiling9Alt.hh"
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-class TiledJet3 {
-public:
-  double     eta, phi, kt2, NN_dist;
-  TiledJet3 * NN, *previous, * next; 
-  int        _jets_index, tile_index;
-  bool _minheap_update_needed;
-  bool is_ghost;
-
-  // indicate whether jets need to have their minheap entries
-  // updated).
-  inline void label_minheap_update_needed() {_minheap_update_needed = true;}
-  inline void label_minheap_update_done()   {_minheap_update_needed = false;}
-  inline bool minheap_update_needed() const {return _minheap_update_needed;}
-};
-
-
-class Tile3 {
-public:
-  /// pointers to neighbouring tiles, including self
-  Tile3 *   begin_tiles[n_tile_neighbours]; 
-  /// neighbouring tiles, excluding self
-  Tile3 **  surrounding_tiles; 
-  /// half of neighbouring tiles, no self
-  Tile3 **  RH_tiles;  
-  /// just beyond end of tiles
-  Tile3 **  end_tiles; 
-  /// start of list of BriefJets contained in this tile
-  TiledJet3 * head;    
-  /// start of list of BriefJets contained in this tile
-  TiledJet3 * ghost_head;    
-  /// sometimes useful to be able to tag a tile
-  bool     tagged;    
-  /// for all particles in the tile, this stores the largest of the
-  /// (squared) nearest-neighbour distances.
-  double max_NN_dist;
-  double eta_centre, phi_centre;
-
-  bool is_near_zero_phi(double tile_size_phi) const {
-    return phi_centre < tile_size_phi || (twopi-phi_centre) < tile_size_phi;
-  }
-};
-
-
-//----------------------------------------------------------------------
-class LazyTiling9SeparateGhosts {
-public:
-  LazyTiling9SeparateGhosts(ClusterSequence & cs);
-
-  void run();
-
-  //void get_next_clustering(int & jetA_index, int & jetB_index, double & dij);
-
-  /// this is the pt2 threshold below which particles will be
-  /// considered as ghosts.
-  ///
-  /// Note that as it stands, a user can decide to change that
-  /// value. Note however that this has to be done at the user's own
-  /// risk (this is an internal part of fastjet).In a similar spirit,
-  /// the interface to access this valus might also change in a future
-  /// release of FastJet.
-  static double ghost_pt2_threshold;
-
-protected:
-  ClusterSequence & _cs;
-  const std::vector<PseudoJet> & _jets;
-  std::vector<Tile3> _tiles;
-
-
-  double _Rparam, _R2, _invR2;
-  double _tiles_eta_min, _tiles_eta_max;
-  double _tile_size_eta, _tile_size_phi;
-  double _tile_half_size_eta, _tile_half_size_phi;
-  int    _n_tiles_phi,_tiles_ieta_min,_tiles_ieta_max;
-
-  std::vector<TiledJet3 *> _jets_for_minheap;
-  
-  //MinHeap _minheap;
-
-  void _initialise_tiles();
-
-  // reasonably robust return of tile index given ieta and iphi, in particular
-  // it works even if iphi is negative
-  inline int _tile_index (int ieta, int iphi) const {
-    // note that (-1)%n = -1 so that we have to add _n_tiles_phi
-    // before performing modulo operation
-    return (ieta-_tiles_ieta_min)*_n_tiles_phi
-                  + (iphi+_n_tiles_phi) % _n_tiles_phi;
-  }
-
-  void  _bj_remove_from_tiles(TiledJet3 * const jet);
-
-  /// returns the tile index given the eta and phi values of a jet
-  int _tile_index(const double eta, const double phi) const;
-
-  // sets up information regarding the tiling of the given jet
-  void _tj_set_jetinfo(TiledJet3 * const jet, const int _jets_index, bool is_ghost);
-
-  void _print_tiles(TiledJet3 * briefjets ) const;
-  void _add_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles) const;
-  void _add_untagged_neighbours_to_tile_union(const int tile_index, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  void _add_untagged_neighbours_to_tile_union_using_max_info(const TiledJet3 * const jet, 
-		 std::vector<int> & tile_union, int & n_near_tiles);
-  double _distance_to_tile(const TiledJet3 * bj, const Tile3 *) const;
-  void _update_jetX_jetI_NN(TiledJet3 * jetX, TiledJet3 * jetI, std::vector<TiledJet3 *> & jets_for_minheap);
-
-  void _set_NN(TiledJet3 * jetI, std::vector<TiledJet3 *> & jets_for_minheap);
-
-  // return the diJ (multiplied by _R2) for this jet assuming its NN
-  // info is correct
-  template <class J> double _bj_diJ(const J * const jet) const {
-    double kt2 = jet->kt2;
-    if (jet->NN != NULL) {if (jet->NN->kt2 < kt2) {kt2 = jet->NN->kt2;}}
-    return jet->NN_dist * kt2;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline void _bj_set_jetinfo(
-                            J * const jetA, const int _jets_index) const {
-    jetA->eta  = _jets[_jets_index].rap();
-    jetA->phi  = _jets[_jets_index].phi_02pi();
-    jetA->kt2  = _cs.jet_scale_for_algorithm(_jets[_jets_index]);
-    jetA->_jets_index = _jets_index;
-    // initialise NN info as well
-    jetA->NN_dist = _R2;
-    jetA->NN      = NULL;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist(
-                const J * const jetA, const J * const jetB) const {
-    double dphi = std::abs(jetA->phi - jetB->phi);
-    double deta = (jetA->eta - jetB->eta);
-    if (dphi > pi) {dphi = twopi - dphi;}
-    return dphi*dphi + deta*deta;
-  }
-
-
-  //----------------------------------------------------------------------
-  template <class J> inline double _bj_dist_not_periodic(
-                const J * const jetA, const J * const jetB) const {
-    double dphi = jetA->phi - jetB->phi;
-    double deta = (jetA->eta - jetB->eta);
-    return dphi*dphi + deta*deta;
-  }
-
-};
-
-
-FASTJET_END_NAMESPACE
-
-#endif // __FASTJET_LAZYTILING9SEPARATEGHOSTS_HH__
Index: external/fastjet/internal/LimitedWarning.hh
===================================================================
--- external/fastjet/internal/LimitedWarning.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/LimitedWarning.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_INTERNALLIMITEDWARNING_HH__
 
-//FJSTARTHEADER
-// $Id: LimitedWarning.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: LimitedWarning.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/internal/MinHeap.hh
===================================================================
--- external/fastjet/internal/MinHeap.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/MinHeap.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: MinHeap.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: MinHeap.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_MINHEAP__HH__
@@ -52,26 +50,18 @@
   /// expansion to a maximum size max_size;
   MinHeap (const std::vector<double> & values, unsigned int max_size) :
-    _heap(max_size) {initialise(values);}
-
-  /// do the minimal setup for a MinHeap that can reach max_size;
-  /// initialisation must be performed later with the actual values.
-  MinHeap (unsigned int max_size) : _heap(max_size) {}
+    _heap(max_size) {_initialise(values);};
 
   /// constructor in which the the maximum size is the size of the values array
   MinHeap (const std::vector<double> & values) :
-    _heap(values.size()) {initialise(values);}
-
-  /// initialise the heap with the supplied values. Should only be called if
-  /// the constructor did not supply values.
-  void initialise(const std::vector<double> & values);
-
+    _heap(values.size()) {_initialise(values);};
+  
   /// return the location of the minimal value on the heap
   inline unsigned int minloc() const {
-    return (_heap[0].minloc) - &(_heap[0]);}
+    return (_heap[0].minloc) - &(_heap[0]);};
   
   /// return the minimal value on the heap
-  inline double       minval() const {return _heap[0].minloc->value;}
+  inline double       minval() const {return _heap[0].minloc->value;};
 
-  inline double operator[](int i) const {return _heap[i].value;}
+  inline double operator[](int i) const {return _heap[i].value;};
 
   /// remove the value at the specified location (i.e. replace it with
@@ -92,4 +82,5 @@
   std::vector<ValueLoc> _heap;
 
+  void _initialise(const std::vector<double> & values);
 
 
Index: external/fastjet/internal/SearchTree.hh
===================================================================
--- external/fastjet/internal/SearchTree.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/SearchTree.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: SearchTree.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: SearchTree.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -91,5 +89,5 @@
   // tracking the depth may have some speed overhead -- so leave it 
   // out for the time being...
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
   /// the max depth the tree has ever reached
   inline unsigned int max_depth() const {return _max_depth;};
@@ -131,5 +129,5 @@
 
   
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
   unsigned int _max_depth;
 #endif
@@ -190,11 +188,5 @@
 public:
 
-  // so that it can access our _node object;
-  // note: "class U" needed for clang (v1.1 branches/release_27) compilation
-  // 2014-07-22: as reported by Torbjorn Sjostrand,
-  // the next line was giving a warning with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
-  // (dependent nested name specifier 'SearchTree<U>::' for friend class declaration is not supported)
-  // Just commenting it out, things still seem to work; same with a template of type T
-  //template<class U> friend class SearchTree<U>::const_circulator;
+  // so that it can access out _node object;
   friend class SearchTree<T>::const_circulator;
   friend class SearchTree<T>;
@@ -348,5 +340,5 @@
   //_available_nodes.reserve();
 
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
   _max_depth     = 0;
 #endif
@@ -398,5 +390,5 @@
 					 ) {
 
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
   // keep track of tree depth for checking things stay reasonable...
   _max_depth = max(depth, _max_depth);
@@ -573,9 +565,9 @@
   bool             on_left = true; // (init not needed -- but soothes g++4)
   // work through tree until we reach its end
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
   unsigned int depth = 0;
 #endif
   while(location != NULL) {
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
     depth++;
 #endif
@@ -585,5 +577,5 @@
     else {location = location->right;}
   }
-#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
+#ifdef TRACK_DEPTH
   _max_depth = max(depth, _max_depth);
 #endif
Index: external/fastjet/internal/TilingExtent.hh
===================================================================
--- external/fastjet/internal/TilingExtent.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,72 +1,0 @@
-#ifndef __FASTJET_TILINGEXTENT_HH__
-#define __FASTJET_TILINGEXTENT_HH__
-
-#include "fastjet/ClusterSequence.hh"
-
-//FJSTARTHEADER
-// $Id: TilingExtent.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-//----------------------------------------------------------------------
-/// class to perform a fast analysis of the appropriate rapidity range
-/// in which to perform tiling
-class TilingExtent {
-public:
-  /// constructor that takes a ClusterSequence in a state where the
-  /// initial particles have been set up, but before clustering has
-  /// started.
-  TilingExtent(ClusterSequence & cs);
-
-  /// constructor that takes a list of PseudoJets
-  TilingExtent(const std::vector<PseudoJet> &particles);
-
-  /// returns the suggested minimum rapidity for the tiling
-  double minrap() const {return _minrap;}
-  /// returns the suggested maximum rapidity for the tiling
-  double maxrap() const {return _maxrap;}
-
-  /// internally, the class bins the particle multiplicity versus
-  /// rapidity, in bins of size 1 running roughly from minrap to maxrap
-  /// (including overflows); this function returns the sum of squares
-  /// of bin contents, which may be informative for deciding strategy
-  /// choices.
-  double sum_of_binned_squared_multiplicity() const {return _cumul2;}
-
-private:
-  double _minrap, _maxrap, _cumul2;
-
-  /// attempts to calculate a sensible rapidity extent for the tiling
-  void _determine_rapidity_extent(const std::vector<PseudoJet> & particles);
-};
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-
-#endif // __FASTJET_TILINGEXTENT_HH__
Index: external/fastjet/internal/Triangulation.hh
===================================================================
--- external/fastjet/internal/Triangulation.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/Triangulation.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3,8 +3,8 @@
 #define __FASTJET_TRIANGULATION__
 
-//FJSTARTHEADER
-// $Id: Triangulation.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: Triangulation.hh 2595 2011-09-23 09:05:04Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -17,9 +17,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -31,5 +29,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/internal/Voronoi.hh
===================================================================
--- external/fastjet/internal/Voronoi.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/Voronoi.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,33 +2,28 @@
 #define __FASTJET__VORONOI_H__
 
-//FJSTARTHEADER
-// $Id: Voronoi.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: Voronoi.hh 2686 2011-11-14 09:28:22Z soyez $
+//
+// Copyright (c) 1994 by AT&T Bell Laboratories (see below)
+//
 //
 //----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
+// This file is included as part of FastJet but was mostly written by
+// S. Fortune in C, put into C++ with memory management by S
+// O'Sullivan, and with further interface and memeory management
+// modifications by Gregory Soyez.
+//
+// Permission to use, copy, modify, and distribute this software for
+// any purpose without fee is hereby granted, provided that this
+// entire notice is included in all copies of any software which is or
+// includes a copy or modification of this software and in all copies
+// of the supporting documentation for such software. THIS SOFTWARE IS
+// BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY.
+// IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY REPRESENTATION
+// OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
+// SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
+//
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/internal/base.hh
===================================================================
--- external/fastjet/internal/base.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/base.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,7 +1,7 @@
 
-//FJSTARTHEADER
-// $Id: base.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: base.hh 2717 2011-11-17 14:15:46Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -14,9 +14,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -28,10 +26,8 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_FASTJET_BASE_HH__
 #define __FASTJET_FASTJET_BASE_HH__
-
-#include "fastjet/config.h"
 
 /// \namespace fastjet
@@ -45,11 +41,3 @@
 #define FASTJET_END_NAMESPACE   }
 
-// define a macro to mark virtual function in derived classes as
-// overriding the base-class definition
-#ifdef FASTJET_HAVE_OVERRIDE
-#define FASTJET_OVERRIDE  override
-#else
-#define FASTJET_OVERRIDE  
-#endif
-
 #endif // __FASTJET_FASTJET_BASE_HH__
Index: external/fastjet/internal/deprecated.hh
===================================================================
--- external/fastjet/internal/deprecated.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,58 +1,0 @@
-
-//FJSTARTHEADER
-// $Id: deprecated.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-//FJENDHEADER
-
-#ifndef __FASTJET_FASTJET_DEPRECATED_HH__
-#define __FASTJET_FASTJET_DEPRECATED_HH__
-
-#include "fastjet/config.h"
-
-#ifndef SWIG
-
-// define a deprecation macro based on the capabilities of the compiler
-// (as determined at configure time).
-#if defined(FASTJET_HAVE_CXX14_DEPRECATED) && (!defined(__FJCORE__))
-#define FASTJET_DEPRECATED               [[deprecated]]
-#define FASTJET_DEPRECATED_MSG(message)  [[deprecated(message)]]
-#elif defined(FASTJET_HAVE_GNUCXX_DEPRECATED)
-#define FASTJET_DEPRECATED               __attribute__((__deprecated__))
-#define FASTJET_DEPRECATED_MSG(message)  __attribute__((__deprecated__))
-#else
-#define FASTJET_DEPRECATED               
-#define FASTJET_DEPRECATED_MSG(message) 
-#endif
-
-#else  // SIWG
-#define FASTJET_DEPRECATED               
-#define FASTJET_DEPRECATED_MSG(message) 
-#endif // SWIG
-
-
-#endif // __FASTJET_FASTJET_DEPRECATED_HH__
Index: external/fastjet/internal/numconsts.hh
===================================================================
--- external/fastjet/internal/numconsts.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/internal/numconsts.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: numconsts.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: numconsts.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/plugins/ATLASCone/ATLASConePlugin.cc
===================================================================
--- external/fastjet/plugins/ATLASCone/ATLASConePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/ATLASCone/ATLASConePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ATLASConePlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // fastjet stuff
Index: external/fastjet/plugins/ATLASCone/fastjet/ATLASConePlugin.hh
===================================================================
--- external/fastjet/plugins/ATLASCone/fastjet/ATLASConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/ATLASCone/fastjet/ATLASConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: ATLASConePlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: ATLASConePlugin.hh 2758 2011-11-24 08:31:58Z soyez $
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // Note on the implementation:
Index: external/fastjet/plugins/CDFCones/CDFJetCluPlugin.cc
===================================================================
--- external/fastjet/plugins/CDFCones/CDFJetCluPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CDFCones/CDFJetCluPlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CDFJetCluPlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/CDFJetCluPlugin.hh"
Index: external/fastjet/plugins/CDFCones/CDFMidPointPlugin.cc
===================================================================
--- external/fastjet/plugins/CDFCones/CDFMidPointPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CDFCones/CDFMidPointPlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CDFMidPointPlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/CDFMidPointPlugin.hh"
Index: external/fastjet/plugins/CDFCones/JetCluAlgorithm.cc
===================================================================
--- external/fastjet/plugins/CDFCones/JetCluAlgorithm.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CDFCones/JetCluAlgorithm.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -11,8 +11,4 @@
 // History of changes compared to the original JetCluAlgorithm.cc file
 // 
-// 2014-08-13 Matteo Cacciari and Gavin Salam
-//        * commented out towers variable in JetCluAlgorithm::buildPreClusters
-//          interface to avoid compiler warning
-//
 // 2011-11-14  Gregory Soyez  <soyez@fastjet.fr>
 //
@@ -32,5 +28,4 @@
 #include <algorithm>
 #include <cmath>
-#include <cstdlib>
 
 #include <fastjet/internal/base.hh>
@@ -59,7 +54,5 @@
 }
 
-// MC+GPS 2014-08-13, commented out the towers variable to avoid an
-// unused variable warning
-void JetCluAlgorithm::buildPreClusters(std::vector<Cluster>& seedTowers, std::vector<PhysicsTower>& /*towers*/,
+void JetCluAlgorithm::buildPreClusters(std::vector<Cluster>& seedTowers, std::vector<PhysicsTower>& towers,
 				       std::vector<Cluster>& preClusters)
 {
@@ -86,6 +79,6 @@
 	  if ((iEtaPreClusterTower >= 8 && iEtaPreClusterTower < 14) || (iEtaPreClusterTower >= 38 && iEtaPreClusterTower < 44))
 	    iPhiPreClusterTower = iPhiPreClusterTower/2;
-	  int dIEta = std::abs(iEtaSeedTower - iEtaPreClusterTower);
-	  int dIPhi = std::abs(iPhiSeedTower - iPhiPreClusterTower);
+	  int dIEta = abs(iEtaSeedTower - iEtaPreClusterTower);
+	  int dIPhi = abs(iPhiSeedTower - iPhiPreClusterTower);
 	  if(dIPhi > 12)
 	    dIPhi = 24 - dIPhi;
Index: external/fastjet/plugins/CDFCones/MidPointAlgorithm.cc
===================================================================
--- external/fastjet/plugins/CDFCones/MidPointAlgorithm.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CDFCones/MidPointAlgorithm.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -11,9 +11,4 @@
 // History of changes compared to the original MidPointAlgorithm.cc file
 // 
-// 2014-08-13 Matteo Cacciari and Gavin Salam
-//        * changed a number of int -> unsigned (and in one case
-//          added explicit conversion to int) to eliminate
-//          long-standing compiler warnings
-//
 // 2009-01-17  Gregory Soyez  <soyez@fastjet.fr>
 // 
@@ -73,11 +68,9 @@
   std::vector< std::vector<bool> > distanceOK;
   distanceOK.resize(stableCones.size() - 1);
-  // MC+GPS 2014-08-13, replaced int with unsigned
-  for(unsigned nCluster1 = 1; nCluster1 < stableCones.size(); nCluster1++){
+  for(int nCluster1 = 1; nCluster1 < stableCones.size(); nCluster1++){
     distanceOK[nCluster1 - 1].resize(nCluster1);
     double cluster1Rapidity = stableCones[nCluster1].fourVector.y();
     double cluster1Phi      = stableCones[nCluster1].fourVector.phi();
-    // MC+GPS 2014-08-13, replaced int with unsigned
-    for(unsigned nCluster2 = 0; nCluster2 < nCluster1; nCluster2++){
+    for(int nCluster2 = 0; nCluster2 < nCluster1; nCluster2++){
       double cluster2Rapidity = stableCones[nCluster2].fourVector.y();
       double cluster2Phi      = stableCones[nCluster2].fourVector.phi();
@@ -101,10 +94,8 @@
   // Loop over all combinations. Calculate MidPoint. Make midPointClusters.
   bool reduceConeSize = false;
-  // MC+GPS 2014-08-13, replaced int with unsigned
-  for(unsigned iPair = 0; iPair < pairs.size(); iPair++){
+  for(int iPair = 0; iPair < pairs.size(); iPair++){
     // Calculate rapidity, phi and pT of MidPoint.
     LorentzVector midPoint(0,0,0,0);
-    // MC+GPS 2014-08-13, replaced int with unsigned
-    for(unsigned iPairMember = 0; iPairMember < pairs[iPair].size(); iPairMember++)
+    for(int iPairMember = 0; iPairMember < pairs[iPair].size(); iPairMember++)
       midPoint.add(stableCones[pairs[iPair][iPairMember]].fourVector);
     iterateCone(midPoint.y(),midPoint.phi(),midPoint.pt(),towers,stableCones,reduceConeSize);
@@ -183,10 +174,8 @@
   if(testPair.size())
     nextClusterStart = testPair.back() + 1;
-  // MC+GPS 2014-08-13, replaced int nextCluster with unsigned
-  for(unsigned nextCluster = nextClusterStart; nextCluster <= distanceOK.size(); nextCluster++){
+  for(int nextCluster = nextClusterStart; nextCluster <= distanceOK.size(); nextCluster++){
     // Is new SeedCone less than 2*_coneRadius apart from all clusters in testPair?
     bool addCluster = true;
-    // MC+GPS 2014-08-13, replaced int iCluster with unsigned
-    for(unsigned iCluster = 0; iCluster < testPair.size() && addCluster; iCluster++)
+    for(int iCluster = 0; iCluster < testPair.size() && addCluster; iCluster++)
       if(!distanceOK[nextCluster - 1][testPair[iCluster]])
 	addCluster = false;
@@ -198,6 +187,5 @@
 	pairs.push_back(testPair);
       // If not bigger than allowed, find more clusters within 2*_coneRadius.
-      // GPS+MC 2014-08-13, replaced testPair.size() with int(testPair.size())
-      if(int(testPair.size()) < maxClustersInPair)
+      if(testPair.size() < maxClustersInPair)
 	addClustersToPairs(testPair,pairs,distanceOK,maxClustersInPair);
       // All combinations containing testPair found. Remove last element.
Index: external/fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh
===================================================================
--- external/fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CDFCones/fastjet/CDFJetCluPlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CDFJetCluPlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: CDFJetCluPlugin.hh 2758 2011-11-24 08:31:58Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __CDFJETCLUPLUGIN_HH__
Index: external/fastjet/plugins/CDFCones/fastjet/CDFMidPointPlugin.hh
===================================================================
--- external/fastjet/plugins/CDFCones/fastjet/CDFMidPointPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CDFCones/fastjet/CDFMidPointPlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CDFMidPointPlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: CDFMidPointPlugin.hh 2758 2011-11-24 08:31:58Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __CDFMIDPOINTPLUGIN_HH__
Index: external/fastjet/plugins/CMSIterativeCone/CMSIterativeConePlugin.cc
===================================================================
--- external/fastjet/plugins/CMSIterativeCone/CMSIterativeConePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CMSIterativeCone/CMSIterativeConePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,31 +1,38 @@
-//FJSTARTHEADER
-// $Id: CMSIterativeConePlugin.cc 1504 2009-04-10 13:39:48Z salam $
-//
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) ????-????, CMS [for the iterative-cone code itself]
 //
 //----------------------------------------------------------------------
-// This file is part of FastJet.
-//
-//  FastJet 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 2 of the License, or
-//  (at your option) any later version.
-//
-//  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
-//  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
-//
-//  FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
+// This file is part of FastJet. It contains code that has been
+// obtained from the CMS collaboration, revision 1.14 of the
+// CMSIterativeConeAlgorithm.cc file in CMSSW, see
+//   http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/RecoJets/JetAlgorithms/src/CMSIterativeConeAlgorithm.cc?hideattic=0&revision=1.14&view=markup
+//
+// Permission has been granted by the CMS collaboration to release it
+// in FastJet under the terms of the GNU Public License(v2) (see the
+// COPYING file in the main FastJet directory for details).
+// Changes from the original file are listed below.
+//
+// FastJet 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 2 of the License, or
+// (at your option) any later version.
+//
+// The algorithms that underlie FastJet have required considerable
+// development and are described in hep-ph/0512210. If you use
+// FastJet as part of work towards a scientific publication, please
+// include a citation to the FastJet paper.
+//
+// FastJet 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 FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // List of changes compared to the original CMS code (revision 1.14 of
Index: external/fastjet/plugins/CMSIterativeCone/fastjet/CMSIterativeConePlugin.hh
===================================================================
--- external/fastjet/plugins/CMSIterativeCone/fastjet/CMSIterativeConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/CMSIterativeCone/fastjet/CMSIterativeConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
+//STARTHEADER
 // $Id: CMSIterativeConePlugin.hh 1508 2009-04-10 22:46:49Z soyez $
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __CMSITERATIVECONEPLUGIN_HH__
Index: external/fastjet/plugins/D0RunICone/D0RunIBaseConePlugin.cc
===================================================================
--- external/fastjet/plugins/D0RunICone/D0RunIBaseConePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunICone/D0RunIBaseConePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: D0RunIBaseConePlugin.cc 1779 2010-10-25 10:32:59Z soyez $
-//
-// Copyright (c) 2009-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // D0 stuff
Index: external/fastjet/plugins/D0RunICone/fastjet/D0RunIBaseConePlugin.hh
===================================================================
--- external/fastjet/plugins/D0RunICone/fastjet/D0RunIBaseConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunICone/fastjet/D0RunIBaseConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __D0RUNIBASECONEPLUGIN_HH__
 
-//FJSTARTHEADER
+//STARTHEADER
 // $Id: D0RunIBaseConePlugin.hh 1778 2010-10-25 10:02:58Z soyez $
 //
-// Copyright (c) 2009-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/JetDefinition.hh"
Index: external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh
===================================================================
--- external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __D0RUNICONEPLUGIN_HH__
 
-//FJSTARTHEADER
+//STARTHEADER
 // $Id: D0RunIConePlugin.hh 1778 2010-10-25 10:02:58Z soyez $
 //
-// Copyright (c) 2009-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,7 +28,6 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
-#include "fastjet/internal/base.hh"     // namespace macros (include explicitly to help Doxygen)
 #include "D0RunIBaseConePlugin.hh"
 
Index: external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh
===================================================================
--- external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __D0RUNIPRE96CONEPLUGIN_HH__
 
-//FJSTARTHEADER
+//STARTHEADER
 // $Id: D0RunIpre96ConePlugin.hh 1778 2010-10-25 10:02:58Z soyez $
 //
-// Copyright (c) 2009-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,7 +28,6 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
-#include "fastjet/internal/base.hh"     // namespace macros (include explicitly to help Doxygen)
 #include "D0RunIBaseConePlugin.hh"
 
Index: external/fastjet/plugins/D0RunIICone/ConeSplitMerge.hpp
===================================================================
--- external/fastjet/plugins/D0RunIICone/ConeSplitMerge.hpp	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunIICone/ConeSplitMerge.hpp	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -75,5 +75,5 @@
 {
 public:
-  bool operator()(const ProtoJet<Item> & first, const ProtoJet<Item> & second) const
+  bool operator()(const ProtoJet<Item> & first, const ProtoJet<Item> & second)
   {
     if ( first.pT() > second.pT() ) return true;
Index: external/fastjet/plugins/D0RunIICone/D0RunIIConePlugin.cc
===================================================================
--- external/fastjet/plugins/D0RunIICone/D0RunIIConePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunIICone/D0RunIIConePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: D0RunIIConePlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/D0RunIIConePlugin.hh"
Index: external/fastjet/plugins/D0RunIICone/ILConeAlgorithm.hpp
===================================================================
--- external/fastjet/plugins/D0RunIICone/ILConeAlgorithm.hpp	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunIICone/ILConeAlgorithm.hpp	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -49,4 +49,5 @@
 //
 // 2012-06-12  Gregory Soyez  <soyez@fastjet.fr>
+//
 //        * Replaced addItem(...) by this->addItem(...) to allow
 //          compilation with gcc 4.7 which no longer performs
Index: external/fastjet/plugins/D0RunIICone/fastjet/D0RunIIConePlugin.hh
===================================================================
--- external/fastjet/plugins/D0RunIICone/fastjet/D0RunIIConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/D0RunIICone/fastjet/D0RunIIConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __D0RUNIICONEPLUGIN_HH__
 
-//FJSTARTHEADER
-// $Id: D0RunIIConePlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: D0RunIIConePlugin.hh 2761 2011-11-24 13:54:05Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/JetDefinition.hh"
Index: external/fastjet/plugins/EECambridge/EECambridgePlugin.cc
===================================================================
--- external/fastjet/plugins/EECambridge/EECambridgePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/EECambridge/EECambridgePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: EECambridgePlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // fastjet stuff
Index: external/fastjet/plugins/EECambridge/fastjet/EECambridgePlugin.hh
===================================================================
--- external/fastjet/plugins/EECambridge/fastjet/EECambridgePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/EECambridge/fastjet/EECambridgePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __EECAMBRIDGEPLUGIN_HH__
 
-//FJSTARTHEADER
-// $Id: EECambridgePlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: EECambridgePlugin.hh 2692 2011-11-14 16:27:44Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2009, Matteo Cacciari, Gavin Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -84,8 +82,4 @@
   virtual bool exclusive_sequence_meaningful() const {return true;}
 
-  /// returns true because this plugin is intended for spherical
-  /// geometries (i.e. it's an e+e- algorithm).
-  virtual bool is_spherical() const {return true;}
-
 private:
   double _ycut;
Index: external/fastjet/plugins/GridJet/GridJetPlugin.cc
===================================================================
--- external/fastjet/plugins/GridJet/GridJetPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/GridJet/GridJetPlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: GridJetPlugin.cc 2268 2011-06-20 15:12:26Z salam $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // fastjet stuff
@@ -45,8 +43,4 @@
                               double requested_grid_spacing, 
                               const JetDefinition & post_jet_def) :
-#ifdef FASTJET_GRIDJET_USEFJGRID
-  RectangularGrid(ymax, requested_grid_spacing), _post_jet_def(post_jet_def) {
-}
-#else
   _ymin(-ymax), _ymax(ymax), 
   _requested_grid_spacing(requested_grid_spacing) ,
@@ -55,16 +49,5 @@
   setup_grid();
 }
-#endif
 
-#ifdef FASTJET_GRIDJET_USEFJGRID
-GridJetPlugin::GridJetPlugin (const RectangularGrid & grid,
-                              const JetDefinition & post_jet_def) : 
-  RectangularGrid(grid), _post_jet_def(post_jet_def) {
-  if (!RectangularGrid::is_initialised()) 
-    throw Error("attempt to construct GridJetPlugin with uninitialised RectangularGrid");
-}
-#endif // FASTJET_GRIDJET_USEFJGRID
-
-#ifndef FASTJET_GRIDJET_USEFJGRID
 void GridJetPlugin::setup_grid() {
   // since we've exchanged the arguments of the constructor,
@@ -86,6 +69,22 @@
 }
 
+
 //----------------------------------------------------------------------
-int GridJetPlugin::tile_index(const PseudoJet & p) const {
+string GridJetPlugin::description () const {
+  ostringstream desc;
+  desc << "GridJetPlugin plugin with ymax = " << _ymax << ", dy = " << _dy << ", dphi = " << _dphi << " (requested grid spacing was " << _requested_grid_spacing << ")";
+  if (_post_jet_def.jet_algorithm() != undefined_jet_algorithm) {
+    desc << ", followed by " << _post_jet_def.description();
+  }
+  return desc.str();
+}
+
+
+//----------------------------------------------------------------------
+double GridJetPlugin::R() const {return sqrt(_dy*_dphi/pi);}
+
+
+//----------------------------------------------------------------------
+int GridJetPlugin::igrid(const PseudoJet & p) const {
   // directly taking int does not work for values between -1 and 0
   // so use floor instead
@@ -109,25 +108,4 @@
   return igrid_res;
 }
-#endif // not FASTJET_GRIDJET_USEFJGRID
-
-
-//----------------------------------------------------------------------
-string GridJetPlugin::description () const {
-  ostringstream desc;
-  desc << "GridJetPlugin plugin with ";
-#ifndef FASTJET_GRIDJET_USEFJGRID
-  desc << "ymax = " << _ymax << ", dy = " << _dy << ", dphi = " << _dphi << " (requested grid spacing was " << _requested_grid_spacing << ")";
-#else
-  desc << RectangularGrid::description();
-#endif
-  if (_post_jet_def.jet_algorithm() != undefined_jet_algorithm) {
-    desc << ", followed by " << _post_jet_def.description();
-  }
-  return desc.str();
-}
-
-
-//----------------------------------------------------------------------
-double GridJetPlugin::R() const {return sqrt(drap()*dphi()/pi);}
 
 
@@ -139,5 +117,5 @@
   //  * a number >= 0 will mean that particle indicated by the index
   //    is currently the jet on the grid
-  vector<int> grid(n_tiles(), -1);
+  vector<int> grid(_ntotal, -1);
  
   int nparticles = cs.jets().size();
@@ -148,9 +126,9 @@
   // combine particles with whatever is in the grid
   for (int i = 0; i < nparticles; i++) {
-    int igrd = tile_index(cs.jets()[i]);
+    int igrd = igrid(cs.jets()[i]);
     //cout << i << " " << cs.jets()[i].rap() << " " << cs.jets()[i].phi() 
     // 	 << " " << igrd << " " << grid.size() << " " << _ntotal << endl;
     if (igrd < 0) continue;
-    assert(igrd <= n_tiles());
+    assert(igrd <= _ntotal);
     if (grid[igrd] == -1) {
       grid[igrd] = i; // jet index of initial particle i is i
@@ -167,6 +145,6 @@
     // make the final jets via iB recombinations
     for (unsigned igrd = 0; igrd < grid.size(); igrd++) {
-      if (grid[igrd] != -1 && tile_is_good(igrd)) 
-                   cs.plugin_record_iB_recombination(grid[igrd], dij_or_diB);
+      if (grid[igrd] != -1) cs.plugin_record_iB_recombination(grid[igrd], 
+							      dij_or_diB);
     }
   } else {
Index: external/fastjet/plugins/GridJet/fastjet/GridJetPlugin.hh
===================================================================
--- external/fastjet/plugins/GridJet/fastjet/GridJetPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/GridJet/fastjet/GridJetPlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,9 @@
-#ifndef __FASTJET_GRIDJETPLUGIN_HH__
-#define __FASTJET_GRIDJETPLUGIN_HH__
+#ifndef __GRIDJETPLUGIN_HH__
+#define __GRIDJETPLUGIN_HH__
 
-//FJSTARTHEADER
+//STARTHEADER
 // $Id: GridJetPlugin.hh 2267 2011-06-20 15:10:23Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,16 +28,8 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
 #include "fastjet/JetDefinition.hh"
-
-// makes it easy to switch back and forth between use of
-// RectangularGrid or not; this got enabled in FJ3.1
-#define FASTJET_GRIDJET_USEFJGRID
-
-#ifdef FASTJET_GRIDJET_USEFJGRID
-#include "fastjet/RectangularGrid.hh"
-#endif
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -59,11 +49,7 @@
 /// but is rather provided for comparison purposes with the 
 /// GridMedianBackgroundEstimator (which is even faster).
-class GridJetPlugin : public JetDefinition::Plugin 
-#ifdef FASTJET_GRIDJET_USEFJGRID
-                                      , RectangularGrid
-#endif 
-{
+class GridJetPlugin : public JetDefinition::Plugin {
 public:
-  /// Basic constructor for the GridJetPlugin Plugin class.
+  /// Main constructor for the GridJetPlugin Plugin class.
   ///
   /// \param ymax           The maximal rapidity extent of the grid
@@ -76,23 +62,8 @@
 		 const JetDefinition & post_jet_def = JetDefinition());
 
-#ifdef FASTJET_GRIDJET_USEFJGRID
-  /// Constructor for the GridJetPlugin Plugin class that allows
-  /// full control over the underlying grid. New in FastJet 3.1.
-  ///
-  /// \param grid           The maximal rapidity extent of the grid
-  /// \param post_jet_def   if present, and not == JetDefinition()
-  ///                       (which has undefined_jet_algorithm), then
-  ///                       run the post_jet_def on the result of the grid
-  ///                       clustering.
-  GridJetPlugin (const RectangularGrid & grid,
-		 const JetDefinition & post_jet_def = JetDefinition());
-#endif // FASTJET_GRIDJET_USEFJGRID
-
-  
-
-  // /// copy constructor
-  // GridJetPlugin (const GridJetPlugin & plugin) {
-  //   *this = plugin;
-  // }
+  /// copy constructor
+  GridJetPlugin (const GridJetPlugin & plugin) {
+    *this = plugin;
+  }
 
   // the things that are required by base class
@@ -104,31 +75,12 @@
   virtual double R() const;
 
-  // As of FastJet 3.1 the following functions become available through
-  // the underlying RectangularGrid class.
-#ifndef FASTJET_GRIDJET_USEFJGRID
-  /// returns the actual rapidity spacing of the grid
-  double drap()   const {return _dy;}
-  /// returns the actual phi spacing of the grid
-  double dphi() const {return _dphi;}
-  /// returns the minimum rapidity of the grid
-  double rapmin() const {return _ymin;}
-  /// returns the maximum rapidity of the grid
-  double rapmax() const {return _ymax;}
-#endif
-
 private:
 
-#ifndef FASTJET_GRIDJET_USEFJGRID
   void setup_grid();
 
-  int n_tiles() const {return _ntotal;}
-  int n_good_tiles() const {return _ntotal;}
-
-  int tile_index(const PseudoJet & p) const;
-  bool tile_is_good(int /* itile */) const {return true;}
+  int igrid(const PseudoJet & p) const;
 
   double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing;
   int _ny, _nphi, _ntotal;
-#endif
 
   JetDefinition _post_jet_def;
@@ -138,4 +90,4 @@
 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
 
-#endif // __FASTJET_GRIDJETPLUGIN_HH__
+#endif // __GRIDJETPLUGIN_HH__
 
Index: external/fastjet/plugins/Jade/JadePlugin.cc
===================================================================
--- external/fastjet/plugins/Jade/JadePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/Jade/JadePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: JadePlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // fastjet stuff
@@ -35,5 +33,4 @@
 //#include "fastjet/internal/ClusterSequence_N2.icc"
 #include "fastjet/NNH.hh"
-#include "fastjet/NNFJN2Plain.hh"
 
 // other stuff
@@ -52,23 +49,4 @@
 //----------------------------------------------------------------------
 /// class to help run a JADE algorithm
-///
-/// This class works both with NNH and NNFJN2Plain clustering
-/// helpers. They both use the same init(...) call, but for the
-/// clustering:
-///
-/// - NNH uses distance(...) and beam_distance()
-/// - NNFJPlainN2 uses geometrical_distance(...), momentum_factor()
-///   and geometrical_beam_distance()
-///
-/// For NNFJPlainN2 the 2 E_i E_j (1-cos theta_{ij}) factor
-/// gets broken up into
-///
-///     sqrt(2)*min(E_i,E_j) * [sqrt(2)*max(E_i,E_j) (1 - cos \theta_{ij})]
-///
-/// The second factor is what we call the "geometrical_distance" even
-/// though it isn't actually purely geometrical. But the fact that it
-/// gets multiplied by min(E_i,E_j) to get the full distance is
-/// sufficient for the validity of the FJ lemma, allowing for the use
-/// of NNFJN2Plain.
 class JadeBriefJet {
 public:
@@ -89,31 +67,8 @@
   }
 
-  double geometrical_distance(const JadeBriefJet * jet) const {
-    double dij = 1 - nx*jet->nx
-                   - ny*jet->ny
-                   - nz*jet->nz;
-    dij *= max(rt2E,jet->rt2E);
-    return dij;
-  }
-
-  double momentum_factor() const {
-    return rt2E;
-  }
-  
   double beam_distance() const {
     return numeric_limits<double>::max();
   }
 
-  double geometrical_beam_distance() const {
-    // get a number that is almost the same as max(), just a little
-    // smaller so as to ensure that when we divide it by rt2E and then
-    // multiply it again, we won't get an overflow.
-    // Watch out for cases where rt2E < 1.0 (cf. bug fix from
-    // andrii.verbytskyi@mpp.mpg.de on 2019-02-14)
-    const double almost_max = numeric_limits<double>::max() * (1 - 1e-13);
-    if (rt2E>1.0) return almost_max / rt2E;
-    else          return almost_max; 
-  }
-  
 private:
   double rt2E, nx, ny, nz;
@@ -125,64 +80,11 @@
   ostringstream desc;
   desc << "e+e- JADE algorithm plugin";
-  switch(_strategy) {
-  case strategy_NNH:
-    desc << ", using NNH strategy"; break;
-  case strategy_NNFJN2Plain:
-    desc << ", using NNFJN2Plain strategy"; break;
-  default:
-    throw Error("Unrecognized strategy in JadePlugin");
-  }
-
   return desc.str();
 }
 
-// //----------------------------------------------------------------------
-// void JadePlugin::run_clustering(ClusterSequence & cs) const {
-//   int njets = cs.jets().size();
-// 
-//   //SharedPtr<NNBase<> > nn;
-//   NNBase<> * nn;
-//   switch(_strategy) {
-//   case strategy_NNH:
-//     //nn.reset(new NNH<JadeBriefJet>(cs.jets()));
-//     nn = new NNH<JadeBriefJet>(cs.jets());
-//     break;
-//   case strategy_NNFJN2Plain:
-//     //nn.reset(new NNFJN2Plain<JadeBriefJet>(cs.jets()));
-//     nn = new NNFJN2Plain<JadeBriefJet>(cs.jets());
-//     break;
-//   default:
-//     throw Error("Unrecognized strategy in JadePlugin");
-//   }
-//   //NNH<JadeBriefJet> nnh(cs.jets());
-//   //NNFJN2Plain<JadeBriefJet> nnh(cs.jets());
-// 
-//   // if testing against Hoeth's implementation, need to rescale the
-//   // dij by Q^2.
-//   //double Q2 = cs.Q2(); 
-// 
-//   while (njets > 0) {
-//     int i, j, k;
-//     double dij = nn->dij_min(i, j);
-// 
-//     if (j >= 0) {
-//       cs.plugin_record_ij_recombination(i, j, dij, k);
-//       nn->merge_jets(i, j, cs.jets()[k], k);
-//     } else {
-//       double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB
-//       cs.plugin_record_iB_recombination(i, diB);
-//       nn->remove_jet(i);
-//     }
-//     njets--;
-//   }
-//   delete nn;
-// }
-
-
-template<class N> void JadePlugin::_actual_run_clustering(ClusterSequence & cs) const {
-
+//----------------------------------------------------------------------
+void JadePlugin::run_clustering(ClusterSequence & cs) const {
   int njets = cs.jets().size();
-
-  N nn(cs.jets());
+  NNH<JadeBriefJet> nnh(cs.jets());
 
   // if testing against Hoeth's implementation, need to rescale the
@@ -192,34 +94,17 @@
   while (njets > 0) {
     int i, j, k;
-    double dij = nn.dij_min(i, j);
+    double dij = nnh.dij_min(i, j);
 
     if (j >= 0) {
       cs.plugin_record_ij_recombination(i, j, dij, k);
-      nn.merge_jets(i, j, cs.jets()[k], k);
+      nnh.merge_jets(i, j, cs.jets()[k], k);
     } else {
       double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB
       cs.plugin_record_iB_recombination(i, diB);
-      nn.remove_jet(i);
+      nnh.remove_jet(i);
     }
     njets--;
   }
-
 }
 
-//----------------------------------------------------------------------
-void JadePlugin::run_clustering(ClusterSequence & cs) const {
-
-  switch(_strategy) {
-  case strategy_NNH:
-    _actual_run_clustering<NNH<JadeBriefJet> >(cs);
-    break;
-  case strategy_NNFJN2Plain:
-    _actual_run_clustering<NNFJN2Plain<JadeBriefJet> >(cs);
-    break;
-  default:
-    throw Error("Unrecognized strategy in JadePlugin");
-  }
-}
-
-
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/plugins/Jade/fastjet/JadePlugin.hh
===================================================================
--- external/fastjet/plugins/Jade/fastjet/JadePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/Jade/fastjet/JadePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __JADEPLUGIN_HH__
 
-//FJSTARTHEADER
-// $Id: JadePlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: JadePlugin.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2009, Matteo Cacciari, Gavin Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/JetDefinition.hh"
@@ -77,11 +75,6 @@
 class JadePlugin : public JetDefinition::Plugin {
 public:
-  /// enum that contains the two clustering strategy options; for
-  /// higher multiplicities, strategy_NNFJN2Plain is about a factor of
-  /// two faster.
-  enum Strategy { strategy_NNH = 0, strategy_NNFJN2Plain = 1};
-  
   /// Main constructor for the Jade Plugin class.  
-  JadePlugin (Strategy strategy = strategy_NNFJN2Plain) : _strategy(strategy) {}
+  JadePlugin (){}
 
   /// copy constructor
@@ -105,7 +98,4 @@
 private:
 
-  template<class N> void _actual_run_clustering(ClusterSequence &) const;
-  
-  Strategy _strategy;
 };
 
Index: external/fastjet/plugins/NestedDefs/NestedDefsPlugin.cc
===================================================================
--- external/fastjet/plugins/NestedDefs/NestedDefsPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/NestedDefs/NestedDefsPlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: NestedDefsPlugin.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // TODO
Index: external/fastjet/plugins/NestedDefs/fastjet/NestedDefsPlugin.hh
===================================================================
--- external/fastjet/plugins/NestedDefs/fastjet/NestedDefsPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/NestedDefs/fastjet/NestedDefsPlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: NestedDefsPlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: NestedDefsPlugin.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __NESTEDALGSPLUGIN_HH__
Index: external/fastjet/plugins/SISCone/AUTHORS
===================================================================
--- external/fastjet/plugins/SISCone/AUTHORS	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/AUTHORS	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -6,8 +6,11 @@
 	     France
 
-	 (2) Rudolf Peierls Centre for Theoretical Physics, Parks Road, Oxford OX1 3PU, UK;
-             PH-TH, CERN, CH-1211 Geneva 23, Switzerland;
+	 (2) PH-TH, CERN, CH-1211 Geneva 23, Switzerland;
+             Physics Department, Princeton University, Princeton NJ 08544, USA;
              LPTHE, UPMC (Univ. Paris 6), 75252 Paris cedex 05, France.
 
+phone  : +33 69 08 40 11
+         +41 22 767 2462
+
 email  : soyez@fastjet.fr
-         gavin.salam@physics.ox.ac.uk
+         salam@lpthe.jussieu.fr
Index: external/fastjet/plugins/SISCone/SISConePlugin.cc
===================================================================
--- external/fastjet/plugins/SISCone/SISConePlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/SISConePlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,63 +22,11 @@
 }
 
-//======================================================================
-// wrap-up around siscone's user-defined scales
-namespace siscone_plugin_internal{
-  /// @ingroup internal
-  /// \class SISConeUserScale
-  /// class that makes the transition between the internal SISCone
-  /// user-defined scale choice (using SISCone's Cjet) and
-  /// user-defined scale choices in the plugn above (using FastJet's
-  /// PseudoJets)
-  class SISConeUserScale  : public siscone::Csplit_merge::Cuser_scale_base{
-  public:
-    /// ctor takes the "fastjet-style" user-defined scale as well as a
-    /// reference to the current cluster sequence (to access the
-    /// particles if needed)
-    SISConeUserScale(const SISConePlugin::UserScaleBase *user_scale,
-		     const ClusterSequence &cs)
-      : _user_scale(user_scale), _cs(cs){}
-
-    /// returns the scale associated to a given jet
-    virtual double operator()(const siscone::Cjet &jet) const{
-      return _user_scale->result(_build_PJ_from_Cjet(jet));
-    }
-
-    /// returns true id the scasle associated to jet a is larger than
-    /// the scale associated to jet b
-    virtual bool is_larger(const siscone::Cjet &a, const siscone::Cjet &b) const{
-      return _user_scale->is_larger(_build_PJ_from_Cjet(a), _build_PJ_from_Cjet(b));
-    }
-
-  private:
-    /// constructs a PseudoJet from a siscone::Cjet
-    ///
-    /// Note that it is tempting to overload the PseudoJet ctor. This
-    /// would not work because down the line we need to access the
-    /// original PseudoJet through the ClusterSequence and therefore
-    /// the PseudoJet structure needs to be aware of the
-    /// ClusterSequence.
-    PseudoJet _build_PJ_from_Cjet(const siscone::Cjet &jet) const{
-      PseudoJet j(jet.v.px, jet.v.py, jet.v.pz, jet.v.E);
-      j.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(
-                                   new SISConePlugin::UserScaleBaseStructureType<siscone::Cjet>(jet,_cs)));      
-      return j;
-    }
-
-    const SISConePlugin::UserScaleBase *_user_scale;
-    const ClusterSequence & _cs;
-  };
-}
-
-// end of the internal material
-//======================================================================
-
 
 /////////////////////////////////////////////
 // static members declaration              //
 /////////////////////////////////////////////
-SharedPtr<SISConePlugin>           SISConePlugin::stored_plugin;
-SharedPtr<std::vector<PseudoJet> > SISConePlugin::stored_particles;
-SharedPtr<Csiscone>                SISConePlugin::stored_siscone;
+std::auto_ptr<SISConePlugin>           SISConePlugin::stored_plugin;
+std::auto_ptr<std::vector<PseudoJet> > SISConePlugin::stored_particles;
+std::auto_ptr<Csiscone>                SISConePlugin::stored_siscone;
 
 
@@ -97,21 +45,10 @@
   desc << "SISCone jet algorithm with " ;
   desc << "cone_radius = "       << cone_radius        () << ", ";
-  if (_progressive_removal)
-    desc << "progressive-removal mode, ";
-  else  
-    desc << "overlap_threshold = " << overlap_threshold  () << ", ";
+  desc << "overlap_threshold = " << overlap_threshold  () << ", ";
   desc << "n_pass_max = "        << n_pass_max         () << ", ";
   desc << "protojet_ptmin = "    << protojet_ptmin()      << ", ";
-  if (_progressive_removal && _user_scale) {
-    desc << "using a user-defined scale for ordering of stable cones";
-    string user_scale_desc = _user_scale->description();
-    if (user_scale_desc != "") desc << " (" << user_scale_desc << ")";
-  } else {
-    desc <<  sm_scale_string;
-  }
-  if (!_progressive_removal){
-    desc << ", caching turned "      << (caching() ? on : off);
-    desc << ", SM stop scale = "     << _split_merge_stopping_scale;
-  }
+  desc <<  sm_scale_string                                << ", ";
+  desc << "caching turned "      << (caching() ? on : off);
+  desc << ", SM stop scale = "     << _split_merge_stopping_scale;
 
   // add a note to the description if we use the pt-weighted splitting
@@ -148,5 +85,5 @@
   bool new_siscone = true; // by default we'll be running it
 
-  if (caching() && !_progressive_removal) {
+  if (caching()) {
 
     // Establish if we have a cached run with the same R, npass and
@@ -201,19 +138,7 @@
     // run the jet finding
     //cout << "plg sms: " << split_merge_scale() << endl;
-    if (_progressive_removal){
-      // handle the optional user-defined scale choice
-      SharedPtr<siscone_plugin_internal::SISConeUserScale> internal_scale;
-      if (_user_scale){
-	internal_scale.reset(new siscone_plugin_internal::SISConeUserScale(_user_scale, clust_seq));
-	siscone->set_user_scale(internal_scale.get());
-      }
-      siscone->compute_jets_progressive_removal(siscone_momenta, cone_radius(),
-						n_pass_max(), protojet_or_ghost_ptmin(), 
-						Esplit_merge_scale(split_merge_scale()));
-    } else {
-      siscone->compute_jets(siscone_momenta, cone_radius(), overlap_threshold(),
-			    n_pass_max(), protojet_or_ghost_ptmin(), 
-			    Esplit_merge_scale(split_merge_scale()));
-    }
+    siscone->compute_jets(siscone_momenta, cone_radius(), overlap_threshold(),
+			  n_pass_max(), protojet_or_ghost_ptmin(), 
+			  Esplit_merge_scale(split_merge_scale()));
   } else {
     // rerun the jet finding
@@ -230,8 +155,4 @@
   SISConeExtras * extras = new SISConeExtras(n);
 
-  // the ordering in which the inclusive jets are transfered here is
-  // deliberate and ensures that when a user asks for
-  // inclusive_jets(), they are provided in the order in which SISCone
-  // created them.
   for (int ijet = njet-1; ijet >= 0; ijet--) {
     const Cjet & jet = siscone->jets[ijet]; // shorthand
@@ -286,10 +207,5 @@
 
   // give the extras object to the cluster sequence.
-  // 
-  // As of v3.1 of FastJet, extras are automatically owned (as
-  // SharedPtr) by the ClusterSequence and auto_ptr is deprecated. So
-  // we can use a simple pointer here
-  //clust_seq.plugin_associate_extras(std::auto_ptr<ClusterSequence::Extras>(extras));
-  clust_seq.plugin_associate_extras(extras);
+  clust_seq.plugin_associate_extras(std::auto_ptr<ClusterSequence::Extras>(extras));
 }
 
@@ -299,53 +215,3 @@
 }
 
-// //======================================================================
-// // material to handle user-defined scales
-// 
-// //--------------------------------------------------
-// // SISCone structure type
-// 
-// // the textual descripotion
-// std::string SISConePlugin::UserScaleBase::StructureType::description() const{
-//   return "PseudoJet wrapping a siscone::Cjet stable cone"; 
-// }
-// 
-// // retrieve the constituents
-// //
-// // if you simply need to iterate over the constituents, it will be
-// // faster to access them via constituent(i)
-// vector<PseudoJet> SISConePlugin::UserScaleBase::StructureType::constituents(const PseudoJet &) const{ 
-//   vector<PseudoJet> constits;
-//   constits.reserve(_jet.n);
-//   for (unsigned int i=0; i<(unsigned int)_jet.n;i++)
-//     constits.push_back(constituent(i));
-//   return constits;
-// }
-// 
-// // returns the number of constituents
-// unsigned int SISConePlugin::UserScaleBase::StructureType::size() const{
-//   return _jet.n;
-// }
-// 
-// // returns the index (in the original particle list) of the ith
-// // constituent
-// int SISConePlugin::UserScaleBase::StructureType::constituent_index(unsigned int i) const{ 
-//   return _jet.contents[i];
-// }
-// 
-// // returns the ith constituent (as a PseusoJet)
-// const PseudoJet & SISConePlugin::UserScaleBase::StructureType::constituent(unsigned int i) const{
-//   return _cs.jets()[_jet.contents[i]];
-// }
-// 
-// // returns the scalar pt of this stable cone
-// double SISConePlugin::UserScaleBase::StructureType::pt_tilde() const{
-//   return _jet.pt_tilde;
-// }
-// 
-// // returns the sm_var2 (signed ordering variable squared) for this stable cone
-// double SISConePlugin::UserScaleBase::StructureType::ordering_var2() const{
-//   return _jet.sm_var2;
-// }
-
-
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/plugins/SISCone/area.cc
===================================================================
--- external/fastjet/plugins/SISCone/area.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/area.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 149                                                          $//
-// $Date:: 2007-03-15 00:13:58 +0100 (Thu, 15 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/area.h
===================================================================
--- external/fastjet/plugins/SISCone/area.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/area.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 149                                                          $//
-// $Date:: 2007-03-15 00:13:58 +0100 (Thu, 15 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/circulator.h
===================================================================
--- external/fastjet/plugins/SISCone/circulator.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/circulator.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 103                                                          $//
-// $Date:: 2007-02-18 17:07:34 +0100 (Sun, 18 Feb 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/config.h
===================================================================
--- external/fastjet/plugins/SISCone/config.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/config.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,117 +1,66 @@
-#ifndef _SISCONE_CONFIG_H
-#define _SISCONE_CONFIG_H 1
- 
-/* siscone/config.h. Generated automatically at end of configure. */
-/* siscone/config_raw.h.  Generated from config.h.in by configure.  */
+/* siscone/config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to 1 if you have the <dlfcn.h> header file. */
-#ifndef SISCONE_HAVE_DLFCN_H 
-#define SISCONE_HAVE_DLFCN_H  1 
-#endif
+#define HAVE_DLFCN_H 1
 
 /* Define to 1 if you have the <inttypes.h> header file. */
-#ifndef SISCONE_HAVE_INTTYPES_H 
-#define SISCONE_HAVE_INTTYPES_H  1 
-#endif
+#define HAVE_INTTYPES_H 1
 
 /* Define to 1 if you have the `m' library (-lm). */
-#ifndef SISCONE_HAVE_LIBM 
-#define SISCONE_HAVE_LIBM  1 
-#endif
+#define HAVE_LIBM 1
 
 /* Define to 1 if you have the <memory.h> header file. */
-#ifndef SISCONE_HAVE_MEMORY_H 
-#define SISCONE_HAVE_MEMORY_H  1 
-#endif
+#define HAVE_MEMORY_H 1
 
 /* Define to 1 if you have the <stdint.h> header file. */
-#ifndef SISCONE_HAVE_STDINT_H 
-#define SISCONE_HAVE_STDINT_H  1 
-#endif
+#define HAVE_STDINT_H 1
 
 /* Define to 1 if you have the <stdlib.h> header file. */
-#ifndef SISCONE_HAVE_STDLIB_H 
-#define SISCONE_HAVE_STDLIB_H  1 
-#endif
+#define HAVE_STDLIB_H 1
 
 /* Define to 1 if you have the <strings.h> header file. */
-#ifndef SISCONE_HAVE_STRINGS_H 
-#define SISCONE_HAVE_STRINGS_H  1 
-#endif
+#define HAVE_STRINGS_H 1
 
 /* Define to 1 if you have the <string.h> header file. */
-#ifndef SISCONE_HAVE_STRING_H 
-#define SISCONE_HAVE_STRING_H  1 
-#endif
+#define HAVE_STRING_H 1
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
-#ifndef SISCONE_HAVE_SYS_STAT_H 
-#define SISCONE_HAVE_SYS_STAT_H  1 
-#endif
+#define HAVE_SYS_STAT_H 1
 
 /* Define to 1 if you have the <sys/types.h> header file. */
-#ifndef SISCONE_HAVE_SYS_TYPES_H 
-#define SISCONE_HAVE_SYS_TYPES_H  1 
-#endif
+#define HAVE_SYS_TYPES_H 1
 
 /* Define to 1 if you have the <unistd.h> header file. */
-#ifndef SISCONE_HAVE_UNISTD_H 
-#define SISCONE_HAVE_UNISTD_H  1 
-#endif
+#define HAVE_UNISTD_H 1
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#ifndef SISCONE_LT_OBJDIR 
-#define SISCONE_LT_OBJDIR  ".libs/" 
-#endif
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
 
 /* Name of package */
-#ifndef SISCONE_PACKAGE 
-#define SISCONE_PACKAGE  "siscone" 
-#endif
+#define PACKAGE "siscone"
 
 /* Define to the address where bug reports for this package should be sent. */
-#ifndef SISCONE_PACKAGE_BUGREPORT 
-#define SISCONE_PACKAGE_BUGREPORT  "" 
-#endif
+#define PACKAGE_BUGREPORT ""
 
 /* Define to the full name of this package. */
-#ifndef SISCONE_PACKAGE_NAME 
-#define SISCONE_PACKAGE_NAME  "SISCone" 
-#endif
+#define PACKAGE_NAME "SISCone"
 
 /* Define to the full name and version of this package. */
-#ifndef SISCONE_PACKAGE_STRING 
-#define SISCONE_PACKAGE_STRING  "SISCone 3.0.5" 
-#endif
+#define PACKAGE_STRING "SISCone 2.0.5"
 
 /* Define to the one symbol short name of this package. */
-#ifndef SISCONE_PACKAGE_TARNAME 
-#define SISCONE_PACKAGE_TARNAME  "siscone" 
-#endif
+#define PACKAGE_TARNAME "siscone"
 
 /* Define to the home page for this package. */
-#ifndef SISCONE_PACKAGE_URL 
-#define SISCONE_PACKAGE_URL  "" 
-#endif
+#define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#ifndef SISCONE_PACKAGE_VERSION 
-#define SISCONE_PACKAGE_VERSION  "3.0.5" 
-#endif
+#define PACKAGE_VERSION "2.0.5"
 
 /* Define to 1 if you have the ANSI C header files. */
-#ifndef SISCONE_STDC_HEADERS 
-#define SISCONE_STDC_HEADERS  1 
-#endif
-
-/* use unique_ptr instead of auto_ptr */
-/* #undef USES_UNIQUE_PTR_AS_AUTO_PTR */
+#define STDC_HEADERS 1
 
 /* Version number of package */
-#ifndef SISCONE_VERSION 
-#define SISCONE_VERSION  "3.0.5" 
-#endif
- 
-/* once: _SISCONE_CONFIG_H */
-#endif
+#define VERSION "2.0.5"
Index: external/fastjet/plugins/SISCone/config_raw.h
===================================================================
--- external/fastjet/plugins/SISCone/config_raw.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/* siscone/config_raw.h.  Generated from config.h.in by configure.  */
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `m' library (-lm). */
-#define HAVE_LIBM 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "siscone"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "SISCone"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "SISCone 3.0.5"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "siscone"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.0.5"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* use unique_ptr instead of auto_ptr */
-/* #undef USES_UNIQUE_PTR_AS_AUTO_PTR */
-
-/* Version number of package */
-#define VERSION "3.0.5"
Index: external/fastjet/plugins/SISCone/defines.h
===================================================================
--- external/fastjet/plugins/SISCone/defines.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/defines.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 401                                                          $//
-// $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -35,7 +35,7 @@
 // defined in siscone.h
 // Otherwise, config.h
-// It is also defined as "SISCONE_PACKAGE_NAME" in config.h but this method 
+// It is also defined as "PACKAGE_NAME" in config.h but this method 
 // might lead to conflicts
-//#define PROGRAM   SISCONE_PACKAGE_NAME 
+//#define PROGRAM   PACKAGE_NAME 
 
 // program version
@@ -43,5 +43,5 @@
 //   siscone::siscone_version
 // defined in siscone.h
-// It is also defined as "SISCONE_VERSION" in config.h but this method 
+// It is also defined as "VERSION" in config.h but this method 
 // might lead to conflicts
 
Index: external/fastjet/plugins/SISCone/fastjet/SISConeBasePlugin.hh
===================================================================
--- external/fastjet/plugins/SISCone/fastjet/SISConeBasePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/fastjet/SISConeBasePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -43,5 +43,4 @@
   SISConeBasePlugin (){
     _use_jet_def_recombiner = false;
-    set_progressive_removal(false);
   }
 
@@ -50,25 +49,4 @@
     *this = plugin;
   }
-
-  /// set whether to use SISCone with progressive removal instead of
-  /// the default split_merge step.
-  ///
-  /// If progressive removal is enabled, the following SISCone
-  /// variables are not used:
-  ///
-  /// - overlap_threshold
-  /// - caching
-  /// - split_merge_stopping_scale
-  ///
-  /// The split_merge_scale choice is reinterpreted as the ordering
-  /// variable for progressive removal. It is also possible for the
-  /// user to supply his/her own function for the scale that orders
-  /// progressive removal, with set_user_scale(...)
-  void set_progressive_removal(bool progressive_removal_in=true){
-    _progressive_removal = progressive_removal_in;
-  }
-
-  /// returns true if progressive_removal is enabled
-  bool progressive_removal() const{ return _progressive_removal;}
 
   /// the cone radius
@@ -127,64 +105,4 @@
   }
 
-  // user-defined scale for progressive removal
-  //------------------------------------------------------------
-
-  /// \class UserScaleBase
-  /// base class for user-defined ordering of stable cones (used for
-  /// prorgessive removal)
-  ///
-  /// derived classes have to implement the () operator that returns
-  /// the scale associated with a given jet.
-  /// 
-  /// It is also highly recommended to implement the is_larger()
-  /// method whenever possible, in order to avoid rounding issues
-  /// known to lead to possible infrared unsafeties.
-  ///
-  /// The jets that are passed to this class will carry the structure
-  /// of type SISConePlugin::StructureType which allows to retreive
-  /// easily the following information:
-  ///
-  ///   vector<PseudoJet> constituents = jet.constituents();
-  ///   unsigned int n_constituents = jet.structure_of<SISConePlugin::UserScaleBase>().size();
-  ///   int index = jet.structure_of<SISConePlugin::UserScaleBase>().constituent_index(index i);
-  ///   const PseudoJet & p = jet.structure_of<SISConePlugin::UserScaleBase>().constituent(index i);
-  ///   double scalar_pt = jet.structure_of<SISConePlugin::UserScaleBase>().pt_tilde();
-  ///
-  /// see SISConePlugin::StructureType below for further details
-  class UserScaleBase : public FunctionOfPseudoJet<double>{
-  public:
-    /// empty virtual dtor
-    virtual ~UserScaleBase(){}
-
-    /// returns the scale associated with a given jet
-    ///
-    /// "progressive removal" iteratively removes the stable cone with
-    /// the largest scale
-    virtual double result(const PseudoJet & jet) const = 0;
-
-    /// returns true when the scale associated with jet a is larger than
-    /// the scale associated with jet b
-    ///
-    /// By default this does a simple direct comparison but it can be
-    /// overloaded for higher precision [recommended if possible]
-    virtual bool is_larger(const PseudoJet & a, const PseudoJet & b) const;
-
-    class StructureType; // defined below
-  };
-
-  // template class derived from UserScaleBase::StryctureType that
-  // works for both SISCone jet classes
-  // implemented below 
-  template<class Tjet> 
-  class UserScaleBaseStructureType;
-
-  /// set a user-defined scale for stable-cone ordering in
-  /// progressive removal
-  void set_user_scale(const UserScaleBase *user_scale_in){ _user_scale = user_scale_in;}
-
-  /// returns the user-defined scale in use (0 if none)
-  const UserScaleBase * user_scale() const{ return _user_scale;}
-
-
   // the things that one MUST overload required by base class
   //---------------------------------------------------------
@@ -202,5 +120,4 @@
   double _split_merge_stopping_scale;
   bool   _use_jet_def_recombiner;
-  bool   _progressive_removal;
 
   mutable double _ghost_sep_scale;
@@ -209,6 +126,4 @@
   /// call the re-clustering itself 
   virtual void reset_stored_plugin() const =0;
-
-  const UserScaleBase * _user_scale;
 
 };
@@ -270,110 +185,4 @@
 inline SISConeBaseExtras::~SISConeBaseExtras(){}
 
-//----------------------------------------------------------------------
-// implementation of the structure type associated with the UserScaleBase class
-
-/// \class SISConeBasePlugin::UserScaleBase::StructureType
-/// the structure that allows to store the information contained
-/// into a siscone::Cjet (built internally in SISCone from a stable
-/// cone) into a PseudoJet
-class SISConeBasePlugin::UserScaleBase::StructureType : public PseudoJetStructureBase {
-public:
-  /// base ctor (constructed from a ClusterSequence tin order to have
-  /// access to the initial particles
-  StructureType(const ClusterSequence &cs)
-    : _cs(cs){}
-
-  /// empty virtual dtor 
-  virtual ~StructureType(){}
-  
-  //--------------------------------------------------
-  // members inherited from the base class
-  /// the textual descripotion
-  virtual std::string description() const{
-    return "PseudoJet wrapping a siscone jet from a stable cone"; 
-  }
-
-  /// this structure has constituents
-  virtual bool has_constituents() const {return true;}
-
-  /// retrieve the constituents 
-  ///
-  /// if you simply need to iterate over the constituents, it will be
-  /// faster to access them via constituent(i)
-  virtual std::vector<PseudoJet> constituents(const PseudoJet & /*reference*/) const{ 
-    std::vector<PseudoJet> constits;
-    constits.reserve(size());
-    for (unsigned int i=0; i<size();i++)
-      constits.push_back(constituent(i));
-    return constits;
-  }
-  
-  //--------------------------------------------------
-  // additional information relevant for this structure
-
-  /// returns the number of constituents
-  virtual unsigned int size() const = 0;
-
-  /// returns the index (in the original particle list) of the ith
-  /// constituent
-  virtual int constituent_index(unsigned int i) const = 0;
-
-  /// returns the ith constituent (as a PseusoJet)
-  const PseudoJet & constituent(unsigned int i) const{
-    return _cs.jets()[constituent_index(i)];
-  }
-
-  // /// returns the scalar pt of this stable cone
-  // virtual double pt_tilde() const = 0;
-
-  /// returns the sm_var2 (signed ordering variable squared) for this stable cone
-  virtual double ordering_var2() const = 0;
-
-protected:
-  const ClusterSequence &_cs; ///< a reference to the CS (for access to the particles)
-};
-
-
-///@ingroup internal
-/// template class derived from UserScaleBase::StryctureType that
-/// works for both SISCone jet classes
-/// implemented below 
-template<class Tjet>
-class SISConeBasePlugin::UserScaleBaseStructureType : public UserScaleBase::StructureType{
-public:
-  UserScaleBaseStructureType(const Tjet &jet, const ClusterSequence &cs)
-    : UserScaleBase::StructureType(cs), _jet(jet){}
-
-  /// empty virtual dtor 
-  virtual ~UserScaleBaseStructureType(){}
-
-  //--------------------------------------------------
-  // additional information relevant for this structure
-
-  /// returns the number of constituents
-  virtual unsigned int size() const{
-    return _jet.n;
-  }
-
-  /// returns the index (in the original particle list) of the ith
-  /// constituent
-  virtual int constituent_index(unsigned int i) const{
-    return _jet.contents[i];
-  }
-
-  // /// returns the scalar pt of this stable cone
-  // virtual double pt_tilde() const{
-  //   return _jet.pt_tilde;
-  // }
-
-  /// returns the sm_var2 (signed ordering variable squared) for this stable cone
-  virtual double ordering_var2() const{
-    return _jet.sm_var2;
-  }
-
-protected:
-  const Tjet &_jet; ///< a reference to the internal jet in SISCone
-};
-
 
 FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
Index: external/fastjet/plugins/SISCone/fastjet/SISConePlugin.hh
===================================================================
--- external/fastjet/plugins/SISCone/fastjet/SISConePlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/fastjet/SISConePlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -7,5 +7,4 @@
 namespace siscone{
   class Csiscone;
-  class Cjet;
 }
 
@@ -75,12 +74,11 @@
   /// enum for the different split-merge scale choices;
   /// Note that order _must_ be the same as in siscone
-  enum SplitMergeScale {
-    SM_pt,     ///< transverse momentum (E-scheme), IR unsafe
-    SM_Et,     ///< transverse energy (E-scheme), not long. boost invariant
-               ///< original run-II choice [may not be implemented]
-    SM_mt,     ///< transverse mass (E-scheme), IR safe except
-               ///< in decays of two identical narrow heavy particles
-    SM_pttilde ///< pt-scheme pt = \sum_{i in jet} |p_{ti}|, should
-               ///< be IR safe in all cases
+  enum SplitMergeScale {SM_pt,     ///< transverse momentum (E-scheme), IR unsafe
+                        SM_Et,     ///< transverse energy (E-scheme), not long. boost invariant
+                                   ///< original run-II choice [may not be implemented]
+                        SM_mt,     ///< transverse mass (E-scheme), IR safe except
+                                   ///< in decays of two identical narrow heavy particles
+                        SM_pttilde ///< pt-scheme pt = \sum_{i in jet} |p_{ti}|, should
+                                   ///< be IR safe in all cases
   };
 
@@ -110,6 +108,5 @@
     _split_merge_stopping_scale = split_merge_stopping_scale_in;
     _ghost_sep_scale       = 0.0;
-    _use_pt_weighted_splitting = false;
-    _user_scale = 0;}
+    _use_pt_weighted_splitting = false;}
 
 
@@ -128,6 +125,5 @@
     _split_merge_stopping_scale = 0.0;
     _split_merge_scale     = split_merge_on_transverse_mass_in ? SM_mt : SM_pttilde;
-    _ghost_sep_scale       = 0.0;
-    _user_scale = 0;}
+    _ghost_sep_scale       = 0.0;}
   
   /// backwards compatible constructor for the SISCone Plugin class
@@ -145,6 +141,5 @@
     _split_merge_stopping_scale = 0.0;
     _ghost_sep_scale       = 0.0;
-    _use_pt_weighted_splitting = false;
-    _user_scale = 0;}
+    _use_pt_weighted_splitting = false;}
 
   /// minimum pt for a protojet to be considered in the split-merge step
@@ -191,56 +186,9 @@
   // part needed for the cache 
   // variables for caching the results and the input
-  static SharedPtr<SISConePlugin          > stored_plugin;
-  static SharedPtr<std::vector<PseudoJet> > stored_particles;
-  static SharedPtr<siscone::Csiscone      > stored_siscone;
+  static std::auto_ptr<SISConePlugin          > stored_plugin;
+  static std::auto_ptr<std::vector<PseudoJet> > stored_particles;
+  static std::auto_ptr<siscone::Csiscone      > stored_siscone;
 };
 
-
-/////\class SISConePlugin::UserScaleBase::StructureType
-///// the structure that allows to store the information contained
-///// into a siscone::Cjet (built internally in SISCone from a stable
-///// cone) into a PseudoJet
-//class SISConePlugin::UserScaleBase::StructureType : public PseudoJetStructureBase {
-//public:
-//  StructureType(const siscone::Cjet & jet, const ClusterSequence &cs)
-//    : _jet(jet), _cs(cs){}
-//
-//  //--------------------------------------------------
-//  // members inherited from the base class
-//  /// the textual descripotion
-//  virtual std::string description() const;
-//
-//  /// this structure has constituents
-//  virtual bool has_constituents() const {return true;}
-//
-//  /// retrieve the constituents 
-//  ///
-//  /// if you simply need to iterate over the constituents, it will be
-//  /// faster to access them via constituent(i)
-//  virtual std::vector<PseudoJet> constituents(const PseudoJet & /*reference*/) const;
-//
-//  //--------------------------------------------------
-//  // additional information relevant for this structure
-//
-//  /// returns the number of constituents
-//  unsigned int size() const;
-//
-//  /// returns the index (in the original particle list) of the ith
-//  /// constituent
-//  int constituent_index(unsigned int i) const;
-//
-//  /// returns the ith constituent (as a PseusoJet)
-//  const PseudoJet & constituent(unsigned int i) const;
-//
-//  /// returns the scalar pt of this stable cone
-//  double pt_tilde() const;
-//
-//  /// returns the sm_var2 (signed ordering variable squared) for this stable cone
-//  double ordering_var2() const;
-//
-//protected:
-//  const siscone::Cjet &_jet;  ///< a dreference to the internal jet in SISCone
-//  const ClusterSequence &_cs; ///< a reference to the CS (for access to the particles)
-//};
 
 //======================================================================
Index: external/fastjet/plugins/SISCone/fastjet/SISConeSphericalPlugin.hh
===================================================================
--- external/fastjet/plugins/SISCone/fastjet/SISConeSphericalPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/fastjet/SISConeSphericalPlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -152,8 +152,4 @@
   virtual void run_clustering(ClusterSequence &) const ;
 
-  /// returns true because this plugin is intended for spherical
-  /// geometries (i.e. it's an e+e- algorithm).
-  virtual bool is_spherical() const {return true;}
-
 protected:
   virtual void reset_stored_plugin() const;
@@ -166,7 +162,7 @@
   // part needed for the cache 
   // variables for caching the results and the input
-  static SharedPtr<SISConeSphericalPlugin        > stored_plugin;
-  static SharedPtr<std::vector<PseudoJet>        > stored_particles;
-  static SharedPtr<siscone_spherical::CSphsiscone> stored_siscone;
+  static std::auto_ptr<SISConeSphericalPlugin        > stored_plugin;
+  static std::auto_ptr<std::vector<PseudoJet>        > stored_particles;
+  static std::auto_ptr<siscone_spherical::CSphsiscone> stored_siscone;
 };
 
Index: external/fastjet/plugins/SISCone/geom_2d.cc
===================================================================
--- external/fastjet/plugins/SISCone/geom_2d.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/geom_2d.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 171                                                          $//
-// $Date:: 2007-06-19 16:26:05 +0200 (Tue, 19 Jun 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/geom_2d.h
===================================================================
--- external/fastjet/plugins/SISCone/geom_2d.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/geom_2d.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 422                                                          $//
-// $Date:: 2020-04-22 11:51:09 +0200 (Wed, 22 Apr 2020)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -153,10 +153,10 @@
   /// return the cell index corrsponding to an eta value
   inline unsigned int get_eta_cell(double eta){
-    return (unsigned int) (1u << ((int) (32*((eta-eta_min)/(eta_max-eta_min)))));
+    return (unsigned int) (1 << ((int) (32*((eta-eta_min)/(eta_max-eta_min)))));
   }
 
   /// return the cell index corrsponding to a phi value
   inline unsigned int get_phi_cell(double phi){
-    return (unsigned int) (1u << ((int) (32*phi/twopi+16)%32));
+    return (unsigned int) (1 << ((int) (32*phi/twopi+16)%32));
   }
 };
Index: external/fastjet/plugins/SISCone/hash.cc
===================================================================
--- external/fastjet/plugins/SISCone/hash.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/hash.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 225                                                          $//
-// $Date:: 2008-05-20 16:59:47 +0200 (Tue, 20 May 2008)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/hash.h
===================================================================
--- external/fastjet/plugins/SISCone/hash.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/hash.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 224                                                          $//
-// $Date:: 2008-05-16 19:58:30 +0200 (Fri, 16 May 2008)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/momentum.cc
===================================================================
--- external/fastjet/plugins/SISCone/momentum.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/momentum.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 123                                                          $//
-// $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/momentum.h
===================================================================
--- external/fastjet/plugins/SISCone/momentum.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/momentum.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 163                                                          $//
-// $Date:: 2007-04-26 22:31:02 +0200 (Thu, 26 Apr 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/protocones.cc
===================================================================
--- external/fastjet/plugins/SISCone/protocones.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/protocones.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 322                                                          $//
-// $Date:: 2011-11-15 10:12:36 +0100 (Tue, 15 Nov 2011)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/protocones.h
===================================================================
--- external/fastjet/plugins/SISCone/protocones.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/protocones.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 224                                                          $//
-// $Date:: 2008-05-16 19:58:30 +0200 (Fri, 16 May 2008)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/quadtree.cc
===================================================================
--- external/fastjet/plugins/SISCone/quadtree.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/quadtree.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 320                                                          $//
-// $Date:: 2011-11-15 09:54:50 +0100 (Tue, 15 Nov 2011)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/quadtree.h
===================================================================
--- external/fastjet/plugins/SISCone/quadtree.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/quadtree.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 123                                                          $//
-// $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/reference.cc
===================================================================
--- external/fastjet/plugins/SISCone/reference.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/reference.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 311                                                          $//
-// $Date:: 2011-10-05 23:27:09 +0200 (Wed, 05 Oct 2011)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/reference.h
===================================================================
--- external/fastjet/plugins/SISCone/reference.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/reference.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 123                                                          $//
-// $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/siscone.cc
===================================================================
--- external/fastjet/plugins/SISCone/siscone.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/siscone.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,9 +21,16 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 403                                                          $//
-// $Date:: 2016-05-19 16:52:05 +0200 (Thu, 19 May 2016)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
+//#ifdef HAVE_CONFIG_H
 #include "config.h"
+//#else
+//#define PACKAGE_NAME "SISCone"
+//#define VERSION "1.4.0-devel"
+//#warning "No config.h file available, using preset values"
+//#endif
+
 #include "ranlux.h"
 #include "momentum.h"
@@ -80,5 +87,31 @@
 			   int _n_pass_max, double _ptmin,
 			   Esplit_merge_scale _split_merge_scale){
-  _initialise_if_needed();
+  // initialise random number generator
+  if (!init_done){
+    // initialise random number generator
+    ranlux_init();
+
+    // do not do this again
+    init_done=true;
+
+    // print the banner
+    if (_banner_ostr != 0){
+      (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
+      (*_banner_ostr) << "#                    SISCone   version " << setw(28) << left << siscone_version() << "o" << endl;
+      (*_banner_ostr) << "#              http://projects.hepforge.org/siscone                o" << endl;
+      (*_banner_ostr) << "#                                                                  o" << endl;
+      (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm   o" << endl;
+      (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez             o" << endl;
+      (*_banner_ostr) << "# It is released under the terms of the GNU General Public License o" << endl;
+      (*_banner_ostr) << "#                                                                  o" << endl;
+      (*_banner_ostr) << "# A description of the algorithm is available in the publication   o" << endl;
+      (*_banner_ostr) << "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)].                   o" << endl;
+      (*_banner_ostr) << "# Please cite it if you use SISCone.                               o" << endl;
+      (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
+      (*_banner_ostr) << endl;
+
+      _banner_ostr->flush();
+    }
+  }
 
   // run some general safety tests (NB: f will be checked in split-merge)
@@ -141,66 +174,4 @@
 }
 
-
-/*
- * compute the jets from a given particle set doing multiple passes
- * such pass N looks for jets among all particles not put into jets
- * during previous passes.
- *  - _particles   list of particles
- *  - _radius      cone radius
- *  - _n_pass_max  maximum number of runs
- *  - _ptmin       minimum pT of the protojets
- *  - _ordering_scale    the ordering scale to decide which stable
- *                       cone is removed
- * return the number of jets found.
- **********************************************************************/
-int Csiscone::compute_jets_progressive_removal(vector<Cmomentum> &_particles, double _radius, 
-					       int _n_pass_max, double _ptmin,
-					       Esplit_merge_scale _ordering_scale){
-  _initialise_if_needed();
-
-  // run some general safety tests (NB: f will be checked in split-merge)
-  if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
-    ostringstream message;
-    message << "Illegal value for cone radius, R = " << _radius 
-            << " (legal values are 0<R<pi/2)";
-    throw Csiscone_error(message.str());
-  }
-
-  ptcomparison.split_merge_scale = _ordering_scale;
-  partial_clear(); // make sure some things are initialised properly
-
-  // init the split_merge algorithm with the initial list of particles
-  // this initialises particle list p_left of remaining particles to deal with
-  //
-  // this stores the "processed" particles in p_uncol_hard
-  init_particles(_particles);
-  jets.clear();
-
-  bool unclustered_left;
-  rerun_allowed = false;
-  protocones_list.clear();
-
-  do{
-    //cout << n_left << " particle left" << endl; 
-
-    // initialise stable_cone finder
-    // here we use the list of remaining particles
-    // AFTER COLLINEAR CLUSTERING !!!!!!
-    Cstable_cones::init(p_uncol_hard);
-
-    // get stable cones (stored in 'protocones')
-    unclustered_left = get_stable_cones(_radius);
-
-    // add the hardest stable cone to the list of jets
-    if (add_hardest_protocone_to_jets(&protocones, R2, _ptmin)) break;
-  
-    _n_pass_max--;
-  } while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0));
-
-  // split & merge
-  return jets.size();
-}
-
-
 /*
  * recompute the jets with a different overlap parameter.
@@ -234,37 +205,4 @@
 }  
 
-// ensure things are initialised
-void Csiscone::_initialise_if_needed(){
-  // initialise random number generator
-  if (init_done) return;
-
-  // initialise random number generator
-  ranlux_init();
-
-  // do not do this again
-  init_done=true;
-
-  // print the banner
-  if (_banner_ostr != 0){
-    ios::fmtflags flags_to_restore(_banner_ostr->flags());
-
-    (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
-    (*_banner_ostr) << "#                    SISCone   version " << setw(28) << left << siscone_version() << "o" << endl;
-    (*_banner_ostr) << "#              http://projects.hepforge.org/siscone                o" << endl;
-    (*_banner_ostr) << "#                                                                  o" << endl;
-    (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm   o" << endl;
-    (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez             o" << endl;
-    (*_banner_ostr) << "# It is released under the terms of the GNU General Public License o" << endl;
-    (*_banner_ostr) << "#                                                                  o" << endl;
-    (*_banner_ostr) << "# A description of the algorithm is available in the publication   o" << endl;
-    (*_banner_ostr) << "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)].                   o" << endl;
-    (*_banner_ostr) << "# Please cite it if you use SISCone.                               o" << endl;
-    (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
-    (*_banner_ostr) << endl;
-
-    _banner_ostr->flush();
-    _banner_ostr->flags(flags_to_restore);
-  }
-}
 
 // finally, a bunch of functions to access to 
@@ -275,10 +213,10 @@
  * return SISCone package name.
  * This is nothing but "SISCone", it is a replacement to the
- * SISCONE_PACKAGE_NAME string defined in config.h and which is not
- * guaranteed to be public.
+ * PACKAGE_NAME string defined in config.h and which is not
+ * public by default.
  * return the SISCone name as a string
  */
 string siscone_package_name(){
-  return SISCONE_PACKAGE_NAME;
+  return PACKAGE_NAME;
 }
 
@@ -289,6 +227,6 @@
  */
 string siscone_version(){
-  return SISCONE_VERSION;
-}
-
-}
+  return VERSION;
+}
+
+}
Index: external/fastjet/plugins/SISCone/siscone.h
===================================================================
--- external/fastjet/plugins/SISCone/siscone.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/siscone.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 401                                                          $//
-// $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -79,25 +79,4 @@
 
   /**
-   * compute the jets from a given particle set.
-   * We are doing multiple passes such pass n_pass looks for jets among 
-   * all particles not put into jets during previous passes.
-   * By default the number of passes is infinite (0). 
-   * \param _particles   list of particles
-   * \param _radius      cone radius
-   * \param _n_pass_max  maximum number of passes (0=full search)
-   * \param _ptmin       minimum pT of the protojets
-   * \param _ordering_scale    the ordering scale to decide which stable
-   *                           cone is removed
-   *
-   * Note that the Csplit_merge::SM_var2_hardest_cut_off cut is not
-   * used in the progressive removal variant.
-   * 
-   * \return the number of jets found.
-   */
-  int compute_jets_progressive_removal(std::vector<Cmomentum> &_particles, double _radius, 
-				       int _n_pass_max=0, double _ptmin=0.0,
-				       Esplit_merge_scale _ordering_scale=SM_pttilde);
-
-  /**
    * recompute the jets with a different overlap parameter.
    * we use the same particles and R as in the preceeding call.
@@ -114,5 +93,5 @@
 		     Esplit_merge_scale _split_merge_scale=SM_pttilde);
 
-  /// list of protocones found pass-by-pass (not filled by compute_jets_progressive_removal)
+  /// list of protocones found pass-by-pass
   std::vector<std::vector<Cmomentum> > protocones_list;
 
@@ -146,8 +125,4 @@
   bool rerun_allowed;         ///< is recompute_jets allowed ?
   static std::ostream * _banner_ostr; ///< stream to use for banners
-
-  /// ensure things are initialised
-  void _initialise_if_needed();
-
 };
 
@@ -160,6 +135,6 @@
  * return SISCone package name.
  * This is nothing but "SISCone", it is a replacement to the
- * SISCONE_PACKAGE_NAME string defined in config.h and which is not
- * guaranteed to be public.
+ * PACKAGE_NAME string defined in config.h and which is not
+ * public by default.
  * \return the SISCone name as a string
  */
Index: external/fastjet/plugins/SISCone/siscone_error.cc
===================================================================
--- external/fastjet/plugins/SISCone/siscone_error.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/siscone_error.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 123                                                          $//
-// $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/siscone_error.h
===================================================================
--- external/fastjet/plugins/SISCone/siscone_error.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/siscone_error.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 327                                                          $//
-// $Date:: 2011-11-25 15:19:39 +0100 (Fri, 25 Nov 2011)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/SISCone/split_merge.cc
===================================================================
--- external/fastjet/plugins/SISCone/split_merge.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/split_merge.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 390                                                          $//
-// $Date:: 2016-03-03 11:06:52 +0100 (Thu, 03 Mar 2016)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -28,4 +28,5 @@
 #include "siscone_error.h"
 #include "momentum.h"
+#include <math.h>
 #include <limits>   // for max
 #include <iostream>
@@ -33,5 +34,4 @@
 #include <sstream>
 #include <cassert>
-#include <cmath>
 
 namespace siscone{
@@ -54,6 +54,4 @@
   pt_tilde = 0.0;
   sm_var2 = 0.0;
-  pass = CJET_INEXISTENT_PASS; // initialised to a value that should
-                               // notappear in the end (after clustering)
 }
 
@@ -231,5 +229,4 @@
 #endif
 #endif
-  _user_scale = NULL;
   indices = NULL;
 
@@ -240,5 +237,5 @@
 
   // no hardest cut (col-unsafe)
-  SM_var2_hardest_cut_off = -numeric_limits<double>::max();
+  SM_var2_hardest_cut_off = -1.0;
 
   // no pt cutoff for the particles to put in p_uncol_hard
@@ -558,150 +555,4 @@
 }
 
-
-/*
- * remove the hardest protocone and declare it a a jet 
- *  - protocones  list of protocones (initial jet candidates)
- *  - R2          cone radius (squared)
- *  - ptmin       minimal pT allowed for jets
- * return 0 on success, 1 on error
- *
- * The list of remaining particles (and the uncollinear-hard ones)
- * is updated.
- */
-int Csplit_merge::add_hardest_protocone_to_jets(std::vector<Cmomentum> *protocones, double R2, double ptmin){
-
-  int i;
-  Cmomentum *c;
-  Cmomentum *v;
-  double eta, phi;
-  double dx, dy;
-  double R;
-  Cjet jet, jet_candidate;
-  bool found_jet = false;
-
-  if (protocones->size()==0)
-    return 1;
-
-  pt_min2 = ptmin*ptmin;
-  R = sqrt(R2);
-
-  // browse protocones
-  // for each of them, build the list of particles in them
-  for (vector<Cmomentum>::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){
-    // initialise variables
-    c = &(*p_it);
-
-    // note: cones have been tested => their (eta,phi) coordinates are computed
-    eta = c->eta;
-    phi = c->phi;
-
-    // NOTE: this is common to this method and add_protocones, so it
-    // could be moved into a 'build_jet_from_protocone' method
-    //
-    // browse particles to create cone contents
-    jet_candidate.v = Cmomentum();
-    jet_candidate.pt_tilde=0;
-    jet_candidate.contents.clear();
-    for (i=0;i<n_left;i++){
-      v = &(p_remain[i]);
-      // for security, avoid including particles with infinite rapidity)
-      // NO NEEDED ANYMORE SINCE REMOVED FROM p_remain FROM THE BEGINNING
-      //if (fabs(v->pz)!=v->E){
-      dx = eta - v->eta;
-      dy = fabs(phi - v->phi);
-      if (dy>M_PI) 
-	dy -= twopi;
-      if (dx*dx+dy*dy<R2){
-	jet_candidate.contents.push_back(v->parent_index);
-	jet_candidate.v+= *v;
-	jet_candidate.pt_tilde+= pt[v->parent_index];
-	v->index=0;
-      }
-    }
-    jet_candidate.n=jet_candidate.contents.size();
-
-    // set the momentum in protocones 
-    // (it was only known through eta and phi up to now)
-    *c = jet_candidate.v;
-    c->eta = eta; // restore exact original coords
-    c->phi = phi; // to avoid rounding error inconsistencies
-
-    // set the jet range
-    jet_candidate.range=Ceta_phi_range(eta,phi,R);
-
-    // check that the protojet has large enough pt
-    if (jet_candidate.v.perp2()<pt_min2)
-      continue;
-
-    // assign the split-merge (or progressive-removal) squared scale variable
-    if (_user_scale) {
-      // sm_var2 is the signed square of the user scale returned
-      // for the jet candidate
-      jet_candidate.sm_var2 = (*_user_scale)(jet_candidate);
-      jet_candidate.sm_var2 *= abs(jet_candidate.sm_var2);
-    } else {
-      jet_candidate.sm_var2 = get_sm_var2(jet_candidate.v, jet_candidate.pt_tilde);
-    }
-
-    // now check if it is possibly the hardest
-    if ((! found_jet) ||
-	(_user_scale ? _user_scale->is_larger(jet_candidate, jet)
-	             : ptcomparison(jet_candidate, jet))){
-      jet = jet_candidate;
-      found_jet = true;
-    }
-  }
-
-  // make sure at least one of the jets has passed the selection
-  if (!found_jet) return 1;  
-  
-  // add the jet to the list of jets
-  jets.push_back(jet);
-  jets[jets.size()-1].v.build_etaphi();
-
-#ifdef DEBUG_SPLIT_MERGE
-  cout << "PR-Jet " << jets.size() << " [size " << jet.contents.size() << "]:";
-#endif
-    
-  // update the list of what particles are left
-  int p_remain_index = 0;
-  int contents_index = 0;
-  //sort(next_jet.contents.begin(),next_jet.contents.end());
-  for (int index=0;index<n_left;index++){
-    if ((contents_index<(int) jet.contents.size()) &&
-	(p_remain[index].parent_index == jet.contents[contents_index])){
-      // this particle belongs to the newly found jet
-      // set pass in initial list
-      particles[p_remain[index].parent_index].index = n_pass;
-#ifdef DEBUG_SPLIT_MERGE
-      cout << " " << jet.contents[contents_index];
-#endif
-      contents_index++;
-    } else {
-      // this particle still has to be clustered
-      p_remain[p_remain_index] = p_remain[index];
-      p_remain[p_remain_index].parent_index = p_remain[index].parent_index;
-      p_remain[p_remain_index].index=1;
-      p_remain_index++;
-    }
-  }
-  p_remain.resize(n_left-jet.contents.size());
-  n_left = p_remain.size();
-  jets[jets.size()-1].pass = particles[jet.contents[0]].index;
-
-  // increase the pass index
-  n_pass++;
-
-#ifdef DEBUG_SPLIT_MERGE
-  cout << endl;
-#endif
-
-  // male sure the list of uncol_hard particles (used for the next
-  // stable cone finding) is updated [could probably be more
-  // efficient]
-  merge_collinear_and_remove_soft();
-  
-  return 0;
-}
 
 /*
@@ -1181,6 +1032,6 @@
   }
 
-  //return 0.0;
-}
-
-}
+  return 0.0;
+}
+
+}
Index: external/fastjet/plugins/SISCone/split_merge.h
===================================================================
--- external/fastjet/plugins/SISCone/split_merge.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/split_merge.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 405                                                          $//
-// $Date:: 2016-05-23 20:15:02 +0200 (Mon, 23 May 2016)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -29,5 +29,4 @@
 #define __SPLIT_MERGE_H__
 
-#include "config.h"
 #include "defines.h"
 #include "geom_2d.h"
@@ -40,6 +39,4 @@
 
 namespace siscone{
-
-const int CJET_INEXISTENT_PASS = -2;
 
 /**
@@ -78,6 +75,4 @@
   /// pass at which the jet has been found
   /// It starts at 0 (first pass), -1 means infinite rapidity
-  /// (it will be initialised to "CJET_INEXISTENT_PASS" which should
-  /// never appear after clustering)
   int pass;
 };
@@ -146,5 +141,5 @@
   /// the split-merge process i.e. the variable we use for 
   ///  1. ordering jet candidates;
-  ///  2. computing the overlap fraction of two candidates.
+  ///  2. computing te overlap fraction of two candidates.
   /// The default value uses pttile (p-scheme pt). Other alternatives are
   /// pt, mt=sqrt(pt^2+m^2)=sqrt(E^2-pz^2) or Et. 
@@ -156,5 +151,5 @@
   ///   the default value i.e.  to use pt only for the purpose of
   ///   investigating the IR issue
-  /// - using Et is safe but does not respect boost invariance
+  /// - using Et is safe but do not respect boost invariance
   /// - using mt solves the IR unsafety issues with the pt variable
   ///   for QCD jets but the IR unsafety remains for nack-to-back 
@@ -239,50 +234,4 @@
   int full_clear();
 
-  ///////////////////////////////////////
-  // user-defined stable-cone ordering //
-  ///////////////////////////////////////
-
-  /// \class Cuser_scale_base
-  /// base class for user-defined ordering of stable cones
-  ///
-  /// derived classes have to implement the () operator that returns
-  /// the scale associated with a given jet.
-  class Cuser_scale_base{
-  public:
-    /// empty virtual dtor
-    virtual ~Cuser_scale_base(){}
-
-    /// the scale associated with a given jet
-    ///
-    /// "progressive removal" iteratively removes the stable cone with
-    /// the largest scale
-    virtual double operator()(const Cjet & jet) const = 0;
-
-    /// returns true when the scale associated with jet a is larger than
-    /// the scale associated with jet b
-    ///
-    /// By default this does a simple direct comparison but it can be
-    /// overloaded for higher precision [recommended if possible]
-    ///
-    /// This function assumes that a.sm_var2 and b.sm_var2 have been
-    /// correctly initialised with the signed squared output of
-    /// operator(), as is by default the case when is_larger is called
-    /// from within siscone.
-    virtual bool is_larger(const Cjet & a, const Cjet & b) const{
-      return (a.sm_var2 > b.sm_var2);
-    }
-  };
-
-  /// associate a user-defined scale to order the stable cones
-  ///
-  /// Note that this is only used in "progressive-removal mode",
-  /// e.g. in add_hardest_protocone_to_jets().
-  void set_user_scale(const Cuser_scale_base * user_scale_in){
-    _user_scale = user_scale_in;
-  }
-
-  /// return the user-defined scale (NULL if none)
-  const Cuser_scale_base * user_scale() const { return _user_scale; }
-
 
   /////////////////////////////////
@@ -307,16 +256,4 @@
    */
   int add_protocones(std::vector<Cmomentum> *protocones, double R2, double ptmin=0.0);
-
-  /**
-   * remove the hardest protocone and declare it a jet 
-   * \param protocones  list of protocones (initial jet candidates)
-   * \param R2          cone radius (squared)
-   * \param ptmin       minimal pT allowed for jets
-   * \return 0 on success, 1 on error
-   *
-   * The list of remaining particles (and the uncollinear-hard ones)
-   * is updated.
-   */
-  int add_hardest_protocone_to_jets(std::vector<Cmomentum> *protocones, double R2, double ptmin=0.0);
 
   /**
@@ -377,9 +314,8 @@
   Csplit_merge_ptcomparison ptcomparison;
 
-  /// stop split--merge or progressive-removal when the squared SM_var
-  /// of the hardest protojet is below this cut-off. Note that this is
-  /// a signed square (ie SM_var*|SM_var|) to be able to handle
-  /// negative values.
-  ///
+  /// stop split--merge when the SM_var of the hardest protojet 
+  /// is below this cut-off. 
+  /// This is not collinear-safe so you should not use this
+  /// variable unless you really know what you are doing
   /// Note that the cut-off is set on the variable squared.
   double SM_var2_hardest_cut_off;
@@ -388,8 +324,4 @@
   /// this is meant to allow removing soft particles in the
   /// stable-cone search.
-  ///
-  /// This is not collinear-safe so you should not use this
-  /// variable unless you really know what you are doing
-  /// Note that the cut-off is set on the variable squared.
   double stable_cone_soft_pt2_cutoff;
 
@@ -446,10 +378,6 @@
   // jet information
   /// list of jet candidates
-#if __cplusplus < 201103L
   std::auto_ptr<std::multiset<Cjet,Csplit_merge_ptcomparison> > candidates;
-#else
-  std::unique_ptr<std::multiset<Cjet,Csplit_merge_ptcomparison> > candidates;
-#endif
-  
+
   /// minimal pt2
   double pt_min2;
@@ -461,8 +389,4 @@
    */
   bool use_pt_weighted_splitting;
-
-  /// use a user-defined scale to order the stable cones and jet
-  /// candidates
-  const Cuser_scale_base *_user_scale;
 
 #ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES
Index: external/fastjet/plugins/SISCone/vicinity.cc
===================================================================
--- external/fastjet/plugins/SISCone/vicinity.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/vicinity.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -21,6 +21,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 388                                                          $//
-// $Date:: 2016-03-03 10:42:25 +0100 (Thu, 03 Mar 2016)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -80,5 +80,4 @@
   VR2 = VR = 0.0;
 
-  ve_list = NULL;
   set_particle_list(_particle_list);
 }
Index: external/fastjet/plugins/SISCone/vicinity.h
===================================================================
--- external/fastjet/plugins/SISCone/vicinity.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/SISCone/vicinity.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,6 +22,6 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
 //                                                                           //
-// $Revision:: 123                                                          $//
-// $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007)                     $//
+// $Revision::                                                              $//
+// $Date::                                                                  $//
 ///////////////////////////////////////////////////////////////////////////////
 
Index: external/fastjet/plugins/TrackJet/TrackJetPlugin.cc
===================================================================
--- external/fastjet/plugins/TrackJet/TrackJetPlugin.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/TrackJet/TrackJetPlugin.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,9 +1,14 @@
-//FJSTARTHEADER
-// $Id: TrackJetPlugin.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
-// This file is part of FastJet.
+// This file is part of FastJet. It contains code that has been
+// obtained from the Rivet project by Leif Lonnblad, Andy Buckley and
+// Jon Butterworth. See http://www.hepforge.org/downloads/rivet.
+// Rivet is free software released under the terms of the GNU Public
+// License(v2).
+// Changes from the original file are listed below.
 //
 //  FastJet is free software; you can redistribute it and/or modify
@@ -13,9 +18,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +30,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 // History of changes from the original TrackJet.cc file in Rivet <=1.1.2
Index: external/fastjet/plugins/TrackJet/fastjet/TrackJetPlugin.hh
===================================================================
--- external/fastjet/plugins/TrackJet/fastjet/TrackJetPlugin.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/plugins/TrackJet/fastjet/TrackJetPlugin.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: TrackJetPlugin.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: TrackJetPlugin.hh 2758 2011-11-24 08:31:58Z soyez $
 //
-// Copyright (c) 2007-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2007-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __TRACKJETPLUGIN_HH__
Index: external/fastjet/tools/BackgroundEstimatorBase.cc
===================================================================
--- external/fastjet/tools/BackgroundEstimatorBase.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/BackgroundEstimatorBase.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: BackgroundEstimatorBase.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/tools/BackgroundEstimatorBase.hh
===================================================================
--- external/fastjet/tools/BackgroundEstimatorBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/BackgroundEstimatorBase.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_BACKGROUND_ESTIMATOR_BASE_HH__
 
-//FJSTARTHEADER
-// $Id: BackgroundEstimatorBase.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: BackgroundEstimatorBase.hh 2689 2011-11-14 14:51:06Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/ClusterSequenceAreaBase.hh>
@@ -45,6 +43,7 @@
 ///
 /// Abstract base class that provides the basic interface for classes
-/// that estimate levels of background radiation in hadron and
+/// that estimate levels of background radiation in hadrion and
 /// heavy-ion collider events.
+///
 ///
 class BackgroundEstimatorBase {
@@ -100,40 +99,6 @@
   /// determination of sigma
   virtual bool has_sigma() {return false;}
-
-  //----------------------------------------------------------------
-  // now do the same thing for rho_m and sigma_m
-
-  /// returns rho_m, the purely longitudinal, particle-mass-induced
-  /// component of the background density per unit area
-  virtual double rho_m() const{
-    throw Error("rho_m() not supported for this Background Estimator");
-  }
-
-  /// returns sigma_m, a measure of the fluctuations in the purely
-  /// longitudinal, particle-mass-induced component of the background
-  /// density per unit area; must be multipled by sqrt(area) to get
-  /// fluctuations for a region of a given area.
-  virtual double sigma_m() const { 
-    throw Error("sigma_m() not supported for this Background Estimator");
-  }
-
-  /// Returns rho_m locally at the jet position. As for rho(jet), it is non-const.
-  virtual double rho_m(const PseudoJet & /*jet*/){
-    throw Error("rho_m(jet) not supported for this Background Estimator");
-  }
-
-  /// Returns sigma_m locally at the jet position. As for rho(jet), it is non-const.
-  virtual double sigma_m(const PseudoJet & /*jet*/) { 
-    throw Error("sigma_m(jet) not supported for this Background Estimator");
-  }
-
-  /// Returns true if this background estimator has support for
-  /// determination of rho_m.
-  ///
-  /// Note that support for sigma_m is automatic is one has sigma and
-  /// rho_m support.
-  virtual bool has_rho_m() const {return false;}
-  //\}
-
+  //\}
+  
 
   /// @name configuring the behaviour
@@ -149,7 +114,4 @@
   /// The BackgroundRescalingYPolynomial class can be used to get a
   /// rescaling that depends just on rapidity.
-  ///
-  /// There is currently no support for different rescaling classes 
-  /// for rho and rho_m determinations.
   virtual void set_rescaling_class(const FunctionOfPseudoJet<double> * rescaling_class_in) { _rescaling_class = rescaling_class_in; }
 
Index: external/fastjet/tools/Boost.hh
===================================================================
--- external/fastjet/tools/Boost.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Boost.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Boost.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: Boost.hh 2689 2011-11-14 14:51:06Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_TOOL_BOOST_HH__
Index: external/fastjet/tools/CASubJetTagger.cc
===================================================================
--- external/fastjet/tools/CASubJetTagger.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/CASubJetTagger.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CASubJetTagger.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/tools/CASubJetTagger.hh>
Index: external/fastjet/tools/CASubJetTagger.hh
===================================================================
--- external/fastjet/tools/CASubJetTagger.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/CASubJetTagger.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: CASubJetTagger.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: CASubJetTagger.hh 2616 2011-09-30 18:03:40Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __CASUBJET_TAGGER_HH__
Index: external/fastjet/tools/Filter.cc
===================================================================
--- external/fastjet/tools/Filter.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Filter.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Filter.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,9 +25,7 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/tools/Filter.hh"
-#include "fastjet/tools/Recluster.hh"
-#include "fastjet/tools/Subtractor.hh"
 #include <fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh>
 #include <cassert>
@@ -49,8 +45,4 @@
 // class description
 string Filter::description() const {
-  if (!_initialised){
-    return "uninitialised Filter";
-  }
-
   ostringstream ostr;
   ostr << "Filter with subjet_def = ";
@@ -81,9 +73,4 @@
 // by the filtering
 PseudoJet Filter::result(const PseudoJet &jet) const {
-  if (!_initialised){
-    //Q: do we throw or do we return an empty PJ?
-    throw Error("uninitialised Filter");
-  }
-
   // start by getting the list of subjets (including a list of sanity
   // checks)
@@ -91,19 +78,10 @@
   //     _set_filtered_elements_cafilt)
   vector<PseudoJet> subjets; 
-  //JetDefinition subjet_def;
-  bool ca_optimised = _set_filtered_elements(jet, subjets);
-
-  // apply subtraction if needed:
-  if (_subtractor){
-    subjets = (*_subtractor)(subjets);
-  } else if (_rho!=0){
-    if (subjets.size()>0){
-      //const ClusterSequenceAreaBase *csab = subjets[0].validated_csab();
-      for (unsigned int i=0;i<subjets.size();i++){
-        //subjets[i]=csab->subtracted_jet(subjets[i], _rho);
-        subjets[i]=Subtractor(_rho)(subjets[i]);
-      }
-    }
-  }
+  JetDefinition subjet_def;
+  bool discard_area;
+  // NB: on return, subjet_def is set to the jet definition actually
+  //     used (so that we can make use of its recombination scheme 
+  //     when joining the jets to be kept).
+  _set_filtered_elements(jet, subjets, subjet_def, discard_area);
 
   // now build the vector of kept and rejected subjets
@@ -116,25 +94,199 @@
 
   // gather the info under the form of a PseudoJet
-  return _finalise(jet, kept, rejected, ca_optimised);
+  return _finalise(jet, kept, rejected, subjet_def, discard_area);
 }
 
 
 // sets filtered_elements to be all the subjets on which filtering will work
-//
-// return true when the subjets have been optained using teh optimised
-// method for C/A
-bool Filter::_set_filtered_elements(const PseudoJet & jet,
-                                    vector<PseudoJet> & filtered_elements) const {
-  // create the recluster instance
-  Recluster recluster;
-  if ((_Rfilt>=0) || (_Rfiltfunc))
-    recluster = Recluster(cambridge_algorithm, (_Rfiltfunc) ? (*_Rfiltfunc)(jet) : _Rfilt, Recluster::keep_all);
-  else
-    recluster = Recluster(_subjet_def, false, Recluster::keep_all);
-
-  // get the subjets
-  //JetDefinition subjet_def;
-  return recluster.get_new_jets_and_def(jet, filtered_elements);
-}
+void Filter::_set_filtered_elements(const PseudoJet & jet,
+                                    vector<PseudoJet> & filtered_elements,
+                                    JetDefinition & subjet_def,
+                                    bool & discard_area) const {
+  // sanity checks
+  //-------------------------------------------------------------------
+  // make sure that the jet has constituents
+  if (! jet.has_constituents())
+    throw Error("Filter can only be applied on jets having constituents");
+
+  // for a whole variety of checks, we shall need the "recursive"
+  // pieces of the jet (the jet itself or recursing down to its most
+  // fundamental pieces).
+  // So we do compute these once and for all
+  vector<PseudoJet> all_pieces; //.clear();
+  if ((!_get_all_pieces(jet, all_pieces)) || (all_pieces.size()==0))
+    throw Error("Attempt to filter a jet that has no associated ClusterSequence or is not a superposition of jets associated with a ClusterSequence");
+  
+  // if the filter uses subtraction, make sure we have a CS that supports area and has
+  // explicit ghosts 
+  if (_uses_subtraction()) {
+    if (!jet.has_area())   
+      throw Error("Attempt to filter and subtract (non-zero rho or subtractor) without area info for the original jet");
+
+    if (!_check_explicit_ghosts(all_pieces))
+      throw Error("Attempt to filter and subtract (non-zero rho or subtractor) without explicit ghosts");
+  }
+
+  // if we're dealing with a dynamic determination of the filtering
+  // radius, do it now
+  if ((_Rfilt>=0) || (_Rfiltfunc)){
+    double Rfilt = (_Rfiltfunc) ? (*_Rfiltfunc)(jet) : _Rfilt;
+    const JetDefinition::Recombiner * common_recombiner = _get_common_recombiner(all_pieces);
+    if (common_recombiner) {
+      if (typeid(*common_recombiner) == typeid(JetDefinition::DefaultRecombiner)) {
+        RecombinationScheme scheme = 
+          static_cast<const JetDefinition::DefaultRecombiner *>(common_recombiner)->scheme();
+        subjet_def = JetDefinition(cambridge_algorithm, Rfilt, scheme);
+      } else {
+        subjet_def = JetDefinition(cambridge_algorithm, Rfilt, common_recombiner);
+      }
+    } else {
+      subjet_def = JetDefinition(cambridge_algorithm, Rfilt);
+    }
+  } else {
+    subjet_def = _subjet_def;
+  }
+
+  // get the jet definition to be use and whether we can apply our
+  // simplified C/A+C/A filter
+  //
+  // we apply C/A clustering iff
+  //  - the request subjet_def is C/A
+  //  - the jet is either directly coming from C/A or if it is a
+  //    superposition of C/A jets
+  //  - the pieces agree with the recombination scheme of subjet_def
+  //------------------------------------------------------------------
+  bool simple_cafilt = _check_ca(all_pieces);
+
+  // extract the subjets
+  //-------------------------------------------------------------------
+  discard_area = false;
+  if (simple_cafilt){
+    // first make sure that 'filtered_elements' is empty
+    filtered_elements.clear();
+    _set_filtered_elements_cafilt(jet, filtered_elements, subjet_def.R());
+    // in the following case, areas can be erroneous and will be discarded
+    discard_area = (!_uses_subtraction()) && (jet.has_area()) && (!_check_explicit_ghosts(all_pieces));
+  } else {
+    // here we'll simply recluster the jets.
+    //
+    // To include an area support we need
+    //  - the jet to have an area
+    //  - subtraction requested or explicit ghosts
+    bool do_areas = (jet.has_area()) && ((_uses_subtraction()) || (_check_explicit_ghosts(all_pieces))); 
+    _set_filtered_elements_generic(jet, filtered_elements, subjet_def, do_areas);
+  }
+
+  // order the filtered elements in pt
+  filtered_elements = sorted_by_pt(filtered_elements);
+}
+
+// set the filtered elements in the simple case of C/A+C/A
+//
+// WATCH OUT: this could be recursively called, so filtered elements
+//            of 'jet' are APPENDED to 'filtered_elements'
+void Filter::_set_filtered_elements_cafilt(const PseudoJet & jet, 
+                                           vector<PseudoJet> & filtered_elements, 
+                                           double Rfilt) const{
+  // we know that the jet is either a C/A jet or a superposition of
+  // such pieces
+  if (jet.has_associated_cluster_sequence()){
+    // just extract the exclusive subjets of 'jet'
+    const ClusterSequence *cs = jet.associated_cluster_sequence(); 
+    vector<PseudoJet> local_fe;
+
+    double dcut = Rfilt / cs->jet_def().R();
+    if (dcut>=1.0){
+      local_fe.push_back(jet);
+    } else {
+      dcut *= dcut;
+      local_fe = jet.exclusive_subjets(dcut);
+    }
+
+    // subtract the jets if needed
+    // Note that this one would work on pieces!!
+    //-----------------------------------------------------------------
+    if (_uses_subtraction()){
+      const ClusterSequenceAreaBase * csab = jet.validated_csab();
+      for (unsigned int i=0;i<local_fe.size();i++) {
+        if (_subtractor) {
+          local_fe[i] = (*_subtractor)(local_fe[i]);
+        } else {
+          local_fe[i] = csab->subtracted_jet(local_fe[i], _rho);
+        }
+      }
+    }
+
+    copy(local_fe.begin(), local_fe.end(), back_inserter(filtered_elements));
+    return;
+  }
+
+  // just recurse into the pieces
+  const vector<PseudoJet> & pieces = jet.pieces();
+  for (vector<PseudoJet>::const_iterator it = pieces.begin(); 
+       it!=pieces.end(); it++)
+    _set_filtered_elements_cafilt(*it, filtered_elements, Rfilt);
+}
+
+
+// set the filtered elements in the generic re-clustering case (wo
+// subtraction)
+void Filter::_set_filtered_elements_generic(const PseudoJet & jet, 
+                                            vector<PseudoJet> & filtered_elements,
+                                            const JetDefinition & subjet_def,
+					    bool do_areas) const{
+  // create a new, internal, ClusterSequence from the jet constituents
+  // get the subjets directly from there
+  //
+  // If the jet has area support then we separate the ghosts from the
+  // "regular" particles so the subjets will also have area
+  // support. Note that we do this regardless of whether rho is zero
+  // or not.
+  //
+  // Note that to be able to separate the ghosts, one needs explicit
+  // ghosts!!
+  // ---------------------------------------------------------------
+  if (do_areas){
+    vector<PseudoJet> all_constituents = jet.constituents();
+    vector<PseudoJet> regular_constituents, ghosts;  
+
+    for (vector<PseudoJet>::iterator it = all_constituents.begin(); 
+         it != all_constituents.end(); it++){
+      if (it->is_pure_ghost())
+        ghosts.push_back(*it);
+      else
+        regular_constituents.push_back(*it);
+    }
+
+    // figure out the ghost area from the 1st ghost (if none, any value
+    // would probably do as the area will be 0 and subtraction will have
+    // no effect!)
+    double ghost_area = (ghosts.size()) ? ghosts[0].area() : 0.01;
+    ClusterSequenceActiveAreaExplicitGhosts * csa
+      = new ClusterSequenceActiveAreaExplicitGhosts(regular_constituents, 
+                                                    subjet_def, 
+                                                    ghosts, ghost_area);
+
+    // get the subjets: we use the subtracted or unsubtracted ones
+    // depending on rho or _subtractor being non-zero
+    if (_uses_subtraction()) {
+      if (_subtractor) {
+        filtered_elements = (*_subtractor)(csa->inclusive_jets());
+      } else {
+        filtered_elements = csa->subtracted_jets(_rho);
+      }
+    } else {
+      filtered_elements = csa->inclusive_jets();
+    }
+
+    // allow the cs to be deleted when it's no longer used
+    csa->delete_self_when_unused();
+  } else {
+    ClusterSequence * cs = new ClusterSequence(jet.constituents(), subjet_def);
+    filtered_elements = cs->inclusive_jets();
+    // allow the cs to be deleted when it's no longer used
+    cs->delete_self_when_unused();
+  }
+}
+
 
 // gather the information about what is kept and rejected under the
@@ -143,36 +295,118 @@
                             vector<PseudoJet> & kept, 
                             vector<PseudoJet> & rejected,
-			    bool ca_optimisation_used) const {
-  PseudoJet filtered_jet;
-
-  if (kept.size()+rejected.size()>0){
-    // figure out which recombiner to use
-    const JetDefinition::Recombiner &rec = (kept.size()>0)
-      ? *(kept[0].associated_cs()->jet_def().recombiner())
-      : *(rejected[0].associated_cs()->jet_def().recombiner());
-
-    // create an appropriate structure and transfer the info to it
-    filtered_jet = join<StructureType>(kept, rec);
-  } else {
-    filtered_jet = join<StructureType>(kept);
-  }
+                            const JetDefinition & subjet_def,
+                            const bool discard_area) const {
+  // figure out which recombiner to use
+  const JetDefinition::Recombiner &rec = *(subjet_def.recombiner());
+
+  // create an appropriate structure and transfer the info to it
+  PseudoJet filtered_jet = join<StructureType>(kept, rec);
   StructureType *fs = (StructureType*) filtered_jet.structure_non_const_ptr();
+//  fs->_original_jet = jet;
   fs->_rejected = rejected;
+
+  if (discard_area){
+    // safety check: make sure there is an area to discard!!!
+    assert(fs->_area_4vector_ptr);
+    delete fs->_area_4vector_ptr;
+    fs->_area_4vector_ptr=0;
+  }
   
-  // if we've used C/A optimisation, we need to get rid of the area
-  // information if it comes from a non-explicit-ghost clustering.
-  // (because in that case it can be erroneous due the lack of
-  // information about empty areas)
-  if ((ca_optimisation_used) && (kept.size()+rejected.size()>0)){
-    bool has_non_explicit_ghost_area = (kept.size()>0)
-      ? (kept[0].has_area()     && (!(kept[0].validated_csab()->has_explicit_ghosts())))
-      : (rejected[0].has_area() && (!(rejected[0].validated_csab()->has_explicit_ghosts())));
-    if (has_non_explicit_ghost_area)
-      fs->discard_area();
-  }
-
   return filtered_jet;
 }
 
+// various checks
+//----------------------------------------------------------------------
+
+// get the pieces down to the fundamental pieces
+// 
+// Note that this just checks that there is an associated CS to the
+// fundamental pieces, not that it is still valid
+bool Filter::_get_all_pieces(const PseudoJet &jet, vector<PseudoJet> &all_pieces) const{
+  if (jet.has_associated_cluster_sequence()){
+    all_pieces.push_back(jet);
+    return true;
+  }
+
+  if (jet.has_pieces()){
+    const vector<PseudoJet> pieces = jet.pieces();
+    for (vector<PseudoJet>::const_iterator it=pieces.begin(); it!=pieces.end(); it++)
+      if (!_get_all_pieces(*it, all_pieces)) return false;
+    return true;
+  }
+
+  return false;
+}
+
+// get the common recombiner to all pieces (NULL if none)
+//
+// Note that if the jet has an associated cluster sequence that is no
+// longer valid, an error will be thrown (needed since it could be the
+// 1st check called after the enumeration of the pieces)
+const JetDefinition::Recombiner* Filter::_get_common_recombiner(const vector<PseudoJet> &all_pieces) const{
+  const JetDefinition & jd_ref = all_pieces[0].validated_cs()->jet_def();
+  for (unsigned int i=1; i<all_pieces.size(); i++)
+    if (!all_pieces[i].validated_cs()->jet_def().has_same_recombiner(jd_ref)) return NULL;
+
+  return jd_ref.recombiner();
+}
+
+// check if the jet (or all its pieces) have explicit ghosts
+// (assuming the jet has area support
+//
+// Note that if the jet has an associated cluster sequence that is no
+// longer valid, an error will be thrown (needed since it could be the
+// 1st check called after the enumeration of the pieces)
+bool Filter::_check_explicit_ghosts(const vector<PseudoJet> &all_pieces) const{
+  for (vector<PseudoJet>::const_iterator it=all_pieces.begin(); it!=all_pieces.end(); it++)
+    if (! it->validated_csab()->has_explicit_ghosts()) return false;
+  return true;
+}
+
+// check if one can apply the simplification for C/A subjets
+//
+// This includes:
+//  - the subjet definition asks for C/A subjets
+//  - all the pieces share the same CS
+//  - that CS is C/A with the same recombiner as the subjet def
+//  - the filtering radius is not larger than any of the pairwise
+//    distance between the pieces
+//
+// Note that if the jet has an associated cluster sequence that is no
+// longer valid, an error will be thrown (needed since it could be the
+// 1st check called after the enumeration of the pieces)
+bool Filter::_check_ca(const vector<PseudoJet> &all_pieces) const{
+  if (_subjet_def.jet_algorithm() != cambridge_algorithm) return false;
+
+  // check that the 1st of all the pieces (we're sure there is at
+  // least one) is coming from a C/A clustering. Then check that all
+  // the following pieces share the same ClusterSequence
+  const ClusterSequence * cs_ref = all_pieces[0].validated_cs();
+  if (cs_ref->jet_def().jet_algorithm() != cambridge_algorithm) return false;
+  for (unsigned int i=1; i<all_pieces.size(); i++)
+    if (all_pieces[i].validated_cs() != cs_ref) return false;
+
+  // check that the 1st peice has the same recombiner as the one used
+  // for the subjet clustering
+  // Note that since they share the same CS, checking the 2st one is enough
+  if (!cs_ref->jet_def().has_same_recombiner(_subjet_def)) return false;
+
+  // we also have to make sure that the filtering radius is not larger
+  // than any of the inter-pieces distance
+  double Rfilt2 = _subjet_def.R();
+  Rfilt2 *= Rfilt2;
+  for (unsigned int i=0; i<all_pieces.size()-1; i++){
+    for (unsigned int j=i+1; j<all_pieces.size(); j++){
+      if (all_pieces[i].squared_distance(all_pieces[j]) <  Rfilt2) return false;
+    }
+  }
+
+  return true;
+}
+
+//----------------------------------------------------------------------
+// FilterInterface implementation 
+//----------------------------------------------------------------------
+
 
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/tools/Filter.hh
===================================================================
--- external/fastjet/tools/Filter.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Filter.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_TOOLS_FILTER_HH__
 
-//FJSTARTHEADER
-// $Id: Filter.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: Filter.hh 2694 2011-11-14 22:27:51Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/ClusterSequence.hh>
@@ -100,5 +98,5 @@
   /// Note: this is just for derived classes
   ///       a Filter initialised through this constructor will not work!
-  Filter() : _Rfiltfunc(0), _initialised(false){};
+  Filter() : _Rfiltfunc(0){};
 
   /// define a filter that decomposes a jet into subjets using a
@@ -115,5 +113,5 @@
   /// ghosts
   Filter(JetDefinition subjet_def, Selector selector, double rho = 0.0) : 
-    _subjet_def(subjet_def), _Rfiltfunc(0), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {}
+    _subjet_def(subjet_def), _Rfiltfunc(0), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0) {}
 
   /// Same as the full constructor (see above) but just specifying the radius
@@ -123,5 +121,5 @@
   ///  \param Rfilt   the filtering radius
   Filter(double Rfilt, Selector selector, double rho = 0.0) : 
-    _Rfiltfunc(0), _Rfilt(Rfilt), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) { 
+    _Rfiltfunc(0), _Rfilt(Rfilt), _selector(selector), _rho(rho), _subtractor(0) { 
     if (_Rfilt<0)
       throw Error("Attempt to create a Filter with a negative filtering radius");
@@ -135,5 +133,5 @@
   ///  \param Rfilt_func   the filtering radius function of a PseudoJet
   Filter(FunctionOfPseudoJet<double> *Rfilt_func, Selector selector, double rho = 0.0) : 
-    _Rfiltfunc(Rfilt_func), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0), _initialised(true) {}
+    _Rfiltfunc(Rfilt_func), _Rfilt(-1), _selector(selector), _rho(rho), _subtractor(0) {}
 
   /// default dtor
@@ -142,9 +140,5 @@
   /// Set a subtractor that is applied to all individual subjets before
   /// deciding which ones to keep. It takes precedence over a non-zero rho.
-  void set_subtractor(const FunctionOfPseudoJet<PseudoJet> * subtractor_in) {_subtractor = subtractor_in;}
-
-  /// Set a subtractor that is applied to all individual subjets before
-  /// deciding which ones to keep. It takes precedence over a non-zero rho.
-  const FunctionOfPseudoJet<PseudoJet> * subtractor() const{ return _subtractor;}
+  void set_subtractor(const Transformer * subtractor) {_subtractor = subtractor;}
 
   /// runs the filtering and sets kept and rejected to be the jets of interest
@@ -165,20 +159,45 @@
   /// It also sets the subjet_def to be used in joining things (the bit of
   /// subjet def that is of interest for later is the recombiner).
-  ///
-  /// this returns true if teh optimisation trick for C/A reclustering has been used
-  bool _set_filtered_elements(const PseudoJet & jet,
-                              std::vector<PseudoJet> & filtered_elements) const;
+  void _set_filtered_elements(const PseudoJet & jet,
+                              std::vector<PseudoJet> & filtered_elements,
+                              JetDefinition & subjet_def,
+                              bool & discard_area) const;
   
+  /// set the filtered elements in the simple case of C/A+C/A
+  void _set_filtered_elements_cafilt(const PseudoJet & jet,
+                                     std::vector<PseudoJet> & filtered_elements,
+                                     double Rfilt) const;
+
+  /// set the filtered elements in the generic re-clustering case
+  void _set_filtered_elements_generic(const PseudoJet & jet, 
+                                      std::vector<PseudoJet> & filtered_elements,
+                                      const JetDefinition & subjet_def,
+				      bool do_areas) const;
+
   /// gather the information about what is kept and rejected under the
   /// form of a PseudoJet with a special ClusterSequenceInfo
-  ///
-  /// The last argument (ca_optimisation_used) should be true if the
-  /// optimisation trick for C/A reclustering has been used (in which
-  /// case some extra tests have to be run for non-explicit-ghost
-  /// areas)
   PseudoJet _finalise(const PseudoJet & jet, 
                       std::vector<PseudoJet> & kept, 
                       std::vector<PseudoJet> & rejected,
-		      bool ca_optimisation_used) const;
+                      const JetDefinition & subjet_def,
+                      const bool discard_area) const;
+
+  // a series of checks
+  //--------------------------------------------------------------------
+  /// get the pieces down to the fundamental pieces
+  bool _get_all_pieces(const PseudoJet &jet, std::vector<PseudoJet> &all_pieces) const;
+
+  /// get the common recombiner to all pieces (NULL if none)
+  const JetDefinition::Recombiner* _get_common_recombiner(const std::vector<PseudoJet> &all_pieces) const;
+
+  /// check if one can apply the simplified trick for C/A subjets
+  bool _check_ca(const std::vector<PseudoJet> &all_pieces) const;
+
+  /// check if the jet (or all its pieces) have explicit ghosts
+  /// (assuming the jet has area support
+  ///
+  /// Note that if the jet has an associated cluster sequence that is no
+  /// longer valid, an error will be thrown
+  bool _check_explicit_ghosts(const std::vector<PseudoJet> &all_pieces) const;
 
   bool _uses_subtraction() const {return (_subtractor || _rho != 0);}
@@ -190,7 +209,5 @@
   Selector _selector;  ///< the subjet selection criterium
   double _rho;                 ///< the background density (used for subtraction when possible)
-  const FunctionOfPseudoJet<PseudoJet> * _subtractor; ///< for subtracting bkgd density from subjets
-
-  bool _initialised;    ///< true when the Filter has been properly intialised
+  const Transformer * _subtractor; ///< for subtracting bkgd density from subjets
 };
 
Index: external/fastjet/tools/GridMedianBackgroundEstimator.cc
===================================================================
--- external/fastjet/tools/GridMedianBackgroundEstimator.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/GridMedianBackgroundEstimator.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: GridMedianBackgroundEstimator.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
@@ -34,5 +32,4 @@
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
 
 //----------------------------------------------------------------------
@@ -42,87 +39,15 @@
 // of the specified particles.
 void GridMedianBackgroundEstimator::set_particles(const vector<PseudoJet> & particles) {
-  vector<double> scalar_pt(n_tiles(), 0.0);
-
-#ifdef FASTJET_GMBGE_USEFJGRID
-  assert(all_tiles_equal_area());
-  //assert(n_good_tiles() == n_tiles()); // not needed now that we have an implementation
-#endif
-
-  // check if we need to compute only rho or both rho and rho_m
-  if (_enable_rho_m){
-    // both rho and rho_m
-    //
-    // this requires a few other variables
-    vector<double> scalar_dt(n_tiles(), 0.0);
-    double pt, dt;
-    for (unsigned i = 0; i < particles.size(); i++) {
-      int j = tile_index(particles[i]);
-      if (j >= 0){
-	pt = particles[i].pt();
-	dt = particles[i].mt() - pt;
-	if (_rescaling_class == 0){
-	  scalar_pt[j] += pt;
-	  scalar_dt[j] += dt;
-	} else {
-	  double r = (*_rescaling_class)(particles[i]);
-	  scalar_pt[j] += pt/r;
-	  scalar_dt[j] += dt/r;
-	}
-      }
-    }
-    // sort things for _percentile
-    sort(scalar_dt.begin(), scalar_dt.end());
-
-    // compute rho_m and sigma_m (see comment below for the
-    // normaliosation of sigma)
-    double p50 = _percentile(scalar_dt, 0.5);
-    _rho_m   = p50 / mean_tile_area();
-    _sigma_m = (p50-_percentile(scalar_dt, (1.0-0.6827)/2.0))/sqrt(mean_tile_area());
-  } else {
-    // only rho
-    //fill(_scalar_pt.begin(), _scalar_pt.end(), 0.0);
-    for (unsigned i = 0; i < particles.size(); i++) {
-      int j = tile_index(particles[i]);
-      if (j >= 0){
-	if (_rescaling_class == 0){
-	  scalar_pt[j] += particles[i].pt();
-	} else {
-	  scalar_pt[j] += particles[i].pt()/(*_rescaling_class)(particles[i]);
-	}
-      }
+  fill(_scalar_pt.begin(), _scalar_pt.end(), 0.0);
+  for (unsigned i = 0; i < particles.size(); i++) {
+    int j = igrid(particles[i]);
+    if (j >= 0){
+      if (_rescaling_class == 0)
+        _scalar_pt[j] += particles[i].perp();
+      else
+        _scalar_pt[j] += particles[i].perp()/(*_rescaling_class)(particles[i]);
     }
   }
-
-  // if there are some "bad" tiles, then we need to exclude them from
-  // the calculation of the median. We'll do this by condensing the
-  // scalar_pt vector down to just the values for the tiles that are
-  // good.
-  //
-  // tested answers look right in "issue" 2014-08-08-testing-rect-grid
-  if (n_good_tiles() != n_tiles()) {
-    int newn = 0;
-    for (unsigned i = 0; i < scalar_pt.size(); i++) {
-      if (tile_is_good(i)) {
-        // clang gets confused with the SharedPtr swap if we don't
-        // have std:: here
-        std::swap(scalar_pt[i],scalar_pt[newn]);
-        newn++;
-      }
-    }
-    scalar_pt.resize(newn);
-  }
-
-  // in all cases, carry on with the computation of rho
-  // 
-  // first sort
-  sort(scalar_pt.begin(), scalar_pt.end());
-
-  // then compute rho
-  //
-  // watch out: by definition, our sigma is the standard deviation of
-  // the pt density multiplied by the square root of the cell area
-  double p50 = _percentile(scalar_pt, 0.5);
-  _rho   = p50 / mean_tile_area();
-  _sigma = (p50-_percentile(scalar_pt, (1.0-0.6827)/2.0))/sqrt(mean_tile_area());
+  sort(_scalar_pt.begin(), _scalar_pt.end());
 
   _has_particles = true;
@@ -136,5 +61,5 @@
 double GridMedianBackgroundEstimator::rho() const {
   verify_particles_set();
-  return _rho;
+  return _percentile(_scalar_pt, 0.5) / _cell_area;
 }
 
@@ -146,5 +71,9 @@
 double GridMedianBackgroundEstimator::sigma() const{
   verify_particles_set();
-  return _sigma; 
+  // watch out: by definition, our sigma is the standard deviation of
+  // the pt density multiplied by the square root of the cell area
+  return (_percentile(_scalar_pt, 0.5) -
+          _percentile(_scalar_pt, (1.0-0.6827)/2.0)
+          )/sqrt(_cell_area);
 }
 
@@ -156,5 +85,5 @@
 // determination.
 double GridMedianBackgroundEstimator::rho(const PseudoJet & jet)  {
-  //verify_particles_set();
+  verify_particles_set();
   double rescaling = (_rescaling_class == 0) ? 1.0 : (*_rescaling_class)(jet);
   return rescaling*rho();
@@ -166,49 +95,7 @@
 // the position of a given jet. As for rho(jet), it is non-const.
 double GridMedianBackgroundEstimator::sigma(const PseudoJet & jet){
-  //verify_particles_set();
+  verify_particles_set();
   double rescaling = (_rescaling_class == 0) ? 1.0 : (*_rescaling_class)(jet);
   return rescaling*sigma();
-}
-
-//----------------------------------------------------------------------
-// returns rho_m (particle-masses contribution to the 4-vector density)
-double GridMedianBackgroundEstimator::rho_m() const {
-  if (! _enable_rho_m){
-    throw Error("GridMediamBackgroundEstimator: rho_m requested but rho_m calculation has been disabled.");
-  }
-  verify_particles_set();
-  return _rho_m;
-}
-
-
-//----------------------------------------------------------------------
-// returns sigma_m (particle-masses contribution to the 4-vector
-// density); must be multipled by sqrt(area) to get fluctuations
-// for a region of a given area.
-double GridMedianBackgroundEstimator::sigma_m() const{
-  if (! _enable_rho_m){
-    throw Error("GridMediamBackgroundEstimator: sigma_m requested but rho_m/sigma_m calculation has been disabled.");
-  }
-  verify_particles_set();
-  return _sigma_m; 
-}
-
-//----------------------------------------------------------------------
-// returns rho_m locally at the position of a given jet. As for
-// rho(jet), it is non-const.
-double GridMedianBackgroundEstimator::rho_m(const PseudoJet & jet)  {
-  //verify_particles_set();
-  double rescaling = (_rescaling_class == 0) ? 1.0 : (*_rescaling_class)(jet);
-  return rescaling*rho_m();
-}
-
-
-//----------------------------------------------------------------------
-// returns sigma_m locally at the position of a given jet. As for
-// rho(jet), it is non-const.
-double GridMedianBackgroundEstimator::sigma_m(const PseudoJet & jet){
-  //verify_particles_set();
-  double rescaling = (_rescaling_class == 0) ? 1.0 : (*_rescaling_class)(jet);
-  return rescaling*sigma_m();
 }
 
@@ -225,11 +112,6 @@
 string GridMedianBackgroundEstimator::description() const { 
   ostringstream desc;
-#ifdef FASTJET_GMBGE_USEFJGRID
-  desc << "GridMedianBackgroundEstimator, with " << RectangularGrid::description();
-#else
   desc << "GridMedianBackgroundEstimator, with grid extension |y| < " << _ymax 
-       << ", and grid cells of size dy x dphi = " << _dy << " x " << _dphi
-       << " (requested size = " << _requested_grid_spacing << ")";
-#endif
+       << " and requested grid spacing = " << _requested_grid_spacing;
   return desc.str();
 }       
@@ -262,5 +144,4 @@
 
 
-#ifndef FASTJET_GMBGE_USEFJGRID
 //----------------------------------------------------------------------
 // protected material
@@ -287,12 +168,12 @@
 
   _ntotal = _nphi * _ny;
-  //_scalar_pt.resize(_ntotal);
-  _tile_area = _dy * _dphi;
-}
-
-
-//----------------------------------------------------------------------
-// retrieve the grid tile index for a given PseudoJet
-int GridMedianBackgroundEstimator::tile_index(const PseudoJet & p) const {
+  _scalar_pt.resize(_ntotal);
+  _cell_area = _dy * _dphi;
+}
+
+
+//----------------------------------------------------------------------
+// retrieve the grid cell index for a given PseudoJet
+int GridMedianBackgroundEstimator::igrid(const PseudoJet & p) const {
   // directly taking int does not work for values between -1 and 0
   // so use floor instead
@@ -312,10 +193,8 @@
   if (iphi == _nphi) iphi = 0; // just in case of rounding errors
 
-  int index_res = iy*_nphi + iphi;
-  assert (index_res >= 0 && index_res < _ny*_nphi);
-  return index_res;
-}
-#endif // FASTJET_GMBGE_USEFJGRID
-
+  int igrid_res = iy*_nphi + iphi;
+  assert (igrid_res >= 0 && igrid_res < _ny*_nphi);
+  return igrid_res;
+}
 
 
Index: external/fastjet/tools/GridMedianBackgroundEstimator.hh
===================================================================
--- external/fastjet/tools/GridMedianBackgroundEstimator.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/GridMedianBackgroundEstimator.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __GRID_MEDIAN_BACKGROUND_ESTIMATOR_HH__
 
-//FJSTARTHEADER
-// $Id: GridMedianBackgroundEstimator.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: GridMedianBackgroundEstimator.hh 2580 2011-09-13 17:25:43Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,20 +28,8 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
 #include "fastjet/tools/BackgroundEstimatorBase.hh"
-
-// if defined then we'll use the RectangularGrid class
-//
-// (For FastJet 3.2, maybe remove the symbol and simply clean up the
-// code below to use exclusively the RectangularGrid)
-#define FASTJET_GMBGE_USEFJGRID
-
-#ifdef FASTJET_GMBGE_USEFJGRID
-#include "fastjet/RectangularGrid.hh"
-#endif
-
-
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
@@ -75,14 +61,8 @@
 ///   rho() [Without rescaling, they are identical]
 ///
-class GridMedianBackgroundEstimator : public BackgroundEstimatorBase
-#ifdef FASTJET_GMBGE_USEFJGRID
-                                    , public RectangularGrid
-#endif 
-{
-
+class GridMedianBackgroundEstimator : public BackgroundEstimatorBase {
 public:
   /// @name  constructors and destructors
   //\{
-#ifdef FASTJET_GMBGE_USEFJGRID
   //----------------------------------------------------------------
   ///   \param ymax   maximal absolute rapidity extent of the grid
@@ -91,43 +71,7 @@
   ///             periodicity in azimuthal angle (size, not area)
   GridMedianBackgroundEstimator(double ymax, double requested_grid_spacing) :
-    RectangularGrid(ymax, requested_grid_spacing),
-    _has_particles(false), _enable_rho_m(true) {} 
-
-  //----------------------------------------------------------------
-  /// Constructor based on a user's fully specified RectangularGrid
-  GridMedianBackgroundEstimator(const RectangularGrid & grid) :
-    RectangularGrid(grid),
-    _has_particles(false), _enable_rho_m(true) {
-    if (!RectangularGrid::is_initialised()) 
-      throw Error("attempt to construct GridMedianBackgroundEstimator with uninitialised RectangularGrid");
-  }    
-
-  //---------------------------------------------------------------- 
-  /// Constructor with the explicit parameters for the underlying
-  /// RectangularGrid
-  ///
-  ///  \param rapmin         the minimum rapidity extent of the grid
-  ///  \param rapmax         the maximum rapidity extent of the grid
-  ///  \param drap           the grid spacing in rapidity
-  ///  \param dphi           the grid spacing in azimuth
-  ///  \param tile_selector  optional (geometric) selector to specify 
-  ///                        which tiles are good; a tile is good if
-  ///                        a massless 4-vector at the center of the tile passes
-  ///                        the selection
-  GridMedianBackgroundEstimator(double rapmin_in, double rapmax_in, double drap_in, double dphi_in,
-                                Selector tile_selector = Selector()) :
-    RectangularGrid(rapmin_in, rapmax_in, drap_in, dphi_in, tile_selector),
-    _has_particles(false), _enable_rho_m(true) {}
-
-#else  // alternative in old framework where we didn't have the rectangular grid
-  GridMedianBackgroundEstimator(double ymax, double requested_grid_spacing) :
     _ymin(-ymax), _ymax(ymax), 
     _requested_grid_spacing(requested_grid_spacing),
-    _has_particles(false), _enable_rho_m(true)
-  {
-     setup_grid();
-  }
-#endif // FASTJET_GMBGE_USEFJGRID
-
+    _has_particles(false){setup_grid();}
   //\}
 
@@ -140,8 +84,4 @@
   /// of the specified particles.
   void set_particles(const std::vector<PseudoJet> & particles);
-
-  /// determine whether the automatic calculation of rho_m and sigma_m
-  /// is enabled (by default true)
-  void set_compute_rho_m(bool enable){ _enable_rho_m = enable;}
 
   //\}
@@ -174,32 +114,7 @@
   bool has_sigma() {return true;}
 
-  //-----------------------------------------------------------------
-  /// Returns rho_m, the purely longitudinal, particle-mass-induced
-  /// component of the background density per unit area
-  double rho_m() const;
-
-  /// returns sigma_m, a measure of the fluctuations in the purely
-  /// longitudinal, particle-mass-induced component of the background
-  /// density per unit area; must be multipled by sqrt(area) to get
-  /// fluctuations for a region of a given area.
-  double sigma_m() const;
-
-  /// Returns rho_m locally at the jet position. As for rho(jet), it is non-const.
-  double rho_m(const PseudoJet & jet);
-
-  /// Returns sigma_m locally at the jet position. As for rho(jet), it is non-const.
-  double sigma_m(const PseudoJet & jet);
-
-  /// Returns true if this background estimator has support for
-  /// determination of rho_m.
-  ///
-  /// Note that support for sigma_m is automatic if one has sigma and
-  /// rho_m support.
-  bool has_rho_m() const {return _enable_rho_m;}
-
-
   /// returns the area of the grid cells (all identical, but
   /// referred to as "mean" area for uniformity with JetMedianBGE).
-  double mean_area() const {return mean_tile_area();}
+  double mean_area() const {return _cell_area;}
   //\}
 
@@ -219,8 +134,4 @@
   /// Note that this has to be called BEFORE any attempt to do an
   /// actual computation
-  ///
-  /// The same profile will be used for both pt and mt (this is
-  /// probabaly a good approximation since the particle density
-  /// changes is what dominates the rapidity profile)
   virtual void set_rescaling_class(const FunctionOfPseudoJet<double> * rescaling_class);
 
@@ -238,35 +149,22 @@
 
 private:
-
-#ifndef FASTJET_GMBGE_USEFJGRID
-
   /// configure the grid
   void setup_grid();
 
   /// retrieve the grid cell index for a given PseudoJet
-  int tile_index(const PseudoJet & p) const;
-
-  // information about the grid
-  double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing, _tile_area;
-  int _ny, _nphi, _ntotal;
-
-  int n_tiles() const {return _ntotal;}
-  int n_good_tiles() const {return n_tiles();}
-  int tile_is_good(int /* itile */) const {return true;}
-
-  double mean_tile_area() const {return _tile_area;}
-#endif // FASTJET_GMBGE_USEFJGRID
-
+  int igrid(const PseudoJet & p) const;
 
   /// verify that particles have been set and throw an error if not
   void verify_particles_set() const;
 
+  // information about the grid
+  double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing, _cell_area;
+  int _ny, _nphi, _ntotal;
+
   // information abotu the event
-  //std::vector<double> _scalar_pt;
-  double _rho, _sigma, _rho_m, _sigma_m;
+  std::vector<double> _scalar_pt;
   bool _has_particles;
-  bool _enable_rho_m;
 
-  // various warnings to inform people of potential dangers
+  // various warnings to let people aware of potential dangers
   LimitedWarning _warning_rho_of_jet;
   LimitedWarning _warning_rescaling;
Index: external/fastjet/tools/JHTopTagger.cc
===================================================================
--- external/fastjet/tools/JHTopTagger.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/JHTopTagger.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: JHTopTagger.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/tools/JHTopTagger.hh>
@@ -70,5 +68,5 @@
   // warn if the jet has not been clustered with a Cambridge/Aachen
   // algorithm
-  if (jet.validated_cs()->jet_def().jet_algorithm() != cambridge_algorithm)
+  if (! jet.validated_cs()->jet_def().jet_algorithm() == cambridge_algorithm)
     _warnings_nonca.warn("JHTopTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk.");
 
Index: external/fastjet/tools/JHTopTagger.hh
===================================================================
--- external/fastjet/tools/JHTopTagger.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/JHTopTagger.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_JH_TOP_TAGGER_HH__
 
-//FJSTARTHEADER
-// $Id: JHTopTagger.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: JHTopTagger.hh 2689 2011-11-14 14:51:06Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 
Index: external/fastjet/tools/JetMedianBackgroundEstimator.cc
===================================================================
--- external/fastjet/tools/JetMedianBackgroundEstimator.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/JetMedianBackgroundEstimator.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: JetMedianBackgroundEstimator.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/tools/JetMedianBackgroundEstimator.hh"
@@ -33,5 +31,4 @@
 #include <fastjet/ClusterSequenceStructure.hh>
 #include <iostream>
-#include <sstream>
 
 FASTJET_BEGIN_NAMESPACE     // defined in fastjet/internal/base.hh
@@ -40,7 +37,5 @@
 
 double BackgroundJetScalarPtDensity::result(const PseudoJet & jet) const {
-  // do not include the ghosts in the list of constituents to have a
-  // correct behaviour when _pt_power is <= 0
-  std::vector<PseudoJet> constituents = (!SelectorIsPureGhost())(jet.constituents());
+  std::vector<PseudoJet> constituents = jet.constituents();
   double scalar_pt = 0;
   for (unsigned i = 0; i < constituents.size(); i++) {
@@ -48,12 +43,4 @@
   }
   return scalar_pt / jet.area();
-}
-
-
-std::string BackgroundJetScalarPtDensity::description() const {
-  ostringstream oss;
-  oss << "BackgroundScalarJetPtDensity";
-  if (_pt_power != 1.0) oss << " with pt_power = " << _pt_power;
-  return oss.str();
 }
 
@@ -85,5 +72,5 @@
                                          const JetDefinition &jet_def,
                                          const AreaDefinition &area_def)
-  : _rho_range(rho_range), _jet_def(jet_def), _area_def(area_def){
+  : _rho_range(rho_range), _jet_def(jet_def), _area_def(area_def) {
 
   // initialise things decently
@@ -194,5 +181,5 @@
 
   _csi = jets[0].structure_shared_ptr();
-  ClusterSequenceStructure * csi = dynamic_cast<ClusterSequenceStructure*>(_csi.get());
+  ClusterSequenceStructure * csi = dynamic_cast<ClusterSequenceStructure*>(_csi());
   const ClusterSequenceAreaBase * csab = csi->validated_csab();
 
@@ -274,56 +261,4 @@
 
 //----------------------------------------------------------------------
-// returns rho_m (particle-masses contribution to the 4-vector density)
-double JetMedianBackgroundEstimator::rho_m() const {
-  if (! has_rho_m()){
-    throw Error("JetMediamBackgroundEstimator: rho_m requested but rho_m calculation is disabled (either eplicitly or due to the presence of a jet density class).");
-  }
-  if (_rho_range.takes_reference())
-    throw Error("The background estimation is obtained from a selector that takes a reference jet. rho(PseudoJet) should be used in that case");
-  _recompute_if_needed();
-  return _rho_m;
-}
-
-
-//----------------------------------------------------------------------
-// returns sigma_m (particle-masses contribution to the 4-vector
-// density); must be multipled by sqrt(area) to get fluctuations
-// for a region of a given area.
-double JetMedianBackgroundEstimator::sigma_m() const{
-  if (! has_rho_m()){
-    throw Error("JetMediamBackgroundEstimator: sigma_m requested but rho_m/sigma_m calculation is disabled (either explicitly or due to the presence of a jet density class).");
-  }
-  if (_rho_range.takes_reference())
-    throw Error("The background estimation is obtained from a selector that takes a reference jet. rho(PseudoJet) should be used in that case");
-  _recompute_if_needed();
-  return _sigma_m;
-}
-
-//----------------------------------------------------------------------
-// returns rho_m locally at the position of a given jet. As for
-// rho(jet), it is non-const.
-double JetMedianBackgroundEstimator::rho_m(const PseudoJet & jet)  {
-  _recompute_if_needed(jet);
-  double our_rho = _rho_m;
-  if (_rescaling_class != 0) { 
-    our_rho *= (*_rescaling_class)(jet);
-  }
-  return our_rho;
-}
-
-
-//----------------------------------------------------------------------
-// returns sigma_m locally at the position of a given jet. As for
-// rho(jet), it is non-const.
-double JetMedianBackgroundEstimator::sigma_m(const PseudoJet & jet){
-  _recompute_if_needed(jet);
-  double our_sigma = _sigma_m;
-  if (_rescaling_class != 0) { 
-    our_sigma *= (*_rescaling_class)(jet);
-  }
-  return our_sigma;
-}
-
-//----------------------------------------------------------------------
 // configuring behaviour
 //----------------------------------------------------------------------
@@ -336,9 +271,6 @@
   set_provide_fj2_sigma(false);
 
-  _enable_rho_m = true;
-
   // reset the computed values
   _rho = _sigma = 0.0;
-  _rho_m = _sigma_m = 0.0;
   _n_jets_used = _n_empty_jets = 0;
   _empty_area = _mean_area = 0.0;
@@ -357,5 +289,5 @@
 // is used (as occurs also if this function is not called).
 void JetMedianBackgroundEstimator::set_jet_density_class(const FunctionOfPseudoJet<double> * jet_density_class_in) {
-  _warnings_preliminary.warn("JetMedianBackgroundEstimator::set_jet_density_class: density classes are still preliminary in FastJet 3.1. Their interface may differ in future releases (without guaranteeing backward compatibility). Note that since FastJet 3.1, rho_m and sigma_m are accessible direclty in JetMedianBackgroundEstimator and GridMedianBackgroundEstimator(with no need for a density class).");
+  _warnings_preliminary.warn("JetMedianBackgroundEstimator::set_jet_density_class: density classes are still preliminary in FastJet 3.0. Their interface may differ in future releases (without guaranteeing backward compatibility).");
   _jet_density_class = jet_density_class_in;
   _uptodate = false;
@@ -406,6 +338,5 @@
   // fill the vector of pt/area (or the quantity from the jet density class) 
   //  - in the range
-  vector<double> vector_for_median_pt;
-  vector<double> vector_for_median_dt;
+  vector<double> vector_for_median;
   double total_area  = 0.0;
   _n_jets_used = 0;
@@ -415,38 +346,20 @@
 
   // compute the pt/area for the selected jets
-  double median_input_pt, median_input_dt=0.0;
-  BackgroundJetPtMDensity m_density;
-  bool do_rho_m = has_rho_m();
   for (unsigned i = 0; i < selected_jets.size(); i++) {
     const PseudoJet & current_jet = selected_jets[i];
 
     double this_area = (_use_area_4vector) ? current_jet.area_4vector().perp() : current_jet.area(); 
+
     if (this_area>0){
-      // for the pt component, we either use pt or the user-provided
-      // density class
+      double median_input;
       if (_jet_density_class == 0) {
-        median_input_pt = current_jet.perp()/this_area;
+        median_input = current_jet.perp()/this_area;
       } else {
-        median_input_pt = (*_jet_density_class)(current_jet);
+        median_input = (*_jet_density_class)(current_jet);
       }
-
-      // handle the rho_m part if requested
-      // note that we're using the scalar area as a normalisation inside the
-      // density class!
-      if (do_rho_m) 
-	median_input_dt = m_density(current_jet);
-    
-      // perform rescaling if needed
       if (_rescaling_class != 0) {
-	double resc = (*_rescaling_class)(current_jet);;
-        median_input_pt /= resc;
-        median_input_dt /= resc;
+        median_input /= (*_rescaling_class)(current_jet);
       }
-      
-      // store the result for future computation of the median
-      vector_for_median_pt.push_back(median_input_pt);
-      if (do_rho_m) 
-	vector_for_median_dt.push_back(median_input_dt);
-
+      vector_for_median.push_back(median_input);
       total_area  += this_area;
       _n_jets_used++;
@@ -454,12 +367,11 @@
       _warnings_zero_area.warn("JetMedianBackgroundEstimator::_compute(...): discarded jet with zero area. Zero-area jets may be due to (i) too large a ghost area (ii) a jet being outside the ghost range (iii) the computation not being done using an appropriate algorithm (kt;C/A).");
     }
+      
   }
   
   // there is nothing inside our region, so answer will always be zero
-  if (vector_for_median_pt.size() == 0) {
+  if (vector_for_median.size() == 0) {
     _rho        = 0.0;
     _sigma      = 0.0;
-    _rho_m      = 0.0;
-    _sigma_m    = 0.0;
     _mean_area  = 0.0;
     return;
@@ -467,5 +379,5 @@
 
   // determine the number of empty jets
-  const ClusterSequenceAreaBase * csab = (dynamic_cast<ClusterSequenceStructure*>(_csi.get()))->validated_csab();
+  const ClusterSequenceAreaBase * csab = (dynamic_cast<ClusterSequenceStructure*>(_csi()))->validated_csab();
   if (csab->has_explicit_ghosts()) {
     _empty_area = 0.0;
@@ -480,5 +392,5 @@
 
   double stand_dev;
-  _median_and_stddev(vector_for_median_pt, _n_empty_jets, _rho, stand_dev, 
+  _median_and_stddev(vector_for_median, _n_empty_jets, _rho, stand_dev, 
                      _provide_fj2_sigma);
 
@@ -487,11 +399,4 @@
   _sigma      = stand_dev * sqrt(_mean_area);
 
-  // compute the rho_m part now
-  if (do_rho_m){
-    _median_and_stddev(vector_for_median_dt, _n_empty_jets, _rho_m, stand_dev, 
-		       _provide_fj2_sigma);
-    _sigma_m = stand_dev * sqrt(_mean_area);
-  }
-
   // record that the computation has been performed  
   _uptodate = true;
@@ -503,9 +408,9 @@
 // throw an error otherwise
 void JetMedianBackgroundEstimator::_check_csa_alive() const{
-  ClusterSequenceStructure* csa = dynamic_cast<ClusterSequenceStructure*>(_csi.get());
+  ClusterSequenceStructure* csa = dynamic_cast<ClusterSequenceStructure*>(_csi());
   if (csa == 0) {
     throw Error("JetMedianBackgroundEstimator: there is no cluster sequence associated with the JetMedianBackgroundEstimator");
   }
-  if (! dynamic_cast<ClusterSequenceStructure*>(_csi.get())->has_associated_cluster_sequence())
+  if (! dynamic_cast<ClusterSequenceStructure*>(_csi())->has_associated_cluster_sequence())
     throw Error("JetMedianBackgroundEstimator: modifications are no longer possible as the underlying ClusterSequence has gone out of scope");
 }
@@ -521,5 +426,5 @@
   // cluster sequence
   if (_jet_def.jet_algorithm() == undefined_jet_algorithm){
-    const ClusterSequence * cs = dynamic_cast<ClusterSequenceStructure*>(_csi.get())->validated_cs();
+    const ClusterSequence * cs = dynamic_cast<ClusterSequenceStructure*>(_csi())->validated_cs();
     jet_def = &(cs->jet_def());
   }
@@ -534,4 +439,5 @@
 
 
+
 FASTJET_END_NAMESPACE
 
Index: external/fastjet/tools/JetMedianBackgroundEstimator.hh
===================================================================
--- external/fastjet/tools/JetMedianBackgroundEstimator.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/JetMedianBackgroundEstimator.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_BACKGROUND_ESTIMATOR_HH__
 
-//FJSTARTHEADER
-// $Id: JetMedianBackgroundEstimator.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: JetMedianBackgroundEstimator.hh 2689 2011-11-14 14:51:06Z soyez $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/ClusterSequenceAreaBase.hh>
@@ -123,6 +121,5 @@
   ///
   JetMedianBackgroundEstimator(const Selector &rho_range = SelectorIdentity())
-    : _rho_range(rho_range), _jet_def(JetDefinition()),
-      _enable_rho_m(true){ reset(); }
+    : _rho_range(rho_range), _jet_def(JetDefinition()) { reset(); }
   
 
@@ -171,8 +168,4 @@
   }
 
-  /// determine whether the automatic calculation of rho_m and sigma_m
-  /// is enabled (by default true)
-  void set_compute_rho_m(bool enable){ _enable_rho_m = enable;}
-
   //\}
 
@@ -208,32 +201,4 @@
   virtual bool has_sigma() {return true;}
 
-  //----------------------------------------------------------------
-  // now do the same thing for rho_m and sigma_m
-
-  /// returns rho_m, the purely longitudinal, particle-mass-induced
-  /// component of the background density per unit area
-  virtual double rho_m() const;
-
-  /// returns sigma_m, a measure of the fluctuations in the purely
-  /// longitudinal, particle-mass-induced component of the background
-  /// density per unit area; must be multipled by sqrt(area) to get
-  /// fluctuations for a region of a given area.
-  virtual double sigma_m() const;
-
-  /// Returns rho_m locally at the jet position. As for rho(jet), it is non-const.
-  virtual double rho_m(const PseudoJet & /*jet*/);
-
-  /// Returns sigma_m locally at the jet position. As for rho(jet), it is non-const.
-  virtual double sigma_m(const PseudoJet & /*jet*/);
-
-  /// Returns true if this background estimator has support for
-  /// determination of rho_m.
-  ///
-  /// In te presence of a density class, support for rho_m is
-  /// automatically disabled
-  ///
-  /// Note that support for sigma_m is automatic is one has sigma and
-  /// rho_m support.
-  virtual bool has_rho_m() const {return _enable_rho_m && (_jet_density_class == 0);}
   //\}
   
@@ -243,9 +208,6 @@
   /// Returns the mean area of the jets used to actually compute the
   /// background properties in the last call of rho() or sigma()
-  /// If the configuration has changed in the meantime, throw an error.
   double mean_area() const{
-    if (!_uptodate)
-      throw Error("JetMedianBackgroundEstimator::mean_area(): one may not retrieve information about the last call to rho() or sigma() when the configuration has changed in the meantime.");
-    //_recompute_if_needed();
+    _recompute_if_needed();
     return _mean_area;
   }
@@ -253,23 +215,7 @@
   /// returns the number of jets used to actually compute the
   /// background properties in the last call of rho() or sigma()
-  /// If the configuration has changed in the meantime, throw an error.
   unsigned int n_jets_used() const{
-    if (!_uptodate)
-      throw Error("JetMedianBackgroundEstimator::n_jets_used(): one may not retrieve information about the last call to rho() or sigma() when the configuration has changed in the meantime.");
-    //_recompute_if_needed();
+    _recompute_if_needed();
     return _n_jets_used;
-  }
-
-  /// returns the jets used to actually compute the background
-  /// properties
-  std::vector<PseudoJet> jets_used() const{
-    if (!_uptodate) throw Error("JetMedianBackgroundEstimator::n_jets_used(): one may not retrieve information about the last call to rho() or sigma() when the configuration has changed in the meantime.");
-    _check_csa_alive();
-    std::vector<PseudoJet> tmp_jets = _rho_range(_included_jets);
-    std::vector<PseudoJet> used_jets;
-    for (unsigned int i=0; i<tmp_jets.size(); i++){
-      if (tmp_jets[i].area()>0) used_jets.push_back(tmp_jets[i]);
-    }
-    return used_jets;
   }
 
@@ -277,5 +223,4 @@
   /// the selector) that is not occupied by jets. The value is that
   /// for the last call of rho() or sigma()
-  /// If the configuration has changed in the meantime, throw an error.
   ///
   /// The answer is defined to be zero if the area calculation
@@ -289,7 +234,5 @@
   /// call to the ClusterSequenceAreaBase function.
   double empty_area() const{
-    if (!_uptodate)
-      throw Error("JetMedianBackgroundEstimator::empty_area(): one may not retrieve information about the last call to rho() or sigma() when the configuration has changed in the meantime.");
-    //_recompute_if_needed();
+    _recompute_if_needed();
     return _empty_area;
   }
@@ -298,5 +241,4 @@
   /// background properties. The value is that for the last call of
   /// rho() or sigma().
-  /// If the configuration has changed in the meantime, throw an error.
   ///
   /// If the area has explicit ghosts the result is zero; for active
@@ -308,7 +250,5 @@
   /// call to the ClusterSequenceAreaBase function.
   double n_empty_jets() const{
-    if (!_uptodate)
-      throw Error("JetMedianBackgroundEstimator::n_empty_jets(): one may not retrieve information about the last call to rho() or sigma() when the configuration has changed in the meantime.");
-    //_recompute_if_needed();
+    _recompute_if_needed();
     return _n_empty_jets;
   }
@@ -421,5 +361,5 @@
   /// Issue a warning otherwise
   void _check_jet_alg_good_for_median() const;
-
+  
   // the basic parameters of this class (passed through the variou ctors)
   Selector _rho_range;                   ///< range to compute the background in
@@ -428,16 +368,13 @@
   std::vector<PseudoJet> _included_jets; ///< jets to be used
   
-  // the tunable parameters of the class
+  // the tunable aprameters of the class
   bool _use_area_4vector;
   bool _provide_fj2_sigma;
   const FunctionOfPseudoJet<double> * _jet_density_class;
   //SharedPtr<BackgroundRescalingBase> _rescaling_class_sharedptr;
-  bool _enable_rho_m;
   
   // the actual results of the computation
   mutable double _rho;               ///< background estimated density per unit area
   mutable double _sigma;             ///< background estimated fluctuations
-  mutable double _rho_m;             ///< "mass" background estimated density per unit area
-  mutable double _sigma_m;           ///< "mass" background estimated fluctuations
   mutable double _mean_area;         ///< mean area of the jets used to estimate the background
   mutable unsigned int _n_jets_used; ///< number of jets used to estimate the background
@@ -492,5 +429,5 @@
   virtual double result(const PseudoJet & jet) const;
 
-  virtual std::string description() const;
+  virtual std::string description() const {return "BackgroundScalarJetPtDensity";}
 
 private:
Index: external/fastjet/tools/MassDropTagger.cc
===================================================================
--- external/fastjet/tools/MassDropTagger.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/MassDropTagger.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: MassDropTagger.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/tools/MassDropTagger.hh>
@@ -36,5 +34,4 @@
 
 LimitedWarning MassDropTagger::_warnings_nonca;
-LimitedWarning MassDropTagger::_negative_mass_warning;
 
 using namespace std;
@@ -61,5 +58,5 @@
   // clustering
   if ((! j.has_associated_cluster_sequence()) ||
-      (j.validated_cs()->jet_def().jet_algorithm() != cambridge_algorithm))
+      (! j.validated_cs()->jet_def().jet_algorithm() == cambridge_algorithm))
     _warnings_nonca.warn("MassDropTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk.");
 
@@ -72,9 +69,4 @@
   // the case
   while ((had_parents = j.has_parents(j1,j2))) {
-    if (j.m2() <= 0) {
-      _negative_mass_warning.warn(
-           "MassDropTagger: parent (sub)jet has mass^2<=0; returning null jet");
-      return PseudoJet();
-    }
     // make parent1 the more massive jet
     if (j1.m2() < j2.m2()) std::swap(j1,j2);
@@ -97,6 +89,7 @@
   PseudoJet result_local = j;
   MassDropTaggerStructure * s = new MassDropTaggerStructure(result_local);
-  s->_mu = j1.m() / j.m();
-  s->_y  = j1.kt_distance(j2)/j.m2();
+//  s->_original_jet = jet;
+  s->_mu = (j.m2()!=0.0) ? sqrt(j1.m2()/j.m2()) : 0.0;
+  s->_y  = (j.m2()!=0.0) ? j1.kt_distance(j2)/j.m2() : 0.0;
 
   result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
Index: external/fastjet/tools/MassDropTagger.hh
===================================================================
--- external/fastjet/tools/MassDropTagger.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/MassDropTagger.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: MassDropTagger.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: MassDropTagger.hh 2731 2011-11-21 12:15:21Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_MASS_DROP_TAGGER_HH__
@@ -110,5 +108,4 @@
   double _mu, _ycut;
   static LimitedWarning _warnings_nonca;
-  static LimitedWarning _negative_mass_warning;
 };
 
Index: external/fastjet/tools/Pruner.cc
===================================================================
--- external/fastjet/tools/Pruner.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Pruner.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Pruner.cc 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id$
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/tools/Pruner.hh"
@@ -49,10 +47,10 @@
 //----------------------------------------------------------------------
 // alternative (dynamic) ctor
-//  \param jet_def     the jet definition for the internal clustering
+//  \param jet_def the jet definition for the internal clustering
 //  \param zcut_dyn    dynamic pt-fraction cut in the pruning
 //  \param Rcut_dyn    dynamic angular distance cut in the pruning
 Pruner::Pruner(const JetDefinition &jet_def, 
-         const FunctionOfPseudoJet<double> *zcut_dyn,
-         const FunctionOfPseudoJet<double> *Rcut_dyn)
+         FunctionOfPseudoJet<double> *zcut_dyn,
+         FunctionOfPseudoJet<double> *Rcut_dyn)
   : _jet_def(jet_def), _zcut(0), _Rcut_factor(0),
     _zcut_dyn(zcut_dyn), _Rcut_dyn(Rcut_dyn), _get_recombiner_from_jet(false)  {
@@ -76,17 +74,25 @@
   double zcut = (_zcut_dyn) ? (*_zcut_dyn)(jet) : _zcut;
   PruningPlugin * pruning_plugin;
-
   // for some constructors, we get the recombiner from the 
-  // input jet -- some acrobatics are needed
+  // input jet -- some acrobatics are needed (see plans for FJ3.1
+  // for a hopefully better solution).
   if (_get_recombiner_from_jet) {
-    JetDefinition jet_def = _jet_def;
-
-    // if all the pieces have a shared recombiner, we'll use that
-    // one. Otherwise, use the one from _jet_def as a fallback.
-    JetDefinition jet_def_for_recombiner;
-    if (_check_common_recombiner(jet, jet_def_for_recombiner)){
-      jet_def.set_recombiner(jet_def_for_recombiner);
-    }
-    pruning_plugin = new PruningPlugin(jet_def, zcut, Rcut);
+    const JetDefinition::Recombiner * common_recombiner = 
+                                              _get_common_recombiner(jet);
+    if (common_recombiner) {
+      JetDefinition jet_def = _jet_def;
+      if (typeid(*common_recombiner) == typeid(JetDefinition::DefaultRecombiner)) {
+        RecombinationScheme scheme = 
+          static_cast<const JetDefinition::DefaultRecombiner *>(common_recombiner)->scheme();
+        jet_def.set_recombination_scheme(scheme);
+      } else {
+        jet_def.set_recombiner(common_recombiner);
+      }
+      pruning_plugin = new PruningPlugin(jet_def, zcut, Rcut);
+    } else {
+      // if there wasn't a common recombiner, we just use the default
+      // recombiner that was in _jet_def
+      pruning_plugin = new PruningPlugin(_jet_def, zcut, Rcut);
+    }
   } else {
     pruning_plugin = new PruningPlugin(_jet_def, zcut, Rcut);
@@ -116,6 +122,4 @@
   PseudoJet result_local = SelectorNHardest(1)(cs->inclusive_jets())[0];
   PrunerStructure * s = new PrunerStructure(result_local);
-  s->_Rcut = Rcut;
-  s->_zcut = zcut;
   result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
   
@@ -151,36 +155,31 @@
 }
 
-// see if there is a common recombiner among the pieces; if there is
-// return true and set jet_def_for_recombiner so that the recombiner
-// can be taken from that JetDefinition. Otherwise, return
-// false. 'assigned' is initially false; when true, each time we meet
-// a new jet definition, we'll check it shares the same recombiner as
-// jet_def_for_recombiner.
-bool Pruner::_check_common_recombiner(const PseudoJet &jet, 
-				      JetDefinition &jet_def_for_recombiner,
-				      bool assigned) const{
-  if (jet.has_associated_cluster_sequence()){
-    // if the jet def for recombination has already been assigned, check if we have the same
-    if (assigned)
-      return jet.validated_cs()->jet_def().has_same_recombiner(jet_def_for_recombiner);
-
-    // otherwise, assign it.
-    jet_def_for_recombiner = jet.validated_cs()->jet_def();
-    assigned = true;
-    return true;
-  }
+// see if there is a common recombiner among the pieces; if there
+// is return a pointer to it; otherwise, return NULL.
+// 
+// NB: this way of doing things is not ideal, because quite some work
+//     is needed to get a correct handling of the final recombiner
+//     (e.g. default v. non-default). In future add
+//     set_recombiner(jet_def) to JetDefinition, maybe also add
+//     an invalid_scheme to the default recombiner and then 
+//     do all the work below directly with a JetDefinition directly
+//     together with JD::has_same_recombiner(...)
+const JetDefinition::Recombiner * Pruner::_get_common_recombiner(const PseudoJet &jet) const{
+  if (jet.has_associated_cluster_sequence())
+    return jet.validated_cs()->jet_def().recombiner();
 
   // if the jet has pieces, recurse in the pieces
   if (jet.has_pieces()){
     vector<PseudoJet> pieces = jet.pieces();
-    if (pieces.size() == 0) return false;
-    for (unsigned int i=0;i<pieces.size(); i++)
-      if (!_check_common_recombiner(pieces[i], jet_def_for_recombiner, assigned)) return false;
+    if (pieces.size() == 0) return 0;
+    const JetDefinition::Recombiner * reco = _get_common_recombiner(pieces[0]);
+    for (unsigned int i=1;i<pieces.size(); i++)
+      if (_get_common_recombiner(pieces[i]) != reco) return 0;
     // never returned false, so we're OK.
-    return true;
+    return reco;
   }
 
   // return false for any other (unknown) structure
-  return false;
+  return 0;
 }
 
Index: external/fastjet/tools/Pruner.hh
===================================================================
--- external/fastjet/tools/Pruner.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Pruner.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_TOOLS_PRUNER_HH__
 
-//FJSTARTHEADER
-// $Id: Pruner.hh 4442 2020-05-05 07:50:11Z soyez $
-//
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+//STARTHEADER
+// $Id: Pruner.hh 2616 2011-09-30 18:03:40Z salam $
+//
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/ClusterSequence.hh"
@@ -45,9 +43,4 @@
 class PruningRecombiner;
 class PruningPlugin;
-
-// This tells third-party code that the pruner structure 
-// stores Rcut info; the alternative is for the user to 
-// get the information from the version number
-#define FASTJET_PRUNER_STRUCTURE_STORES_RCUT
 
 //----------------------------------------------------------------------
@@ -142,6 +135,6 @@
   ///  \param Rcut_dyn    dynamic angular distance cut in the pruning
   Pruner(const JetDefinition &jet_def, 
-         const FunctionOfPseudoJet<double> *zcut_dyn,
-         const FunctionOfPseudoJet<double> *Rcut_dyn);
+         FunctionOfPseudoJet<double> *zcut_dyn,
+         FunctionOfPseudoJet<double> *Rcut_dyn);
 
   /// action on a single jet
@@ -159,19 +152,13 @@
   bool _check_explicit_ghosts(const PseudoJet &jet) const;
 
-  /// see if there is a common recombiner among the pieces; if there
-  /// is return true and set jet_def_for_recombiner so that the
-  /// recombiner can be taken from that JetDefinition. Otherwise,
-  /// return false. 'assigned' is initially false; when true, each
-  /// time we meet a new jet definition, we'll check it shares the
-  /// same recombiner as jet_def_for_recombiner.
-  bool _check_common_recombiner(const PseudoJet &jet, 
-				JetDefinition &jet_def_for_recombiner,
-				bool assigned=false) const;
+  /// return a pointer to a "common" recombiner if there is one,
+  /// alternatively a null pointer.
+  const JetDefinition::Recombiner * _get_common_recombiner(const PseudoJet &jet) const;
 
   JetDefinition _jet_def; ///< the internal jet definition
   double _zcut;        	  ///< the pt-fraction cut
   double _Rcut_factor;    ///< the angular separation cut factor
-  const FunctionOfPseudoJet<double> *_zcut_dyn; ///< dynamic zcut
-  const FunctionOfPseudoJet<double> *_Rcut_dyn; ///< dynamic Rcut
+  FunctionOfPseudoJet<double> *_zcut_dyn; ///< dynamic zcut
+  FunctionOfPseudoJet<double> *_Rcut_dyn; ///< dynamic Rcut
   bool   _get_recombiner_from_jet; ///< true for minimal constructor,
                                    ///< causes recombiner to be set equal 
@@ -207,15 +194,6 @@
   std::vector<PseudoJet> extra_jets() const;
 
-  /// return the value of Rcut that was used for this specific pruning.
-  double Rcut() const {return _Rcut;}
-
-  /// return the value of Rcut that was used for this specific pruning.
-  double zcut() const {return _zcut;}
-
 protected:
   friend class Pruner; ///< to allow setting the internal information
-
-private:
-  double _Rcut, _zcut;
 };
 
Index: external/fastjet/tools/Recluster.cc
===================================================================
--- external/fastjet/tools/Recluster.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,417 +1,0 @@
-// $Id: Recluster.cc 3629 2014-08-14 17:21:15Z salam $
-//
-// Copyright (c) 2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet contrib.
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include "fastjet/tools/Recluster.hh"
-#include "fastjet/CompositeJetStructure.hh"
-#include <fastjet/ClusterSequenceActiveAreaExplicitGhosts.hh>
-#include <sstream>
-#include <typeinfo>
-
-using namespace std;
-
-// Comments:
-//
-//  - If the jet comes from a C/A clustering (or is a composite jet
-//    made of C/A clusterings) and we recluster it with a C/A
-//    algorithm, we just use exclusive jets instead of doing the
-//    clustering explicitly. In this specific case, we need to make
-//    sure that all the pieces share the same cluster sequence.
-//
-//  - If the recombiner has to be taken from the original jet and that
-//    jet is composite, we need to check that all the pieces were
-//    obtained with the same recombiner.
-//
-//  - Note that a preliminary version of this code has been
-//    distributed in the RecursiveTools fastjet-contrib. The present
-//    version has a few minor fixed
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-LimitedWarning Recluster::_explicit_ghost_warning;
-
-// ctor
-Recluster::Recluster(JetAlgorithm new_jet_alg, double new_jet_radius, Keep keep_in)
-  : _new_jet_def(JetDefinition(new_jet_alg, new_jet_radius)), 
-    _acquire_recombiner(true), _keep(keep_in), _cambridge_optimisation_enabled(true){}
-
-Recluster::Recluster(JetAlgorithm new_jet_alg, Keep keep_in)
-    : _acquire_recombiner(true), _keep(keep_in), _cambridge_optimisation_enabled(true){
-  switch (JetDefinition::n_parameters_for_algorithm(new_jet_alg)){
-  case 0: _new_jet_def = JetDefinition(new_jet_alg); break;
-  case 1: _new_jet_def = JetDefinition(new_jet_alg, JetDefinition::max_allowable_R); break;
-  default:
-    throw Error("Recluster(): tried to construct specifying only a jet algorithm ("+JetDefinition::algorithm_description(new_jet_alg)+") which takes more than 1 parameter");
-  };
-}
-
-
-// class description
-string Recluster::description() const {
-  ostringstream ostr;
-  ostr << "Recluster with new_jet_def = ";
-  if (_acquire_recombiner){
-    ostr << _new_jet_def.description_no_recombiner();
-    ostr << ", using a recombiner obtained from the jet being reclustered";
-  } else {
-    ostr << _new_jet_def.description();
-  }
-
-  if (_keep == keep_only_hardest)
-    ostr << " and keeping the hardest inclusive jet";
-  else
-    ostr << " and joining all inclusive jets into a composite jet";
-
-  return ostr.str();
-}
-
-
-// the main piece of code that performs the reclustering
-PseudoJet Recluster::result(const PseudoJet &jet) const {
-  // get the incljets and the exact jet definition that has been used
-  // to get them
-  vector<PseudoJet> incljets;
-  bool ca_optimised = get_new_jets_and_def(jet, incljets);
-
-  return generate_output_jet(incljets, ca_optimised);
-}
-
-
-// a lower-level method that does the actual work of reclustering the
-// input jet. The resulting incljets are stored in output_jets and the
-// jet definition that has been used can be deduced from their
-// associated ClusterSequence
-//
-//  - input_jet       the (input) jet that one wants to recluster
-//  - output_jets     incljets resulting from the new clustering
-//
-// returns true if the C/A optimisation has been used (this means
-// that generate_output_jet will watch out for non-explicit-ghost
-// areas that might be leftover)
-bool Recluster::get_new_jets_and_def(const PseudoJet & input_jet, 
-                                     vector<PseudoJet> & output_jets) const{
-  // generic sanity checks
-  //-------------------------------------------------------------------
-  // make sure that the jet has constituents
-  if (! input_jet.has_constituents())
-    throw Error("Recluster can only be applied on jets having constituents");
-
-  // tests particular to certain configurations
-  //-------------------------------------------------------------------
-
-  // for a whole variety of tests, we shall need the "recursive"
-  // pieces of the jet (the jet itself or recursing down to its most
-  // fundamental pieces). So we do compute these once and for all.
-  //
-  // Note that the pieces are always needed (either for C/A or for the
-  // area checks)
-  vector<PseudoJet> all_pieces;
-  if ((!_get_all_pieces(input_jet, all_pieces)) || (all_pieces.size()==0)){
-    throw Error("Recluster: failed to retrieve all the pieces composing the jet.");
-  }
-
-  // decide which jet definition to use
-  //-------------------------------------------------------------------
-  JetDefinition new_jet_def = _new_jet_def;
-  if (_acquire_recombiner){
-    _acquire_recombiner_from_pieces(all_pieces, new_jet_def);
-  }
-
-  // the vector that will ultimately hold the incljets
-  output_jets.clear();
-
-  // check if we can apply the simplification for C/A jets reclustered
-  // with C/A
-  //
-  // we apply C/A clustering iff
-  //  - the requested new_jet_def is C/A
-  //  - the jet is either directly coming from C/A or if it is a
-  //    superposition of C/A jets from the same cluster sequence
-  //  - the pieces agree with the recombination scheme of new_jet_def
-  //
-  // In this case area support will be automatically inherited so we
-  // can only worry about this later
-  // -------------------------------------------------------------------
-  if (_check_ca(all_pieces, new_jet_def)){
-    _recluster_ca(all_pieces, output_jets, new_jet_def.R());
-    output_jets = sorted_by_pt(output_jets);
-    return true;
-  }
-
-  // decide if area support has to be kept
-  //-------------------------------------------------------------------
-  bool include_area_support = input_jet.has_area();
-  if ((include_area_support) &&  (!_check_explicit_ghosts(all_pieces))){
-    _explicit_ghost_warning.warn("Recluster: the original cluster sequence is lacking explicit ghosts; area support will no longer be available after re-clustering");
-    include_area_support = false;
-  }
-
-  // extract the incljets
-  //-------------------------------------------------------------------
-  _recluster_generic(input_jet, output_jets, new_jet_def, include_area_support);
-  output_jets = sorted_by_pt(output_jets);
-
-  return false;
-}
-
-// given a set of incljets and a jet definition used, create the
-// resulting PseudoJet
-PseudoJet Recluster::generate_output_jet(std::vector<PseudoJet> & incljets, 
-                                         bool ca_optimisation_used) const{
-  // first handle the case where we only need to keep the hardest incljet
-  if (_keep == keep_only_hardest) {
-    if (incljets.size() > 0) {
-      return incljets[0];
-    } else {
-      return PseudoJet();
-    }
-  }
-
-  // now the case where all incljets have to be joined
-
-  // safekeeper
-  if (incljets.size()==0) return join(incljets);
-
-  PseudoJet reclustered = join(incljets, 
-			       *(incljets[0].associated_cluster_sequence()->jet_def().recombiner()));
-
-  // if we've used C/A optimisation, we need to get rid of the area
-  // information if it comes from a non-explicit-ghost clustering.
-  // (because in that case it can be erroneous due to the lack of
-  // information about empty areas)
-  if (ca_optimisation_used){
-    if (reclustered.has_area() &&
-        (incljets.size() > 0) &&
-        (! incljets[0].validated_csab()->has_explicit_ghosts())){
-      CompositeJetStructure *css = dynamic_cast<CompositeJetStructure *>(reclustered.structure_non_const_ptr());
-      assert(css);
-      css->discard_area();
-    }
-  }
-  
-  return reclustered;
-}
-
-//----------------------------------------------------------------------
-// the parts that really do the reclustering
-//----------------------------------------------------------------------
-
-// get the subjets in the simple case of C/A+C/A
-void Recluster::_recluster_ca(const vector<PseudoJet> & all_pieces, 
-                              vector<PseudoJet> & subjets, 
-                              double Rfilt) const{
-  subjets.clear();
-
-  // each individual piece should have a C/A cluster sequence
-  // associated to it. So a simple loop would do the job
-  for (vector<PseudoJet>::const_iterator piece_it = all_pieces.begin(); 
-       piece_it!=all_pieces.end(); piece_it++){
-    // just extract the exclusive subjets of 'jet'
-    const ClusterSequence *cs = piece_it->associated_cluster_sequence(); 
-    vector<PseudoJet> local_subjets;
-
-    double dcut = Rfilt / cs->jet_def().R();
-    if (dcut>=1.0){
-      // remember that in this case all the pairwise interpiece
-      // distances are supposed to be larger than Rfilt (this was
-      // tested in _check_ca), which means that they can never
-      // recombine with each other.
-      local_subjets.push_back(*piece_it);
-    } else {
-      local_subjets = piece_it->exclusive_subjets(dcut*dcut);
-    }
-
-    copy(local_subjets.begin(), local_subjets.end(), back_inserter(subjets));
-  }
-}
-
-
-// perform the reclustering itself for all cases where the "C/A trick"
-// does not apply
-void Recluster::_recluster_generic(const PseudoJet & jet, 
-                                   vector<PseudoJet> & incljets,
-                                   const JetDefinition & new_jet_def,
-                                   bool do_areas) const{
-  // create a new, internal, ClusterSequence from the jet constituents
-  // get the incljets directly from there
-  //
-  // If the jet has area support then we separate the ghosts from the
-  // "regular" particles so the incljets will also have area
-  // support. Note that we do this regardless of whether rho is zero
-  // or not.
-  //
-  // Note that to be able to separate the ghosts, one needs explicit
-  // ghosts!!
-  // ---------------------------------------------------------------
-  if (do_areas){
-    //vector<PseudoJet> all_constituents = jet.constituents();
-    vector<PseudoJet> regular_constituents, ghosts;  
-    SelectorIsPureGhost().sift(jet.constituents(), ghosts, regular_constituents);
-
-    // figure out the ghost area from the 1st ghost (if none, any value
-    // would probably do as the area will be 0 and subtraction will have
-    // no effect!)
-    double ghost_area = (ghosts.size()) ? ghosts[0].area() : 0.01;
-    ClusterSequenceActiveAreaExplicitGhosts * csa
-      = new ClusterSequenceActiveAreaExplicitGhosts(regular_constituents, 
-                                                    new_jet_def, 
-                                                    ghosts, ghost_area);
-
-    incljets = csa->inclusive_jets();
-
-    // allow the cs to be deleted when it's no longer used
-    // 
-    // Note that there is at least one constituent in the jet so there
-    // is in principle at least one incljet. But one may have used a
-    // nasty recombiner or jet def that left an empty set of incljets,
-    // so we'd rather play it safe (e.g. GridJetPlugin, with the
-    // constituents outside the range of the grid)
-    if (incljets.size())
-      csa->delete_self_when_unused();
-    else
-      delete csa;
-  } else {
-    ClusterSequence * cs = new ClusterSequence(jet.constituents(), new_jet_def);
-    incljets = cs->inclusive_jets();
-    // allow the cs to be deleted when it's no longer used (again, we
-    // add an extra safety check)
-    if (incljets.size())
-      cs->delete_self_when_unused();
-    else 
-      delete cs;
-  }
-}
-
-//----------------------------------------------------------------------
-// various checks and internal constructs
-//----------------------------------------------------------------------
-
-// fundamental info for CompositeJets
-//----------------------------------------------------------------------
- 
-// get the pieces down to the fundamental pieces
-// 
-// Note that this just checks that there is an associated CS to the
-// fundamental pieces, not that it is still valid
-bool Recluster::_get_all_pieces(const PseudoJet &jet, vector<PseudoJet> &all_pieces) const{
-  if (jet.has_associated_cluster_sequence()){
-    all_pieces.push_back(jet);
-    return true;
-  }
-
-  if (jet.has_pieces()){
-    const vector<PseudoJet> pieces = jet.pieces();
-    for (vector<PseudoJet>::const_iterator it=pieces.begin(); it!=pieces.end(); it++)
-      if (!_get_all_pieces(*it, all_pieces)) return false;
-    return true;
-  }
-
-  return false;
-}
-
-// construct the re-clustering jet definition using the recombiner
-// from whatever definition has been used to obtain the original jet
-//----------------------------------------------------------------------
-void Recluster::_acquire_recombiner_from_pieces(const vector<PseudoJet> &all_pieces, 
-                                                JetDefinition &new_jet_def) const{
-  // a quick safety check
-  assert(_acquire_recombiner);
-
-  // check that all the pieces have the same recombiner
-  //
-  // Note that if the jet has an associated cluster sequence that is no
-  // longer valid, an error will be thrown (needed since it could be the
-  // 1st check called after the enumeration of the pieces)
-  const JetDefinition & jd_ref = all_pieces[0].validated_cs()->jet_def();
-  for (unsigned int i=1; i<all_pieces.size(); i++){
-    if (!all_pieces[i].validated_cs()->jet_def().has_same_recombiner(jd_ref)){
-      throw Error("Recluster instance is configured to determine the recombination scheme (or recombiner) from the original jet, but different pieces of the jet were found to have non-equivalent recombiners.");
-    }
-  }
-
-  // get the recombiner from the original jet_def
-  new_jet_def.set_recombiner(jd_ref);
-}
-
-// area support
-//----------------------------------------------------------------------
-
-// check if the jet (or all its pieces) have explicit ghosts
-// (assuming the jet has area support).
-//
-// Note that if the jet has an associated cluster sequence that is no
-// longer valid, an error will be thrown (needed since it could be the
-// 1st check called after the enumeration of the pieces)
-bool Recluster::_check_explicit_ghosts(const vector<PseudoJet> &all_pieces) const{
-  for (vector<PseudoJet>::const_iterator it=all_pieces.begin(); it!=all_pieces.end(); it++)
-    if (! it->validated_csab()->has_explicit_ghosts()) return false;
-  return true;
-}
-
-// C/A specific tests
-//----------------------------------------------------------------------
-
-// check if one can apply the simplification for C/A incljets
-//
-// This includes:
-//  - the incljet definition asks for C/A incljets
-//  - all the pieces share the same CS
-//  - that CS is C/A with the same recombiner as the incljet def
-//  - the re-clustering radius is not larger than any of the pairwise
-//    distance between the pieces
-//
-// Note that if the jet has an associated cluster sequence that is no
-// longer valid, an error will be thrown (needed since it could be the
-// 1st check called after the enumeration of the pieces)
-bool Recluster::_check_ca(const vector<PseudoJet> &all_pieces, 
-                          const JetDefinition &new_jet_def) const{
-  // check that optimisation is enabled
-  if (!_cambridge_optimisation_enabled) return false;
-
-  // check that we're reclustering with C/A
-  if (new_jet_def.jet_algorithm() != cambridge_algorithm) return false;
-
-  // check that the 1st of all the pieces (we're sure there is at
-  // least one) is coming from a C/A clustering. Then check that all
-  // the following pieces share the same ClusterSequence
-  const ClusterSequence * cs_ref = all_pieces[0].validated_cs();
-  if (cs_ref->jet_def().jet_algorithm() != cambridge_algorithm) return false;
-  for (unsigned int i=1; i<all_pieces.size(); i++)
-    if (all_pieces[i].validated_cs() != cs_ref) return false;
-
-  // check that the 1st piece has the same recombiner as the one used
-  // for the incljet clustering
-  // Note that since they share the same CS, checking the 1st one is enough
-  if (!cs_ref->jet_def().has_same_recombiner(new_jet_def)) return false;
-
-  // we also have to make sure that the reclustering radius is not larger
-  // than any of the inter-piece distances
-  double Rnew2 = new_jet_def.R();
-  Rnew2 *= Rnew2;
-  for (unsigned int i=0; i<all_pieces.size()-1; i++){
-    for (unsigned int j=i+1; j<all_pieces.size(); j++){
-      if (all_pieces[i].squared_distance(all_pieces[j]) <  Rnew2) return false;
-    }
-  }
-
-  return true;
-}
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: external/fastjet/tools/Recluster.hh
===================================================================
--- external/fastjet/tools/Recluster.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,263 +1,0 @@
-#ifndef __FASTJET_TOOLS_RECLUSTER_HH__
-#define __FASTJET_TOOLS_RECLUSTER_HH__
-
-// $Id: Recluster.hh 3753 2014-12-17 15:19:55Z salam $
-//
-// Copyright (c) 2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
-//
-//----------------------------------------------------------------------
-// This file is part of FastJet
-//
-// It 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 2 of the License, or (at
-// your option) any later version.
-//
-// It 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 code. If not, see <http://www.gnu.org/licenses/>.
-//----------------------------------------------------------------------
-
-#include <fastjet/JetDefinition.hh>
-#include <fastjet/FunctionOfPseudoJet.hh>   // to derive Recluster from FOfPJ<PJ>
-#include <iostream>
-#include <string>
-
-// TODO:
-//
-//  - maintain Voronoi areas? Requires CSAB:has_voronoi_area()    {->UNASSIGNED}
-//  - make sure the description of the class is OK
-
-
-
-FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
-
-//----------------------------------------------------------------------
-/// @ingroup tools_generic
-/// \class Recluster
-/// Recluster a jet's constituents with a new jet definition.
-///
-/// When Recluster is constructed from a JetDefinition, it is that
-/// definition that will be used to obtain the new jets. The user may
-/// then decide if the recombiner should be the one from that jet
-/// definition or if it should be acquired from the jet being
-/// processed (the default).
-///
-/// Alternatively, Recluster can be constructed from a jet algorithm
-/// and an optional radius. In that case the recombiner is
-/// systematically obtained from the jet being processed (unless you
-/// call set_acquire_recombiner(false)). If only the jet algorithm is
-/// specified, a default radius of max_allowable_R will be assumed if
-/// needed.
-///
-/// Recluster has two possible behaviours:
-///
-///  - if it is constructed with keep=keep_only_hardest the hardest
-///    inclusive jet is returned as a "standard" jet with an
-///    associated cluster sequence (unless there were no inclusive
-///    jets, in which case a zero jet is returned, with no associated
-///    cluster sequence)
-///
-///  - if it is constructed with keep=keep_all
-///    all the inclusive jets are joined into a composite jet
-///
-/// [Note that since the structure of the resulting PseudoJet depends
-/// on its usage, this class inherits from
-/// FunctionOfPseudoJet<PseudoJet> (including a description) rather
-/// than being a full-fledged Transformer]
-///
-class Recluster : public FunctionOfPseudoJet<PseudoJet> {
-public:
-  /// the various options for the output of Recluster
-  enum Keep{
-    /// keep only the hardest inclusive jet and return a "standard" jet with
-    /// an associated ClusterSequence [this will be the default]
-    keep_only_hardest,
-    /// keep all the inclusive jets. result() will join them into a composite
-    /// jet
-    keep_all
-  };
-
-  /// default constructor (uses an undefined JetDefinition, and so cannot
-  /// be used directly).
-  Recluster() : _new_jet_def(), _acquire_recombiner(true),
-                _keep(keep_only_hardest), _cambridge_optimisation_enabled(true){}
-
-  /// Constructs a Recluster object that reclusters a jet into a new jet
-  /// using a generic JetDefinition
-  ///
-  ///  \param new_jet_def   the jet definition applied to do the reclustering
-  ///  \param acquire_recombiner
-  ///                       when true, the reclustering will guess the
-  ///                       recombiner from the input jet instead of
-  ///                       the one in new_jet_def. An error is then
-  ///                       thrown if no consistent recombiner is found
-  ///  \param keep_in       Recluster::keep_only_hardest: the result is
-  ///                       the hardest inclusive jet after reclustering,
-  ///                       returned as a "standard" jet.
-  ///                       Recluster::keep_all: the result is a
-  ///                       composite jet with the inclusive jets as pieces.
-  Recluster(const JetDefinition & new_jet_def, 
-            bool acquire_recombiner_in = false, 
-            Keep keep_in = keep_only_hardest)
-    : _new_jet_def(new_jet_def), _acquire_recombiner(acquire_recombiner_in), 
-      _keep(keep_in), _cambridge_optimisation_enabled(true) {}
-
-  /// Constructs a Recluster object that reclusters a jet into a new jet
-  /// using a JetAlgorithm and its parameters
-  ///
-  ///  \param new_jet_alg    the jet algorithm applied to obtain the new clustering
-  ///  \param new_jet_radius the jet radius
-  ///  \param keep_in        Recluster::keep_only_hardest: the result is
-  ///                        the hardest inclusive jet after reclustering,
-  ///                        returned as a "standard" jet.
-  ///                        Recluster::keep_all: the result is a
-  ///                        composite jet with the inclusive jets as pieces.
-  /// 
-  /// This ctor will always acquire the recombiner from the jet being
-  /// reclustered (it will throw if none can be found).  If you wish
-  /// to use Recluster with an algorithm that requires an extra
-  /// parameter (like the genkt algorithm), please specify the jet
-  /// definition fully using the constructor above.
-  Recluster(JetAlgorithm new_jet_alg, double new_jet_radius, Keep keep_in = keep_only_hardest);
-
-  /// constructor with just a jet algorithm, but no jet radius. If the
-  /// algorithm requires a jet radius, JetDefinition::max_allowable_R will be used. 
-  ///
-  Recluster(JetAlgorithm new_jet_alg, Keep keep_in = keep_only_hardest);
-
-  /// default dtor
-  virtual ~Recluster(){}
-
-  //----------------------------------------------------------------------
-  // tweaking the behaviour and corresponding enquiry functions
-
-  /// set whether the reclustering should attempt to acquire a
-  /// recombiner from the input jet
-  void set_acquire_recombiner(bool acquire) {_acquire_recombiner = acquire;}
-
-  /// returns true if this reclusterer is set to acquire the
-  /// recombiner from the input jet
-  bool acquire_recombiner() const{ return _acquire_recombiner;}
-
-
-  /// sets whether to try to optimise reclustering with
-  /// Cambridge/Aachen algorithms (by not reclustering if the
-  /// requested C/A reclustering can be obtained by using subjets of
-  /// an input C/A jet or one composed of multiple C/A pieces from the
-  /// same clustering sequence). By default this is enabled, and
-  /// _should_ always be correct; disable it to test this statement!
-  void set_cambridge_optimisation(bool enabled){ _cambridge_optimisation_enabled = enabled;}
-  /// sets whether to try to optimise reclustering with Cambridge/Aachen algorithms (US spelling!)
-  void set_cambridge_optimization(bool enabled){ _cambridge_optimisation_enabled = enabled;}
-
-  /// returns true if the reclusterer tries to optimise reclustering
-  /// with Cambridge/Aachen algorithms
-  bool cambridge_optimization(){return _cambridge_optimisation_enabled;}
-  bool cambridge_optimisation(){return _cambridge_optimisation_enabled;}
-
-  /// set the behaviour with regards to keeping all resulting jets or
-  /// just the hardest.
-  void set_keep(Keep keep_in) {_keep = keep_in;}
-
-  /// returns the current "keep" mode i.e. whether only the hardest
-  /// inclusive jet is returned or all of them (see the Keep enum above)
-  Keep keep() const{ return _keep;}
-
-
-  //----------------------------------------------------------------------
-  // retrieving info about the behaviour
-
-  /// class description
-  virtual std::string description() const;
-
-
-  //----------------------------------------------------------------------
-  // core action of ths class
-
-  /// runs the reclustering and sets kept and rejected to be the jets
-  /// of interest (with non-zero rho, they will have been
-  /// subtracted). Normally this will be accessed through the base
-  /// class's operator().
-  ///
-  /// \param jet    the jet that gets reclustered
-  /// \return the reclustered jet
-  virtual PseudoJet result(const PseudoJet & jet) const;
-
-  /// A lower-level method that does the actual work of reclustering
-  /// the input jet. The resulting jets are stored in output_jets.
-  /// The jet definition that has been used can be accessed from the
-  /// output_jets' ClusterSequence.
-  ///
-  /// \param input_jet       the (input) jet that one wants to recluster
-  /// \param output_jets     inclusive jets resulting from the new clustering
-  ///
-  /// Returns true if the C/A optimisation has been used (this means
-  /// that generate_output_jet then has to watch out for non-explicit-ghost
-  /// areas that might be leftover)
-  bool get_new_jets_and_def(const PseudoJet & input_jet, 
-                            std::vector<PseudoJet> & output_jets) const;
-
-  /// given a set of inclusive jets and a jet definition used, create the
-  /// resulting PseudoJet;
-  /// 
-  /// If ca_optimisation_used then special care will be taken in
-  /// deciding whether the final jet can legitimately have an area.
-  PseudoJet generate_output_jet(std::vector<PseudoJet> & incljets,
-                                bool ca_optimisation_used) const;
-
-
-private:
-  /// set the reclustered elements in the simple case of C/A+C/A
-  void _recluster_ca(const std::vector<PseudoJet> & all_pieces,
-                     std::vector<PseudoJet> & incljets,
-                     double Rfilt) const;
-
-  /// set the reclustered elements in the generic re-clustering case
-  void _recluster_generic(const PseudoJet & jet, 
-                          std::vector<PseudoJet> & incljets,
-                          const JetDefinition & new_jet_def,
-                          bool do_areas) const;
-  
-  // a series of checks
-  //--------------------------------------------------------------------
-  /// get the pieces down to the fundamental pieces
-  bool _get_all_pieces(const PseudoJet &jet, std::vector<PseudoJet> &all_pieces) const;
-
-  /// associate the proper recombiner taken from the underlying pieces
-  /// (an error is thrown if the pieces do no share a common
-  /// recombiner)
-  void _acquire_recombiner_from_pieces(const std::vector<PseudoJet> &all_pieces, 
-                                       JetDefinition &new_jet_def) const;
-
-  /// check if one can apply the simplified trick for C/A subjets
-  bool _check_ca(const std::vector<PseudoJet> &all_pieces, 
-                 const JetDefinition &new_jet_def) const;
-
-  /// check if the jet (or all its pieces) have explicit ghosts
-  /// (assuming the jet has area support
-  ///
-  /// Note that if the jet has an associated cluster sequence that is no
-  /// longer valid, an error will be thrown
-  bool _check_explicit_ghosts(const std::vector<PseudoJet> &all_pieces) const;
-
-  JetDefinition _new_jet_def;  ///< the jet definition to use to extract the jets
-  bool _acquire_recombiner;    ///< get the recombiner from the input
-                               ///< jet rather than from _new_jet_def
-  Keep _keep;                  ///< dictates which inclusive jets are kept and
-                               ///< which are returned (see Keep above)
-
-  bool _cambridge_optimisation_enabled; ///<enable the checks to
-                                        ///< perform optimisation when
-                                        ///< C/A reclustering is asked
-
-  static LimitedWarning   _explicit_ghost_warning;
-};
-
-FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
-
-#endif   // __FASTJET_TOOLS_RECLUSTER_HH__
Index: external/fastjet/tools/RestFrameNSubjettinessTagger.cc
===================================================================
--- external/fastjet/tools/RestFrameNSubjettinessTagger.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/RestFrameNSubjettinessTagger.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: RestFrameNSubjettinessTagger.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/tools/RestFrameNSubjettinessTagger.hh>
Index: external/fastjet/tools/RestFrameNSubjettinessTagger.hh
===================================================================
--- external/fastjet/tools/RestFrameNSubjettinessTagger.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/RestFrameNSubjettinessTagger.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_RESTFRAMENSUBJETTINESS_TAGGER_HH__
 
-//FJSTARTHEADER
-// $Id: RestFrameNSubjettinessTagger.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: RestFrameNSubjettinessTagger.hh 2689 2011-11-14 14:51:06Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/PseudoJet.hh>
Index: external/fastjet/tools/Subtractor.cc
===================================================================
--- external/fastjet/tools/Subtractor.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Subtractor.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Subtractor.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include "fastjet/tools/Subtractor.hh"
@@ -39,113 +37,35 @@
 const double Subtractor::_invalid_rho = -numeric_limits<double>::infinity();
 
-LimitedWarning Subtractor::_unused_rho_m_warning;
 
-//----------------------------------------------------------------------
-// ctor
 Subtractor::Subtractor(double rho) : _bge(0), _rho(rho) {
-  if (_rho<0.0) throw Error("Subtractor(rho) was passed a negative rho value; rho should be >= 0");
-  set_defaults();
+  assert(_rho>0.0);
 }
 
-//----------------------------------------------------------------------
-// ctor
-Subtractor::Subtractor(double rho, double rho_m) : _bge(0), _rho(rho) {
-  if (_rho<0.0) throw Error("Subtractor(rho, rho_m) was passed a negative rho value; rho should be >= 0");
-  if (rho_m<0.0) throw Error("Subtractor(rho, rho_m) was passed a negative rho_m value; rho_m should be >= 0");
-  set_defaults();
-  _rho_m = rho_m;
-  set_use_rho_m(true);
-}
-
-//----------------------------------------------------------------------
-void Subtractor::set_defaults(){
-  _rho_m = _invalid_rho;
-  _use_rho_m = false; // likely to change in future releases!!
-  _safe_mass = false; // likely to change in future releases!!
-
-  _sel_known_vertex = Selector();
-  _sel_leading_vertex = Selector();
-}
-
-//----------------------------------------------------------------------
-// perform the subtraction of a given jet
 PseudoJet Subtractor::result(const PseudoJet & jet) const {
   if (!jet.has_area()){
-    throw Error("Subtractor::result(...): Trying to subtract a jet without area support");
+    throw Error("Trying to subtract a jet without area support");
+  }
+  
+  double rho;
+  if (_bge != 0) {
+    rho = _bge->rho(jet);
+  } else if (_rho != _invalid_rho) {
+    rho = _rho;
+  } else {
+    throw Error("default Subtractor does not have any information about the background, which is needed to perform the subtraction");
   }
 
-  PseudoJet known_lv, known_pu;
-  PseudoJet unknown = jet;
-  if (_sel_known_vertex.worker()){
-    // separate the jet constituents in 3 groups:
-    //   unknown vertex
-    //   known vertex, leading vertex
-    //   known vertex, non-leading vertex (PU)
-    vector<PseudoJet> constits_unknown, constits_known;
-    _sel_known_vertex.sift(jet.constituents(), 
-			   constits_known,
-			   constits_unknown);
-    vector<PseudoJet> constits_known_lv, constits_known_pu;
-    _sel_leading_vertex.sift(constits_known,
-			     constits_known_lv,
-			     constits_known_pu);
-
-    // For the parts related to the known vertices (LV or PU), we just
-    // sum the 4-momenta. For the unknown part, we assign it the full
-    // jet area.
-    known_lv = (constits_known_lv.size()!=0) 
-      ? SelectorIdentity().sum(constits_known_lv) : 0.0*jet;
-    known_pu = (constits_known_pu.size()!=0) 
-      ? SelectorIdentity().sum(constits_known_pu) : 0.0*jet;
-    if (constits_unknown.size()==0){
-      // no need for any form of subtraction!
-      PseudoJet subtracted_jet = jet;
-      subtracted_jet.reset_momentum(known_lv);
-      return subtracted_jet;
-    }
-    unknown = jet; // that keeps all info including area
-    unknown.reset_momentum(SelectorIdentity().sum(constits_unknown));
-  } else {
-    known_lv = jet; // ensures correct rap-phi!
-    known_lv *= 0.0;
-    known_pu = known_lv;
-  }
-
-  // prepare for the subtraction and compute the 4-vector to be
-  // subtracted
   PseudoJet subtracted_jet = jet;
-  PseudoJet to_subtract = known_pu + _amount_to_subtract(unknown);
-
-  // sanity check for the transverse momentum
-  if (to_subtract.pt2() < jet.pt2() ) { 
+  PseudoJet area4vect = jet.area_4vector();
+  // sanity check
+  if (rho*area4vect.perp() < jet.perp() ) { 
     // this subtraction should retain the jet's structural
     // information
-    subtracted_jet -= to_subtract;
+    subtracted_jet -= rho*area4vect;
   } else { 
-    // this sets the jet's momentum while maintaining all of the jet's
-    // structural information
-    subtracted_jet.reset_momentum(known_lv);
-    return subtracted_jet;
+    // this sets the jet's momentum to zero while
+    // maintaining all of the jet's structural information
+    subtracted_jet *= 0;
   }
-
-  // make sure that in the end the pt is at least the one known to
-  // come from the leading vertex
-  if (subtracted_jet.pt2() < known_lv.pt2()){
-    subtracted_jet.reset_momentum(known_lv);
-    return subtracted_jet;
-  }
-
-  // sanity check for the mass (if needed)
-  if ((_safe_mass) && (subtracted_jet.m2() < known_lv.m2())){
-    // in this case, we keep pt and phi as obtained from the
-    // subtraction above and take rap and m from the part that comes
-    // from the leading vertex (or the original jet if nothing comes
-    // from the leading vertex)
-    subtracted_jet.reset_momentum(PtYPhiM(subtracted_jet.pt(),
-					  known_lv.rap(),
-					  subtracted_jet.phi(),
-					  known_lv.m()));
-  }
-
   return subtracted_jet;
 }
@@ -154,15 +74,8 @@
 std::string Subtractor::description() const{
   if (_bge != 0) {
-    string desc = "Subtractor that uses the following background estimator to determine rho: "+_bge->description();
-    if (use_rho_m()) desc += "; including the rho_m correction";
-    if (safe_mass()) desc += "; including mass safety tests";
-    if (_sel_known_vertex.worker()){
-      desc += "; using known vertex selection: "+_sel_known_vertex.description()+" and leading vertex selection: "+_sel_leading_vertex.description();
-    }
-    return desc;
+    return "Subtractor that uses the following background estimator to determine rho: "+_bge->description();
   } else if (_rho != _invalid_rho) {
     ostringstream ostr;
     ostr << "Subtractor that uses a fixed value of rho = " << _rho;
-    if (use_rho_m()) ostr << " and rho_m = " << _rho_m;
     return ostr.str();
   } else {
@@ -171,45 +84,3 @@
 }
 
-//----------------------------------------------------------------------
-// compute the 4-vector that should be subtracted from the given
-// jet
-PseudoJet Subtractor::_amount_to_subtract(const PseudoJet &jet) const{
-  // the "transverse momentum" part
-  double rho;
-  if (_bge != 0) {
-    rho = _bge->rho(jet);
-  } else if (_rho != _invalid_rho) {
-    rho = _rho;
-  } else {
-    throw Error("Subtractor::_amount_to_subtract(...): default Subtractor does not have any information about the background, needed to perform the subtraction");
-  }
-
-  PseudoJet area = jet.area_4vector();
-  PseudoJet to_subtract = rho*area;
-
-  double const rho_m_warning_threshold = 1e-5;
-
-  // add an optional contribution from the unknown particles masses
-  if (_use_rho_m) {
-    double rho_m;
-    
-    if (_bge != 0) {
-      if (!_bge->has_rho_m()) throw Error("Subtractor::_amount_to_subtract(...): requested subtraction with rho_m from a background estimator, but the estimator does not have rho_m support");
-      rho_m = _bge->rho_m(jet);
-    } else if (_rho_m != _invalid_rho) {
-      rho_m = _rho_m;
-    } else {
-      throw Error("Subtractor::_amount_to_subtract(...): default Subtractor does not have any information about the background rho_m, needed to perform the rho_m subtraction");
-    }
-    to_subtract += rho_m * PseudoJet(0.0, 0.0, area.pz(), area.E());
-  } else if (_bge && 
-             _bge->has_rho_m() && 
-             _bge->rho_m(jet) > rho_m_warning_threshold * rho) {
-    _unused_rho_m_warning.warn("Subtractor::_amount_to_subtract(...): Background estimator indicates non-zero rho_m, but use_rho_m()==false in subtractor; consider calling set_use_rho_m(true) to include the rho_m information");
-  }
-
-  return to_subtract;
-}
-
-
 FASTJET_END_NAMESPACE
Index: external/fastjet/tools/Subtractor.hh
===================================================================
--- external/fastjet/tools/Subtractor.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Subtractor.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Subtractor.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: Subtractor.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,10 +25,9 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_TOOLS_SUBTRACTOR_HH__
 #define __FASTJET_TOOLS_SUBTRACTOR_HH__
 
-#include "fastjet/internal/base.hh"     // namespace macros (include explicitly to help Doxygen)
 #include "fastjet/tools/Transformer.hh" // to derive Subtractor from Transformer
 #include "fastjet/tools/BackgroundEstimatorBase.hh" // used as a ctor argument
@@ -64,5 +61,5 @@
   /// define a subtractor based on a BackgroundEstimator
   Subtractor(BackgroundEstimatorBase * bge) : 
-    _bge(bge), _rho(-1.0) { set_defaults(); }
+    _bge(bge), _rho(-1.0) {}
 
   /// define a subtractor that uses a fixed value of rho, the background
@@ -70,96 +67,9 @@
   Subtractor(double rho);
 
-  /// define a subtractor that uses a fixed value of rho and rho_m;
-  /// both must be >= 0;
-  Subtractor(double rho, double rho_m);
-
   /// default constructor
-  Subtractor() : _bge(0), _rho(_invalid_rho) { set_defaults(); }
+  Subtractor() : _bge(0), _rho(_invalid_rho) {}
 
   /// default dtor
   virtual ~Subtractor(){};
-
-  /// @name configuring the behaviour
-  //\{
-  //----------------------------------------------------------------
-
-  /// reset all parameters to default values
-  ///
-  /// Note: by default, the rho_m term is not included and the safety
-  /// test for the mass is not done. This is mostly for backwards
-  /// compatibility with FastJet 3.0 and is highly likely to change in
-  /// a future release of FastJet
-  void set_defaults();
-
-  /// when 'use_rho_m' is true, include in the subtraction the
-  /// correction from rho_m, the purely longitudinal,
-  /// particle-mass-induced component of the background density per
-  /// unit area
-  ///
-  /// Note: this will be switched off by default (for backwards
-  /// compatibility with FastJet 3.0) but is highly likely to change
-  /// in a future release of FastJet
-  void set_use_rho_m(bool use_rho_m_in = true){
-    if (_bge == 0  && _rho_m < 0) {
-      throw Error("Subtractor: rho_m support works only for Subtractors constructed with a background estimator or an explicit rho_m value");
-    }
-    _use_rho_m=use_rho_m_in;
-  }
-  
-  /// returns whether or not the rho_m component is used
-  bool use_rho_m() const{ return _use_rho_m;}
-
-  /// when 'safe_mass' is true, ensure that the mass of the subtracted
-  /// 4-vector remain positive
-  ///
-  /// when true, if the subtracted mass is negative, we return a
-  /// 4-vector with 0 mass, pt and phi from the subtracted 4-vector
-  /// and the rapidity of the original, unsubtracted jet.
-  ///
-  /// Note: this will be switched off by default (for backwards
-  /// compatibility with FastJet 3.0) but is highly likely to change
-  /// in a future release of FastJet
-  void set_safe_mass(bool safe_mass_in=true){ _safe_mass=safe_mass_in;}
-
-  /// returns whether or not safety tests on the mass are included
-  bool safe_mass() const{ return _safe_mass;}
-
-  /// This is mostly intended for cherge-hadron-subtracted type of
-  /// events where we wich to use vertex information to improve the
-  /// subtraction.
-  ///
-  /// Given the following parameters:
-  ///   \param sel_known_vertex    selects the particles with a
-  ///                              known vertex origin
-  ///   \param sel_leading_vertex  amongst the particles with a
-  ///                              known vertex origin, select those
-  ///                              coming from the leading vertex
-  /// Momentum identified as coming from the leading vertex will be
-  /// kept, momentum identified as coming from a non-leading vertex
-  /// will be eliminated and a regular area-median subtraction will be
-  /// applied on the 4-vector sum of the particles with unknown vertex
-  /// origin.
-  ///
-  /// When this is set, we shall ensure that the pt of the subtracted
-  /// 4-vector is at least the pt of the particles that are known to
-  /// come from the leading vertex (if it fails, subtraction returns
-  /// the component that is known to come from the leading vertex ---
-  /// or, the original unsubtracted jet if it contains no particles
-  /// from the leading vertex).  Furthermore, when safe_mass() is on, we
-  /// also impose a similar constraint on the mass of the subtracted
-  /// 4-vector (if the test fails, the longitudinal part of the
-  /// subtracted 4-vector is taken from the component that is known to
-  /// come from the leading vertex).
-  void set_known_selectors(const Selector &sel_known_vertex,
-			   const Selector &sel_leading_vertex){
-    _sel_known_vertex   = sel_known_vertex;
-    _sel_leading_vertex = sel_leading_vertex;
-  }
-
-  //\}
-
-  /// @name description and action
-  //\{
-  //----------------------------------------------------------------
 
   /// returns a jet that's subtracted
@@ -172,25 +82,11 @@
   virtual std::string description() const;
 
-  //\}
 protected:
-  /// compute the 4-vector that should be subtracted from the given
-  /// jet
-  PseudoJet _amount_to_subtract(const PseudoJet &jet) const;
 
   /// the tool used to estimate the background
   /// if has to be mutable in case its underlying selector takes a reference jet
   mutable BackgroundEstimatorBase * _bge;
-  /// the fixed value of rho and/or rho_m to use if the user has selected that option
-  double _rho, _rho_m;
-
-  // configuration parameters/flags
-  bool _use_rho_m;   ///< include the rho_m correction
-  bool _safe_mass;   ///< ensures that the subtracted mass is +ve
-
-  Selector _sel_known_vertex;   ///< selects the particles with a
-				///< known vertex origin
-  Selector _sel_leading_vertex; ///< amongst the particles with a
-				///< known vertex origin, select those
-				///< coming from the leading vertex
+  /// the fixed value of rho to use if the user has selected that option
+  double _rho;
 
   /// a value of rho that is used as a default to label that the stored
@@ -202,6 +98,4 @@
   // that's not allowed in an include file.
   static const double _invalid_rho;
-
-  static LimitedWarning _unused_rho_m_warning;
 };
 
Index: external/fastjet/tools/TopTaggerBase.cc
===================================================================
--- external/fastjet/tools/TopTaggerBase.cc	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/TopTaggerBase.cc	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: TopTaggerBase.cc 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id$
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/tools/TopTaggerBase.hh>
Index: external/fastjet/tools/TopTaggerBase.hh
===================================================================
--- external/fastjet/tools/TopTaggerBase.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/TopTaggerBase.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -2,8 +2,8 @@
 #define __FASTJET_TOP_TAGGER_BASE_HH__
 
-//FJSTARTHEADER
-// $Id: TopTaggerBase.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: TopTaggerBase.hh 2689 2011-11-14 14:51:06Z soyez $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -16,9 +16,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -30,5 +28,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #include <fastjet/internal/base.hh>
Index: external/fastjet/tools/Transformer.hh
===================================================================
--- external/fastjet/tools/Transformer.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/tools/Transformer.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: Transformer.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: Transformer.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_TRANSFORMER_HH__
Index: external/fastjet/version.hh
===================================================================
--- external/fastjet/version.hh	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/fastjet/version.hh	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1,6 +1,6 @@
-//FJSTARTHEADER
-// $Id: version.hh 4442 2020-05-05 07:50:11Z soyez $
+//STARTHEADER
+// $Id: version.hh 2577 2011-09-13 15:11:38Z salam $
 //
-// Copyright (c) 2005-2020, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -13,9 +13,7 @@
 //
 //  The algorithms that underlie FastJet have required considerable
-//  development. They are described in the original FastJet paper,
-//  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
+//  development and are described in hep-ph/0512210. If you use
 //  FastJet as part of work towards a scientific publication, please
-//  quote the version you use and include a citation to the manual and
-//  optionally also to hep-ph/0512210.
+//  include a citation to the FastJet paper.
 //
 //  FastJet is distributed in the hope that it will be useful,
@@ -27,5 +25,5 @@
 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
 //----------------------------------------------------------------------
-//FJENDHEADER
+//ENDHEADER
 
 #ifndef __FASTJET_VERSION_HH__
Index: external/tcl/CMakeLists.txt
===================================================================
--- external/tcl/CMakeLists.txt	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ 	(revision )
@@ -1,5 +1,0 @@
-include_directories(${CMAKE_SOURCE_DIR}/external)
-
-file(GLOB sources *.c)
-
-add_library(tcl OBJECT ${sources})
Index: external/tcl/VERSION
===================================================================
--- external/tcl/VERSION	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
+++ external/tcl/VERSION	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -0,0 +1,1 @@
+8.0.5
Index: external/tcl/tcl.h
===================================================================
--- external/tcl/tcl.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tcl.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -488,4 +488,12 @@
 EXTERN int		Tcl_IsShared _ANSI_ARGS_((Tcl_Obj *objPtr));
 
+#ifdef TCL_MEM_DEBUG
+#   define Tcl_IncrRefCount(objPtr) \
+	Tcl_DbIncrRefCount(objPtr, __FILE__, __LINE__)
+#   define Tcl_DecrRefCount(objPtr) \
+	Tcl_DbDecrRefCount(objPtr, __FILE__, __LINE__)
+#   define Tcl_IsShared(objPtr) \
+	Tcl_DbIsShared(objPtr, __FILE__, __LINE__)
+#else
 #   define Tcl_IncrRefCount(objPtr) \
 	++(objPtr)->refCount
@@ -494,7 +502,10 @@
 #   define Tcl_IsShared(objPtr) \
 	((objPtr)->refCount > 1)
+#endif
 
 /*
  * Macros and definitions that help to debug the use of Tcl objects.
+ * When TCL_MEM_DEBUG is defined, the Tcl_New* declarations are 
+ * overridden to call debugging versions of the object creation procedures.
  */
 
@@ -508,4 +519,21 @@
 EXTERN Tcl_Obj *	Tcl_NewStringObj _ANSI_ARGS_((char *bytes,
 			    int length));
+
+#ifdef TCL_MEM_DEBUG
+#  define Tcl_NewBooleanObj(val) \
+     Tcl_DbNewBooleanObj(val, __FILE__, __LINE__)
+#  define Tcl_NewDoubleObj(val) \
+     Tcl_DbNewDoubleObj(val, __FILE__, __LINE__)
+#  define Tcl_NewIntObj(val) \
+     Tcl_DbNewLongObj(val, __FILE__, __LINE__)
+#  define Tcl_NewListObj(objc, objv) \
+     Tcl_DbNewListObj(objc, objv, __FILE__, __LINE__)
+#  define Tcl_NewLongObj(val) \
+     Tcl_DbNewLongObj(val, __FILE__, __LINE__)
+#  define Tcl_NewObj() \
+     Tcl_DbNewObj(__FILE__, __LINE__)
+#  define Tcl_NewStringObj(bytes, len) \
+     Tcl_DbNewStringObj(bytes, len, __FILE__, __LINE__)
+#endif /* TCL_MEM_DEBUG */
 
 /*
@@ -653,4 +681,13 @@
 
 /*
+ * Flag values passed to Tcl_RecordAndEval.
+ * WARNING: these bit choices must not conflict with the bit choices
+ * for evalFlag bits in tclInt.h!!
+ */
+
+#define TCL_NO_EVAL		0x10000
+#define TCL_EVAL_GLOBAL		0x20000
+
+/*
  * Special freeProc values that may be passed to Tcl_SetResult (see
  * the man page for details):
@@ -698,4 +735,19 @@
 			    unsigned int size));
 
+#ifdef TCL_MEM_DEBUG
+
+#  define Tcl_Alloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
+#  define Tcl_Free(x)  Tcl_DbCkfree(x, __FILE__, __LINE__)
+#  define Tcl_Realloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
+#  define ckalloc(x) Tcl_DbCkalloc(x, __FILE__, __LINE__)
+#  define ckfree(x)  Tcl_DbCkfree(x, __FILE__, __LINE__)
+#  define ckrealloc(x,y) Tcl_DbCkrealloc((x), (y),__FILE__, __LINE__)
+
+EXTERN int		Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName));
+EXTERN void		Tcl_ValidateAllMemory _ANSI_ARGS_((char *file,
+			    int line));
+
+#else
+
 /*
  * If USE_TCLALLOC is true, then we need to call Tcl_Alloc instead of
@@ -717,4 +769,6 @@
 #  define Tcl_DumpActiveMemory(x)
 #  define Tcl_ValidateAllMemory(x,y)
+
+#endif /* TCL_MEM_DEBUG */
 
 /*
@@ -750,5 +804,5 @@
 					 * as necessary for this table's
 					 * keys. */
-	char string[1];			/* String for key.  The actual size
+	char string[4];			/* String for key.  The actual size
 					 * will be as large as needed to hold
 					 * the key. */
@@ -1170,4 +1224,6 @@
 EXTERN Tcl_Obj *	Tcl_DuplicateObj _ANSI_ARGS_((Tcl_Obj *objPtr));
 EXTERN int		Tcl_Eof _ANSI_ARGS_((Tcl_Channel chan));
+EXTERN char *		Tcl_ErrnoId _ANSI_ARGS_((void));
+EXTERN char *		Tcl_ErrnoMsg _ANSI_ARGS_((int err));
 EXTERN int		Tcl_Eval _ANSI_ARGS_((Tcl_Interp *interp,
 			    char *string));
@@ -1357,4 +1413,8 @@
 	        	    char *bufPtr, int toRead));
 EXTERN void		Tcl_ReapDetachedProcs _ANSI_ARGS_((void));
+EXTERN int		Tcl_RecordAndEval _ANSI_ARGS_((Tcl_Interp *interp,
+			    char *cmd, int flags));
+EXTERN int		Tcl_RecordAndEvalObj _ANSI_ARGS_((Tcl_Interp *interp,
+			    Tcl_Obj *cmdPtr, int flags));
 EXTERN Tcl_RegExp	Tcl_RegExpCompile _ANSI_ARGS_((Tcl_Interp *interp,
 			    char *string));
@@ -1425,4 +1485,6 @@
 			    char *part1, char *part2, char *newValue,
 			    int flags));
+EXTERN char *		Tcl_SignalId _ANSI_ARGS_((int sig));
+EXTERN char *		Tcl_SignalMsg _ANSI_ARGS_((int sig));
 EXTERN void		Tcl_SourceRCFile _ANSI_ARGS_((Tcl_Interp *interp));
 EXTERN int		Tcl_SplitList _ANSI_ARGS_((Tcl_Interp *interp,
Index: external/tcl/tclBasic.c
===================================================================
--- external/tcl/tclBasic.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclBasic.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -3287,4 +3287,7 @@
 	    TclInitByteCodeObj(objPtr, &compEnv);
 	    codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr;
+	    if (tclTraceCompile == 2) {
+		TclPrintByteCodeObj(interp, objPtr);
+	    }
 	    TclFreeCompileEnv(&compEnv);
 	} else {
Index: external/tcl/tclCkalloc.c
===================================================================
--- external/tcl/tclCkalloc.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclCkalloc.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -22,26 +22,269 @@
 #define TRUE	1
 
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_Alloc --
- *	Interface to TclpAlloc.
- *	It does check that memory was actually allocated.
- *
- *----------------------------------------------------------------------
- */
-
-char *
-Tcl_Alloc (size)
-    unsigned int size;
-{
-        char *result;
-
-        result = TclpAlloc(size);
-        if (result == NULL) 
-                panic("unable to alloc %d bytes", size);
-        return result;
-}
-
+#ifdef TCL_MEM_DEBUG
+
+/*
+ * One of the following structures is allocated each time the
+ * "memory tag" command is invoked, to hold the current tag.
+ */
+
+typedef struct MemTag {
+    int refCount;		/* Number of mem_headers referencing
+				 * this tag. */
+    char string[4];		/* Actual size of string will be as
+				 * large as needed for actual tag.  This
+				 * must be the last field in the structure. */
+} MemTag;
+
+#define TAG_SIZE(bytesInString) ((unsigned) sizeof(MemTag) + bytesInString - 3)
+
+static MemTag *curTagPtr = NULL;/* Tag to use in all future mem_headers
+				 * (set by "memory tag" command). */
+
+/*
+ * One of the following structures is allocated just before each
+ * dynamically allocated chunk of memory, both to record information
+ * about the chunk and to help detect chunk under-runs.
+ */
+
+#define LOW_GUARD_SIZE (8 + (32 - (sizeof(long) + sizeof(int)))%8)
+struct mem_header {
+    struct mem_header *flink;
+    struct mem_header *blink;
+    MemTag *tagPtr;		/* Tag from "memory tag" command;  may be
+				 * NULL. */
+    char *file;
+    long length;
+    int line;
+    unsigned char low_guard[LOW_GUARD_SIZE];
+				/* Aligns body on 8-byte boundary, plus
+				 * provides at least 8 additional guard bytes
+				 * to detect underruns. */
+    char body[1];		/* First byte of client's space.  Actual
+				 * size of this field will be larger than
+				 * one. */
+};
+
+static struct mem_header *allocHead = NULL;  /* List of allocated structures */
+
+#define GUARD_VALUE  0141
+
+/*
+ * The following macro determines the amount of guard space *above* each
+ * chunk of memory.
+ */
+
+#define HIGH_GUARD_SIZE 8
+
+/*
+ * The following macro computes the offset of the "body" field within
+ * mem_header.  It is used to get back to the header pointer from the
+ * body pointer that's used by clients.
+ */
+
+#define BODY_OFFSET \
+	((unsigned long) (&((struct mem_header *) 0)->body))
+
+static int total_mallocs = 0;
+static int total_frees = 0;
+static int current_bytes_malloced = 0;
+static int maximum_bytes_malloced = 0;
+static int current_malloc_packets = 0;
+static int maximum_malloc_packets = 0;
+static int break_on_malloc = 0;
+static int trace_on_at_malloc = 0;
+static int  alloc_tracing = FALSE;
+static int  init_malloced_bodies = TRUE;
+#ifdef MEM_VALIDATE
+    static int  validate_memory = TRUE;
+#else
+    static int  validate_memory = FALSE;
+#endif
+
+/*
+ * Prototypes for procedures defined in this file:
+ */
+
+static int		MemoryCmd _ANSI_ARGS_((ClientData clientData,
+			    Tcl_Interp *interp, int argc, char **argv));
+static void		ValidateMemory _ANSI_ARGS_((
+			    struct mem_header *memHeaderP, char *file,
+			    int line, int nukeGuards));
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclDumpMemoryInfo --
+ *     Display the global memory management statistics.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+TclDumpMemoryInfo(outFile) 
+    FILE *outFile;
+{
+        fprintf(outFile,"total mallocs             %10d\n", 
+                total_mallocs);
+        fprintf(outFile,"total frees               %10d\n", 
+                total_frees);
+        fprintf(outFile,"current packets allocated %10d\n", 
+                current_malloc_packets);
+        fprintf(outFile,"current bytes allocated   %10d\n", 
+                current_bytes_malloced);
+        fprintf(outFile,"maximum packets allocated %10d\n", 
+                maximum_malloc_packets);
+        fprintf(outFile,"maximum bytes allocated   %10d\n", 
+                maximum_bytes_malloced);
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ValidateMemory --
+ *     Procedure to validate allocted memory guard zones.
+ *
+ *----------------------------------------------------------------------
+ */
+static void
+ValidateMemory(memHeaderP, file, line, nukeGuards)
+    struct mem_header *memHeaderP;
+    char              *file;
+    int                line;
+    int                nukeGuards;
+{
+    unsigned char *hiPtr;
+    int   idx;
+    int   guard_failed = FALSE;
+    int byte;
+    
+    for (idx = 0; idx < LOW_GUARD_SIZE; idx++) {
+        byte = *(memHeaderP->low_guard + idx);
+        if (byte != GUARD_VALUE) {
+            guard_failed = TRUE;
+            fflush(stdout);
+	    byte &= 0xff;
+            fprintf(stderr, "low guard byte %d is 0x%x  \t%c\n", idx, byte,
+		    (isprint(UCHAR(byte)) ? byte : ' '));
+        }
+    }
+    if (guard_failed) {
+        TclDumpMemoryInfo (stderr);
+        fprintf(stderr, "low guard failed at %lx, %s %d\n",
+                 (long unsigned int) memHeaderP->body, file, line);
+        fflush(stderr);  /* In case name pointer is bad. */
+        fprintf(stderr, "%ld bytes allocated at (%s %d)\n", memHeaderP->length,
+		memHeaderP->file, memHeaderP->line);
+        panic ("Memory validation failure");
+    }
+
+    hiPtr = (unsigned char *)memHeaderP->body + memHeaderP->length;
+    for (idx = 0; idx < HIGH_GUARD_SIZE; idx++) {
+        byte = *(hiPtr + idx);
+        if (byte != GUARD_VALUE) {
+            guard_failed = TRUE;
+            fflush (stdout);
+	    byte &= 0xff;
+            fprintf(stderr, "hi guard byte %d is 0x%x  \t%c\n", idx, byte,
+		    (isprint(UCHAR(byte)) ? byte : ' '));
+        }
+    }
+
+    if (guard_failed) {
+        TclDumpMemoryInfo (stderr);
+        fprintf(stderr, "high guard failed at %lx, %s %d\n",
+                 (long unsigned int) memHeaderP->body, file, line);
+        fflush(stderr);  /* In case name pointer is bad. */
+        fprintf(stderr, "%ld bytes allocated at (%s %d)\n",
+		memHeaderP->length, memHeaderP->file,
+		memHeaderP->line);
+        panic("Memory validation failure");
+    }
+
+    if (nukeGuards) {
+        memset ((char *) memHeaderP->low_guard, 0, LOW_GUARD_SIZE); 
+        memset ((char *) hiPtr, 0, HIGH_GUARD_SIZE); 
+    }
+
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_ValidateAllMemory --
+ *     Validates guard regions for all allocated memory.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+Tcl_ValidateAllMemory (file, line)
+    char  *file;
+    int    line;
+{
+    struct mem_header *memScanP;
+
+    for (memScanP = allocHead; memScanP != NULL; memScanP = memScanP->flink)
+        ValidateMemory(memScanP, file, line, FALSE);
+
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DumpActiveMemory --
+ *     Displays all allocated memory to stderr.
+ *
+ * Results:
+ *     Return TCL_ERROR if an error accessing the file occures, `errno' 
+ *     will have the file error number left in it.
+ *----------------------------------------------------------------------
+ */
+int
+Tcl_DumpActiveMemory (fileName)
+    char *fileName;
+{
+    FILE              *fileP;
+    struct mem_header *memScanP;
+    char              *address;
+
+    fileP = fopen(fileName, "w");
+    if (fileP == NULL)
+        return TCL_ERROR;
+
+    for (memScanP = allocHead; memScanP != NULL; memScanP = memScanP->flink) {
+        address = &memScanP->body [0];
+        fprintf(fileP, "%8lx - %8lx  %7ld @ %s %d %s",
+		(long unsigned int) address,
+                 (long unsigned int) address + memScanP->length - 1,
+		 memScanP->length, memScanP->file, memScanP->line,
+		 (memScanP->tagPtr == NULL) ? "" : memScanP->tagPtr->string);
+	(void) fputc('\n', fileP);
+    }
+    fclose (fileP);
+    return TCL_OK;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbCkalloc - debugging ckalloc
+ *
+ *        Allocate the requested amount of space plus some extra for
+ *        guard bands at both ends of the request, plus a size, panicing 
+ *        if there isn't enough space, then write in the guard bands
+ *        and return the address of the space in the middle that the
+ *        user asked for.
+ *
+ *        The second and third arguments are file and line, these contain
+ *        the filename and line number corresponding to the caller.
+ *        These are sent by the ckalloc macro; it uses the preprocessor
+ *        autodefines __FILE__ and __LINE__.
+ *
+ *----------------------------------------------------------------------
+ */
 char *
 Tcl_DbCkalloc(size, file, line)
@@ -50,41 +293,163 @@
     int          line;
 {
-    char *result;
-
-    result = (char *) TclpAlloc(size);
-
+    struct mem_header *result;
+
+    if (validate_memory)
+        Tcl_ValidateAllMemory (file, line);
+
+    result = (struct mem_header *) TclpAlloc((unsigned)size + 
+                              sizeof(struct mem_header) + HIGH_GUARD_SIZE);
     if (result == NULL) {
         fflush(stdout);
+        TclDumpMemoryInfo(stderr);
         panic("unable to alloc %d bytes, %s line %d", size, file, 
               line);
     }
-    return result;
-}
-
-
-
-/*
- *----------------------------------------------------------------------
- *
- * Tcl_Realloc --
- *	Interface to TclpRealloc.
- *	It does check that memory was actually allocated.
- *
- *----------------------------------------------------------------------
- */
-
-char *
-Tcl_Realloc(ptr, size)
-    char *ptr;
-    unsigned int size;
-{
-    char *result;
-
-    result = TclpRealloc(ptr, size);
-    if (result == NULL) 
-	panic("unable to realloc %d bytes", size);
-    return result;
-}
-
+
+    /*
+     * Fill in guard zones and size.  Also initialize the contents of
+     * the block with bogus bytes to detect uses of initialized data.
+     * Link into allocated list.
+     */
+    if (init_malloced_bodies) {
+        memset ((VOID *) result, GUARD_VALUE,
+		size + sizeof(struct mem_header) + HIGH_GUARD_SIZE);
+    } else {
+	memset ((char *) result->low_guard, GUARD_VALUE, LOW_GUARD_SIZE);
+	memset (result->body + size, GUARD_VALUE, HIGH_GUARD_SIZE);
+    }
+    result->length = size;
+    result->tagPtr = curTagPtr;
+    if (curTagPtr != NULL) {
+	curTagPtr->refCount++;
+    }
+    result->file = file;
+    result->line = line;
+    result->flink = allocHead;
+    result->blink = NULL;
+    if (allocHead != NULL)
+        allocHead->blink = result;
+    allocHead = result;
+
+    total_mallocs++;
+    if (trace_on_at_malloc && (total_mallocs >= trace_on_at_malloc)) {
+        (void) fflush(stdout);
+        fprintf(stderr, "reached malloc trace enable point (%d)\n",
+                total_mallocs);
+        fflush(stderr);
+        alloc_tracing = TRUE;
+        trace_on_at_malloc = 0;
+    }
+
+    if (alloc_tracing)
+        fprintf(stderr,"ckalloc %lx %d %s %d\n",
+		(long unsigned int) result->body, size, file, line);
+
+    if (break_on_malloc && (total_mallocs >= break_on_malloc)) {
+        break_on_malloc = 0;
+        (void) fflush(stdout);
+        fprintf(stderr,"reached malloc break limit (%d)\n", 
+                total_mallocs);
+        fprintf(stderr, "program will now enter C debugger\n");
+        (void) fflush(stderr);
+	abort();
+    }
+
+    current_malloc_packets++;
+    if (current_malloc_packets > maximum_malloc_packets)
+        maximum_malloc_packets = current_malloc_packets;
+    current_bytes_malloced += size;
+    if (current_bytes_malloced > maximum_bytes_malloced)
+        maximum_bytes_malloced = current_bytes_malloced;
+
+    return result->body;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbCkfree - debugging ckfree
+ *
+ *        Verify that the low and high guards are intact, and if so
+ *        then free the buffer else panic.
+ *
+ *        The guards are erased after being checked to catch duplicate
+ *        frees.
+ *
+ *        The second and third arguments are file and line, these contain
+ *        the filename and line number corresponding to the caller.
+ *        These are sent by the ckfree macro; it uses the preprocessor
+ *        autodefines __FILE__ and __LINE__.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tcl_DbCkfree(ptr, file, line)
+    char *  ptr;
+    char     *file;
+    int       line;
+{
+    /*
+     * The following cast is *very* tricky.  Must convert the pointer
+     * to an integer before doing arithmetic on it, because otherwise
+     * the arithmetic will be done differently (and incorrectly) on
+     * word-addressed machines such as Crays (will subtract only bytes,
+     * even though BODY_OFFSET is in words on these machines).
+     */
+
+    struct mem_header *memp = (struct mem_header *)
+	    (((unsigned long) ptr) - BODY_OFFSET);
+
+    if (alloc_tracing)
+        fprintf(stderr, "ckfree %lx %ld %s %d\n",
+		(long unsigned int) memp->body, memp->length, file, line);
+
+    if (validate_memory)
+        Tcl_ValidateAllMemory(file, line);
+
+    ValidateMemory(memp, file, line, TRUE);
+    if (init_malloced_bodies) {
+	memset((VOID *) ptr, GUARD_VALUE, (size_t) memp->length);
+    }
+
+    total_frees++;
+    current_malloc_packets--;
+    current_bytes_malloced -= memp->length;
+
+    if (memp->tagPtr != NULL) {
+	memp->tagPtr->refCount--;
+	if ((memp->tagPtr->refCount == 0) && (curTagPtr != memp->tagPtr)) {
+	    TclpFree((char *) memp->tagPtr);
+	}
+    }
+
+    /*
+     * Delink from allocated list
+     */
+    if (memp->flink != NULL)
+        memp->flink->blink = memp->blink;
+    if (memp->blink != NULL)
+        memp->blink->flink = memp->flink;
+    if (allocHead == memp)
+        allocHead = memp->flink;
+    TclpFree((char *) memp);
+    return 0;
+}
+
+
+/*
+ *--------------------------------------------------------------------
+ *
+ * Tcl_DbCkrealloc - debugging ckrealloc
+ *
+ *	Reallocate a chunk of memory by allocating a new one of the
+ *	right size, copying the old data to the new location, and then
+ *	freeing the old memory space, using all the memory checking
+ *	features of this package.
+ *
+ *--------------------------------------------------------------------
+ */
 char *
 Tcl_DbCkrealloc(ptr, size, file, line)
@@ -94,4 +459,293 @@
     int line;
 {
+    char *new;
+    unsigned int copySize;
+
+    /*
+     * See comment from Tcl_DbCkfree before you change the following
+     * line.
+     */
+
+    struct mem_header *memp = (struct mem_header *)
+	    (((unsigned long) ptr) - BODY_OFFSET);
+
+    copySize = size;
+    if (copySize > (unsigned int) memp->length) {
+	copySize = memp->length;
+    }
+    new = Tcl_DbCkalloc(size, file, line);
+    memcpy((VOID *) new, (VOID *) ptr, (size_t) copySize);
+    Tcl_DbCkfree(ptr, file, line);
+    return(new);
+}
+
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_Alloc, et al. --
+ *
+ *	These functions are defined in terms of the debugging versions
+ *	when TCL_MEM_DEBUG is set.
+ *
+ * Results:
+ *	Same as the debug versions.
+ *
+ * Side effects:
+ *	Same as the debug versions.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#undef Tcl_Alloc
+#undef Tcl_Free
+#undef Tcl_Realloc
+
+char *
+Tcl_Alloc(size)
+    unsigned int size;
+{
+    return Tcl_DbCkalloc(size, "unknown", 0);
+}
+
+void
+Tcl_Free(ptr)
+    char *ptr;
+{
+    Tcl_DbCkfree(ptr, "unknown", 0);
+}
+
+char *
+Tcl_Realloc(ptr, size)
+    char *ptr;
+    unsigned int size;
+{
+    return Tcl_DbCkrealloc(ptr, size, "unknown", 0);
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * MemoryCmd --
+ *     Implements the TCL memory command:
+ *       memory info
+ *       memory display
+ *       break_on_malloc count
+ *       trace_on_at_malloc count
+ *       trace on|off
+ *       validate on|off
+ *
+ * Results:
+ *     Standard TCL results.
+ *
+ *----------------------------------------------------------------------
+ */
+	/* ARGSUSED */
+static int
+MemoryCmd (clientData, interp, argc, argv)
+    ClientData  clientData;
+    Tcl_Interp *interp;
+    int         argc;
+    char      **argv;
+{
+    char *fileName;
+    Tcl_DString buffer;
+    int result;
+
+    if (argc < 2) {
+	Tcl_AppendResult(interp, "wrong # args: should be \"",
+		argv[0], " option [args..]\"", (char *) NULL);
+	return TCL_ERROR;
+    }
+
+    if (strcmp(argv[1],"active") == 0) {
+        if (argc != 3) {
+	    Tcl_AppendResult(interp, "wrong # args: should be \"",
+		    argv[0], " active file\"", (char *) NULL);
+	    return TCL_ERROR;
+	}
+	fileName = Tcl_TranslateFileName(interp, argv[2], &buffer);
+	if (fileName == NULL) {
+	    return TCL_ERROR;
+	}
+	result = Tcl_DumpActiveMemory (fileName);
+	Tcl_DStringFree(&buffer);
+	if (result != TCL_OK) {
+	    Tcl_AppendResult(interp, "error accessing ", argv[2], 
+		    (char *) NULL);
+	    return TCL_ERROR;
+	}
+	return TCL_OK;
+    }
+    if (strcmp(argv[1],"break_on_malloc") == 0) {
+        if (argc != 3) {
+            goto argError;
+	}
+        if (Tcl_GetInt(interp, argv[2], &break_on_malloc) != TCL_OK) {
+	    return TCL_ERROR;
+	}
+        return TCL_OK;
+    }
+    if (strcmp(argv[1],"info") == 0) {
+        TclDumpMemoryInfo(stdout);
+        return TCL_OK;
+    }
+    if (strcmp(argv[1],"init") == 0) {
+        if (argc != 3) {
+            goto bad_suboption;
+	}
+        init_malloced_bodies = (strcmp(argv[2],"on") == 0);
+        return TCL_OK;
+    }
+    if (strcmp(argv[1],"tag") == 0) {
+	if (argc != 3) {
+	    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+		    " tag string\"", (char *) NULL);
+	    return TCL_ERROR;
+	}
+	if ((curTagPtr != NULL) && (curTagPtr->refCount == 0)) {
+	    TclpFree((char *) curTagPtr);
+	}
+	curTagPtr = (MemTag *) TclpAlloc(TAG_SIZE(strlen(argv[2])));
+	curTagPtr->refCount = 0;
+	strcpy(curTagPtr->string, argv[2]);
+	return TCL_OK;
+    }
+    if (strcmp(argv[1],"trace") == 0) {
+        if (argc != 3) {
+            goto bad_suboption;
+	}
+        alloc_tracing = (strcmp(argv[2],"on") == 0);
+        return TCL_OK;
+    }
+
+    if (strcmp(argv[1],"trace_on_at_malloc") == 0) {
+        if (argc != 3) {
+            goto argError;
+	}
+        if (Tcl_GetInt(interp, argv[2], &trace_on_at_malloc) != TCL_OK) {
+	    return TCL_ERROR;
+	}
+	return TCL_OK;
+    }
+    if (strcmp(argv[1],"validate") == 0) {
+        if (argc != 3) {
+	    goto bad_suboption;
+	}
+        validate_memory = (strcmp(argv[2],"on") == 0);
+        return TCL_OK;
+    }
+
+    Tcl_AppendResult(interp, "bad option \"", argv[1],
+	    "\": should be active, break_on_malloc, info, init, ",
+	    "tag, trace, trace_on_at_malloc, or validate", (char *) NULL);
+    return TCL_ERROR;
+
+argError:
+    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+	    " ", argv[1], " count\"", (char *) NULL);
+    return TCL_ERROR;
+
+bad_suboption:
+    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
+	    " ", argv[1], " on|off\"", (char *) NULL);
+    return TCL_ERROR;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_InitMemory --
+ *     Initialize the memory command.
+ *
+ *----------------------------------------------------------------------
+ */
+void
+Tcl_InitMemory(interp)
+    Tcl_Interp *interp;
+{
+    Tcl_CreateCommand (interp, "memory", MemoryCmd, (ClientData) NULL, 
+	    (Tcl_CmdDeleteProc *) NULL);
+}
+
+#else
+
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_Alloc --
+ *     Interface to TclpAlloc when TCL_MEM_DEBUG is disabled.  It does check
+ *     that memory was actually allocated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+Tcl_Alloc (size)
+    unsigned int size;
+{
+        char *result;
+
+        result = TclpAlloc(size);
+        if (result == NULL) 
+                panic("unable to alloc %d bytes", size);
+        return result;
+}
+
+char *
+Tcl_DbCkalloc(size, file, line)
+    unsigned int size;
+    char        *file;
+    int          line;
+{
+    char *result;
+
+    result = (char *) TclpAlloc(size);
+
+    if (result == NULL) {
+        fflush(stdout);
+        panic("unable to alloc %d bytes, %s line %d", size, file, 
+              line);
+    }
+    return result;
+}
+
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_Realloc --
+ *     Interface to TclpRealloc when TCL_MEM_DEBUG is disabled.  It does 
+ *     check that memory was actually allocated.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+Tcl_Realloc(ptr, size)
+    char *ptr;
+    unsigned int size;
+{
+    char *result;
+
+    result = TclpRealloc(ptr, size);
+    if (result == NULL) 
+	panic("unable to realloc %d bytes", size);
+    return result;
+}
+
+char *
+Tcl_DbCkrealloc(ptr, size, file, line)
+    char *ptr;
+    unsigned int size;
+    char *file;
+    int line;
+{
     char *result;
 
@@ -111,5 +765,7 @@
  *
  * Tcl_Free --
- *	Interface to TclpFree.
+ *     Interface to TclpFree when TCL_MEM_DEBUG is disabled.  Done here
+ *     rather in the macro to keep some modules from being compiled with 
+ *     TCL_MEM_DEBUG enabled and some with it disabled.
  *
  *----------------------------------------------------------------------
@@ -122,2 +778,52 @@
         TclpFree(ptr);
 }
+
+int
+Tcl_DbCkfree(ptr, file, line)
+    char *  ptr;
+    char     *file;
+    int       line;
+{
+    TclpFree(ptr);
+    return 0;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_InitMemory --
+ *     Dummy initialization for memory command, which is only available 
+ *     if TCL_MEM_DEBUG is on.
+ *
+ *----------------------------------------------------------------------
+ */
+	/* ARGSUSED */
+void
+Tcl_InitMemory(interp)
+    Tcl_Interp *interp;
+{
+}
+
+#undef Tcl_DumpActiveMemory
+#undef Tcl_ValidateAllMemory
+
+extern int		Tcl_DumpActiveMemory _ANSI_ARGS_((char *fileName));
+extern void		Tcl_ValidateAllMemory _ANSI_ARGS_((char *file,
+			    int line));
+
+int
+Tcl_DumpActiveMemory(fileName)
+    char *fileName;
+{
+    return TCL_OK;
+}
+
+void
+Tcl_ValidateAllMemory(file, line)
+    char  *file;
+    int    line;
+{
+}
+
+#endif
Index: external/tcl/tclCompExpr.c
===================================================================
--- external/tcl/tclCompExpr.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclCompExpr.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -31,4 +31,13 @@
 #define ERANGE 34
 #endif
+
+/*
+ * Boolean variable that controls whether expression compilation tracing
+ * is enabled.
+ */
+
+#ifdef TCL_COMPILE_DEBUG
+static int traceCompileExpr = 0;
+#endif /* TCL_COMPILE_DEBUG */
 
 /*
@@ -123,4 +132,20 @@
 #define NOT		(COLON + 1)
 #define BIT_NOT		(NOT + 1)
+
+/*
+ * Mapping from tokens to strings; used for debugging messages. These
+ * entries must match the order and number of the token definitions above.
+ */
+
+#ifdef TCL_COMPILE_DEBUG
+static char *tokenStrings[] = {
+    "LITERAL", "FUNCNAME",
+    "[", "]", "(", ")", "$", "\"", ",", "END", "UNKNOWN",
+    "*", "/", "%", "+", "-",
+    "<<", ">>", "<", ">", "<=", ">=", "==", "!=",
+    "&", "^", "|", "&&", "||", "?", ":",
+    "!", "~"
+};
+#endif /* TCL_COMPILE_DEBUG */
 
 /*
@@ -173,4 +198,19 @@
 			    ExprInfo *infoPtr, CompileEnv *envPtr));
 
+/*
+ * Macro used to debug the execution of the recursive descent parser used
+ * to compile expressions.
+ */
+
+#ifdef TCL_COMPILE_DEBUG
+#define HERE(production, level) \
+    if (traceCompileExpr) { \
+	fprintf(stderr, "%*s%s: token=%s, next=\"%.20s\"\n", \
+		(level), " ", (production), tokenStrings[infoPtr->token], \
+		infoPtr->next); \
+    }
+#else
+#define HERE(production, level)
+#endif /* TCL_COMPILE_DEBUG */
 
 
@@ -237,4 +277,10 @@
 				 * to execute the expression. */
     int result;
+
+#ifdef TCL_COMPILE_DEBUG
+    if (traceCompileExpr) {
+	fprintf(stderr, "expr: string=\"%.30s\"\n", string);
+    }
+#endif /* TCL_COMPILE_DEBUG */
 
     /*
@@ -363,4 +409,5 @@
     int elseCodeOffset, currCodeOffset, jumpDist, result;
     
+    HERE("condExpr", 1);
     result = CompileLorExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -524,4 +571,5 @@
     Tcl_Obj *objPtr;
     
+    HERE("lorExpr", 2);
     result = CompileLandExpr(interp, infoPtr, flags, envPtr);
     if ((result != TCL_OK) || (infoPtr->token != OR)) {
@@ -691,4 +739,5 @@
     Tcl_Obj *objPtr;
 
+    HERE("landExpr", 3);
     result = CompileBitOrExpr(interp, infoPtr, flags, envPtr);
     if ((result != TCL_OK) || (infoPtr->token != AND)) {
@@ -850,4 +899,5 @@
     int result;
 
+    HERE("bitOrExpr", 4);
     result = CompileBitXorExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -920,4 +970,5 @@
     int result;
 
+    HERE("bitXorExpr", 5);
     result = CompileBitAndExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -990,4 +1041,5 @@
     int result;
 
+    HERE("bitAndExpr", 6);
     result = CompileEqualityExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -1060,4 +1112,5 @@
     int op, result;
 
+    HERE("equalityExpr", 7);
     result = CompileRelationalExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -1137,4 +1190,5 @@
     int op, result;
 
+    HERE("relationalExpr", 8);
     result = CompileShiftExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -1223,4 +1277,5 @@
     int op, result;
 
+    HERE("shiftExpr", 9);
     result = CompileAddExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -1300,4 +1355,5 @@
     int op, result;
 
+    HERE("addExpr", 10);
     result = CompileMultiplyExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -1377,4 +1433,5 @@
     int op, result;
 
+    HERE("multiplyExpr", 11);
     result = CompileUnaryExpr(interp, infoPtr, flags, envPtr);
     if (result != TCL_OK) {
@@ -1456,4 +1513,5 @@
     int op, result;
 
+    HERE("unaryExpr", 12);
     op = infoPtr->token;
     if ((op == PLUS) || (op == MINUS) || (op == BIT_NOT) || (op == NOT)) {
@@ -1550,4 +1608,5 @@
      */
 
+    HERE("primaryExpr", 13);
     theToken = infoPtr->token;
 
Index: external/tcl/tclCompile.c
===================================================================
--- external/tcl/tclCompile.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclCompile.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -17,4 +17,39 @@
 #include "tclInt.h"
 #include "tclCompile.h"
+
+/*
+ * Variable that controls whether compilation tracing is enabled and, if so,
+ * what level of tracing is desired:
+ *    0: no compilation tracing
+ *    1: summarize compilation of top level cmds and proc bodies
+ *    2: display all instructions of each ByteCode compiled
+ * This variable is linked to the Tcl variable "tcl_traceCompile".
+ */
+
+int tclTraceCompile = 0;
+static int traceInitialized = 0;
+
+/*
+ * Count of the number of compilations and various other compilation-
+ * related statistics.
+ */
+
+#ifdef TCL_COMPILE_STATS
+long tclNumCompilations = 0;
+double tclTotalSourceBytes = 0.0;
+double tclTotalCodeBytes = 0.0;
+
+double tclTotalInstBytes = 0.0;
+double tclTotalObjBytes = 0.0;
+double tclTotalExceptBytes = 0.0;
+double tclTotalAuxBytes = 0.0;
+double tclTotalCmdMapBytes = 0.0;
+
+double tclCurrentSourceBytes = 0.0;
+double tclCurrentCodeBytes = 0.0;
+
+int tclSourceCount[32];
+int tclByteCodeCount[32];
+#endif /* TCL_COMPILE_STATS */
 
 /*
@@ -408,4 +443,404 @@
  *----------------------------------------------------------------------
  *
+ * TclPrintByteCodeObj --
+ *
+ *	This procedure prints ("disassembles") the instructions of a
+ *	bytecode object to stdout.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclPrintByteCodeObj(interp, objPtr)
+    Tcl_Interp *interp;		/* Used only for Tcl_GetStringFromObj. */
+    Tcl_Obj *objPtr;		/* The bytecode object to disassemble. */
+{
+    ByteCode* codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr;
+    unsigned char *codeStart, *codeLimit, *pc;
+    unsigned char *codeDeltaNext, *codeLengthNext;
+    unsigned char *srcDeltaNext, *srcLengthNext;
+    int codeOffset, codeLen, srcOffset, srcLen;
+    int numCmds, numObjs, delta, objBytes, i;
+
+    if (codePtr->refCount <= 0) {
+	return;			/* already freed */
+    }
+
+    codeStart = codePtr->codeStart;
+    codeLimit = (codeStart + codePtr->numCodeBytes);
+    numCmds = codePtr->numCommands;
+    numObjs = codePtr->numObjects;
+
+    objBytes = (numObjs * sizeof(Tcl_Obj));
+    for (i = 0;  i < numObjs;  i++) {
+	Tcl_Obj *litObjPtr = codePtr->objArrayPtr[i];
+	if (litObjPtr->bytes != NULL) {
+	    objBytes += litObjPtr->length;
+	}
+    }
+
+    /*
+     * Print header lines describing the ByteCode.
+     */
+
+    fprintf(stdout, "\nByteCode 0x%x, ref ct %u, epoch %u, interp 0x%x(epoch %u)\n",
+	    (unsigned int) codePtr, codePtr->refCount,
+	    codePtr->compileEpoch, (unsigned int) codePtr->iPtr,
+	    codePtr->iPtr->compileEpoch);
+    fprintf(stdout, "  Source ");
+    TclPrintSource(stdout, codePtr->source,
+	    TclMin(codePtr->numSrcChars, 70));
+    fprintf(stdout, "\n  Cmds %d, chars %d, inst %d, objs %u, aux %d, stk depth %u, code/src %.2f\n",
+	    numCmds, codePtr->numSrcChars, codePtr->numCodeBytes, numObjs,
+	    codePtr->numAuxDataItems, codePtr->maxStackDepth,
+	    (codePtr->numSrcChars?
+	            ((float)codePtr->totalSize)/((float)codePtr->numSrcChars) : 0.0));
+    fprintf(stdout, "  Code %zu = %u(header)+%d(inst)+%d(objs)+%u(exc)+%u(aux)+%d(cmd map)\n",
+	    codePtr->totalSize, sizeof(ByteCode), codePtr->numCodeBytes,
+	    objBytes, (codePtr->numExcRanges * sizeof(ExceptionRange)),
+	    (codePtr->numAuxDataItems * sizeof(AuxData)),
+	    codePtr->numCmdLocBytes);
+
+    /*
+     * If the ByteCode is the compiled body of a Tcl procedure, print
+     * information about that procedure. Note that we don't know the
+     * procedure's name since ByteCode's can be shared among procedures.
+     */
+    
+    if (codePtr->procPtr != NULL) {
+	Proc *procPtr = codePtr->procPtr;
+	int numCompiledLocals = procPtr->numCompiledLocals;
+	fprintf(stdout,
+	        "  Proc 0x%x, ref ct %d, args %d, compiled locals %d\n",
+		(unsigned int) procPtr, procPtr->refCount, procPtr->numArgs,
+		numCompiledLocals);
+	if (numCompiledLocals > 0) {
+	    CompiledLocal *localPtr = procPtr->firstLocalPtr;
+	    for (i = 0;  i < numCompiledLocals;  i++) {
+		fprintf(stdout, "      %d: slot %d%s%s%s%s%s%s",
+			i, localPtr->frameIndex,
+			((localPtr->flags & VAR_SCALAR)?  ", scalar"  : ""),
+			((localPtr->flags & VAR_ARRAY)?  ", array"  : ""),
+			((localPtr->flags & VAR_LINK)?  ", link"  : ""),
+			((localPtr->flags & VAR_ARGUMENT)?  ", arg"  : ""),
+			((localPtr->flags & VAR_TEMPORARY)? ", temp" : ""),
+			((localPtr->flags & VAR_RESOLVED)? ", resolved" : ""));
+		if (TclIsVarTemporary(localPtr)) {
+		    fprintf(stdout,	"\n");
+		} else {
+		    fprintf(stdout,	", name=\"%s\"\n", localPtr->name);
+		}
+		localPtr = localPtr->nextPtr;
+	    }
+	}
+    }
+
+    /*
+     * Print the ExceptionRange array.
+     */
+
+    if (codePtr->numExcRanges > 0) {
+	fprintf(stdout, "  Exception ranges %d, depth %d:\n",
+	        codePtr->numExcRanges, codePtr->maxExcRangeDepth);
+	for (i = 0;  i < codePtr->numExcRanges;  i++) {
+	    ExceptionRange *rangePtr = &(codePtr->excRangeArrayPtr[i]);
+	    fprintf(stdout, "      %d: level %d, %s, pc %d-%d, ",
+		    i, rangePtr->nestingLevel,
+		    ((rangePtr->type == LOOP_EXCEPTION_RANGE)? "loop":"catch"),
+		    rangePtr->codeOffset,
+		    (rangePtr->codeOffset + rangePtr->numCodeBytes - 1));
+	    switch (rangePtr->type) {
+	    case LOOP_EXCEPTION_RANGE:
+		fprintf(stdout,	"continue %d, break %d\n",
+		        rangePtr->continueOffset, rangePtr->breakOffset);
+		break;
+	    case CATCH_EXCEPTION_RANGE:
+		fprintf(stdout,	"catch %d\n", rangePtr->catchOffset);
+		break;
+	    default:
+		panic("TclPrintSource: unrecognized ExceptionRange type %d\n",
+		        rangePtr->type);
+	    }
+	}
+    }
+    
+    /*
+     * If there were no commands (e.g., an expression or an empty string
+     * was compiled), just print all instructions and return.
+     */
+
+    if (numCmds == 0) {
+	pc = codeStart;
+	while (pc < codeLimit) {
+	    fprintf(stdout, "    ");
+	    pc += TclPrintInstruction(codePtr, pc);
+	}
+	return;
+    }
+    
+    /*
+     * Print table showing the code offset, source offset, and source
+     * length for each command. These are encoded as a sequence of bytes.
+     */
+
+    fprintf(stdout, "  Commands %d:", numCmds);
+    codeDeltaNext = codePtr->codeDeltaStart;
+    codeLengthNext = codePtr->codeLengthStart;
+    srcDeltaNext  = codePtr->srcDeltaStart;
+    srcLengthNext = codePtr->srcLengthStart;
+    codeOffset = srcOffset = 0;
+    for (i = 0;  i < numCmds;  i++) {
+	if ((unsigned int) (*codeDeltaNext) == (unsigned int) 0xFF) {
+	    codeDeltaNext++;
+	    delta = TclGetInt4AtPtr(codeDeltaNext);
+	    codeDeltaNext += 4;
+	} else {
+	    delta = TclGetInt1AtPtr(codeDeltaNext);
+	    codeDeltaNext++;
+	}
+	codeOffset += delta;
+
+	if ((unsigned int) (*codeLengthNext) == (unsigned int) 0xFF) {
+	    codeLengthNext++;
+	    codeLen = TclGetInt4AtPtr(codeLengthNext);
+	    codeLengthNext += 4;
+	} else {
+	    codeLen = TclGetInt1AtPtr(codeLengthNext);
+	    codeLengthNext++;
+	}
+	
+	if ((unsigned int) (*srcDeltaNext) == (unsigned int) 0xFF) {
+	    srcDeltaNext++;
+	    delta = TclGetInt4AtPtr(srcDeltaNext);
+	    srcDeltaNext += 4;
+	} else {
+	    delta = TclGetInt1AtPtr(srcDeltaNext);
+	    srcDeltaNext++;
+	}
+	srcOffset += delta;
+
+	if ((unsigned int) (*srcLengthNext) == (unsigned int) 0xFF) {
+	    srcLengthNext++;
+	    srcLen = TclGetInt4AtPtr(srcLengthNext);
+	    srcLengthNext += 4;
+	} else {
+	    srcLen = TclGetInt1AtPtr(srcLengthNext);
+	    srcLengthNext++;
+	}
+	
+	fprintf(stdout,	"%s%4d: pc %d-%d, source %d-%d",
+		((i % 2)? "	" : "\n   "),
+		(i+1), codeOffset, (codeOffset + codeLen - 1),
+		srcOffset, (srcOffset + srcLen - 1));
+    }
+    if ((numCmds > 0) && ((numCmds % 2) != 0)) {
+	fprintf(stdout,	"\n");
+    }
+    
+    /*
+     * Print each instruction. If the instruction corresponds to the start
+     * of a command, print the command's source. Note that we don't need
+     * the code length here.
+     */
+
+    codeDeltaNext = codePtr->codeDeltaStart;
+    srcDeltaNext  = codePtr->srcDeltaStart;
+    srcLengthNext = codePtr->srcLengthStart;
+    codeOffset = srcOffset = 0;
+    pc = codeStart;
+    for (i = 0;  i < numCmds;  i++) {
+	if ((unsigned int) (*codeDeltaNext) == (unsigned int) 0xFF) {
+	    codeDeltaNext++;
+	    delta = TclGetInt4AtPtr(codeDeltaNext);
+	    codeDeltaNext += 4;
+	} else {
+	    delta = TclGetInt1AtPtr(codeDeltaNext);
+	    codeDeltaNext++;
+	}
+	codeOffset += delta;
+
+	if ((unsigned int) (*srcDeltaNext) == (unsigned int) 0xFF) {
+	    srcDeltaNext++;
+	    delta = TclGetInt4AtPtr(srcDeltaNext);
+	    srcDeltaNext += 4;
+	} else {
+	    delta = TclGetInt1AtPtr(srcDeltaNext);
+	    srcDeltaNext++;
+	}
+	srcOffset += delta;
+
+	if ((unsigned int) (*srcLengthNext) == (unsigned int) 0xFF) {
+	    srcLengthNext++;
+	    srcLen = TclGetInt4AtPtr(srcLengthNext);
+	    srcLengthNext += 4;
+	} else {
+	    srcLen = TclGetInt1AtPtr(srcLengthNext);
+	    srcLengthNext++;
+	}
+
+	/*
+	 * Print instructions before command i.
+	 */
+	
+	while ((pc-codeStart) < codeOffset) {
+	    fprintf(stdout, "    ");
+	    pc += TclPrintInstruction(codePtr, pc);
+	}
+
+	fprintf(stdout, "  Command %d: ", (i+1));
+	TclPrintSource(stdout, (codePtr->source + srcOffset),
+	        TclMin(srcLen, 70));
+	fprintf(stdout, "\n");
+    }
+    if (pc < codeLimit) {
+	/*
+	 * Print instructions after the last command.
+	 */
+
+	while (pc < codeLimit) {
+	    fprintf(stdout, "    ");
+	    pc += TclPrintInstruction(codePtr, pc);
+	}
+    }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclPrintInstruction --
+ *
+ *	This procedure prints ("disassembles") one instruction from a
+ *	bytecode object to stdout.
+ *
+ * Results:
+ *	Returns the length in bytes of the current instruiction.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclPrintInstruction(codePtr, pc)
+    ByteCode* codePtr;		/* Bytecode containing the instruction. */
+    unsigned char *pc;		/* Points to first byte of instruction. */
+{
+    Proc *procPtr = codePtr->procPtr;
+    unsigned char opCode = *pc;
+    register InstructionDesc *instDesc = &instructionTable[opCode];
+    unsigned char *codeStart = codePtr->codeStart;
+    unsigned int pcOffset = (pc - codeStart);
+    int opnd, elemLen, i, j;
+    Tcl_Obj *elemPtr;
+    char *string;
+    
+    fprintf(stdout, "(%u) %s ", pcOffset, instDesc->name);
+    for (i = 0;  i < instDesc->numOperands;  i++) {
+	switch (instDesc->opTypes[i]) {
+	case OPERAND_INT1:
+	    opnd = TclGetInt1AtPtr(pc+1+i);
+	    if ((i == 0) && ((opCode == INST_JUMP1)
+			     || (opCode == INST_JUMP_TRUE1)
+		             || (opCode == INST_JUMP_FALSE1))) {
+		fprintf(stdout, "%d  	# pc %u", opnd, (pcOffset + opnd));
+	    } else {
+		fprintf(stdout, "%d", opnd);
+	    }
+	    break;
+	case OPERAND_INT4:
+	    opnd = TclGetInt4AtPtr(pc+1+i);
+	    if ((i == 0) && ((opCode == INST_JUMP4)
+			     || (opCode == INST_JUMP_TRUE4)
+		             || (opCode == INST_JUMP_FALSE4))) {
+		fprintf(stdout, "%d  	# pc %u", opnd, (pcOffset + opnd));
+	    } else {
+		fprintf(stdout, "%d", opnd);
+	    }
+	    break;
+	case OPERAND_UINT1:
+	    opnd = TclGetUInt1AtPtr(pc+1+i);
+	    if ((i == 0) && (opCode == INST_PUSH1)) {
+		elemPtr = codePtr->objArrayPtr[opnd];
+		string = Tcl_GetStringFromObj(elemPtr, &elemLen);
+		fprintf(stdout, "%u  	# ", (unsigned int) opnd);
+		TclPrintSource(stdout, string, TclMin(elemLen, 40));
+	    } else if ((i == 0) && ((opCode == INST_LOAD_SCALAR1)
+				    || (opCode == INST_LOAD_ARRAY1)
+				    || (opCode == INST_STORE_SCALAR1)
+				    || (opCode == INST_STORE_ARRAY1))) {
+		int localCt = procPtr->numCompiledLocals;
+		CompiledLocal *localPtr = procPtr->firstLocalPtr;
+		if (opnd >= localCt) {
+		    panic("TclPrintInstruction: bad local var index %u (%u locals)\n",
+			     (unsigned int) opnd, localCt);
+		    return instDesc->numBytes;
+		}
+		for (j = 0;  j < opnd;  j++) {
+		    localPtr = localPtr->nextPtr;
+		}
+		if (TclIsVarTemporary(localPtr)) {
+		    fprintf(stdout, "%u	# temp var %u",
+			    (unsigned int) opnd, (unsigned int) opnd);
+		} else {
+		    fprintf(stdout, "%u	# var ", (unsigned int) opnd);
+		    TclPrintSource(stdout, localPtr->name, 40);
+		}
+	    } else {
+		fprintf(stdout, "%u ", (unsigned int) opnd);
+	    }
+	    break;
+	case OPERAND_UINT4:
+	    opnd = TclGetUInt4AtPtr(pc+1+i);
+	    if (opCode == INST_PUSH4) {
+		elemPtr = codePtr->objArrayPtr[opnd];
+		string = Tcl_GetStringFromObj(elemPtr, &elemLen);
+		fprintf(stdout, "%u  	# ", opnd);
+		TclPrintSource(stdout, string, TclMin(elemLen, 40));
+	    } else if ((i == 0) && ((opCode == INST_LOAD_SCALAR4)
+				    || (opCode == INST_LOAD_ARRAY4)
+				    || (opCode == INST_STORE_SCALAR4)
+				    || (opCode == INST_STORE_ARRAY4))) {
+		int localCt = procPtr->numCompiledLocals;
+		CompiledLocal *localPtr = procPtr->firstLocalPtr;
+		if (opnd >= localCt) {
+		    panic("TclPrintInstruction: bad local var index %u (%u locals)\n",
+			     (unsigned int) opnd, localCt);
+		    return instDesc->numBytes;
+		}
+		for (j = 0;  j < opnd;  j++) {
+		    localPtr = localPtr->nextPtr;
+		}
+		if (TclIsVarTemporary(localPtr)) {
+		    fprintf(stdout, "%u	# temp var %u",
+			    (unsigned int) opnd, (unsigned int) opnd);
+		} else {
+		    fprintf(stdout, "%u	# var ", (unsigned int) opnd);
+		    TclPrintSource(stdout, localPtr->name, 40);
+		}
+	    } else {
+		fprintf(stdout, "%u ", (unsigned int) opnd);
+	    }
+	    break;
+	case OPERAND_NONE:
+	default:
+	    break;
+	}
+    }
+    fprintf(stdout, "\n");
+    return instDesc->numBytes;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
  * TclPrintSource --
  *
@@ -537,4 +972,9 @@
     register int i;
 
+#ifdef TCL_COMPILE_STATS    
+    tclCurrentSourceBytes -= (double) codePtr->numSrcChars;
+    tclCurrentCodeBytes -= (double) codePtr->totalSize;
+#endif /* TCL_COMPILE_STATS */
+
     /*
      * A single heap object holds the ByteCode structure and its code,
@@ -627,4 +1067,12 @@
     int length, result;
 
+    if (!traceInitialized) {
+        if (Tcl_LinkVar(interp, "tcl_traceCompile",
+	            (char *) &tclTraceCompile,  TCL_LINK_INT) != TCL_OK) {
+            panic("SetByteCodeFromAny: unable to create link for tcl_traceCompile variable");
+        }
+        traceInitialized = 1;
+    }
+    
     string = Tcl_GetStringFromObj(objPtr, &length);
     TclInitCompileEnv(interp, &compEnv, string);
@@ -665,4 +1113,9 @@
     TclFreeCompileEnv(&compEnv);
 
+    if (result == TCL_OK) {
+	if (tclTraceCompile == 2) {
+	    TclPrintByteCodeObj(interp, objPtr);
+	}
+    }
     return result;
 }
@@ -858,4 +1311,7 @@
     int numObjects, i;
     Namespace *namespacePtr;
+#ifdef TCL_COMPILE_STATS
+    int srcLenLog2, sizeLog2;
+#endif /*TCL_COMPILE_STATS*/
 
     codeBytes = (envPtr->codeNext - envPtr->codeStart);
@@ -886,4 +1342,27 @@
     }
     totalSize = (size + objBytes);
+
+#ifdef TCL_COMPILE_STATS
+    tclNumCompilations++;
+    tclTotalSourceBytes += (double) srcLen;
+    tclTotalCodeBytes += (double) totalSize;
+    
+    tclTotalInstBytes += (double) codeBytes;
+    tclTotalObjBytes += (double) objBytes;
+    tclTotalExceptBytes += exceptArrayBytes;
+    tclTotalAuxBytes += (double) auxDataArrayBytes;
+    tclTotalCmdMapBytes += (double) cmdLocBytes;
+
+    tclCurrentSourceBytes += (double) srcLen;
+    tclCurrentCodeBytes += (double) totalSize;
+
+    srcLenLog2 = TclLog2(srcLen);
+    sizeLog2 = TclLog2((int) totalSize);
+    if ((srcLenLog2 > 31) || (sizeLog2 > 31)) {
+	panic("TclInitByteCodeObj: bad source or code sizes\n");
+    }
+    tclSourceCount[srcLenLog2]++;
+    tclByteCodeCount[sizeLog2]++;
+#endif /* TCL_COMPILE_STATS */    
 
     if (envPtr->iPtr->varFramePtr != NULL) {
@@ -1341,4 +1820,30 @@
 		cmdCodeOffset);
 	    
+	if ((!(flags & TCL_BRACKET_TERM))
+	        && (tclTraceCompile >= 1) && (envPtr->procPtr == NULL)) {
+	    /*
+	     * Display a line summarizing the top level command we are about
+	     * to compile.
+	     */
+	    
+	    char *p = cmdSrcStart;
+	    int numChars, complete;
+	    
+	    while ((CHAR_TYPE(p, lastChar) != TCL_COMMAND_END)
+		   || ((*p == ']') && !(flags & TCL_BRACKET_TERM))) {
+		p++;
+	    }
+	    numChars = (p - cmdSrcStart);
+	    complete = 1;
+	    if (numChars > 60) {
+		numChars = 60;
+		complete = 0;
+	    } else if ((numChars >= 2) && (*p == '\n') && (*(p-1) == '{')) {
+		complete = 0;
+	    }
+	    fprintf(stdout, "Compiling: %.*s%s\n",
+		    numChars, cmdSrcStart, (complete? "" : " ..."));
+	}
+	
 	while ((type != TCL_COMMAND_END)
 	        || ((c == ']') && !(flags & TCL_BRACKET_TERM))) {
Index: external/tcl/tclCompile.h
===================================================================
--- external/tcl/tclCompile.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclCompile.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -36,4 +36,53 @@
 
 extern Tcl_ObjType	tclCmdNameType;
+
+/*
+ * Variable that controls whether compilation tracing is enabled and, if so,
+ * what level of tracing is desired:
+ *    0: no compilation tracing
+ *    1: summarize compilation of top level cmds and proc bodies
+ *    2: display all instructions of each ByteCode compiled
+ * This variable is linked to the Tcl variable "tcl_traceCompile".
+ */
+
+extern int 		tclTraceCompile;
+
+/*
+ * Variable that controls whether execution tracing is enabled and, if so,
+ * what level of tracing is desired:
+ *    0: no execution tracing
+ *    1: trace invocations of Tcl procs only
+ *    2: trace invocations of all (not compiled away) commands
+ *    3: display each instruction executed
+ * This variable is linked to the Tcl variable "tcl_traceExec".
+ */
+
+extern int 		tclTraceExec;
+
+/*
+ * The number of bytecode compilations and various other compilation-related
+ * statistics. The tclByteCodeCount and tclSourceCount arrays are used to
+ * hold the count of ByteCodes and sources whose sizes fall into various
+ * binary decades; e.g., tclByteCodeCount[5] is a count of the ByteCodes
+ * with size larger than 2**4 and less than or equal to 2**5.
+ */
+
+#ifdef TCL_COMPILE_STATS
+extern long		tclNumCompilations;
+extern double		tclTotalSourceBytes;
+extern double		tclTotalCodeBytes;
+
+extern double		tclTotalInstBytes;
+extern double		tclTotalObjBytes;
+extern double		tclTotalExceptBytes;
+extern double		tclTotalAuxBytes;
+extern double		tclTotalCmdMapBytes;
+
+extern double		tclCurrentSourceBytes;
+extern double		tclCurrentCodeBytes;
+
+extern int		tclSourceCount[32];
+extern int		tclByteCodeCount[32];
+#endif /* TCL_COMPILE_STATS */
 
 /*
@@ -767,7 +816,12 @@
 EXTERN void		TclInitJumpFixupArray _ANSI_ARGS_((
 			    JumpFixupArray *fixupArrayPtr));
+#ifdef TCL_COMPILE_STATS
+EXTERN int		TclLog2 _ANSI_ARGS_((int value));
+#endif /*TCL_COMPILE_STATS*/
 EXTERN int		TclObjIndexForString _ANSI_ARGS_((char *start,
 			    int length, int allocStrRep, int inHeap,
 			    CompileEnv *envPtr));
+EXTERN int		TclPrintInstruction _ANSI_ARGS_((ByteCode* codePtr,
+			    unsigned char *pc));
 EXTERN void		TclPrintSource _ANSI_ARGS_((FILE *outFile,
 			    char *string, int maxChars));
Index: external/tcl/tclExecute.c
===================================================================
--- external/tcl/tclExecute.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclExecute.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -51,4 +51,16 @@
 
 /*
+ * Variable that controls whether execution tracing is enabled and, if so,
+ * what level of tracing is desired:
+ *    0: no execution tracing
+ *    1: trace invocations of Tcl procs only
+ *    2: trace invocations of all (not compiled away) commands
+ *    3: display each instruction executed
+ * This variable is linked to the Tcl variable "tcl_traceExec".
+ */
+
+int tclTraceExec = 0;
+
+/*
  * The following global variable is use to signal matherr that Tcl
  * is responsible for the arithmetic, so errors can be handled in a
@@ -90,4 +102,26 @@
 };
     
+/*
+ * Mapping from Tcl result codes to strings; used for error and debugging
+ * messages. 
+ */
+
+#ifdef TCL_COMPILE_DEBUG
+static char *resultStrings[] = {
+    "TCL_OK", "TCL_ERROR", "TCL_RETURN", "TCL_BREAK", "TCL_CONTINUE"
+};
+#endif /* TCL_COMPILE_DEBUG */
+
+/*
+ * The following are statistics-related variables that record information
+ * about the bytecode compiler and interpreter's operation. This includes
+ * an array that records for each instruction how often it is executed.
+ */
+
+#ifdef TCL_COMPILE_STATS
+static long numExecutions = 0;
+static int instructionCount[256];
+#endif /* TCL_COMPILE_STATS */
+
 /*
  * Macros for testing floating-point values for certain special cases. Test
@@ -153,4 +187,66 @@
 #define POP_OBJECT() \
     (stackPtr[stackTop--].o)
+
+/*
+ * Macros used to trace instruction execution. The macros TRACE,
+ * TRACE_WITH_OBJ, and O2S are only used inside TclExecuteByteCode.
+ * O2S is only used in TRACE* calls to get a string from an object.
+ * 
+ * NOTE THAT CLIENTS OF O2S ARE LIKELY TO FAIL IF THE OBJECT'S
+ * STRING REP CONTAINS NULLS. 
+ */
+
+#ifdef TCL_COMPILE_DEBUG
+	
+#define O2S(objPtr) \
+    Tcl_GetStringFromObj((objPtr), &length)
+	
+#ifdef TCL_COMPILE_STATS
+#define TRACE(a) \
+    if (traceInstructions) { \
+        fprintf(stdout, "%d: %d,%ld (%u) ", iPtr->numLevels, \
+	       stackTop, (tclObjsAlloced - tclObjsFreed), \
+	       (unsigned int)(pc - codePtr->codeStart)); \
+	printf a; \
+        fflush(stdout); \
+    }
+#define TRACE_WITH_OBJ(a, objPtr) \
+    if (traceInstructions) { \
+        fprintf(stdout, "%d: %d,%ld (%u) ", iPtr->numLevels, \
+	       stackTop, (tclObjsAlloced - tclObjsFreed), \
+	       (unsigned int)(pc - codePtr->codeStart)); \
+	printf a; \
+	bytes = Tcl_GetStringFromObj((objPtr), &length); \
+        TclPrintSource(stdout, bytes, TclMin(length, 30)); \
+        fprintf(stdout, "\n"); \
+        fflush(stdout); \
+    }
+#else  /* not TCL_COMPILE_STATS */
+#define TRACE(a) \
+    if (traceInstructions) { \
+        fprintf(stdout, "%d: %d (%u) ", iPtr->numLevels, stackTop, \
+	       (unsigned int)(pc - codePtr->codeStart)); \
+	printf a; \
+        fflush(stdout); \
+    }
+#define TRACE_WITH_OBJ(a, objPtr) \
+    if (traceInstructions) { \
+        fprintf(stdout, "%d: %d (%u) ", iPtr->numLevels, stackTop, \
+	       (unsigned int)(pc - codePtr->codeStart)); \
+	printf a; \
+	bytes = Tcl_GetStringFromObj((objPtr), &length); \
+        TclPrintSource(stdout, bytes, TclMin(length, 30)); \
+        fprintf(stdout, "\n"); \
+        fflush(stdout); \
+    }
+#endif /* TCL_COMPILE_STATS */
+
+#else  /* not TCL_COMPILE_DEBUG */
+	
+#define TRACE(a)
+#define TRACE_WITH_OBJ(a, objPtr)
+#define O2S(objPtr)
+	
+#endif /* TCL_COMPILE_DEBUG */
 
 /*
@@ -178,4 +274,8 @@
 static int		ExprUnaryFunc _ANSI_ARGS_((Tcl_Interp *interp,
 			    ExecEnv *eePtr, ClientData clientData));
+#ifdef TCL_COMPILE_STATS
+static int              EvalStatsCmd _ANSI_ARGS_((ClientData clientData,
+                            Tcl_Interp *interp, int argc, char **argv));
+#endif /* TCL_COMPILE_STATS */
 static void		FreeCmdNameInternalRep _ANSI_ARGS_((
     			    Tcl_Obj *objPtr));
@@ -193,5 +293,14 @@
 static int		SetCmdNameFromAny _ANSI_ARGS_((Tcl_Interp *interp,
 			    Tcl_Obj *objPtr));
+#ifdef TCL_COMPILE_DEBUG
+static char *		StringForResultCode _ANSI_ARGS_((int result));
+#endif /* TCL_COMPILE_DEBUG */
 static void		UpdateStringOfCmdName _ANSI_ARGS_((Tcl_Obj *objPtr));
+#ifdef TCL_COMPILE_DEBUG
+static void		ValidatePcAndStackTop _ANSI_ARGS_((
+			    ByteCode *codePtr, unsigned char *pc,
+			    int stackTop, int stackLowerBound,
+			    int stackUpperBound));
+#endif /* TCL_COMPILE_DEBUG */
 
 /*
@@ -259,5 +368,10 @@
  *
  * Side effects:
- *	This procedure initializes the array of instruction names.
+ *	This procedure initializes the array of instruction names. If
+ *	compiling with the TCL_COMPILE_STATS flag, it initializes the
+ *	array that counts the executions of each instruction and it
+ *	creates the "evalstats" command. It also registers the command name
+ *	Tcl_ObjType. It also establishes the link between the Tcl
+ *	"tcl_traceExec" and C "tclTraceExec" variables.
  *
  *----------------------------------------------------------------------
@@ -277,4 +391,18 @@
     for (i = 0;  instructionTable[i].name != NULL;  i++) {
 	opName[i] = instructionTable[i].name;
+    }
+
+#ifdef TCL_COMPILE_STATS    
+    (VOID *) memset(instructionCount, 0, sizeof(instructionCount));
+    (VOID *) memset(tclByteCodeCount, 0, sizeof(tclByteCodeCount));
+    (VOID *) memset(tclSourceCount, 0, sizeof(tclSourceCount));
+
+    Tcl_CreateCommand(interp, "evalstats", EvalStatsCmd,
+		      (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+#endif /* TCL_COMPILE_STATS */
+    
+    if (Tcl_LinkVar(interp, "tcl_traceExec", (char *) &tclTraceExec,
+		    TCL_LINK_INT) != TCL_OK) {
+	panic("InitByteCodeExecution: can't create link for tcl_traceExec variable");
     }
 }
@@ -470,8 +598,12 @@
 				 * process break, continue, and errors. */
     int result = TCL_OK;	/* Return code returned after execution. */
+    int traceInstructions = (tclTraceExec == 3);
     Tcl_Obj *valuePtr, *value2Ptr, *namePtr, *objPtr;
     char *bytes;
     int length;
     long i;
+    Tcl_DString command;	/* Used for debugging. If tclTraceExec >= 2
+				 * holds a string representing the last
+				 * command invoked. */
 
     /*
@@ -488,4 +620,23 @@
 
     /*
+     * THIS PROC FAILS IF AN OBJECT'S STRING REP HAS A NULL BYTE.
+     */
+
+    if (tclTraceExec >= 2) {
+	PrintByteCodeInfo(codePtr);
+#ifdef TCL_COMPILE_STATS
+	fprintf(stdout, "  Starting stack top=%d, system objects=%ld\n",
+		eePtr->stackTop, (tclObjsAlloced - tclObjsFreed));
+#else
+	fprintf(stdout, "  Starting stack top=%d\n", eePtr->stackTop);
+#endif /* TCL_COMPILE_STATS */
+	fflush(stdout);
+    }
+
+#ifdef TCL_COMPILE_STATS
+    numExecutions++;
+#endif /* TCL_COMPILE_STATS */
+
+    /*
      * Make sure the catch stack is large enough to hold the maximum number
      * of catch commands that could ever be executing at the same time. This
@@ -508,4 +659,11 @@
 
     /*
+     * Initialize the buffer that holds a string containing the name and
+     * arguments for the last invoked command.
+     */
+
+    Tcl_DStringInit(&command);
+
+    /*
      * Loop executing instructions until a "done" instruction, a TCL_RETURN,
      * or some error.
@@ -513,5 +671,24 @@
 
     for (;;) {
+#ifdef TCL_COMPILE_DEBUG
+	ValidatePcAndStackTop(codePtr, pc, stackTop, initStackTop,
+		eePtr->stackEnd);
+#else /* not TCL_COMPILE_DEBUG */
+	if (traceInstructions) {
+#ifdef TCL_COMPILE_STATS
+	    fprintf(stdout, "%d: %d,%ld ", iPtr->numLevels, stackTop,
+		    (tclObjsAlloced - tclObjsFreed));
+#else /* TCL_COMPILE_STATS */
+	    fprintf(stdout, "%d: %d ", iPtr->numLevels, stackTop);
+#endif /* TCL_COMPILE_STATS */
+	    TclPrintInstruction(codePtr, pc);
+	    fflush(stdout);
+	}
+#endif /* TCL_COMPILE_DEBUG */
+	
 	opCode = *pc;
+#ifdef TCL_COMPILE_STATS    
+	instructionCount[opCode]++;
+#endif /* TCL_COMPILE_STATS */
 
         switch (opCode) {
@@ -533,4 +710,6 @@
 		panic("TclExecuteByteCode execution failure: end stack top != start stack top");
 	    }
+	    TRACE_WITH_OBJ(("done => return code=%d, result is ", result),
+		    iPtr->objResultPtr);
 	    goto done;
 	    
@@ -538,4 +717,6 @@
 	    valuePtr = objArrayPtr[TclGetUInt1AtPtr(pc+1)];
 	    PUSH_OBJECT(valuePtr);
+	    TRACE_WITH_OBJ(("push1 %u => ", TclGetUInt1AtPtr(pc+1)),
+	            valuePtr);
 	    ADJUST_PC(2);
 	    
@@ -543,8 +724,11 @@
 	    valuePtr = objArrayPtr[TclGetUInt4AtPtr(pc+1)];
 	    PUSH_OBJECT(valuePtr);
+	    TRACE_WITH_OBJ(("push4 %u => ", TclGetUInt4AtPtr(pc+1)),
+		    valuePtr);
 	    ADJUST_PC(5);
 	    
 	case INST_POP:
 	    valuePtr = POP_OBJECT();
+	    TRACE_WITH_OBJ(("pop => discarding "), valuePtr);
 	    TclDecrRefCount(valuePtr); /* finished with pop'ed object. */
 	    ADJUST_PC(1);
@@ -553,4 +737,5 @@
 	    valuePtr = stackPtr[stackTop].o;
 	    PUSH_OBJECT(Tcl_DuplicateObj(valuePtr));
+	    TRACE_WITH_OBJ(("dup => "), valuePtr);
 	    ADJUST_PC(1);
 
@@ -605,4 +790,5 @@
 		
 		PUSH_OBJECT(concatObjPtr);
+		TRACE_WITH_OBJ(("concat %u => ", opnd), concatObjPtr);
 		ADJUST_PC(2);
             }
@@ -629,4 +815,8 @@
 				    * Init. to avoid compiler warning. */
 		Tcl_Command cmd;
+#ifdef TCL_COMPILE_DEBUG
+		int isUnknownCmd = 0;
+		char cmdNameBuf[30];
+#endif /* TCL_COMPILE_DEBUG */
 		
 		/*
@@ -677,8 +867,13 @@
 			        "invalid command name \"", cmdName, "\"",
 				(char *) NULL);
+			TRACE(("%s %u => unknown proc not found: ",
+			       opName[opCode], objc));
 			result = TCL_ERROR;
 			goto checkForCatch;
 		    }
 		    cmdPtr = (Command *) cmd;
+#ifdef TCL_COMPILE_DEBUG
+		    isUnknownCmd = 1;
+#endif /*TCL_COMPILE_DEBUG*/			
 		    stackTop++; /* need room for new inserted objv[0] */
 		    for (i = objc;  i >= 0;  i--) {
@@ -723,4 +918,37 @@
 		Tcl_ResetResult(interp);
 
+		if (tclTraceExec >= 2) {
+		    char buffer[50];
+
+		    sprintf(buffer, "%d: (%u) invoking ", iPtr->numLevels,
+			    (unsigned int)(pc - codePtr->codeStart));
+		    Tcl_DStringAppend(&command, buffer, -1);
+		    
+#ifdef TCL_COMPILE_DEBUG
+		    if (traceInstructions) { /* tclTraceExec == 3 */
+			strncpy(cmdNameBuf, cmdName, 20);
+			TRACE(("%s %u => call ", opName[opCode],
+			       (isUnknownCmd? objc-1 : objc)));
+		    } else {
+			fprintf(stdout, "%s", buffer);
+		    }
+#else /* TCL_COMPILE_DEBUG */
+		    fprintf(stdout, "%s", buffer);
+#endif /*TCL_COMPILE_DEBUG*/
+
+		    for (i = 0;  i < objc;  i++) {
+			bytes = TclGetStringFromObj(objv[i], &length);
+			TclPrintSource(stdout, bytes, TclMin(length, 15));
+			fprintf(stdout, " ");
+
+			sprintf(buffer, "\"%.*s\" ", TclMin(length, 15), bytes);
+			Tcl_DStringAppend(&command, buffer, -1);
+		    }
+		    fprintf(stdout, "\n");
+		    fflush(stdout);
+
+		    Tcl_DStringFree(&command);
+		}
+
 		iPtr->cmdCount++;
 		DECACHE_STACK_INFO();
@@ -768,4 +996,7 @@
 		     */
 		    PUSH_OBJECT(Tcl_GetObjResult(interp));
+		    TRACE_WITH_OBJ(("%s %u => ...after \"%.20s\", result=",
+		            opName[opCode], objc, cmdNameBuf),
+			    Tcl_GetObjResult(interp));
 		    ADJUST_PC(pcAdjustment);
 		    
@@ -784,4 +1015,7 @@
                             /*catchOnly*/ 0, codePtr);
 		    if (rangePtr == NULL) {
+		        TRACE(("%s %u => ... after \"%.20s\", no encl. loop or catch, returning %s\n",
+		                opName[opCode], objc, cmdNameBuf,
+			        StringForResultCode(result)));
 			goto abnormalReturn; /* no catch exists to check */
 		    }
@@ -791,10 +1025,20 @@
 			    newPcOffset = rangePtr->breakOffset;
 			} else if (rangePtr->continueOffset == -1) {
+			    TRACE(("%s %u => ... after \"%.20s\", %s, loop w/o continue, checking for catch\n",
+				   opName[opCode], objc, cmdNameBuf,
+				   StringForResultCode(result)));
 			    goto checkForCatch;
 			} else {
 			    newPcOffset = rangePtr->continueOffset;
 			}
+			TRACE(("%s %u => ... after \"%.20s\", %s, range at %d, new pc %d\n",
+			       opName[opCode], objc, cmdNameBuf,
+			       StringForResultCode(result),
+			       rangePtr->codeOffset, newPcOffset));
 			break;
 		    case CATCH_EXCEPTION_RANGE:
+			TRACE(("%s %u => ... after \"%.20s\", %s...\n",
+			       opName[opCode], objc, cmdNameBuf,
+			       StringForResultCode(result)));
 			goto processCatch; /* it will use rangePtr */
 		    default:
@@ -810,4 +1054,7 @@
 		     * enclosing catch exception range, if any.
 		     */
+		    TRACE_WITH_OBJ(("%s %u => ... after \"%.20s\", TCL_ERROR ",
+		            opName[opCode], objc, cmdNameBuf),
+			    Tcl_GetObjResult(interp));
 		    goto checkForCatch;
 
@@ -818,7 +1065,12 @@
 		     * for an enclosing catch exception range, if any.
 		     */
+		    TRACE(("%s %u => ... after \"%.20s\", TCL_RETURN\n",
+		            opName[opCode], objc, cmdNameBuf));
 		    goto checkForCatch;
 
 		default:
+		    TRACE_WITH_OBJ(("%s %u => ... after \"%.20s\", OTHER RETURN CODE %d ",
+		            opName[opCode], objc, cmdNameBuf, result),
+			    Tcl_GetObjResult(interp));
 		    goto checkForCatch;
 		} /* end of switch on result from invoke instruction */
@@ -836,4 +1088,6 @@
 		
 		PUSH_OBJECT(Tcl_GetObjResult(interp));
+		TRACE_WITH_OBJ(("evalStk \"%.30s\" => ", O2S(objPtr)),
+			Tcl_GetObjResult(interp));
 		TclDecrRefCount(objPtr);
 		ADJUST_PC(1);
@@ -855,4 +1109,6 @@
 			codePtr);
 		if (rangePtr == NULL) {
+		    TRACE(("evalStk \"%.30s\" => no encl. loop or catch, returning %s\n",
+			    O2S(objPtr), StringForResultCode(result)));
 		    Tcl_DecrRefCount(objPtr);
 		    goto abnormalReturn;    /* no catch exists to check */
@@ -863,4 +1119,6 @@
 			newPcOffset = rangePtr->breakOffset;
 		    } else if (rangePtr->continueOffset == -1) {
+			TRACE(("evalStk \"%.30s\" => %s, loop w/o continue, checking for catch\n",
+			       O2S(objPtr), StringForResultCode(result)));
 			Tcl_DecrRefCount(objPtr);
 			goto checkForCatch;
@@ -869,6 +1127,12 @@
 		    }
 		    result = TCL_OK;
+		    TRACE_WITH_OBJ(("evalStk \"%.30s\" => %s, range at %d, new pc %d ",
+			    O2S(objPtr), StringForResultCode(result),
+			    rangePtr->codeOffset, newPcOffset), valuePtr);
 		    break;
 		case CATCH_EXCEPTION_RANGE:
+		    TRACE_WITH_OBJ(("evalStk \"%.30s\" => %s ",
+			    O2S(objPtr), StringForResultCode(result)),
+			    valuePtr);
 		    Tcl_DecrRefCount(objPtr);
 		    goto processCatch;  /* it will use rangePtr */
@@ -880,4 +1144,6 @@
 		continue;	/* restart outer instruction loop at pc */
 	    } else { /* eval returned TCL_ERROR, TCL_RETURN, unknown code */
+		TRACE_WITH_OBJ(("evalStk \"%.30s\" => ERROR: ", O2S(objPtr)),
+		        Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(objPtr);
 		goto checkForCatch;
@@ -891,8 +1157,11 @@
 	    CACHE_STACK_INFO();
 	    if (result != TCL_OK) {
+		TRACE_WITH_OBJ(("exprStk \"%.30s\" => ERROR: ", 
+		        O2S(objPtr)), Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(objPtr);
 		goto checkForCatch;
 	    }
 	    stackPtr[++stackTop].o = valuePtr; /* already has right refct */
+	    TRACE_WITH_OBJ(("exprStk \"%.30s\" => ", O2S(objPtr)), valuePtr);
 	    TclDecrRefCount(objPtr);
 	    ADJUST_PC(1);
@@ -913,8 +1182,11 @@
 	    CACHE_STACK_INFO();
 	    if (valuePtr == NULL) {
+		TRACE_WITH_OBJ(("%s %u => ERROR: ", opName[opCode], opnd),
+			Tcl_GetObjResult(interp));
 		result = TCL_ERROR;
 		goto checkForCatch;
             }
 	    PUSH_OBJECT(valuePtr);
+	    TRACE_WITH_OBJ(("%s %u => ", opName[opCode], opnd), valuePtr);
 	    ADJUST_PC(pcAdjustment);
 
@@ -926,4 +1198,6 @@
 	    CACHE_STACK_INFO();
 	    if (valuePtr == NULL) {
+		TRACE_WITH_OBJ(("loadScalarStk \"%.30s\" => ERROR: ",
+		        O2S(namePtr)), Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(namePtr);
 		result = TCL_ERROR;
@@ -931,4 +1205,6 @@
             }
 	    PUSH_OBJECT(valuePtr);
+	    TRACE_WITH_OBJ(("loadScalarStk \"%.30s\" => ",
+		    O2S(namePtr)), valuePtr);
 	    TclDecrRefCount(namePtr);
 	    ADJUST_PC(1);
@@ -952,4 +1228,7 @@
 		CACHE_STACK_INFO();
 		if (valuePtr == NULL) {
+		    TRACE_WITH_OBJ(("%s %u \"%.30s\" => ERROR: ",
+			    opName[opCode], opnd, O2S(elemPtr)),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(elemPtr);
 		    result = TCL_ERROR;
@@ -957,4 +1236,6 @@
 		}
 		PUSH_OBJECT(valuePtr);
+		TRACE_WITH_OBJ(("%s %u \"%.30s\" => ",
+		        opName[opCode], opnd, O2S(elemPtr)), valuePtr);
 		TclDecrRefCount(elemPtr);
 	    }
@@ -971,4 +1252,7 @@
 		CACHE_STACK_INFO();
 		if (valuePtr == NULL) {
+		    TRACE_WITH_OBJ(("loadArrayStk \"%.30s(%.30s)\" => ERROR: ",
+		            O2S(namePtr), O2S(elemPtr)),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(namePtr);
 		    Tcl_DecrRefCount(elemPtr);
@@ -977,4 +1261,6 @@
 		}
 		PUSH_OBJECT(valuePtr);
+		TRACE_WITH_OBJ(("loadArrayStk \"%.30s(%.30s)\" => ",
+		        O2S(namePtr), O2S(elemPtr)), valuePtr);
 		TclDecrRefCount(namePtr);
 		TclDecrRefCount(elemPtr);
@@ -989,4 +1275,6 @@
 	    CACHE_STACK_INFO();
 	    if (valuePtr == NULL) {
+		TRACE_WITH_OBJ(("loadStk \"%.30s\" => ERROR: ",
+		        O2S(namePtr)), Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(namePtr);
 		result = TCL_ERROR;
@@ -994,4 +1282,6 @@
 	    }
 	    PUSH_OBJECT(valuePtr);
+	    TRACE_WITH_OBJ(("loadStk \"%.30s\" => ", O2S(namePtr)),
+		    valuePtr);
 	    TclDecrRefCount(namePtr);
 	    ADJUST_PC(1);
@@ -1013,4 +1303,7 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(("%s %u <- \"%.30s\" => ERROR: ",
+			opName[opCode], opnd, O2S(valuePtr)),
+			Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(valuePtr);
 		result = TCL_ERROR;
@@ -1018,4 +1311,6 @@
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(("%s %u <- \"%.30s\" => ",
+		    opName[opCode], opnd, O2S(valuePtr)), value2Ptr);
 	    TclDecrRefCount(valuePtr);
 	    ADJUST_PC(pcAdjustment);
@@ -1029,4 +1324,8 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(
+			("storeScalarStk \"%.30s\" <- \"%.30s\" => ERROR: ",
+		        O2S(namePtr), O2S(valuePtr)),
+			Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(namePtr);
 		Tcl_DecrRefCount(valuePtr);
@@ -1035,4 +1334,9 @@
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(
+		    ("storeScalarStk \"%.30s\" <- \"%.30s\" => ",
+		    O2S(namePtr),
+		    O2S(valuePtr)),
+		    value2Ptr);
 	    TclDecrRefCount(namePtr);
 	    TclDecrRefCount(valuePtr);
@@ -1059,4 +1363,8 @@
 		CACHE_STACK_INFO();
 		if (value2Ptr == NULL) {
+		    TRACE_WITH_OBJ(
+			    ("%s %u \"%.30s\" <- \"%.30s\" => ERROR: ",
+			    opName[opCode], opnd, O2S(elemPtr),
+			    O2S(valuePtr)), Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(elemPtr);
 		    Tcl_DecrRefCount(valuePtr);
@@ -1065,4 +1373,7 @@
 		}
 		PUSH_OBJECT(value2Ptr);
+		TRACE_WITH_OBJ(("%s %u \"%.30s\" <- \"%.30s\" => ",
+		        opName[opCode], opnd, O2S(elemPtr), O2S(valuePtr)),
+		        value2Ptr);
 		TclDecrRefCount(elemPtr);
 		TclDecrRefCount(valuePtr);
@@ -1082,4 +1393,7 @@
 		CACHE_STACK_INFO();
 		if (value2Ptr == NULL) {
+		    TRACE_WITH_OBJ(("storeArrayStk \"%.30s(%.30s)\" <- \"%.30s\" => ERROR: ",
+		            O2S(namePtr), O2S(elemPtr), O2S(valuePtr)),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(namePtr);
 		    Tcl_DecrRefCount(elemPtr);
@@ -1089,4 +1403,7 @@
 		}
 		PUSH_OBJECT(value2Ptr);
+		TRACE_WITH_OBJ(("storeArrayStk \"%.30s(%.30s)\" <- \"%.30s\" => ",
+		        O2S(namePtr), O2S(elemPtr), O2S(valuePtr)),
+			value2Ptr);
 		TclDecrRefCount(namePtr);
 		TclDecrRefCount(elemPtr);
@@ -1103,4 +1420,7 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(("storeStk \"%.30s\" <- \"%.30s\" => ERROR: ",
+		        O2S(namePtr), O2S(valuePtr)),
+			Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(namePtr);
 		Tcl_DecrRefCount(valuePtr);
@@ -1109,4 +1429,6 @@
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(("storeStk \"%.30s\" <- \"%.30s\" => ",
+		    O2S(namePtr), O2S(valuePtr)), value2Ptr);
 	    TclDecrRefCount(namePtr);
 	    TclDecrRefCount(valuePtr);
@@ -1119,4 +1441,6 @@
 		result = tclIntType.setFromAnyProc(interp, valuePtr);
 		if (result != TCL_OK) {
+		    TRACE_WITH_OBJ(("incrScalar1 %u (by %s) => ERROR converting increment amount to int: ",
+		            opnd, O2S(valuePtr)), Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(valuePtr);
 		    goto checkForCatch;
@@ -1128,4 +1452,6 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(("incrScalar1 %u (by %ld) => ERROR: ",
+		        opnd, i), Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(valuePtr);
 		result = TCL_ERROR;
@@ -1133,4 +1459,6 @@
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(("incrScalar1 %u (by %ld) => ", opnd, i),
+		    value2Ptr);
 	    TclDecrRefCount(valuePtr);
 	    ADJUST_PC(2);
@@ -1143,4 +1471,7 @@
 		result = tclIntType.setFromAnyProc(interp, valuePtr);
 		if (result != TCL_OK) {
+		    TRACE_WITH_OBJ(("%s \"%.30s\" (by %s) => ERROR converting increment amount to int: ",
+		            opName[opCode], O2S(namePtr), O2S(valuePtr)),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(namePtr);
 		    Tcl_DecrRefCount(valuePtr);
@@ -1154,4 +1485,7 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(("%s \"%.30s\" (by %ld) => ERROR: ",
+		        opName[opCode], O2S(namePtr), i),
+			Tcl_GetObjResult(interp));
 		Tcl_DecrRefCount(namePtr);
 		Tcl_DecrRefCount(valuePtr);
@@ -1160,4 +1494,6 @@
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(("%s \"%.30s\" (by %ld) => ",
+	            opName[opCode], O2S(namePtr), i), value2Ptr);
 	    Tcl_DecrRefCount(namePtr);
 	    Tcl_DecrRefCount(valuePtr);
@@ -1174,4 +1510,7 @@
 		    result = tclIntType.setFromAnyProc(interp, valuePtr);
 		    if (result != TCL_OK) {
+			TRACE_WITH_OBJ(("incrArray1 %u \"%.30s\" (by %s) => ERROR converting increment amount to int: ",
+		                opnd, O2S(elemPtr), O2S(valuePtr)),
+			        Tcl_GetObjResult(interp));
 			Tcl_DecrRefCount(elemPtr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1185,4 +1524,7 @@
 		CACHE_STACK_INFO();
 		if (value2Ptr == NULL) {
+		    TRACE_WITH_OBJ(("incrArray1 %u \"%.30s\" (by %ld) => ERROR: ",
+		            opnd, O2S(elemPtr), i),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(elemPtr);
 		    Tcl_DecrRefCount(valuePtr);
@@ -1191,4 +1533,6 @@
 		}
 		PUSH_OBJECT(value2Ptr);
+		TRACE_WITH_OBJ(("incrArray1 %u \"%.30s\" (by %ld) => ",
+	                opnd, O2S(elemPtr), i), value2Ptr);
 		Tcl_DecrRefCount(elemPtr);
 		Tcl_DecrRefCount(valuePtr);
@@ -1206,4 +1550,7 @@
 		    result = tclIntType.setFromAnyProc(interp, valuePtr);
 		    if (result != TCL_OK) {
+		        TRACE_WITH_OBJ(("incrArrayStk \"%.30s(%.30s)\" (by %s) => ERROR converting increment amount to int: ",
+		                O2S(namePtr), O2S(elemPtr), O2S(valuePtr)),
+			        Tcl_GetObjResult(interp));
 			Tcl_DecrRefCount(namePtr);
 			Tcl_DecrRefCount(elemPtr);
@@ -1218,4 +1565,7 @@
 		CACHE_STACK_INFO();
 		if (value2Ptr == NULL) {
+		    TRACE_WITH_OBJ(("incrArrayStk \"%.30s(%.30s)\" (by %ld) => ERROR: ",
+		            O2S(namePtr), O2S(elemPtr), i),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(namePtr);
 		    Tcl_DecrRefCount(elemPtr);
@@ -1225,4 +1575,6 @@
 		}
 		PUSH_OBJECT(value2Ptr);
+		TRACE_WITH_OBJ(("incrArrayStk \"%.30s(%.30s)\" (by %ld) => ",
+	                O2S(namePtr), O2S(elemPtr), i), value2Ptr);
 		Tcl_DecrRefCount(namePtr);
 		Tcl_DecrRefCount(elemPtr);
@@ -1238,8 +1590,12 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(("incrScalar1Imm %u %ld => ERROR: ",
+		        opnd, i), Tcl_GetObjResult(interp));
 		result = TCL_ERROR;
 		goto checkForCatch;
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(("incrScalar1Imm %u %ld => ", opnd, i),
+		    value2Ptr);
 	    ADJUST_PC(3);
 
@@ -1253,4 +1609,7 @@
 	    CACHE_STACK_INFO();
 	    if (value2Ptr == NULL) {
+		TRACE_WITH_OBJ(("%s \"%.30s\" %ld => ERROR: ",
+		        opName[opCode], O2S(namePtr), i),
+			Tcl_GetObjResult(interp));
 		result = TCL_ERROR;
 		Tcl_DecrRefCount(namePtr);
@@ -1258,4 +1617,6 @@
 	    }
 	    PUSH_OBJECT(value2Ptr);
+	    TRACE_WITH_OBJ(("%s \"%.30s\" %ld => ",
+	            opName[opCode], O2S(namePtr), i), value2Ptr);
 	    TclDecrRefCount(namePtr);
 	    ADJUST_PC(2);
@@ -1273,4 +1634,7 @@
 		CACHE_STACK_INFO();
 		if (value2Ptr == NULL) {
+		    TRACE_WITH_OBJ(("incrArray1Imm %u \"%.30s\" (by %ld) => ERROR: ",
+		            opnd, O2S(elemPtr), i),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(elemPtr);
 		    result = TCL_ERROR;
@@ -1278,4 +1642,6 @@
 		}
 		PUSH_OBJECT(value2Ptr);
+		TRACE_WITH_OBJ(("incrArray1Imm %u \"%.30s\" (by %ld) => ",
+	                opnd, O2S(elemPtr), i), value2Ptr);
 		Tcl_DecrRefCount(elemPtr);
 	    }
@@ -1294,4 +1660,7 @@
 		CACHE_STACK_INFO();
 		if (value2Ptr == NULL) {
+		    TRACE_WITH_OBJ(("incrArrayStkImm \"%.30s(%.30s)\" (by %ld) => ERROR: ",
+		            O2S(namePtr), O2S(elemPtr), i),
+			    Tcl_GetObjResult(interp));
 		    Tcl_DecrRefCount(namePtr);
 		    Tcl_DecrRefCount(elemPtr);
@@ -1300,4 +1669,6 @@
 		}
 		PUSH_OBJECT(value2Ptr);
+		TRACE_WITH_OBJ(("incrArrayStkImm \"%.30s(%.30s)\" (by %ld) => ",
+	                O2S(namePtr), O2S(elemPtr), i), value2Ptr);
 		Tcl_DecrRefCount(namePtr);
 		Tcl_DecrRefCount(elemPtr);
@@ -1307,8 +1678,12 @@
 	case INST_JUMP1:
 	    opnd = TclGetInt1AtPtr(pc+1);
+	    TRACE(("jump1 %d => new pc %u\n", opnd,
+		   (unsigned int)(pc + opnd - codePtr->codeStart)));
 	    ADJUST_PC(opnd);
 
 	case INST_JUMP4:
 	    opnd = TclGetInt4AtPtr(pc+1);
+	    TRACE(("jump4 %d => new pc %u\n", opnd,
+		   (unsigned int)(pc + opnd - codePtr->codeStart)));
 	    ADJUST_PC(opnd);
 
@@ -1334,4 +1709,6 @@
 		    result = Tcl_GetBooleanFromObj(interp, valuePtr, &b);
 		    if (result != TCL_OK) {
+			TRACE_WITH_OBJ(("%s %d => ERROR: ", opName[opCode],
+				opnd), Tcl_GetObjResult(interp));
 			Tcl_DecrRefCount(valuePtr);
 			goto checkForCatch;
@@ -1339,7 +1716,12 @@
 		}
 		if (b) {
+		    TRACE(("%s %d => %.20s true, new pc %u\n",
+			    opName[opCode], opnd, O2S(valuePtr),
+		            (unsigned int)(pc+opnd - codePtr->codeStart)));
 		    TclDecrRefCount(valuePtr);
 		    ADJUST_PC(opnd);
 		} else {
+		    TRACE(("%s %d => %.20s false\n", opName[opCode], opnd,
+		            O2S(valuePtr)));
 		    TclDecrRefCount(valuePtr);
 		    ADJUST_PC(pcAdjustment);
@@ -1368,4 +1750,6 @@
 		    result = Tcl_GetBooleanFromObj(interp, valuePtr, &b);
 		    if (result != TCL_OK) {
+			TRACE_WITH_OBJ(("%s %d => ERROR: ", opName[opCode],
+				opnd), Tcl_GetObjResult(interp));
 			Tcl_DecrRefCount(valuePtr);
 			goto checkForCatch;
@@ -1373,7 +1757,12 @@
 		}
 		if (b) {
+		    TRACE(("%s %d => %.20s true\n", opName[opCode], opnd,
+		            O2S(valuePtr)));
 		    TclDecrRefCount(valuePtr);
 		    ADJUST_PC(pcAdjustment);
 		} else {
+		    TRACE(("%s %d => %.20s false, new pc %u\n",
+			    opName[opCode], opnd, O2S(valuePtr),
+			   (unsigned int)(pc + opnd - codePtr->codeStart)));
 		    TclDecrRefCount(valuePtr);
 		    ADJUST_PC(opnd);
@@ -1415,4 +1804,7 @@
 		    }
 		    if (result != TCL_OK) {
+			TRACE(("%s \"%.20s\" => ILLEGAL TYPE %s \n",
+			        opName[opCode], O2S(valuePtr),
+			        (t1Ptr? t1Ptr->name : "null")));
 			IllegalExprOperandType(interp, opCode, valuePtr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1438,4 +1830,7 @@
 		    }
 		    if (result != TCL_OK) {
+			TRACE(("%s \"%.20s\" => ILLEGAL TYPE %s \n",
+			        opName[opCode], O2S(value2Ptr),
+			        (t2Ptr? t2Ptr->name : "null")));
 			IllegalExprOperandType(interp, opCode, value2Ptr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1456,6 +1851,11 @@
 		if (Tcl_IsShared(valuePtr)) {
 		    PUSH_OBJECT(Tcl_NewLongObj(iResult));
+		    TRACE(("%s %.20s %.20s => %d\n", opName[opCode],
+			   O2S(valuePtr), O2S(value2Ptr), iResult));
 		    TclDecrRefCount(valuePtr);
 		} else {	/* reuse the valuePtr object */
+		    TRACE(("%s %.20s %.20s => %d\n", 
+			   opName[opCode], /* NB: stack top is off by 1 */
+			   O2S(valuePtr), O2S(value2Ptr), iResult));
 		    Tcl_SetLongObj(valuePtr, iResult);
 		    ++stackTop; /* valuePtr now on stk top has right r.c. */
@@ -1613,6 +2013,11 @@
 		if (Tcl_IsShared(valuePtr)) {
 		    PUSH_OBJECT(Tcl_NewLongObj(iResult));
+		    TRACE(("%s %.20s %.20s => %ld\n", opName[opCode],
+		        O2S(valuePtr), O2S(value2Ptr), iResult));
 		    TclDecrRefCount(valuePtr);
 		} else {	/* reuse the valuePtr object */
+		    TRACE(("%s %.20s %.20s => %ld\n",
+			opName[opCode], /* NB: stack top is off by 1 */
+		        O2S(valuePtr), O2S(value2Ptr), iResult));
 		    Tcl_SetLongObj(valuePtr, iResult);
 		    ++stackTop; /* valuePtr now on stk top has right r.c. */
@@ -1644,4 +2049,8 @@
 			    valuePtr, &i);
 		    if (result != TCL_OK) {
+			TRACE(("%s %.20s %.20s => ILLEGAL 1st TYPE %s\n",
+			      opName[opCode], O2S(valuePtr), O2S(value2Ptr),
+			      (valuePtr->typePtr?
+				   valuePtr->typePtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, valuePtr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1656,4 +2065,8 @@
 			    value2Ptr, &i2);
 		    if (result != TCL_OK) {
+			TRACE(("%s %.20s %.20s => ILLEGAL 2nd TYPE %s\n",
+			      opName[opCode], O2S(valuePtr), O2S(value2Ptr),
+			      (value2Ptr->typePtr?
+				   value2Ptr->typePtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, value2Ptr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1672,4 +2085,5 @@
 		     */
 		    if (i2 == 0) {
+			TRACE(("mod %ld %ld => DIVIDE BY ZERO\n", i, i2));
 			Tcl_DecrRefCount(valuePtr);
 			Tcl_DecrRefCount(value2Ptr);
@@ -1723,6 +2137,10 @@
 		if (Tcl_IsShared(valuePtr)) {
 		    PUSH_OBJECT(Tcl_NewLongObj(iResult));
+		    TRACE(("%s %ld %ld => %ld\n", opName[opCode], i, i2,
+			   iResult));
 		    TclDecrRefCount(valuePtr);
 		} else {	/* reuse the valuePtr object */
+		    TRACE(("%s %ld %ld => %ld\n", opName[opCode], i, i2,
+		        iResult)); /* NB: stack top is off by 1 */
 		    Tcl_SetLongObj(valuePtr, iResult);
 		    ++stackTop; /* valuePtr now on stk top has right r.c. */
@@ -1768,4 +2186,8 @@
 		    }
 		    if (result != TCL_OK) {
+			TRACE(("%s %.20s %.20s => ILLEGAL 1st TYPE %s\n",
+			       opName[opCode], s, O2S(value2Ptr),
+			       (valuePtr->typePtr?
+				    valuePtr->typePtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, valuePtr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1790,4 +2212,8 @@
 		    }
 		    if (result != TCL_OK) {
+			TRACE(("%s %.20s %.20s => ILLEGAL 2nd TYPE %s\n",
+			       opName[opCode], O2S(valuePtr), s,
+			       (value2Ptr->typePtr?
+				    value2Ptr->typePtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, value2Ptr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1820,4 +2246,6 @@
 		    case INST_DIV:
 			if (d2 == 0.0) {
+			    TRACE(("div %.6g %.6g => DIVIDE BY ZERO\n",
+				   d1, d2));
 			    Tcl_DecrRefCount(valuePtr);
 			    Tcl_DecrRefCount(value2Ptr);
@@ -1833,4 +2261,6 @@
 		    
 		    if (IS_NAN(dResult) || IS_INF(dResult)) {
+			TRACE(("%s %.20s %.20s => IEEE FLOATING PT ERROR\n",
+			       opName[opCode], O2S(valuePtr), O2S(value2Ptr)));
 			TclExprFloatError(interp, dResult);
 			result = TCL_ERROR;
@@ -1861,4 +2291,6 @@
 			 */
 			if (i2 == 0) {
+			    TRACE(("div %ld %ld => DIVIDE BY ZERO\n",
+				    i, i2));
 			    Tcl_DecrRefCount(valuePtr);
 			    Tcl_DecrRefCount(value2Ptr);
@@ -1886,12 +2318,20 @@
 		    if (doDouble) {
 			PUSH_OBJECT(Tcl_NewDoubleObj(dResult));
+			TRACE(("%s %.6g %.6g => %.6g\n", opName[opCode],
+			       d1, d2, dResult));
 		    } else {
 			PUSH_OBJECT(Tcl_NewLongObj(iResult));
+			TRACE(("%s %ld %ld => %ld\n", opName[opCode],
+			       i, i2, iResult));
 		    } 
 		    TclDecrRefCount(valuePtr);
 		} else {	    /* reuse the valuePtr object */
 		    if (doDouble) { /* NB: stack top is off by 1 */
+			TRACE(("%s %.6g %.6g => %.6g\n", opName[opCode],
+			       d1, d2, dResult));
 			Tcl_SetDoubleObj(valuePtr, dResult);
 		    } else {
+			TRACE(("%s %ld %ld => %ld\n", opName[opCode],
+			       i, i2, iResult));
 			Tcl_SetLongObj(valuePtr, iResult);
 		    }
@@ -1923,8 +2363,12 @@
 		    }
 		    if (result != TCL_OK) { 
+			TRACE(("%s \"%.20s\" => ILLEGAL TYPE %s \n",
+			        opName[opCode], s,
+			        (tPtr? tPtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, valuePtr);
 			goto checkForCatch;
 		    }
 		}
+		TRACE_WITH_OBJ(("uplus %s => ", O2S(valuePtr)), valuePtr);
 	    }
 	    ADJUST_PC(1);
@@ -1955,4 +2399,7 @@
 		    }
 		    if (result != TCL_OK) {
+			TRACE(("%s \"%.20s\" => ILLEGAL TYPE %s\n",
+			        opName[opCode], s,
+			       (tPtr? tPtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, valuePtr);
 			Tcl_DecrRefCount(valuePtr);
@@ -1970,4 +2417,6 @@
 			objPtr = Tcl_NewLongObj(
 			        (opCode == INST_UMINUS)? -i : !i);
+			TRACE_WITH_OBJ(("%s %ld => ", opName[opCode], i),
+		                objPtr); /* NB: stack top is off by 1 */
 		    } else {
 			d = valuePtr->internalRep.doubleValue;
@@ -1981,4 +2430,6 @@
 			    objPtr = Tcl_NewLongObj((d==0.0)? 1 : 0);
 			}
+			TRACE_WITH_OBJ(("%s %.6g => ", opName[opCode], d),
+		                objPtr); /* NB: stack top is off by 1 */
 		    }
 		    PUSH_OBJECT(objPtr);
@@ -1992,4 +2443,6 @@
 			Tcl_SetLongObj(valuePtr,
 			        (opCode == INST_UMINUS)? -i : !i);
+			TRACE_WITH_OBJ(("%s %ld => ", opName[opCode], i),
+		                valuePtr); /* NB: stack top is off by 1 */
 		    } else {
 			d = valuePtr->internalRep.doubleValue;
@@ -2003,4 +2456,6 @@
 			    Tcl_SetLongObj(valuePtr, (d==0.0)? 1 : 0);
 			}
+			TRACE_WITH_OBJ(("%s %.6g => ", opName[opCode], d),
+		                valuePtr); /* NB: stack top is off by 1 */
 		    }
 		    ++stackTop; /* valuePtr now on stk top has right r.c. */
@@ -2026,4 +2481,6 @@
 			    valuePtr, &i);
 		    if (result != TCL_OK) {   /* try to convert to double */
+			TRACE(("bitnot \"%.20s\" => ILLEGAL TYPE %s\n",
+			       O2S(valuePtr), (tPtr? tPtr->name : "null")));
 			IllegalExprOperandType(interp, opCode, valuePtr);
 			Tcl_DecrRefCount(valuePtr);
@@ -2035,4 +2492,5 @@
 		if (Tcl_IsShared(valuePtr)) {
 		    PUSH_OBJECT(Tcl_NewLongObj(~i));
+		    TRACE(("bitnot 0x%lx => (%lu)\n", i, ~i));
 		    TclDecrRefCount(valuePtr);
 		} else {
@@ -2042,4 +2500,5 @@
 		    Tcl_SetLongObj(valuePtr, ~i);
 		    ++stackTop; /* valuePtr now on stk top has right r.c. */
+		    TRACE(("bitnot 0x%lx => (%lu)\n", i, ~i));
 		}
 	    }
@@ -2056,4 +2515,5 @@
 
 		if ((opnd < 0) || (opnd > LAST_BUILTIN_FUNC)) {
+		    TRACE(("UNRECOGNIZED BUILTIN FUNC CODE %d\n", opnd));
 		    panic("TclExecuteByteCode: unrecognized builtin function code %d", opnd);
 		}
@@ -2068,4 +2528,6 @@
 		    goto checkForCatch;
 		}
+		TRACE_WITH_OBJ(("callBuiltinFunc1 %d => ", opnd),
+		        stackPtr[stackTop].o);
 	    }
 	    ADJUST_PC(2);
@@ -2093,4 +2555,6 @@
 		    goto checkForCatch;
 		}
+		TRACE_WITH_OBJ(("callFunc1 %d => ", objc),
+		        stackPtr[stackTop].o);
 		ADJUST_PC(2);
 	    }
@@ -2163,4 +2627,6 @@
 			d = valuePtr->internalRep.doubleValue;
 			if (IS_NAN(d) || IS_INF(d)) {
+			    TRACE(("tryCvtToNumeric \"%.20s\" => IEEE FLOATING PT ERROR\n",
+			           O2S(valuePtr)));
 			    TclExprFloatError(interp, d);
 			    result = TCL_ERROR;
@@ -2170,4 +2636,11 @@
 		    shared = shared;		/* lint, shared not used. */
 		    converted = converted;	/* lint, converted not used. */
+		    TRACE(("tryCvtToNumeric \"%.20s\" => numeric, %s, %s\n",
+			   O2S(valuePtr),
+			   (converted? "converted" : "not converted"),
+			   (shared? "shared" : "not shared")));
+		} else {
+		    TRACE(("tryCvtToNumeric \"%.20s\" => not numeric\n",
+			   O2S(valuePtr)));
 		}
 	    }
@@ -2187,4 +2660,5 @@
 		    codePtr);
 	    if (rangePtr == NULL) {
+		TRACE(("break => no encl. loop or catch, returning TCL_BREAK\n"));
 		result = TCL_BREAK;
 		goto abnormalReturn; /* no catch exists to check */
@@ -2193,7 +2667,10 @@
 	    case LOOP_EXCEPTION_RANGE:
 		result = TCL_OK;
+		TRACE(("break => range at %d, new pc %d\n",
+		       rangePtr->codeOffset, rangePtr->breakOffset));
 		break;
 	    case CATCH_EXCEPTION_RANGE:
 		result = TCL_BREAK;
+		TRACE(("break => ...\n"));
 		goto processCatch; /* it will use rangePtr */
 	    default:
@@ -2216,4 +2693,5 @@
 		    codePtr);
 	    if (rangePtr == NULL) {
+		TRACE(("continue => no encl. loop or catch, returning TCL_CONTINUE\n"));
 		result = TCL_CONTINUE;
 		goto abnormalReturn;
@@ -2222,11 +2700,15 @@
 	    case LOOP_EXCEPTION_RANGE:
 		if (rangePtr->continueOffset == -1) {
+		    TRACE(("continue => loop w/o continue, checking for catch\n"));
 		    goto checkForCatch;
 		} else {
 		    result = TCL_OK;
+		    TRACE(("continue => range at %d, new pc %d\n",
+			   rangePtr->codeOffset, rangePtr->continueOffset));
 		}
 		break;
 	    case CATCH_EXCEPTION_RANGE:
 		result = TCL_CONTINUE;
+		TRACE(("continue => ...\n"));
 		goto processCatch; /* it will use rangePtr */
 	    default:
@@ -2262,4 +2744,6 @@
 		TclSetVarScalar(iterVarPtr);
 		TclClearVarUndefined(iterVarPtr);
+		TRACE(("foreach_start4 %u => loop iter count temp %d\n", 
+		        opnd, iterTmpIndex));
 	    }
 	    ADJUST_PC(5);
@@ -2310,4 +2794,7 @@
 		    result = Tcl_ListObjLength(interp, listPtr, &listLen);
 		    if (result != TCL_OK) {
+			TRACE_WITH_OBJ(("foreach_step4 %u => ERROR converting list %ld, \"%s\": ",
+			        opnd, i, O2S(listPtr)),
+				Tcl_GetObjResult(interp));
 			goto checkForCatch;
 		    }
@@ -2353,4 +2840,7 @@
 			    CACHE_STACK_INFO();
 			    if (value2Ptr == NULL) {
+				TRACE_WITH_OBJ(("foreach_step4 %u => ERROR init. index temp %d: ",
+				       opnd, varIndex),
+				       Tcl_GetObjResult(interp));
 				if (setEmptyStr) {
 				    Tcl_DecrRefCount(elemPtr); /* unneeded */
@@ -2372,4 +2862,7 @@
 
 		PUSH_OBJECT(Tcl_NewLongObj(continueLoop));
+		TRACE(("foreach_step4 %u => %d lists, iter %d, %s loop\n", 
+		        opnd, numLists, iterNum,
+		        (continueLoop? "continue" : "exit")));
 	    }
 	    ADJUST_PC(5);
@@ -2382,4 +2875,6 @@
 	     */
 	    catchStackPtr[++catchTop] = stackTop;
+	    TRACE(("beginCatch4 %u => catchTop=%d, stackTop=%d\n",
+		    TclGetUInt4AtPtr(pc+1), catchTop, stackTop));
 	    ADJUST_PC(5);
 
@@ -2387,15 +2882,19 @@
 	    catchTop--;
 	    result = TCL_OK;
+	    TRACE(("endCatch => catchTop=%d\n", catchTop));
 	    ADJUST_PC(1);
 
 	case INST_PUSH_RESULT:
 	    PUSH_OBJECT(Tcl_GetObjResult(interp));
+	    TRACE_WITH_OBJ(("pushResult => "), Tcl_GetObjResult(interp));
 	    ADJUST_PC(1);
 
 	case INST_PUSH_RETURN_CODE:
 	    PUSH_OBJECT(Tcl_NewLongObj(result));
+	    TRACE(("pushReturnCode => %u\n", result));
 	    ADJUST_PC(1);
 
 	default:
+	    TRACE(("UNRECOGNIZED INSTRUCTION %u\n", opCode));
 	    panic("TclExecuteByteCode: unrecognized opCode %u", opCode);
 	} /* end of switch on opCode */
@@ -2427,4 +2926,6 @@
 	rangePtr = TclGetExceptionRangeForPc(pc, /*catchOnly*/ 1, codePtr);
 	if (rangePtr == NULL) {
+	    TRACE(("   ... no enclosing catch, returning %s\n",
+		    StringForResultCode(result)));
 	    goto abnormalReturn;
 	}
@@ -2444,4 +2945,7 @@
 	    TclDecrRefCount(valuePtr);
 	}
+	TRACE(("  ... found catch at %d, catchTop=%d, unwound to %d, new pc %u\n",
+	        rangePtr->codeOffset, catchTop, catchStackPtr[catchTop],
+	        (unsigned int)(rangePtr->catchOffset)));
 	pc = (codePtr->codeStart + rangePtr->catchOffset);
 	continue;		/* restart the execution loop at pc */
@@ -2471,4 +2975,140 @@
 #undef STATIC_CATCH_STACK_SIZE
 }
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * PrintByteCodeInfo --
+ *
+ *	This procedure prints a summary about a bytecode object to stdout.
+ *	It is called by TclExecuteByteCode when starting to execute the
+ *	bytecode object if tclTraceExec has the value 2 or more.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+PrintByteCodeInfo(codePtr)
+    register ByteCode *codePtr;	/* The bytecode whose summary is printed
+				 * to stdout. */
+{
+    Proc *procPtr = codePtr->procPtr;
+    int numCmds = codePtr->numCommands;
+    int numObjs = codePtr->numObjects;
+    int objBytes, i;
+
+    objBytes = (numObjs * sizeof(Tcl_Obj));
+    for (i = 0;  i < numObjs;  i++) {
+	Tcl_Obj *litObjPtr = codePtr->objArrayPtr[i];
+	if (litObjPtr->bytes != NULL) {
+	    objBytes += litObjPtr->length;
+	}
+    }
+    
+    fprintf(stdout, "\nExecuting ByteCode 0x%x, ref ct %u, epoch %u, interp 0x%x(epoch %u)\n",
+	    (unsigned int) codePtr, codePtr->refCount,
+	    codePtr->compileEpoch, (unsigned int) codePtr->iPtr,
+	    codePtr->iPtr->compileEpoch);
+    
+    fprintf(stdout, "  Source: ");
+    TclPrintSource(stdout, codePtr->source, 70);
+
+    fprintf(stdout, "\n  Cmds %d, chars %d, inst %u, objs %u, aux %d, stk depth %u, code/src %.2fn",
+            numCmds, codePtr->numSrcChars, codePtr->numCodeBytes, numObjs,
+	    codePtr->numAuxDataItems, codePtr->maxStackDepth,
+	    (codePtr->numSrcChars?
+	            ((float)codePtr->totalSize)/((float)codePtr->numSrcChars) : 0.0));
+
+    fprintf(stdout, "  Code %zu = %u(header)+%d(inst)+%d(objs)+%u(exc)+%u(aux)+%d(cmd map)\n",
+	    codePtr->totalSize, sizeof(ByteCode), codePtr->numCodeBytes,
+	    objBytes, (codePtr->numExcRanges * sizeof(ExceptionRange)),
+	    (codePtr->numAuxDataItems * sizeof(AuxData)),
+	    codePtr->numCmdLocBytes);
+
+    if (procPtr != NULL) {
+	fprintf(stdout,
+		"  Proc 0x%x, ref ct %d, args %d, compiled locals %d\n",
+		(unsigned int) procPtr, procPtr->refCount,
+		procPtr->numArgs, procPtr->numCompiledLocals);
+    }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * ValidatePcAndStackTop --
+ *
+ *	This procedure is called by TclExecuteByteCode when debugging to
+ *	verify that the program counter and stack top are valid during
+ *	execution.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	Prints a message to stderr and panics if either the pc or stack
+ *	top are invalid.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_COMPILE_DEBUG
+static void
+ValidatePcAndStackTop(codePtr, pc, stackTop, stackLowerBound, stackUpperBound)
+    register ByteCode *codePtr; /* The bytecode whose summary is printed
+				 * to stdout. */
+    unsigned char *pc;		/* Points to first byte of a bytecode
+				 * instruction. The program counter. */
+    int stackTop;		/* Current stack top. Must be between
+				 * stackLowerBound and stackUpperBound
+				 * (inclusive). */
+    int stackLowerBound;	/* Smallest legal value for stackTop. */
+    int stackUpperBound;	/* Greatest legal value for stackTop. */
+{
+    unsigned int relativePc = (unsigned int) (pc - codePtr->codeStart);
+    unsigned int codeStart = (unsigned int) codePtr->codeStart;
+    unsigned int codeEnd = (unsigned int)
+	    (codePtr->codeStart + codePtr->numCodeBytes);
+    unsigned char opCode = *pc;
+
+    if (((unsigned int) pc < codeStart) || ((unsigned int) pc > codeEnd)) {
+	fprintf(stderr, "\nBad instruction pc 0x%x in TclExecuteByteCode\n",
+		(unsigned int) pc);
+	panic("TclExecuteByteCode execution failure: bad pc");
+    }
+    if ((unsigned int) opCode > LAST_INST_OPCODE) {
+	fprintf(stderr, "\nBad opcode %d at pc %u in TclExecuteByteCode\n",
+		(unsigned int) opCode, relativePc);
+	panic("TclExecuteByteCode execution failure: bad opcode");
+    }
+    if ((stackTop < stackLowerBound) || (stackTop > stackUpperBound)) {
+	int numChars;
+	char *cmd = GetSrcInfoForPc(pc, codePtr, &numChars);
+	char *ellipsis = "";
+	
+	fprintf(stderr, "\nBad stack top %d at pc %u in TclExecuteByteCode",
+		stackTop, relativePc);
+	if (cmd != NULL) {
+	    if (numChars > 100) {
+		numChars = 100;
+		ellipsis = "...";
+	    }
+	    fprintf(stderr, "\n executing %.*s%s\n", numChars, cmd,
+		    ellipsis);
+	} else {
+	    fprintf(stderr, "\n");
+	}
+	panic("TclExecuteByteCode execution failure: bad stack top");
+    }
+}
+#endif /* TCL_COMPILE_DEBUG */
 
 
@@ -3631,4 +4271,182 @@
 
 
+#ifdef TCL_COMPILE_STATS
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclLog2 --
+ *
+ *	Procedure used while collecting compilation statistics to determine
+ *	the log base 2 of an integer.
+ *
+ * Results:
+ *	Returns the log base 2 of the operand. If the argument is less
+ *	than or equal to zero, a zero is returned.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclLog2(value)
+    register int value;		/* The integer for which to compute the
+				 * log base 2. */
+{
+    register int n = value;
+    register int result = 0;
+
+    while (n > 1) {
+	n = n >> 1;
+	result++;
+    }
+    return result;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * EvalStatsCmd --
+ *
+ *	Implements the "evalstats" command that prints instruction execution
+ *	counts to stdout.
+ *
+ * Results:
+ *	Standard Tcl results.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static int
+EvalStatsCmd(unused, interp, argc, argv)
+    ClientData unused;		/* Unused. */
+    Tcl_Interp *interp;		/* The current interpreter. */
+    int argc;			/* The number of arguments. */
+    char **argv;		/* The argument strings. */
+{
+    register double total = 0.0;
+    register int i;
+    int maxSizeDecade = 0;
+    double totalHeaderBytes = (tclNumCompilations * sizeof(ByteCode));
+
+    for (i = 0;  i < 256;  i++) {
+        if (instructionCount[i] != 0) {
+            total += instructionCount[i];
+        }
+    }
+
+    for (i = 31;  i >= 0;  i--) {
+        if ((tclSourceCount[i] > 0) && (tclByteCodeCount[i] > 0)) {
+            maxSizeDecade = i;
+	    break;
+        }
+    } 
+
+    fprintf(stdout, "\nNumber of compilations		%ld\n",
+	    tclNumCompilations);
+    fprintf(stdout, "Number of executions		%ld\n",
+	    numExecutions);
+    fprintf(stdout, "Average executions/compilation	%.0f\n",
+	    ((float) numExecutions/tclNumCompilations));
+    
+    fprintf(stdout, "\nInstructions executed		%.0f\n",
+	    total);
+    fprintf(stdout, "Average instructions/compile	%.0f\n",
+	    total/tclNumCompilations);
+    fprintf(stdout, "Average instructions/execution	%.0f\n",
+	    total/numExecutions);
+    
+    fprintf(stdout, "\nTotal source bytes		%.6g\n",
+	    tclTotalSourceBytes);
+    fprintf(stdout, "Total code bytes		%.6g\n",
+	    tclTotalCodeBytes);
+    fprintf(stdout, "Average code/compilation	%.0f\n",
+	    tclTotalCodeBytes/tclNumCompilations);
+    fprintf(stdout, "Average code/source		%.2f\n",
+	    tclTotalCodeBytes/tclTotalSourceBytes);
+    fprintf(stdout, "Current source bytes		%.6g\n",
+	    tclCurrentSourceBytes);
+    fprintf(stdout, "Current code bytes		%.6g\n",
+	    tclCurrentCodeBytes);
+    fprintf(stdout, "Current code/source		%.2f\n",
+	    tclCurrentCodeBytes/tclCurrentSourceBytes);
+    
+    fprintf(stdout, "\nTotal objects allocated		%ld\n",
+	    tclObjsAlloced);
+    fprintf(stdout, "Total objects freed		%ld\n",
+	    tclObjsFreed);
+    fprintf(stdout, "Current objects:	 	%ld\n",
+	    (tclObjsAlloced - tclObjsFreed));
+
+    fprintf(stdout, "\nBreakdown of code byte requirements:\n");
+    fprintf(stdout, "                   Total bytes      Pct of    Avg per\n");
+    fprintf(stdout, "                                  all code    compile\n");
+    fprintf(stdout, "Total code        %12.6g        100%%   %8.2f\n",
+	    tclTotalCodeBytes, tclTotalCodeBytes/tclNumCompilations);
+    fprintf(stdout, "Header            %12.6g   %8.2f%%   %8.2f\n",
+	    totalHeaderBytes,
+	    ((totalHeaderBytes * 100.0) / tclTotalCodeBytes),
+	    totalHeaderBytes/tclNumCompilations);
+    fprintf(stdout, "Instructions      %12.6g   %8.2f%%   %8.2f\n",
+	    tclTotalInstBytes,
+	    ((tclTotalInstBytes * 100.0) / tclTotalCodeBytes),
+	    tclTotalInstBytes/tclNumCompilations);
+    fprintf(stdout, "Objects           %12.6g   %8.2f%%   %8.2f\n",
+	    tclTotalObjBytes,
+	    ((tclTotalObjBytes * 100.0) / tclTotalCodeBytes),
+	    tclTotalObjBytes/tclNumCompilations);
+    fprintf(stdout, "Exception table   %12.6g   %8.2f%%   %8.2f\n",
+	    tclTotalExceptBytes,
+	    ((tclTotalExceptBytes * 100.0) / tclTotalCodeBytes),
+	    tclTotalExceptBytes/tclNumCompilations);
+    fprintf(stdout, "Auxiliary data    %12.6g   %8.2f%%   %8.2f\n",
+	    tclTotalAuxBytes,
+	    ((tclTotalAuxBytes * 100.0) / tclTotalCodeBytes),
+	    tclTotalAuxBytes/tclNumCompilations);
+    fprintf(stdout, "Command map       %12.6g   %8.2f%%   %8.2f\n",
+	    tclTotalCmdMapBytes,
+	    ((tclTotalCmdMapBytes * 100.0) / tclTotalCodeBytes),
+	    tclTotalCmdMapBytes/tclNumCompilations);
+    
+    fprintf(stdout, "\nSource and ByteCode size distributions:\n");
+    fprintf(stdout, "	 binary decade		source	  code\n");
+    for (i = 0;  i <= maxSizeDecade;  i++) {
+	int decadeLow, decadeHigh;
+
+	if (i == 0) {
+	    decadeLow = 0;
+	} else {
+	    decadeLow = 1 << i;
+	}
+	decadeHigh = (1 << (i+1)) - 1;
+        fprintf(stdout,	"	%6d -%6d		%6d	%6d\n",
+		decadeLow, decadeHigh,
+		tclSourceCount[i], tclByteCodeCount[i]);
+    }
+
+    fprintf(stdout, "\nInstruction counts:\n");
+    for (i = 0;  i < 256;  i++) {
+        if (instructionCount[i]) {
+            fprintf(stdout, "%20s %8d %6.2f%%\n",
+		    opName[i], instructionCount[i],
+		    (instructionCount[i] * 100.0)/total);
+        }
+    }
+
+#ifdef TCL_MEM_DEBUG
+    fprintf(stdout, "\nHeap Statistics:\n");
+    TclDumpMemoryInfo(stdout);
+#endif /* TCL_MEM_DEBUG */
+
+    return TCL_OK;
+}
+#endif /* TCL_COMPILE_STATS */
+
+
 /*
  *----------------------------------------------------------------------
@@ -3940,2 +4758,40 @@
     panic("UpdateStringOfCmdName should never be invoked");
 }
+
+
+#ifdef TCL_COMPILE_DEBUG
+/*
+ *----------------------------------------------------------------------
+ *
+ * StringForResultCode --
+ *
+ *	Procedure that returns a human-readable string representing a
+ *	Tcl result code such as TCL_ERROR. 
+ *
+ * Results:
+ *	If the result code is one of the standard Tcl return codes, the
+ *	result is a string representing that code such as "TCL_ERROR".
+ *	Otherwise, the result string is that code formatted as a
+ *	sequence of decimal digit characters. Note that the resulting
+ *	string must not be modified by the caller.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+static char *
+StringForResultCode(result)
+    int result;			/* The Tcl result code for which to
+				 * generate a string. */
+{
+    static char buf[20];
+    
+    if ((result >= TCL_OK) && (result <= TCL_CONTINUE)) {
+	return resultStrings[result];
+    }
+    TclFormatInt(buf, result);
+    return buf;
+}
+#endif /* TCL_COMPILE_DEBUG */
Index: external/tcl/tclHistory.c
===================================================================
--- external/tcl/tclHistory.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
+++ external/tcl/tclHistory.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -0,0 +1,157 @@
+/* 
+ * tclHistory.c --
+ *
+ *	This module and the Tcl library file history.tcl together implement
+ *	Tcl command history. Tcl_RecordAndEval(Obj) can be called to record
+ *	commands ("events") before they are executed. Commands defined in
+ *	history.tcl may be used to perform history substitutions.
+ *
+ * Copyright (c) 1990-1993 The Regents of the University of California.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: tclHistory.c,v 1.1 2008-06-04 13:58:06 demin Exp $
+ */
+
+#include "tclInt.h"
+#include "tclPort.h"
+
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_RecordAndEval --
+ *
+ *	This procedure adds its command argument to the current list of
+ *	recorded events and then executes the command by calling
+ *	Tcl_Eval.
+ *
+ * Results:
+ *	The return value is a standard Tcl return value, the result of
+ *	executing cmd.
+ *
+ * Side effects:
+ *	The command is recorded and executed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tcl_RecordAndEval(interp, cmd, flags)
+    Tcl_Interp *interp;		/* Token for interpreter in which command
+				 * will be executed. */
+    char *cmd;			/* Command to record. */
+    int flags;			/* Additional flags.  TCL_NO_EVAL means
+				 * only record: don't execute command.
+				 * TCL_EVAL_GLOBAL means use Tcl_GlobalEval
+				 * instead of Tcl_Eval. */
+{
+    register Tcl_Obj *cmdPtr;
+    int length = strlen(cmd);
+    int result;
+
+    if (length > 0) {
+	/*
+	 * Call Tcl_RecordAndEvalObj to do the actual work.
+	 */
+
+	TclNewObj(cmdPtr);
+	TclInitStringRep(cmdPtr, cmd, length);
+	Tcl_IncrRefCount(cmdPtr);
+
+	result = Tcl_RecordAndEvalObj(interp, cmdPtr, flags);
+
+	/*
+	 * Move the interpreter's object result to the string result, 
+	 * then reset the object result.
+	 * FAILS IF OBJECT RESULT'S STRING REPRESENTATION CONTAINS NULLS.
+	 */
+
+	Tcl_SetResult(interp,
+	        TclGetStringFromObj(Tcl_GetObjResult(interp), (int *) NULL),
+	        TCL_VOLATILE);
+
+	/*
+	 * Discard the Tcl object created to hold the command.
+	 */
+	
+	Tcl_DecrRefCount(cmdPtr);	
+    } else {
+	/*
+	 * An empty string. Just reset the interpreter's result.
+	 */
+
+	Tcl_ResetResult(interp);
+	result = TCL_OK;
+    }
+    return result;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_RecordAndEvalObj --
+ *
+ *	This procedure adds the command held in its argument object to the
+ *	current list of recorded events and then executes the command by
+ *	calling Tcl_EvalObj.
+ *
+ * Results:
+ *	The return value is a standard Tcl return value, the result of
+ *	executing the command.
+ *
+ * Side effects:
+ *	The command is recorded and executed.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tcl_RecordAndEvalObj(interp, cmdPtr, flags)
+    Tcl_Interp *interp;		/* Token for interpreter in which command
+				 * will be executed. */
+    Tcl_Obj *cmdPtr;		/* Points to object holding the command to
+				 * record and execute. */
+    int flags;			/* Additional flags. TCL_NO_EVAL means
+				 * record only: don't execute the command.
+				 * TCL_EVAL_GLOBAL means use
+				 * Tcl_GlobalEvalObj instead of
+				 * Tcl_EvalObj. */
+{
+    Interp *iPtr = (Interp *) interp;
+    int result;
+    Tcl_Obj *list[3];
+    register Tcl_Obj *objPtr;
+
+    /*
+     * Do recording by eval'ing a tcl history command: history add $cmd.
+     */
+
+    list[0] = Tcl_NewStringObj("history", -1);
+    list[1] = Tcl_NewStringObj("add", -1);
+    list[2] = cmdPtr;
+    
+    objPtr = Tcl_NewListObj(3, list);
+    Tcl_IncrRefCount(objPtr);
+    (void) Tcl_GlobalEvalObj(interp, objPtr);
+    Tcl_DecrRefCount(objPtr);
+
+    /*
+     * Execute the command.
+     */
+
+    result = TCL_OK;
+    if (!(flags & TCL_NO_EVAL)) {
+	iPtr->evalFlags = (flags & ~TCL_EVAL_GLOBAL);
+	if (flags & TCL_EVAL_GLOBAL) {
+	    result = Tcl_GlobalEvalObj(interp, cmdPtr);
+	} else {
+	    result = Tcl_EvalObj(interp, cmdPtr);
+	}
+    }
+    return result;
+}
Index: external/tcl/tclInt.h
===================================================================
--- external/tcl/tclInt.h	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclInt.h	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -1326,4 +1326,9 @@
 
 extern Tcl_Obj *	tclFreeObjList;
+
+#ifdef TCL_COMPILE_STATS
+extern long		tclObjsAlloced;
+extern long		tclObjsFreed;
+#endif /* TCL_COMPILE_STATS */
 
 /*
@@ -1440,5 +1445,5 @@
 		            int objc, Tcl_Obj *CONST objv[], int flags));
 EXTERN char *		TclpAlloc _ANSI_ARGS_((unsigned int size));
-EXTERN void		TclpFree(char *cp);
+
 EXTERN char *		TclpRealloc _ANSI_ARGS_((char *ptr,
 			    unsigned int size));
@@ -1467,4 +1472,6 @@
 EXTERN int		TclPreventAliasLoop _ANSI_ARGS_((Tcl_Interp *interp,
 		            Tcl_Interp *cmdInterp, Tcl_Command cmd));
+EXTERN void		TclPrintByteCodeObj _ANSI_ARGS_((Tcl_Interp *interp,
+		            Tcl_Obj *objPtr));
 EXTERN void		TclProcCleanupProc _ANSI_ARGS_((Proc *procPtr));
 EXTERN int		TclProcCompileProc _ANSI_ARGS_((Tcl_Interp *interp,
@@ -1681,4 +1688,46 @@
  */
 
+#ifdef TCL_COMPILE_STATS
+#  define TclIncrObjsAllocated() \
+    tclObjsAlloced++
+#  define TclIncrObjsFreed() \
+    tclObjsFreed++
+#else
+#  define TclIncrObjsAllocated()
+#  define TclIncrObjsFreed()
+#endif /* TCL_COMPILE_STATS */
+
+#ifdef TCL_MEM_DEBUG
+#  define TclNewObj(objPtr) \
+    (objPtr) = (Tcl_Obj *) Tcl_DbCkalloc(sizeof(Tcl_Obj), __FILE__, __LINE__); \
+    (objPtr)->refCount = 0; \
+    (objPtr)->bytes    = tclEmptyStringRep; \
+    (objPtr)->length   = 0; \
+    (objPtr)->typePtr  = NULL; \
+    TclIncrObjsAllocated()
+#  define TclDbNewObj(objPtr, file, line) \
+    (objPtr) = (Tcl_Obj *) Tcl_DbCkalloc(sizeof(Tcl_Obj), (file), (line)); \
+    (objPtr)->refCount = 0; \
+    (objPtr)->bytes    = tclEmptyStringRep; \
+    (objPtr)->length   = 0; \
+    (objPtr)->typePtr  = NULL; \
+    TclIncrObjsAllocated()
+#  define TclDecrRefCount(objPtr) \
+    if (--(objPtr)->refCount <= 0) { \
+ 	if ((objPtr)->refCount < -1) \
+            panic("Reference count for %lx was negative: %s line %d", \
+		  (objPtr), __FILE__, __LINE__); \
+        if (((objPtr)->bytes != NULL) \
+	        && ((objPtr)->bytes != tclEmptyStringRep)) { \
+	    ckfree((char *) (objPtr)->bytes); \
+        } \
+        if (((objPtr)->typePtr != NULL) \
+	        && ((objPtr)->typePtr->freeIntRepProc != NULL)) { \
+	    (objPtr)->typePtr->freeIntRepProc(objPtr); \
+        } \
+        ckfree((char *) (objPtr)); \
+        TclIncrObjsFreed(); \
+    }
+#else /* not TCL_MEM_DEBUG */
 #  define TclNewObj(objPtr) \
     if (tclFreeObjList == NULL) { \
@@ -1691,5 +1740,6 @@
     (objPtr)->bytes    = tclEmptyStringRep; \
     (objPtr)->length   = 0; \
-    (objPtr)->typePtr  = NULL;
+    (objPtr)->typePtr  = NULL; \
+    TclIncrObjsAllocated()
 #  define TclDecrRefCount(objPtr) \
     if (--(objPtr)->refCount <= 0) { \
@@ -1704,5 +1754,7 @@
         (objPtr)->internalRep.otherValuePtr = (VOID *) tclFreeObjList; \
         tclFreeObjList = (objPtr); \
+        TclIncrObjsFreed(); \
     }
+#endif /* TCL_MEM_DEBUG */
 
 /*
Index: external/tcl/tclListObj.c
===================================================================
--- external/tcl/tclListObj.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclListObj.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -46,7 +46,11 @@
  * Tcl_NewListObj --
  *
- *	This procedure creates a new list object from an (objc,objv) array:
- *	that is, each of the objc elements of the array	referenced by objv
- *	is inserted as an element into a new Tcl object.
+ *	This procedure is normally called when not debugging: i.e., when
+ *	TCL_MEM_DEBUG is not defined. It creates a new list object from an
+ *	(objc,objv) array: that is, each of the objc elements of the array
+ *	referenced by objv is inserted as an element into a new Tcl object.
+ *
+ *	When TCL_MEM_DEBUG is defined, this procedure just returns the
+ *	result of calling the debugging version Tcl_DbNewListObj.
  *
  * Results:
@@ -62,4 +66,17 @@
  *----------------------------------------------------------------------
  */
+
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewListObj
+
+Tcl_Obj *
+Tcl_NewListObj(objc, objv)
+    int objc;			/* Count of objects referenced by objv. */
+    Tcl_Obj *CONST objv[];	/* An array of pointers to Tcl objects. */
+{
+    return Tcl_DbNewListObj(objc, objv, "unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
 
 Tcl_Obj *
@@ -95,4 +112,89 @@
     return listPtr;
 }
+#endif /* if TCL_MEM_DEBUG */
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbNewListObj --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. It creates new list objects. It is the
+ *	same as the Tcl_NewListObj procedure above except that it calls
+ *	Tcl_DbCkalloc directly with the file name and line number from its
+ *	caller. This simplifies debugging since then the checkmem command
+ *	will report the correct file name and line number when reporting
+ *	objects that haven't been freed.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just returns the
+ *	result of calling Tcl_NewListObj.
+ *
+ * Results:
+ *	A new list object is returned that is initialized from the object
+ *	pointers in objv. If objc is less than or equal to zero, an empty
+ *	object is returned. The new object's string representation
+ *	is left NULL. The new list object has ref count 0.
+ *
+ * Side effects:
+ *	The ref counts of the elements in objv are incremented since the
+ *	resulting list now refers to them.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_MEM_DEBUG
+
+Tcl_Obj *
+Tcl_DbNewListObj(objc, objv, file, line)
+    int objc;			/* Count of objects referenced by objv. */
+    Tcl_Obj *CONST objv[];	/* An array of pointers to Tcl objects. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    register Tcl_Obj *listPtr;
+    register Tcl_Obj **elemPtrs;
+    register List *listRepPtr;
+    int i;
+    
+    TclDbNewObj(listPtr, file, line);
+    
+    if (objc > 0) {
+	Tcl_InvalidateStringRep(listPtr);
+	
+	elemPtrs = (Tcl_Obj **)
+	    ckalloc((unsigned) (objc * sizeof(Tcl_Obj *)));
+	for (i = 0;  i < objc;  i++) {
+	    elemPtrs[i] = objv[i];
+	    Tcl_IncrRefCount(elemPtrs[i]);
+	}
+	
+	listRepPtr = (List *) ckalloc(sizeof(List));
+	listRepPtr->maxElemCount = objc;
+	listRepPtr->elemCount    = objc;
+	listRepPtr->elements     = elemPtrs;
+	
+	listPtr->internalRep.otherValuePtr = (VOID *) listRepPtr;
+	listPtr->typePtr = &tclListType;
+    }
+    return listPtr;
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_DbNewListObj(objc, objv, file, line)
+    int objc;			/* Count of objects referenced by objv. */
+    Tcl_Obj *CONST objv[];	/* An array of pointers to Tcl objects. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    return Tcl_NewListObj(objc, objv);
+}
+#endif /* TCL_MEM_DEBUG */
 
 
Index: external/tcl/tclObj.c
===================================================================
--- external/tcl/tclObj.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclObj.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -36,4 +36,14 @@
 
 char *tclEmptyStringRep = NULL;
+
+/*
+ * Count of the number of Tcl objects every allocated (by Tcl_NewObj) and
+ * freed (by TclFreeObj).
+ */
+
+#ifdef TCL_COMPILE_STATS
+long tclObjsAlloced = 0;
+long tclObjsFreed = 0;
+#endif /* TCL_COMPILE_STATS */
 
 /*
@@ -407,8 +417,12 @@
  * Tcl_NewObj --
  *
- *	This procedure creates new Tcl objects that denote the empty string.
- *	These objects have a NULL object type and NULL string representation
- *	byte pointer. Type managers call this routine to allocate new objects
- *	that they further initialize.
+ *	This procedure is normally called when not debugging: i.e., when
+ *	TCL_MEM_DEBUG is not defined. It creates new Tcl objects that denote
+ *	the empty string. These objects have a NULL object type and NULL
+ *	string representation byte pointer. Type managers call this routine
+ *	to allocate new objects that they further initialize.
+ *
+ *	When TCL_MEM_DEBUG is defined, this procedure just returns the
+ *	result of calling the debugging version Tcl_DbNewObj.
  *
  * Results:
@@ -417,6 +431,21 @@
  *	is set to 0.
  *
- *----------------------------------------------------------------------
- */
+ * Side effects:
+ *	If compiling with TCL_COMPILE_STATS, this procedure increments
+ *	the global count of allocated objects (tclObjsAlloced).
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewObj
+
+Tcl_Obj *
+Tcl_NewObj()
+{
+    return Tcl_DbNewObj("unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
 
 Tcl_Obj *
@@ -439,6 +468,78 @@
     objPtr->length   = 0;
     objPtr->typePtr  = NULL;
+#ifdef TCL_COMPILE_STATS
+    tclObjsAlloced++;
+#endif /* TCL_COMPILE_STATS */
     return objPtr;
 }
+#endif /* TCL_MEM_DEBUG */
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbNewObj --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. It creates new Tcl objects that denote the
+ *	empty string. It is the same as the Tcl_NewObj procedure above
+ *	except that it calls Tcl_DbCkalloc directly with the file name and
+ *	line number from its caller. This simplifies debugging since then
+ *	the checkmem command will report the correct file name and line
+ *	number when reporting objects that haven't been freed.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just returns the
+ *	result of calling Tcl_NewObj.
+ *
+ * Results:
+ *	The result is a newly allocated that represents the empty string.
+ *	The new object's typePtr is set NULL and its ref count is set to 0.
+ *
+ * Side effects:
+ *	If compiling with TCL_COMPILE_STATS, this procedure increments
+ *	the global count of allocated objects (tclObjsAlloced).
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_MEM_DEBUG
+
+Tcl_Obj *
+Tcl_DbNewObj(file, line)
+    register char *file;	/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    register int line;		/* Line number in the source file; used
+				 * for debugging. */
+{
+    register Tcl_Obj *objPtr;
+
+    /*
+     * If debugging Tcl's memory usage, allocate the object using ckalloc.
+     * Otherwise, allocate it using the list of free Tcl_Objs we maintain.
+     */
+
+    objPtr = (Tcl_Obj *) Tcl_DbCkalloc(sizeof(Tcl_Obj), file, line);
+    objPtr->refCount = 0;
+    objPtr->bytes    = tclEmptyStringRep;
+    objPtr->length   = 0;
+    objPtr->typePtr  = NULL;
+#ifdef TCL_COMPILE_STATS
+    tclObjsAlloced++;
+#endif /* TCL_COMPILE_STATS */
+    return objPtr;
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_DbNewObj(file, line)
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    return Tcl_NewObj();
+}
+#endif /* TCL_MEM_DEBUG */
 
 
@@ -508,5 +609,7 @@
  *	after deallocating the string representation and calling the
  *	type-specific Tcl_FreeInternalRepProc to deallocate the object's
- *	internal representation.
+ *	internal representation. If compiling with TCL_COMPILE_STATS,
+ *	this procedure increments the global count of freed objects
+ *	(tclObjsFreed).
  *
  *----------------------------------------------------------------------
@@ -519,4 +622,10 @@
     register Tcl_ObjType *typePtr = objPtr->typePtr;
     
+#ifdef TCL_MEM_DEBUG
+    if ((objPtr)->refCount < -1) {
+	panic("Reference count for %lx was negative", objPtr);
+    }
+#endif /* TCL_MEM_DEBUG */
+
     Tcl_InvalidateStringRep(objPtr);
     if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) {
@@ -525,10 +634,19 @@
 
     /*
-     * Deallocate the object by adding it onto the list of free
+     * If debugging Tcl's memory usage, deallocate the object using ckfree.
+     * Otherwise, deallocate it by adding it onto the list of free
      * Tcl_Objs we maintain.
      */
     
+#ifdef TCL_MEM_DEBUG
+    ckfree((char *) objPtr);
+#else
     objPtr->internalRep.otherValuePtr = (VOID *) tclFreeObjList;
     tclFreeObjList = objPtr;
+#endif /* TCL_MEM_DEBUG */
+
+#ifdef TCL_COMPILE_STATS    
+    tclObjsFreed++;
+#endif /* TCL_COMPILE_STATS */    
 }
 
@@ -676,6 +794,11 @@
  * Tcl_NewBooleanObj --
  *
- *	This procedure creates a new boolean object and	initializes it from
- *	the argument boolean value. A nonzero "boolValue" is coerced to 1.
+ *	This procedure is normally called when not debugging: i.e., when
+ *	TCL_MEM_DEBUG is not defined. It creates a new boolean object and
+ *	initializes it from the argument boolean value. A nonzero
+ *	"boolValue" is coerced to 1.
+ *
+ *	When TCL_MEM_DEBUG is defined, this procedure just returns the
+ *	result of calling the debugging version Tcl_DbNewBooleanObj.
  *
  * Results:
@@ -688,4 +811,7 @@
  *----------------------------------------------------------------------
  */
+
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewBooleanObj
 
 Tcl_Obj *
@@ -693,4 +819,13 @@
     register int boolValue;	/* Boolean used to initialize new object. */
 {
+    return Tcl_DbNewBooleanObj(boolValue, "unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_NewBooleanObj(boolValue)
+    register int boolValue;	/* Boolean used to initialize new object. */
+{
     register Tcl_Obj *objPtr;
 
@@ -702,4 +837,66 @@
     return objPtr;
 }
+#endif /* TCL_MEM_DEBUG */
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbNewBooleanObj --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. It creates new boolean objects. It is the
+ *	same as the Tcl_NewBooleanObj procedure above except that it calls
+ *	Tcl_DbCkalloc directly with the file name and line number from its
+ *	caller. This simplifies debugging since then the checkmem command
+ *	will report the correct file name and line number when reporting
+ *	objects that haven't been freed.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just returns the
+ *	result of calling Tcl_NewBooleanObj.
+ *
+ * Results:
+ *	The newly created object is returned. This object will have an
+ *	invalid string representation. The returned object has ref count 0.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_MEM_DEBUG
+
+Tcl_Obj *
+Tcl_DbNewBooleanObj(boolValue, file, line)
+    register int boolValue;	/* Boolean used to initialize new object. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    register Tcl_Obj *objPtr;
+
+    TclDbNewObj(objPtr, file, line);
+    objPtr->bytes = NULL;
+    
+    objPtr->internalRep.longValue = (boolValue? 1 : 0);
+    objPtr->typePtr = &tclBooleanType;
+    return objPtr;
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_DbNewBooleanObj(boolValue, file, line)
+    register int boolValue;	/* Boolean used to initialize new object. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    return Tcl_NewBooleanObj(boolValue);
+}
+#endif /* TCL_MEM_DEBUG */
 
 
@@ -981,6 +1178,10 @@
  * Tcl_NewDoubleObj --
  *
- *	This procedure creates a new double object and initializes it from
- *	the argument double value.
+ *	This procedure is normally called when not debugging: i.e., when
+ *	TCL_MEM_DEBUG is not defined. It creates a new double object and
+ *	initializes it from the argument double value.
+ *
+ *	When TCL_MEM_DEBUG is defined, this procedure just returns the
+ *	result of calling the debugging version Tcl_DbNewDoubleObj.
  *
  * Results:
@@ -993,4 +1194,7 @@
  *----------------------------------------------------------------------
  */
+
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewDoubleObj
 
 Tcl_Obj *
@@ -998,4 +1202,13 @@
     register double dblValue;	/* Double used to initialize the object. */
 {
+    return Tcl_DbNewDoubleObj(dblValue, "unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_NewDoubleObj(dblValue)
+    register double dblValue;	/* Double used to initialize the object. */
+{
     register Tcl_Obj *objPtr;
 
@@ -1007,4 +1220,66 @@
     return objPtr;
 }
+#endif /* if TCL_MEM_DEBUG */
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbNewDoubleObj --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. It creates new double objects. It is the
+ *	same as the Tcl_NewDoubleObj procedure above except that it calls
+ *	Tcl_DbCkalloc directly with the file name and line number from its
+ *	caller. This simplifies debugging since then the checkmem command
+ *	will report the correct file name and line number when reporting
+ *	objects that haven't been freed.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just returns the
+ *	result of calling Tcl_NewDoubleObj.
+ *
+ * Results:
+ *	The newly created object is returned. This object will have an
+ *	invalid string representation. The returned object has ref count 0.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_MEM_DEBUG
+
+Tcl_Obj *
+Tcl_DbNewDoubleObj(dblValue, file, line)
+    register double dblValue;	/* Double used to initialize the object. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    register Tcl_Obj *objPtr;
+
+    TclDbNewObj(objPtr, file, line);
+    objPtr->bytes = NULL;
+    
+    objPtr->internalRep.doubleValue = dblValue;
+    objPtr->typePtr = &tclDoubleType;
+    return objPtr;
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_DbNewDoubleObj(dblValue, file, line)
+    register double dblValue;	/* Double used to initialize the object. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    return Tcl_NewDoubleObj(dblValue);
+}
+#endif /* TCL_MEM_DEBUG */
 
 
@@ -1256,5 +1531,10 @@
  * Tcl_NewIntObj --
  *
- *	Calls to Tcl_NewIntObj result in a call to one of the two
+ *	If a client is compiled with TCL_MEM_DEBUG defined, calls to
+ *	Tcl_NewIntObj to create a new integer object end up calling the
+ *	debugging procedure Tcl_DbNewLongObj instead.
+ *
+ *	Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
+ *	calls to Tcl_NewIntObj result in a call to one of the two
  *	Tcl_NewIntObj implementations below. We provide two implementations
  *	so that the Tcl core can be compiled to do memory debugging of the 
@@ -1276,8 +1556,20 @@
  */
 
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewIntObj
+
 Tcl_Obj *
 Tcl_NewIntObj(intValue)
     register int intValue;	/* Int used to initialize the new object. */
 {
+    return Tcl_DbNewLongObj((long)intValue, "unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_NewIntObj(intValue)
+    register int intValue;	/* Int used to initialize the new object. */
+{
     register Tcl_Obj *objPtr;
 
@@ -1289,4 +1581,5 @@
     return objPtr;
 }
+#endif /* if TCL_MEM_DEBUG */
 
 
@@ -1563,5 +1856,10 @@
  * Tcl_NewLongObj --
  *
- *	Calls to Tcl_NewLongObj result in a call to one of the two
+ *	If a client is compiled with TCL_MEM_DEBUG defined, calls to
+ *	Tcl_NewLongObj to create a new long integer object end up calling
+ *	the debugging procedure Tcl_DbNewLongObj instead.
+ *
+ *	Otherwise, if the client is compiled without TCL_MEM_DEBUG defined,
+ *	calls to Tcl_NewLongObj result in a call to one of the two
  *	Tcl_NewLongObj implementations below. We provide two implementations
  *	so that the Tcl core can be compiled to do memory debugging of the 
@@ -1583,4 +1881,7 @@
  */
 
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewLongObj
+
 Tcl_Obj *
 Tcl_NewLongObj(longValue)
@@ -1588,4 +1889,14 @@
 				 * new object. */
 {
+    return Tcl_DbNewLongObj(longValue, "unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_NewLongObj(longValue)
+    register long longValue;	/* Long integer used to initialize the
+				 * new object. */
+{
     register Tcl_Obj *objPtr;
 
@@ -1597,4 +1908,5 @@
     return objPtr;
 }
+#endif /* if TCL_MEM_DEBUG */
 
 
@@ -1604,5 +1916,20 @@
  * Tcl_DbNewLongObj --
  *
- *	This procedure just returns the result of calling Tcl_NewLongObj.
+ *	If a client is compiled with TCL_MEM_DEBUG defined, calls to
+ *	Tcl_NewIntObj and Tcl_NewLongObj to create new integer or
+ *	long integer objects end up calling the debugging procedure
+ *	Tcl_DbNewLongObj instead. We provide two implementations of
+ *	Tcl_DbNewLongObj so that whether the Tcl core is compiled to do
+ *	memory debugging of the core is independent of whether a client
+ *	requests debugging for itself.
+ *
+ *	When the core is compiled with TCL_MEM_DEBUG defined,
+ *	Tcl_DbNewLongObj calls Tcl_DbCkalloc directly with the file name and
+ *	line number from its caller. This simplifies debugging since then
+ *	the checkmem command will report the caller's file name and line
+ *	number when reporting objects that haven't been freed.
+ *
+ *	Otherwise, when the core is compiled without TCL_MEM_DEBUG defined,
+ *	this procedure just returns the result of calling Tcl_NewLongObj.
  *
  * Results:
@@ -1616,4 +1943,6 @@
  *----------------------------------------------------------------------
  */
+
+#ifdef TCL_MEM_DEBUG
 
 Tcl_Obj *
@@ -1626,6 +1955,28 @@
 				 * for debugging. */
 {
+    register Tcl_Obj *objPtr;
+
+    TclDbNewObj(objPtr, file, line);
+    objPtr->bytes = NULL;
+    
+    objPtr->internalRep.longValue = longValue;
+    objPtr->typePtr = &tclIntType;
+    return objPtr;
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_DbNewLongObj(longValue, file, line)
+    register long longValue;	/* Long integer used to initialize the
+				 * new object. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
     return Tcl_NewLongObj(longValue);
 }
+#endif /* TCL_MEM_DEBUG */
 
 
@@ -1709,2 +2060,125 @@
     return result;
 }
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbIncrRefCount --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. This checks to see whether or not
+ *	the memory has been freed before incrementing the ref count.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just increments
+ *	the reference count of the object.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	The object's ref count is incremented.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tcl_DbIncrRefCount(objPtr, file, line)
+    register Tcl_Obj *objPtr;	/* The object we are adding a reference to. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+#ifdef TCL_MEM_DEBUG
+    if (objPtr->refCount == 0x61616161) {
+	fprintf(stderr, "file = %s, line = %d\n", file, line);
+	fflush(stderr);
+	panic("Trying to increment refCount of previously disposed object.");
+    }
+#endif
+    ++(objPtr)->refCount;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbDecrRefCount --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. This checks to see whether or not
+ *	the memory has been freed before incrementing the ref count.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just increments
+ *	the reference count of the object.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	The object's ref count is incremented.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+Tcl_DbDecrRefCount(objPtr, file, line)
+    register Tcl_Obj *objPtr;	/* The object we are adding a reference to. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+#ifdef TCL_MEM_DEBUG
+    if (objPtr->refCount == 0x61616161) {
+	fprintf(stderr, "file = %s, line = %d\n", file, line);
+	fflush(stderr);
+	panic("Trying to decrement refCount of previously disposed object.");
+    }
+#endif
+    if (--(objPtr)->refCount <= 0) {
+	TclFreeObj(objPtr);
+    }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbIsShared --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. This checks to see whether or not
+ *	the memory has been freed before incrementing the ref count.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just decrements
+ *	the reference count of the object and throws it away if the count
+ *	is 0 or less.
+ *
+ * Results:
+ *	None.
+ *
+ * Side effects:
+ *	The object's ref count is incremented.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+Tcl_DbIsShared(objPtr, file, line)
+    register Tcl_Obj *objPtr;	/* The object we are adding a reference to. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+#ifdef TCL_MEM_DEBUG
+    if (objPtr->refCount == 0x61616161) {
+	fprintf(stderr, "file = %s, line = %d\n", file, line);
+	fflush(stderr);
+	panic("Trying to check whether previously disposed object is shared.");
+    }
+#endif
+    return ((objPtr)->refCount > 1);
+}
Index: external/tcl/tclPosixStr.c
===================================================================
--- external/tcl/tclPosixStr.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
+++ external/tcl/tclPosixStr.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -0,0 +1,1178 @@
+/* 
+ * tclPosixStr.c --
+ *
+ *	This file contains procedures that generate strings
+ *	corresponding to various POSIX-related codes, such
+ *	as errno and signals.
+ *
+ * Copyright (c) 1991-1994 The Regents of the University of California.
+ * Copyright (c) 1994-1996 Sun Microsystems, Inc.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ *
+ * RCS: @(#) $Id: tclPosixStr.c,v 1.1 2008-06-04 13:58:09 demin Exp $
+ */
+
+#include "tclInt.h"
+#include "tclPort.h"
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_ErrnoId --
+ *
+ *	Return a textual identifier for the current errno value.
+ *
+ * Results:
+ *	This procedure returns a machine-readable textual identifier
+ *	that corresponds to the current errno value (e.g. "EPERM").
+ *	The identifier is the same as the #define name in errno.h.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+Tcl_ErrnoId()
+{
+    switch (errno) {
+#ifdef E2BIG
+	case E2BIG: return "E2BIG";
+#endif
+#ifdef EACCES
+	case EACCES: return "EACCES";
+#endif
+#ifdef EADDRINUSE
+	case EADDRINUSE: return "EADDRINUSE";
+#endif
+#ifdef EADDRNOTAVAIL
+	case EADDRNOTAVAIL: return "EADDRNOTAVAIL";
+#endif
+#ifdef EADV
+	case EADV: return "EADV";
+#endif
+#ifdef EAFNOSUPPORT
+	case EAFNOSUPPORT: return "EAFNOSUPPORT";
+#endif
+#ifdef EAGAIN
+	case EAGAIN: return "EAGAIN";
+#endif
+#ifdef EALIGN
+	case EALIGN: return "EALIGN";
+#endif
+#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
+	case EALREADY: return "EALREADY";
+#endif
+#ifdef EBADE
+	case EBADE: return "EBADE";
+#endif
+#ifdef EBADF
+	case EBADF: return "EBADF";
+#endif
+#ifdef EBADFD
+	case EBADFD: return "EBADFD";
+#endif
+#ifdef EBADMSG
+	case EBADMSG: return "EBADMSG";
+#endif
+#ifdef EBADR
+	case EBADR: return "EBADR";
+#endif
+#ifdef EBADRPC
+	case EBADRPC: return "EBADRPC";
+#endif
+#ifdef EBADRQC
+	case EBADRQC: return "EBADRQC";
+#endif
+#ifdef EBADSLT
+	case EBADSLT: return "EBADSLT";
+#endif
+#ifdef EBFONT
+	case EBFONT: return "EBFONT";
+#endif
+#ifdef EBUSY
+	case EBUSY: return "EBUSY";
+#endif
+#ifdef ECHILD
+	case ECHILD: return "ECHILD";
+#endif
+#ifdef ECHRNG
+	case ECHRNG: return "ECHRNG";
+#endif
+#ifdef ECOMM
+	case ECOMM: return "ECOMM";
+#endif
+#ifdef ECONNABORTED
+	case ECONNABORTED: return "ECONNABORTED";
+#endif
+#ifdef ECONNREFUSED
+	case ECONNREFUSED: return "ECONNREFUSED";
+#endif
+#ifdef ECONNRESET
+	case ECONNRESET: return "ECONNRESET";
+#endif
+#if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
+	case EDEADLK: return "EDEADLK";
+#endif
+#if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK))
+	case EDEADLOCK: return "EDEADLOCK";
+#endif
+#ifdef EDESTADDRREQ
+	case EDESTADDRREQ: return "EDESTADDRREQ";
+#endif
+#ifdef EDIRTY
+	case EDIRTY: return "EDIRTY";
+#endif
+#ifdef EDOM
+	case EDOM: return "EDOM";
+#endif
+#ifdef EDOTDOT
+	case EDOTDOT: return "EDOTDOT";
+#endif
+#ifdef EDQUOT
+	case EDQUOT: return "EDQUOT";
+#endif
+#ifdef EDUPPKG
+	case EDUPPKG: return "EDUPPKG";
+#endif
+#ifdef EEXIST
+	case EEXIST: return "EEXIST";
+#endif
+#ifdef EFAULT
+	case EFAULT: return "EFAULT";
+#endif
+#ifdef EFBIG
+	case EFBIG: return "EFBIG";
+#endif
+#ifdef EHOSTDOWN
+	case EHOSTDOWN: return "EHOSTDOWN";
+#endif
+#ifdef EHOSTUNREACH
+	case EHOSTUNREACH: return "EHOSTUNREACH";
+#endif
+#if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS))
+	case EIDRM: return "EIDRM";
+#endif
+#ifdef EINIT
+	case EINIT: return "EINIT";
+#endif
+#ifdef EINPROGRESS
+	case EINPROGRESS: return "EINPROGRESS";
+#endif
+#ifdef EINTR
+	case EINTR: return "EINTR";
+#endif
+#ifdef EINVAL
+	case EINVAL: return "EINVAL";
+#endif
+#ifdef EIO
+	case EIO: return "EIO";
+#endif
+#ifdef EISCONN
+	case EISCONN: return "EISCONN";
+#endif
+#ifdef EISDIR
+	case EISDIR: return "EISDIR";
+#endif
+#ifdef EISNAME
+	case EISNAM: return "EISNAM";
+#endif
+#ifdef ELBIN
+	case ELBIN: return "ELBIN";
+#endif
+#ifdef EL2HLT
+	case EL2HLT: return "EL2HLT";
+#endif
+#ifdef EL2NSYNC
+	case EL2NSYNC: return "EL2NSYNC";
+#endif
+#ifdef EL3HLT
+	case EL3HLT: return "EL3HLT";
+#endif
+#ifdef EL3RST
+	case EL3RST: return "EL3RST";
+#endif
+#ifdef ELIBACC
+	case ELIBACC: return "ELIBACC";
+#endif
+#ifdef ELIBBAD
+	case ELIBBAD: return "ELIBBAD";
+#endif
+#ifdef ELIBEXEC
+	case ELIBEXEC: return "ELIBEXEC";
+#endif
+#ifdef ELIBMAX
+	case ELIBMAX: return "ELIBMAX";
+#endif
+#ifdef ELIBSCN
+	case ELIBSCN: return "ELIBSCN";
+#endif
+#ifdef ELNRNG
+	case ELNRNG: return "ELNRNG";
+#endif
+#if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT))
+	case ELOOP: return "ELOOP";
+#endif
+#ifdef EMFILE
+	case EMFILE: return "EMFILE";
+#endif
+#ifdef EMLINK
+	case EMLINK: return "EMLINK";
+#endif
+#ifdef EMSGSIZE
+	case EMSGSIZE: return "EMSGSIZE";
+#endif
+#ifdef EMULTIHOP
+	case EMULTIHOP: return "EMULTIHOP";
+#endif
+#ifdef ENAMETOOLONG
+	case ENAMETOOLONG: return "ENAMETOOLONG";
+#endif
+#ifdef ENAVAIL
+	case ENAVAIL: return "ENAVAIL";
+#endif
+#ifdef ENET
+	case ENET: return "ENET";
+#endif
+#ifdef ENETDOWN
+	case ENETDOWN: return "ENETDOWN";
+#endif
+#ifdef ENETRESET
+	case ENETRESET: return "ENETRESET";
+#endif
+#ifdef ENETUNREACH
+	case ENETUNREACH: return "ENETUNREACH";
+#endif
+#ifdef ENFILE
+	case ENFILE: return "ENFILE";
+#endif
+#ifdef ENOANO
+	case ENOANO: return "ENOANO";
+#endif
+#if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
+	case ENOBUFS: return "ENOBUFS";
+#endif
+#ifdef ENOCSI
+	case ENOCSI: return "ENOCSI";
+#endif
+#if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED))
+	case ENODATA: return "ENODATA";
+#endif
+#ifdef ENODEV
+	case ENODEV: return "ENODEV";
+#endif
+#ifdef ENOENT
+	case ENOENT: return "ENOENT";
+#endif
+#ifdef ENOEXEC
+	case ENOEXEC: return "ENOEXEC";
+#endif
+#ifdef ENOLCK
+	case ENOLCK: return "ENOLCK";
+#endif
+#ifdef ENOLINK
+	case ENOLINK: return "ENOLINK";
+#endif
+#ifdef ENOMEM
+	case ENOMEM: return "ENOMEM";
+#endif
+#ifdef ENOMSG
+	case ENOMSG: return "ENOMSG";
+#endif
+#ifdef ENONET
+	case ENONET: return "ENONET";
+#endif
+#ifdef ENOPKG
+	case ENOPKG: return "ENOPKG";
+#endif
+#ifdef ENOPROTOOPT
+	case ENOPROTOOPT: return "ENOPROTOOPT";
+#endif
+#ifdef ENOSPC
+	case ENOSPC: return "ENOSPC";
+#endif
+#if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR))
+	case ENOSR: return "ENOSR";
+#endif
+#if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR))
+	case ENOSTR: return "ENOSTR";
+#endif
+#ifdef ENOSYM
+	case ENOSYM: return "ENOSYM";
+#endif
+#ifdef ENOSYS
+	case ENOSYS: return "ENOSYS";
+#endif
+#ifdef ENOTBLK
+	case ENOTBLK: return "ENOTBLK";
+#endif
+#ifdef ENOTCONN
+	case ENOTCONN: return "ENOTCONN";
+#endif
+#ifdef ENOTDIR
+	case ENOTDIR: return "ENOTDIR";
+#endif
+#if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
+	case ENOTEMPTY: return "ENOTEMPTY";
+#endif
+#ifdef ENOTNAM
+	case ENOTNAM: return "ENOTNAM";
+#endif
+#ifdef ENOTSOCK
+	case ENOTSOCK: return "ENOTSOCK";
+#endif
+#ifdef ENOTSUP
+	case ENOTSUP: return "ENOTSUP";
+#endif
+#ifdef ENOTTY
+	case ENOTTY: return "ENOTTY";
+#endif
+#ifdef ENOTUNIQ
+	case ENOTUNIQ: return "ENOTUNIQ";
+#endif
+#ifdef ENXIO
+	case ENXIO: return "ENXIO";
+#endif
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
+	case EOPNOTSUPP: return "EOPNOTSUPP";
+#endif
+#ifdef EPERM
+	case EPERM: return "EPERM";
+#endif
+#if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT))
+	case EPFNOSUPPORT: return "EPFNOSUPPORT";
+#endif
+#ifdef EPIPE
+	case EPIPE: return "EPIPE";
+#endif
+#ifdef EPROCLIM
+	case EPROCLIM: return "EPROCLIM";
+#endif
+#ifdef EPROCUNAVAIL
+	case EPROCUNAVAIL: return "EPROCUNAVAIL";
+#endif
+#ifdef EPROGMISMATCH
+	case EPROGMISMATCH: return "EPROGMISMATCH";
+#endif
+#ifdef EPROGUNAVAIL
+	case EPROGUNAVAIL: return "EPROGUNAVAIL";
+#endif
+#ifdef EPROTO
+	case EPROTO: return "EPROTO";
+#endif
+#ifdef EPROTONOSUPPORT
+	case EPROTONOSUPPORT: return "EPROTONOSUPPORT";
+#endif
+#ifdef EPROTOTYPE
+	case EPROTOTYPE: return "EPROTOTYPE";
+#endif
+#ifdef ERANGE
+	case ERANGE: return "ERANGE";
+#endif
+#if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
+	case EREFUSED: return "EREFUSED";
+#endif
+#ifdef EREMCHG
+	case EREMCHG: return "EREMCHG";
+#endif
+#ifdef EREMDEV
+	case EREMDEV: return "EREMDEV";
+#endif
+#ifdef EREMOTE
+	case EREMOTE: return "EREMOTE";
+#endif
+#ifdef EREMOTEIO
+	case EREMOTEIO: return "EREMOTEIO";
+#endif
+#ifdef EREMOTERELEASE
+	case EREMOTERELEASE: return "EREMOTERELEASE";
+#endif
+#ifdef EROFS
+	case EROFS: return "EROFS";
+#endif
+#ifdef ERPCMISMATCH
+	case ERPCMISMATCH: return "ERPCMISMATCH";
+#endif
+#ifdef ERREMOTE
+	case ERREMOTE: return "ERREMOTE";
+#endif
+#ifdef ESHUTDOWN
+	case ESHUTDOWN: return "ESHUTDOWN";
+#endif
+#ifdef ESOCKTNOSUPPORT
+	case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT";
+#endif
+#ifdef ESPIPE
+	case ESPIPE: return "ESPIPE";
+#endif
+#ifdef ESRCH
+	case ESRCH: return "ESRCH";
+#endif
+#ifdef ESRMNT
+	case ESRMNT: return "ESRMNT";
+#endif
+#ifdef ESTALE
+	case ESTALE: return "ESTALE";
+#endif
+#ifdef ESUCCESS
+	case ESUCCESS: return "ESUCCESS";
+#endif
+#if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP))
+	case ETIME: return "ETIME";
+#endif
+#if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR))
+	case ETIMEDOUT: return "ETIMEDOUT";
+#endif
+#ifdef ETOOMANYREFS
+	case ETOOMANYREFS: return "ETOOMANYREFS";
+#endif
+#ifdef ETXTBSY
+	case ETXTBSY: return "ETXTBSY";
+#endif
+#ifdef EUCLEAN
+	case EUCLEAN: return "EUCLEAN";
+#endif
+#ifdef EUNATCH
+	case EUNATCH: return "EUNATCH";
+#endif
+#ifdef EUSERS
+	case EUSERS: return "EUSERS";
+#endif
+#ifdef EVERSION
+	case EVERSION: return "EVERSION";
+#endif
+#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
+	case EWOULDBLOCK: return "EWOULDBLOCK";
+#endif
+#ifdef EXDEV
+	case EXDEV: return "EXDEV";
+#endif
+#ifdef EXFULL
+	case EXFULL: return "EXFULL";
+#endif
+    }
+    return "unknown error";
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_ErrnoMsg --
+ *
+ *	Return a human-readable message corresponding to a given
+ *	errno value.
+ *
+ * Results:
+ *	The return value is the standard POSIX error message for
+ *	errno.  This procedure is used instead of strerror because
+ *	strerror returns slightly different values on different
+ *	machines (e.g. different capitalizations), which cause
+ *	problems for things such as regression tests.  This procedure
+ *	provides messages for most standard errors, then it calls
+ *	strerror for things it doesn't understand.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+Tcl_ErrnoMsg(err)
+    int err;			/* Error number (such as in errno variable). */
+{
+    switch (err) {
+#ifdef E2BIG
+	case E2BIG: return "argument list too long";
+#endif
+#ifdef EACCES
+	case EACCES: return "permission denied";
+#endif
+#ifdef EADDRINUSE
+	case EADDRINUSE: return "address already in use";
+#endif
+#ifdef EADDRNOTAVAIL
+	case EADDRNOTAVAIL: return "can't assign requested address";
+#endif
+#ifdef EADV
+	case EADV: return "advertise error";
+#endif
+#ifdef EAFNOSUPPORT
+	case EAFNOSUPPORT: return "address family not supported by protocol family";
+#endif
+#ifdef EAGAIN
+	case EAGAIN: return "resource temporarily unavailable";
+#endif
+#ifdef EALIGN
+	case EALIGN: return "EALIGN";
+#endif
+#if defined(EALREADY) && (!defined(EBUSY) || (EALREADY != EBUSY ))
+	case EALREADY: return "operation already in progress";
+#endif
+#ifdef EBADE
+	case EBADE: return "bad exchange descriptor";
+#endif
+#ifdef EBADF
+	case EBADF: return "bad file number";
+#endif
+#ifdef EBADFD
+	case EBADFD: return "file descriptor in bad state";
+#endif
+#ifdef EBADMSG
+	case EBADMSG: return "not a data message";
+#endif
+#ifdef EBADR
+	case EBADR: return "bad request descriptor";
+#endif
+#ifdef EBADRPC
+	case EBADRPC: return "RPC structure is bad";
+#endif
+#ifdef EBADRQC
+	case EBADRQC: return "bad request code";
+#endif
+#ifdef EBADSLT
+	case EBADSLT: return "invalid slot";
+#endif
+#ifdef EBFONT
+	case EBFONT: return "bad font file format";
+#endif
+#ifdef EBUSY
+	case EBUSY: return "file busy";
+#endif
+#ifdef ECHILD
+	case ECHILD: return "no children";
+#endif
+#ifdef ECHRNG
+	case ECHRNG: return "channel number out of range";
+#endif
+#ifdef ECOMM
+	case ECOMM: return "communication error on send";
+#endif
+#ifdef ECONNABORTED
+	case ECONNABORTED: return "software caused connection abort";
+#endif
+#ifdef ECONNREFUSED
+	case ECONNREFUSED: return "connection refused";
+#endif
+#ifdef ECONNRESET
+	case ECONNRESET: return "connection reset by peer";
+#endif
+#if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
+	case EDEADLK: return "resource deadlock avoided";
+#endif
+#if defined(EDEADLOCK) && (!defined(EDEADLK) || (EDEADLOCK != EDEADLK))
+	case EDEADLOCK: return "resource deadlock avoided";
+#endif
+#ifdef EDESTADDRREQ
+	case EDESTADDRREQ: return "destination address required";
+#endif
+#ifdef EDIRTY
+	case EDIRTY: return "mounting a dirty fs w/o force";
+#endif
+#ifdef EDOM
+	case EDOM: return "math argument out of range";
+#endif
+#ifdef EDOTDOT
+	case EDOTDOT: return "cross mount point";
+#endif
+#ifdef EDQUOT
+	case EDQUOT: return "disk quota exceeded";
+#endif
+#ifdef EDUPPKG
+	case EDUPPKG: return "duplicate package name";
+#endif
+#ifdef EEXIST
+	case EEXIST: return "file already exists";
+#endif
+#ifdef EFAULT
+	case EFAULT: return "bad address in system call argument";
+#endif
+#ifdef EFBIG
+	case EFBIG: return "file too large";
+#endif
+#ifdef EHOSTDOWN
+	case EHOSTDOWN: return "host is down";
+#endif
+#ifdef EHOSTUNREACH
+	case EHOSTUNREACH: return "host is unreachable";
+#endif
+#if defined(EIDRM) && (!defined(EINPROGRESS) || (EIDRM != EINPROGRESS))
+	case EIDRM: return "identifier removed";
+#endif
+#ifdef EINIT
+	case EINIT: return "initialization error";
+#endif
+#ifdef EINPROGRESS
+	case EINPROGRESS: return "operation now in progress";
+#endif
+#ifdef EINTR
+	case EINTR: return "interrupted system call";
+#endif
+#ifdef EINVAL
+	case EINVAL: return "invalid argument";
+#endif
+#ifdef EIO
+	case EIO: return "I/O error";
+#endif
+#ifdef EISCONN
+	case EISCONN: return "socket is already connected";
+#endif
+#ifdef EISDIR
+	case EISDIR: return "illegal operation on a directory";
+#endif
+#ifdef EISNAME
+	case EISNAM: return "is a name file";
+#endif
+#ifdef ELBIN
+	case ELBIN: return "ELBIN";
+#endif
+#ifdef EL2HLT
+	case EL2HLT: return "level 2 halted";
+#endif
+#ifdef EL2NSYNC
+	case EL2NSYNC: return "level 2 not synchronized";
+#endif
+#ifdef EL3HLT
+	case EL3HLT: return "level 3 halted";
+#endif
+#ifdef EL3RST
+	case EL3RST: return "level 3 reset";
+#endif
+#ifdef ELIBACC
+	case ELIBACC: return "can not access a needed shared library";
+#endif
+#ifdef ELIBBAD
+	case ELIBBAD: return "accessing a corrupted shared library";
+#endif
+#ifdef ELIBEXEC
+	case ELIBEXEC: return "can not exec a shared library directly";
+#endif
+#ifdef ELIBMAX
+	case ELIBMAX: return
+		"attempting to link in more shared libraries than system limit";
+#endif
+#ifdef ELIBSCN
+	case ELIBSCN: return ".lib section in a.out corrupted";
+#endif
+#ifdef ELNRNG
+	case ELNRNG: return "link number out of range";
+#endif
+#if defined(ELOOP) && (!defined(ENOENT) || (ELOOP != ENOENT))
+	case ELOOP: return "too many levels of symbolic links";
+#endif
+#ifdef EMFILE
+	case EMFILE: return "too many open files";
+#endif
+#ifdef EMLINK
+	case EMLINK: return "too many links";
+#endif
+#ifdef EMSGSIZE
+	case EMSGSIZE: return "message too long";
+#endif
+#ifdef EMULTIHOP
+	case EMULTIHOP: return "multihop attempted";
+#endif
+#ifdef ENAMETOOLONG
+	case ENAMETOOLONG: return "file name too long";
+#endif
+#ifdef ENAVAIL
+	case ENAVAIL: return "not available";
+#endif
+#ifdef ENET
+	case ENET: return "ENET";
+#endif
+#ifdef ENETDOWN
+	case ENETDOWN: return "network is down";
+#endif
+#ifdef ENETRESET
+	case ENETRESET: return "network dropped connection on reset";
+#endif
+#ifdef ENETUNREACH
+	case ENETUNREACH: return "network is unreachable";
+#endif
+#ifdef ENFILE
+	case ENFILE: return "file table overflow";
+#endif
+#ifdef ENOANO
+	case ENOANO: return "anode table overflow";
+#endif
+#if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
+	case ENOBUFS: return "no buffer space available";
+#endif
+#ifdef ENOCSI
+	case ENOCSI: return "no CSI structure available";
+#endif
+#if defined(ENODATA) && (!defined(ECONNREFUSED) || (ENODATA != ECONNREFUSED))
+	case ENODATA: return "no data available";
+#endif
+#ifdef ENODEV
+	case ENODEV: return "no such device";
+#endif
+#ifdef ENOENT
+	case ENOENT: return "no such file or directory";
+#endif
+#ifdef ENOEXEC
+	case ENOEXEC: return "exec format error";
+#endif
+#ifdef ENOLCK
+	case ENOLCK: return "no locks available";
+#endif
+#ifdef ENOLINK
+	case ENOLINK: return "link has be severed";
+#endif
+#ifdef ENOMEM
+	case ENOMEM: return "not enough memory";
+#endif
+#ifdef ENOMSG
+	case ENOMSG: return "no message of desired type";
+#endif
+#ifdef ENONET
+	case ENONET: return "machine is not on the network";
+#endif
+#ifdef ENOPKG
+	case ENOPKG: return "package not installed";
+#endif
+#ifdef ENOPROTOOPT
+	case ENOPROTOOPT: return "bad proocol option";
+#endif
+#ifdef ENOSPC
+	case ENOSPC: return "no space left on device";
+#endif
+#if defined(ENOSR) && (!defined(ENAMETOOLONG) || (ENAMETOOLONG != ENOSR))
+	case ENOSR: return "out of stream resources";
+#endif
+#if defined(ENOSTR) && (!defined(ENOTTY) || (ENOTTY != ENOSTR))
+	case ENOSTR: return "not a stream device";
+#endif
+#ifdef ENOSYM
+	case ENOSYM: return "unresolved symbol name";
+#endif
+#ifdef ENOSYS
+	case ENOSYS: return "function not implemented";
+#endif
+#ifdef ENOTBLK
+	case ENOTBLK: return "block device required";
+#endif
+#ifdef ENOTCONN
+	case ENOTCONN: return "socket is not connected";
+#endif
+#ifdef ENOTDIR
+	case ENOTDIR: return "not a directory";
+#endif
+#if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
+	case ENOTEMPTY: return "directory not empty";
+#endif
+#ifdef ENOTNAM
+	case ENOTNAM: return "not a name file";
+#endif
+#ifdef ENOTSOCK
+	case ENOTSOCK: return "socket operation on non-socket";
+#endif
+#ifdef ENOTSUP
+	case ENOTSUP: return "operation not supported";
+#endif
+#ifdef ENOTTY
+	case ENOTTY: return "inappropriate device for ioctl";
+#endif
+#ifdef ENOTUNIQ
+	case ENOTUNIQ: return "name not unique on network";
+#endif
+#ifdef ENXIO
+	case ENXIO: return "no such device or address";
+#endif
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
+	case EOPNOTSUPP: return "operation not supported on socket";
+#endif
+#ifdef EPERM
+	case EPERM: return "not owner";
+#endif
+#if defined(EPFNOSUPPORT) && (!defined(ENOLCK) || (ENOLCK != EPFNOSUPPORT))
+	case EPFNOSUPPORT: return "protocol family not supported";
+#endif
+#ifdef EPIPE
+	case EPIPE: return "broken pipe";
+#endif
+#ifdef EPROCLIM
+	case EPROCLIM: return "too many processes";
+#endif
+#ifdef EPROCUNAVAIL
+	case EPROCUNAVAIL: return "bad procedure for program";
+#endif
+#ifdef EPROGMISMATCH
+	case EPROGMISMATCH: return "program version wrong";
+#endif
+#ifdef EPROGUNAVAIL
+	case EPROGUNAVAIL: return "RPC program not available";
+#endif
+#ifdef EPROTO
+	case EPROTO: return "protocol error";
+#endif
+#ifdef EPROTONOSUPPORT
+	case EPROTONOSUPPORT: return "protocol not suppored";
+#endif
+#ifdef EPROTOTYPE
+	case EPROTOTYPE: return "protocol wrong type for socket";
+#endif
+#ifdef ERANGE
+	case ERANGE: return "math result unrepresentable";
+#endif
+#if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
+	case EREFUSED: return "EREFUSED";
+#endif
+#ifdef EREMCHG
+	case EREMCHG: return "remote address changed";
+#endif
+#ifdef EREMDEV
+	case EREMDEV: return "remote device";
+#endif
+#ifdef EREMOTE
+	case EREMOTE: return "pathname hit remote file system";
+#endif
+#ifdef EREMOTEIO
+	case EREMOTEIO: return "remote i/o error";
+#endif
+#ifdef EREMOTERELEASE
+	case EREMOTERELEASE: return "EREMOTERELEASE";
+#endif
+#ifdef EROFS
+	case EROFS: return "read-only file system";
+#endif
+#ifdef ERPCMISMATCH
+	case ERPCMISMATCH: return "RPC version is wrong";
+#endif
+#ifdef ERREMOTE
+	case ERREMOTE: return "object is remote";
+#endif
+#ifdef ESHUTDOWN
+	case ESHUTDOWN: return "can't send afer socket shutdown";
+#endif
+#ifdef ESOCKTNOSUPPORT
+	case ESOCKTNOSUPPORT: return "socket type not supported";
+#endif
+#ifdef ESPIPE
+	case ESPIPE: return "invalid seek";
+#endif
+#ifdef ESRCH
+	case ESRCH: return "no such process";
+#endif
+#ifdef ESRMNT
+	case ESRMNT: return "srmount error";
+#endif
+#ifdef ESTALE
+	case ESTALE: return "stale remote file handle";
+#endif
+#ifdef ESUCCESS
+	case ESUCCESS: return "Error 0";
+#endif
+#if defined(ETIME) && (!defined(ELOOP) || (ETIME != ELOOP))
+	case ETIME: return "timer expired";
+#endif
+#if defined(ETIMEDOUT) && (!defined(ENOSTR) || (ETIMEDOUT != ENOSTR))
+	case ETIMEDOUT: return "connection timed out";
+#endif
+#ifdef ETOOMANYREFS
+	case ETOOMANYREFS: return "too many references: can't splice";
+#endif
+#ifdef ETXTBSY
+	case ETXTBSY: return "text file or pseudo-device busy";
+#endif
+#ifdef EUCLEAN
+	case EUCLEAN: return "structure needs cleaning";
+#endif
+#ifdef EUNATCH
+	case EUNATCH: return "protocol driver not attached";
+#endif
+#ifdef EUSERS
+	case EUSERS: return "too many users";
+#endif
+#ifdef EVERSION
+	case EVERSION: return "version mismatch";
+#endif
+#if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
+	case EWOULDBLOCK: return "operation would block";
+#endif
+#ifdef EXDEV
+	case EXDEV: return "cross-domain link";
+#endif
+#ifdef EXFULL
+	case EXFULL: return "message tables full";
+#endif
+	default:
+#ifdef NO_STRERROR
+	    return "unknown POSIX error";
+#else
+	    return strerror(errno);
+#endif
+    }
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_SignalId --
+ *
+ *	Return a textual identifier for a signal number.
+ *
+ * Results:
+ *	This procedure returns a machine-readable textual identifier
+ *	that corresponds to sig.  The identifier is the same as the
+ *	#define name in signal.h.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+Tcl_SignalId(sig)
+    int sig;			/* Number of signal. */
+{
+    switch (sig) {
+#ifdef SIGABRT
+	case SIGABRT: return "SIGABRT";
+#endif
+#ifdef SIGALRM
+	case SIGALRM: return "SIGALRM";
+#endif
+#ifdef SIGBUS
+	case SIGBUS: return "SIGBUS";
+#endif
+#ifdef SIGCHLD
+	case SIGCHLD: return "SIGCHLD";
+#endif
+#if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
+	case SIGCLD: return "SIGCLD";
+#endif
+#ifdef SIGCONT
+	case SIGCONT: return "SIGCONT";
+#endif
+#if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
+	case SIGEMT: return "SIGEMT";
+#endif
+#ifdef SIGFPE
+	case SIGFPE: return "SIGFPE";
+#endif
+#ifdef SIGHUP
+	case SIGHUP: return "SIGHUP";
+#endif
+#ifdef SIGILL
+	case SIGILL: return "SIGILL";
+#endif
+#ifdef SIGINT
+	case SIGINT: return "SIGINT";
+#endif
+#ifdef SIGIO
+	case SIGIO: return "SIGIO";
+#endif
+#if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT))
+	case SIGIOT: return "SIGIOT";
+#endif
+#ifdef SIGKILL
+	case SIGKILL: return "SIGKILL";
+#endif
+#if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG)) && (!defined(SIGPROF) || (SIGLOST != SIGPROF)) && (!defined(SIGIO) || (SIGLOST != SIGIO))
+	case SIGLOST: return "SIGLOST";
+#endif
+#ifdef SIGPIPE
+	case SIGPIPE: return "SIGPIPE";
+#endif
+#if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
+	case SIGPOLL: return "SIGPOLL";
+#endif
+#ifdef SIGPROF
+	case SIGPROF: return "SIGPROF";
+#endif
+#if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
+	case SIGPWR: return "SIGPWR";
+#endif
+#ifdef SIGQUIT
+	case SIGQUIT: return "SIGQUIT";
+#endif
+#ifdef SIGSEGV
+	case SIGSEGV: return "SIGSEGV";
+#endif
+#ifdef SIGSTOP
+	case SIGSTOP: return "SIGSTOP";
+#endif
+#ifdef SIGSYS
+	case SIGSYS: return "SIGSYS";
+#endif
+#ifdef SIGTERM
+	case SIGTERM: return "SIGTERM";
+#endif
+#ifdef SIGTRAP
+	case SIGTRAP: return "SIGTRAP";
+#endif
+#ifdef SIGTSTP
+	case SIGTSTP: return "SIGTSTP";
+#endif
+#ifdef SIGTTIN
+	case SIGTTIN: return "SIGTTIN";
+#endif
+#ifdef SIGTTOU
+	case SIGTTOU: return "SIGTTOU";
+#endif
+#if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
+	case SIGURG: return "SIGURG";
+#endif
+#if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO))
+	case SIGUSR1: return "SIGUSR1";
+#endif
+#if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG))
+	case SIGUSR2: return "SIGUSR2";
+#endif
+#ifdef SIGVTALRM
+	case SIGVTALRM: return "SIGVTALRM";
+#endif
+#ifdef SIGWINCH
+	case SIGWINCH: return "SIGWINCH";
+#endif
+#ifdef SIGXCPU
+	case SIGXCPU: return "SIGXCPU";
+#endif
+#ifdef SIGXFSZ
+	case SIGXFSZ: return "SIGXFSZ";
+#endif
+    }
+    return "unknown signal";
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_SignalMsg --
+ *
+ *	Return a human-readable message describing a signal.
+ *
+ * Results:
+ *	This procedure returns a string describing sig that should
+ *	make sense to a human.  It may not be easy for a machine
+ *	to parse.
+ *
+ * Side effects:
+ *	None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+char *
+Tcl_SignalMsg(sig)
+    int sig;			/* Number of signal. */
+{
+    switch (sig) {
+#ifdef SIGABRT
+	case SIGABRT: return "SIGABRT";
+#endif
+#ifdef SIGALRM
+	case SIGALRM: return "alarm clock";
+#endif
+#ifdef SIGBUS
+	case SIGBUS: return "bus error";
+#endif
+#ifdef SIGCHLD
+	case SIGCHLD: return "child status changed";
+#endif
+#if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
+	case SIGCLD: return "child status changed";
+#endif
+#ifdef SIGCONT
+	case SIGCONT: return "continue after stop";
+#endif
+#if defined(SIGEMT) && (!defined(SIGXCPU) || (SIGEMT != SIGXCPU))
+	case SIGEMT: return "EMT instruction";
+#endif
+#ifdef SIGFPE
+	case SIGFPE: return "floating-point exception";
+#endif
+#ifdef SIGHUP
+	case SIGHUP: return "hangup";
+#endif
+#ifdef SIGILL
+	case SIGILL: return "illegal instruction";
+#endif
+#ifdef SIGINT
+	case SIGINT: return "interrupt";
+#endif
+#ifdef SIGIO
+	case SIGIO: return "input/output possible on file";
+#endif
+#if defined(SIGIOT) && (!defined(SIGABRT) || (SIGABRT != SIGIOT))
+	case SIGIOT: return "IOT instruction";
+#endif
+#ifdef SIGKILL
+	case SIGKILL: return "kill signal";
+#endif
+#if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT)) && (!defined(SIGURG) || (SIGLOST != SIGURG)) && (!defined(SIGPROF) || (SIGLOST != SIGPROF)) && (!defined(SIGIO) || (SIGLOST != SIGIO))
+	case SIGLOST: return "resource lost";
+#endif
+#ifdef SIGPIPE
+	case SIGPIPE: return "write on pipe with no readers";
+#endif
+#if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
+	case SIGPOLL: return "input/output possible on file";
+#endif
+#ifdef SIGPROF
+	case SIGPROF: return "profiling alarm";
+#endif
+#if defined(SIGPWR) && (!defined(SIGXFSZ) || (SIGPWR != SIGXFSZ))
+	case SIGPWR: return "power-fail restart";
+#endif
+#ifdef SIGQUIT
+	case SIGQUIT: return "quit signal";
+#endif
+#ifdef SIGSEGV
+	case SIGSEGV: return "segmentation violation";
+#endif
+#ifdef SIGSTOP
+	case SIGSTOP: return "stop";
+#endif
+#ifdef SIGSYS
+	case SIGSYS: return "bad argument to system call";
+#endif
+#ifdef SIGTERM
+	case SIGTERM: return "software termination signal";
+#endif
+#ifdef SIGTRAP
+	case SIGTRAP: return "trace trap";
+#endif
+#ifdef SIGTSTP
+	case SIGTSTP: return "stop signal from tty";
+#endif
+#ifdef SIGTTIN
+	case SIGTTIN: return "background tty read";
+#endif
+#ifdef SIGTTOU
+	case SIGTTOU: return "background tty write";
+#endif
+#if defined(SIGURG) && (!defined(SIGIO) || (SIGURG != SIGIO))
+	case SIGURG: return "urgent I/O condition";
+#endif
+#if defined(SIGUSR1) && (!defined(SIGIO) || (SIGUSR1 != SIGIO))
+	case SIGUSR1: return "user-defined signal 1";
+#endif
+#if defined(SIGUSR2) && (!defined(SIGURG) || (SIGUSR2 != SIGURG))
+	case SIGUSR2: return "user-defined signal 2";
+#endif
+#ifdef SIGVTALRM
+	case SIGVTALRM: return "virtual time alarm";
+#endif
+#ifdef SIGWINCH
+	case SIGWINCH: return "window changed";
+#endif
+#ifdef SIGXCPU
+	case SIGXCPU: return "exceeded CPU time limit";
+#endif
+#ifdef SIGXFSZ
+	case SIGXFSZ: return "exceeded file size limit";
+#endif
+    }
+    return "unknown signal";
+}
Index: external/tcl/tclProc.c
===================================================================
--- external/tcl/tclProc.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclProc.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -985,4 +985,15 @@
      */
 
+    if (tclTraceExec >= 1) {
+	fprintf(stdout, "Calling proc ");
+	for (i = 0;  i < objc;  i++) {
+	    bytes = Tcl_GetStringFromObj(objv[i], &length);
+	    TclPrintSource(stdout, bytes, TclMin(length, 15));
+	    fprintf(stdout, " ");
+	}
+	fprintf(stdout, "\n");
+	fflush(stdout);
+    }
+
     iPtr->returnCode = TCL_OK;
     procPtr->refCount++;
@@ -1108,4 +1119,20 @@
  	int numChars;
  	char *ellipsis;
+ 	
+ 	if (tclTraceCompile >= 1) {
+ 	    /*
+ 	     * Display a line summarizing the top level command we
+ 	     * are about to compile.
+ 	     */
+ 
+ 	    numChars = strlen(procName);
+ 	    ellipsis = "";
+ 	    if (numChars > 50) {
+ 		numChars = 50;
+ 		ellipsis = "...";
+ 	    }
+ 	    fprintf(stdout, "Compiling %s \"%.*s%s\"\n",
+ 		    description, numChars, procName, ellipsis);
+ 	}
  	
  	/*
Index: external/tcl/tclStringObj.c
===================================================================
--- external/tcl/tclStringObj.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclStringObj.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -50,6 +50,10 @@
  * Tcl_NewStringObj --
  *
- *	This procedure creates a new string object and initializes it from
- *	the byte pointer and length arguments.
+ *	This procedure is normally called when not debugging: i.e., when
+ *	TCL_MEM_DEBUG is not defined. It creates a new string object and
+ *	initializes it from the byte pointer and length arguments.
+ *
+ *	When TCL_MEM_DEBUG is defined, this procedure just returns the
+ *	result of calling the debugging version Tcl_DbNewStringObj.
  *
  * Results:
@@ -66,4 +70,7 @@
  *----------------------------------------------------------------------
  */
+
+#ifdef TCL_MEM_DEBUG
+#undef Tcl_NewStringObj
 
 Tcl_Obj *
@@ -76,4 +83,18 @@
 				 * NULL byte. */
 {
+    return Tcl_DbNewStringObj(bytes, length, "unknown", 0);
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_NewStringObj(bytes, length)
+    register char *bytes;	/* Points to the first of the length bytes
+				 * used to initialize the new object. */
+    register int length;	/* The number of bytes to copy from "bytes"
+				 * when initializing the new object. If 
+				 * negative, use bytes up to the first
+				 * NULL byte. */
+{
     register Tcl_Obj *objPtr;
 
@@ -85,4 +106,80 @@
     return objPtr;
 }
+#endif /* TCL_MEM_DEBUG */
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * Tcl_DbNewStringObj --
+ *
+ *	This procedure is normally called when debugging: i.e., when
+ *	TCL_MEM_DEBUG is defined. It creates new string objects. It is the
+ *	same as the Tcl_NewStringObj procedure above except that it calls
+ *	Tcl_DbCkalloc directly with the file name and line number from its
+ *	caller. This simplifies debugging since then the checkmem command
+ *	will report the correct file name and line number when reporting
+ *	objects that haven't been freed.
+ *
+ *	When TCL_MEM_DEBUG is not defined, this procedure just returns the
+ *	result of calling Tcl_NewStringObj.
+ *
+ * Results:
+ *	A newly created string object is returned that has ref count zero.
+ *
+ * Side effects:
+ *	The new object's internal string representation will be set to a
+ *	copy of the length bytes starting at "bytes". If "length" is
+ *	negative, use bytes up to the first NULL byte; i.e., assume "bytes"
+ *	points to a C-style NULL-terminated string. The object's type is set
+ *	to NULL. An extra NULL is added to the end of the new object's byte
+ *	array.
+ *
+ *----------------------------------------------------------------------
+ */
+
+#ifdef TCL_MEM_DEBUG
+
+Tcl_Obj *
+Tcl_DbNewStringObj(bytes, length, file, line)
+    register char *bytes;	/* Points to the first of the length bytes
+				 * used to initialize the new object. */
+    register int length;	/* The number of bytes to copy from "bytes"
+				 * when initializing the new object. If 
+				 * negative, use bytes up to the first
+				 * NULL byte. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    register Tcl_Obj *objPtr;
+
+    if (length < 0) {
+	length = (bytes? strlen(bytes) : 0);
+    }
+    TclDbNewObj(objPtr, file, line);
+    TclInitStringRep(objPtr, bytes, length);
+    return objPtr;
+}
+
+#else /* if not TCL_MEM_DEBUG */
+
+Tcl_Obj *
+Tcl_DbNewStringObj(bytes, length, file, line)
+    register char *bytes;	/* Points to the first of the length bytes
+				 * used to initialize the new object. */
+    register int length;	/* The number of bytes to copy from "bytes"
+				 * when initializing the new object. If 
+				 * negative, use bytes up to the first
+				 * NULL byte. */
+    char *file;			/* The name of the source file calling this
+				 * procedure; used for debugging. */
+    int line;			/* Line number in the source file; used
+				 * for debugging. */
+{
+    return Tcl_NewStringObj(bytes, length);
+}
+#endif /* TCL_MEM_DEBUG */
 
 
Index: external/tcl/tclVar.c
===================================================================
--- external/tcl/tclVar.c	(revision 4564cba9fa0180ca6c293da8cea545291a6d0116)
+++ external/tcl/tclVar.c	(revision d7d2da362406b9e37fdf238970417c94779b54b0)
@@ -711,4 +711,22 @@
     char *msg;
 
+#ifdef TCL_COMPILE_DEBUG
+    Proc *procPtr = varFramePtr->procPtr;
+    int localCt = procPtr->numCompiledLocals;
+
+    if (compiledLocals == NULL) {
+	fprintf(stderr, "\nTclGetIndexedScalar: can't get local %i in frame 0x%x, no compiled locals\n",
+		localIndex, (unsigned int) varFramePtr);
+	panic("TclGetIndexedScalar: no compiled locals in frame 0x%x",
+		(unsigned int) varFramePtr);
+    }
+    if ((localIndex < 0) || (localIndex >= localCt)) {
+	fprintf(stderr, "\nTclGetIndexedScalar: can't get local %i in frame 0x%x with %i locals\n",
+		localIndex, (unsigned int) varFramePtr, localCt);
+	panic("TclGetIndexedScalar: bad local index %i in frame 0x%x",
+		localIndex, (unsigned int) varFramePtr);
+    }
+#endif /* TCL_COMPILE_DEBUG */
+    
     varPtr = &(compiledLocals[localIndex]);
     varName = varPtr->name;
@@ -814,4 +832,22 @@
     int new;
 
+#ifdef TCL_COMPILE_DEBUG
+    Proc *procPtr = varFramePtr->procPtr;
+    int localCt = procPtr->numCompiledLocals;
+
+    if (compiledLocals == NULL) {
+	fprintf(stderr, "\nTclGetElementOfIndexedArray: can't get element of local %i in frame 0x%x, no compiled locals\n",
+		localIndex, (unsigned int) varFramePtr);
+	panic("TclGetIndexedScalar: no compiled locals in frame 0x%x",
+		(unsigned int) varFramePtr);
+    }
+    if ((localIndex < 0) || (localIndex >= localCt)) {
+	fprintf(stderr, "\nTclGetIndexedScalar: can't get element of local %i in frame 0x%x with %i locals\n",
+		localIndex, (unsigned int) varFramePtr, localCt);
+	panic("TclGetElementOfIndexedArray: bad local index %i in frame 0x%x",
+		localIndex, (unsigned int) varFramePtr);
+    }
+#endif /* TCL_COMPILE_DEBUG */
+
     /*
      * THIS FAILS IF THE ELEMENT NAME OBJECT'S STRING REP HAS A NULL BYTE.
@@ -1413,4 +1449,22 @@
     Tcl_Obj *resultPtr = NULL;
 
+#ifdef TCL_COMPILE_DEBUG
+    Proc *procPtr = varFramePtr->procPtr;
+    int localCt = procPtr->numCompiledLocals;
+
+    if (compiledLocals == NULL) {
+	fprintf(stderr, "\nTclSetIndexedScalar: can't set local %i in frame 0x%x, no compiled locals\n",
+		localIndex, (unsigned int) varFramePtr);
+	panic("TclSetIndexedScalar: no compiled locals in frame 0x%x",
+		(unsigned int) varFramePtr);
+    }
+    if ((localIndex < 0) || (localIndex >= localCt)) {
+	fprintf(stderr, "\nTclSetIndexedScalar: can't set local %i in frame 0x%x with %i locals\n",
+		localIndex, (unsigned int) varFramePtr, localCt);
+	panic("TclSetIndexedScalar: bad local index %i in frame 0x%x",
+		localIndex, (unsigned int) varFramePtr);
+    }
+#endif /* TCL_COMPILE_DEBUG */
+    
     varPtr = &(compiledLocals[localIndex]);
     varName = varPtr->name;
@@ -1581,4 +1635,22 @@
     int new;
     
+#ifdef TCL_COMPILE_DEBUG
+    Proc *procPtr = varFramePtr->procPtr;
+    int localCt = procPtr->numCompiledLocals;
+
+    if (compiledLocals == NULL) {
+	fprintf(stderr, "\nTclSetElementOfIndexedArray: can't set element of local %i in frame 0x%x, no compiled locals\n",
+		localIndex, (unsigned int) varFramePtr);
+	panic("TclSetIndexedScalar: no compiled locals in frame 0x%x",
+		(unsigned int) varFramePtr);
+    }
+    if ((localIndex < 0) || (localIndex >= localCt)) {
+	fprintf(stderr, "\nTclSetIndexedScalar: can't set elememt of local %i in frame 0x%x with %i locals\n",
+		localIndex, (unsigned int) varFramePtr, localCt);
+	panic("TclSetElementOfIndexedArray: bad local index %i in frame 0x%x",
+		localIndex, (unsigned int) varFramePtr);
+    }
+#endif /* TCL_COMPILE_DEBUG */
+
     /*
      * THIS FAILS IF THE ELEMENT NAME OBJECT'S STRING REP HAS A NULL BYTE.
