Index: trunk/external/fastjet/ClosestPair2D.cc
===================================================================
--- trunk/external/fastjet/ClosestPair2D.cc	(revision 1094)
+++ trunk/external/fastjet/ClosestPair2D.cc	(revision 1332)
@@ -183,5 +183,5 @@
   ID2 = _ID(_points[ID1].neighbour);
   distance2 = _points[ID1].neighbour_dist2;
-  if (ID1 > ID2) swap(ID1,ID2);
+  if (ID1 > ID2) std::swap(ID1,ID2);
 }
 
Index: trunk/external/fastjet/ClusterSequence.cc
===================================================================
--- trunk/external/fastjet/ClusterSequence.cc	(revision 1094)
+++ trunk/external/fastjet/ClusterSequence.cc	(revision 1332)
@@ -2,5 +2,5 @@
 // $Id$
 //
-// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
+// Copyright (c) 2005-2013, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
 //
 //----------------------------------------------------------------------
@@ -385,8 +385,8 @@
   (*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) << "#                                                                       \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";
Index: trunk/external/fastjet/ClusterSequence.hh
===================================================================
--- trunk/external/fastjet/ClusterSequence.hh	(revision 1094)
+++ trunk/external/fastjet/ClusterSequence.hh	(revision 1332)
@@ -1,4 +1,4 @@
 //STARTHEADER
-// $Id: ClusterSequence.hh 2806 2011-12-01 17:21:00Z salam $
+// $Id: ClusterSequence.hh 3114 2013-05-04 08:46:00Z salam $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -33,5 +33,4 @@
 #include<vector>
 #include<map>
-#include "fastjet/internal/DynamicNearestNeighbours.hh"
 #include "fastjet/PseudoJet.hh"
 #include<memory>
@@ -51,6 +50,7 @@
 
 
-// forward declaration
+// forward declarations
 class ClusterSequenceStructure;
+class DynamicNearestNeighbours;
 
 /// @ingroup basic_classes
Index: trunk/external/fastjet/ClusterSequenceStructure.cc
===================================================================
--- trunk/external/fastjet/ClusterSequenceStructure.cc	(revision 1094)
+++ trunk/external/fastjet/ClusterSequenceStructure.cc	(revision 1332)
@@ -31,5 +31,7 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
+#ifndef __FJCORE__
 #include "fastjet/ClusterSequenceAreaBase.hh"
+#endif  // __FJCORE__
 #include <iostream>
 
@@ -255,4 +257,5 @@
 //----------------------------------------------------------------------
 
+#ifndef __FJCORE__
 // if possible, return a valid ClusterSequenceAreaBase pointer; otherwise
 // throw an error
@@ -263,5 +266,4 @@
 }
 
-
 // check if it has a defined area
 bool ClusterSequenceStructure::has_area() const{
@@ -295,4 +297,6 @@
 }
 
+#endif  // __FJCORE__
+
 
 
Index: trunk/external/fastjet/ClusterSequenceStructure.hh
===================================================================
--- trunk/external/fastjet/ClusterSequenceStructure.hh	(revision 1094)
+++ trunk/external/fastjet/ClusterSequenceStructure.hh	(revision 1332)
@@ -1,4 +1,4 @@
 //STARTHEADER
-// $Id: ClusterSequenceStructure.hh 2577 2011-09-13 15:11:38Z salam $
+// $Id: ClusterSequenceStructure.hh 3071 2013-04-01 12:52:46Z cacciari $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -96,7 +96,9 @@
   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  // __FJCORE__
 
   /// set the associated csw
@@ -237,4 +239,5 @@
   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
   //------------------------------------------------------------------
+#ifndef __FJCORE__
 
   /// check if it has a defined area
@@ -258,4 +261,5 @@
   virtual bool is_pure_ghost(const PseudoJet &reference) const;
 
+#endif  // __FJCORE__
   //\} --- end of jet structure -------------------------------------
 
Index: trunk/external/fastjet/ClusterSequence_Delaunay.cc
===================================================================
--- trunk/external/fastjet/ClusterSequence_Delaunay.cc	(revision 1094)
+++ trunk/external/fastjet/ClusterSequence_Delaunay.cc	(revision 1332)
@@ -31,4 +31,5 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
+#include "fastjet/internal/DynamicNearestNeighbours.hh"
 #include<iostream>
 #include<sstream>
Index: trunk/external/fastjet/ClusterSequence_TiledN2.cc
===================================================================
--- trunk/external/fastjet/ClusterSequence_TiledN2.cc	(revision 1094)
+++ trunk/external/fastjet/ClusterSequence_TiledN2.cc	(revision 1332)
@@ -274,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
@@ -517,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
@@ -734,4 +734,5 @@
   TiledJet * jetA = briefjets, * jetB;
   TiledJet oldB;
+  oldB.tile_index=0; // prevents a gcc warning
   
 
Index: trunk/external/fastjet/CompositeJetStructure.cc
===================================================================
--- trunk/external/fastjet/CompositeJetStructure.cc	(revision 1094)
+++ trunk/external/fastjet/CompositeJetStructure.cc	(revision 1332)
@@ -45,4 +45,6 @@
 					     const JetDefinition::Recombiner * recombiner)
   : _pieces(initial_pieces){
+
+#ifndef __FJCORE__
   // deal with area support (cache the area if needed)
   //--------------------------------------------------
@@ -68,4 +70,8 @@
     _area_4vector_ptr = 0;
   }
+#else
+  if (recombiner){};  // ugly trick to prevent a gcc warning
+  _area_4vector_ptr = 0;
+#endif
 
 }
@@ -115,4 +121,5 @@
 
 
+#ifndef __FJCORE__
 // area-related material
 
@@ -167,4 +174,5 @@
 }
 
+#endif  // __FJCORE__
 
 
Index: trunk/external/fastjet/CompositeJetStructure.hh
===================================================================
--- trunk/external/fastjet/CompositeJetStructure.hh	(revision 1094)
+++ trunk/external/fastjet/CompositeJetStructure.hh	(revision 1332)
@@ -1,4 +1,4 @@
 //STARTHEADER
-// $Id: CompositeJetStructure.hh 2684 2011-11-14 07:41:44Z soyez $
+// $Id: CompositeJetStructure.hh 3071 2013-04-01 12:52:46Z cacciari $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -88,4 +88,5 @@
 
   // area-related material
+#ifndef __FJCORE__
 
   /// check if it has a well-defined area
@@ -116,4 +117,5 @@
   }
 
+#endif  // __FJCORE__
 
 protected:
Index: trunk/external/fastjet/NNH.hh
===================================================================
--- trunk/external/fastjet/NNH.hh	(revision 1094)
+++ trunk/external/fastjet/NNH.hh	(revision 1332)
@@ -1,7 +1,7 @@
-#ifndef __NNH_HH__
-#define __NNH_HH__
+#ifndef __FASTJET_NNH_HH__
+#define __FASTJET_NNH_HH__
 
 //STARTHEADER
-// $Id: NNH.hh 2891 2012-06-15 12:47:59Z soyez $
+// $Id: NNH.hh 3203 2013-09-15 07:49:50Z salam $
 //
 // Copyright (c) 2009, Matteo Cacciari, Gavin Salam and Gregory Soyez
@@ -379,3 +379,3 @@
 
 
-#endif // __NNH_HH__
+#endif // __FASTJET_NNH_HH__
Index: trunk/external/fastjet/PseudoJet.cc
===================================================================
--- trunk/external/fastjet/PseudoJet.cc	(revision 1094)
+++ trunk/external/fastjet/PseudoJet.cc	(revision 1332)
@@ -31,5 +31,7 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
+#ifndef __FJCORE__
 #include "fastjet/ClusterSequenceAreaBase.hh"
+#endif  // __FJCORE__
 #include "fastjet/CompositeJetStructure.hh"
 #include<valarray>
@@ -67,4 +69,12 @@
   _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;
 }
 
@@ -668,4 +678,6 @@
 //----------------------------------------------------------------------
 
+#ifndef __FJCORE__
+
 //----------------------------------------------------------------------
 // if possible, return a valid ClusterSequenceAreaBase pointer; otherwise
@@ -715,4 +727,5 @@
 }
 
+#endif  // __FJCORE__
 
 //----------------------------------------------------------------------
Index: trunk/external/fastjet/PseudoJet.hh
===================================================================
--- trunk/external/fastjet/PseudoJet.hh	(revision 1094)
+++ trunk/external/fastjet/PseudoJet.hh	(revision 1332)
@@ -1,4 +1,4 @@
 //STARTHEADER
-// $Id: PseudoJet.hh 2728 2011-11-20 14:18:59Z salam $
+// $Id: PseudoJet.hh 3111 2013-05-04 08:17:27Z salam $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -52,7 +52,10 @@
 /// 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
@@ -73,4 +76,5 @@
   // 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);
@@ -251,5 +255,9 @@
     // dynamic_cast, NULL is returned if L is not derived from
     // PseudoJet
-    const PseudoJet * pj = cast_if_derived<const PseudoJet>(&some_four_vector);
+    //
+    // 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);
 
     if (pj){
@@ -504,4 +512,5 @@
   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
@@ -512,4 +521,6 @@
   /// shorthand for validated_cluster_sequence_area_base()
   const ClusterSequenceAreaBase * validated_csab() const;
+#endif  //  __FJCORE__
+
   //\}
 
@@ -718,4 +729,5 @@
   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
   //------------------------------------------------------------------
+#ifndef __FJCORE__
 
   /// check if it has a defined area
@@ -739,4 +751,5 @@
   virtual bool is_pure_ghost() const;
 
+#endif  // __FJCORE__
   //\} --- end of jet structure -------------------------------------
 
Index: trunk/external/fastjet/PseudoJetStructureBase.cc
===================================================================
--- trunk/external/fastjet/PseudoJetStructureBase.cc	(revision 1094)
+++ trunk/external/fastjet/PseudoJetStructureBase.cc	(revision 1332)
@@ -32,5 +32,7 @@
 #include "fastjet/PseudoJet.hh"
 #include "fastjet/ClusterSequence.hh"
+#ifndef __FJCORE__
 #include "fastjet/ClusterSequenceAreaBase.hh"
+#endif  // __FJCORE__
 
 using namespace std;
@@ -74,4 +76,5 @@
 }
 
+#ifndef __FJCORE__
 // if the jet has valid area information then return a pointer to
 // the associated ClusterSequenceAreaBase object; otherwise throw an error
@@ -81,4 +84,5 @@
   throw Error("This PseudoJet structure is not associated with a valid cluster sequence with area");
 }
+#endif
 
 
@@ -193,4 +197,5 @@
 // parent ClusterSequence (See ClusterSequenceAreaBase for details)
 //------------------------------------------------------------------
+#ifndef __FJCORE__
 
 // return the jet (scalar) area.
@@ -222,4 +227,5 @@
   throw Error("This PseudoJet structure has no implementation for is_pure_ghost");
 }
+#endif  // __FJCORE__
 
 FASTJET_END_NAMESPACE
Index: trunk/external/fastjet/PseudoJetStructureBase.hh
===================================================================
--- trunk/external/fastjet/PseudoJetStructureBase.hh	(revision 1094)
+++ trunk/external/fastjet/PseudoJetStructureBase.hh	(revision 1332)
@@ -1,4 +1,7 @@
+#ifndef __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
+#define __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
+
 //STARTHEADER
-// $Id: PseudoJetStructureBase.hh 2670 2011-11-11 17:01:06Z salam $
+// $Id: PseudoJetStructureBase.hh 3071 2013-04-01 12:52:46Z cacciari $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -28,7 +31,4 @@
 
 
-#ifndef __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
-#define __FASTJET_PSEUDOJET_STRUCTURE_BASE_HH__
-
 #include "fastjet/internal/base.hh"
 
@@ -40,5 +40,7 @@
 class PseudoJet;
 class ClusterSequence;
+#ifndef __FJCORE__
 class ClusterSequenceAreaBase;
+#endif  // __FJCORE__
 
 /// @ingroup extra_info
@@ -85,7 +87,9 @@
   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
 
   //\}
@@ -203,4 +207,5 @@
   // parent ClusterSequence (See ClusterSequenceAreaBase for details)
   //------------------------------------------------------------------
+#ifndef __FJCORE__
 
   /// check if it has a defined area
@@ -230,4 +235,5 @@
   virtual bool is_pure_ghost(const PseudoJet &reference) const;
 
+#endif  // __FJCORE__
   //\} --- end of jet structure -------------------------------------
 };
Index: trunk/external/fastjet/Selector.cc
===================================================================
--- trunk/external/fastjet/Selector.cc	(revision 1094)
+++ trunk/external/fastjet/Selector.cc	(revision 1332)
@@ -31,5 +31,7 @@
 #include <algorithm>
 #include "fastjet/Selector.hh"
+#ifndef __FJCORE__
 #include "fastjet/GhostedAreaSpec.hh"  // for area support
+#endif  // __FJCORE__
 
 using namespace std;
@@ -131,4 +133,5 @@
 }
 
+#ifndef __FJCORE__
 // area using default ghost area
 double Selector::area() const{
@@ -153,4 +156,5 @@
   return ghost_spec.ghost_area() * ((*this)(ghosts)).size();
 }
+#endif  // __FJCORE__
 
 
@@ -1340,4 +1344,5 @@
 
 //----------------------------------------------------------------------
+#ifndef __FJCORE__
 /// helper for selecting the pure ghost
 class SW_IsPureGhost : public SelectorWorker {
@@ -1364,5 +1369,4 @@
   return Selector(new SW_IsPureGhost());
 }
-
 
 //----------------------------------------------------------------------
@@ -1420,4 +1424,5 @@
   _worker.reset(new SW_RangeDefinition(range));
 }
+#endif  // __FJCORE__
 
 
Index: trunk/external/fastjet/Selector.hh
===================================================================
--- trunk/external/fastjet/Selector.hh	(revision 1094)
+++ trunk/external/fastjet/Selector.hh	(revision 1332)
@@ -1,7 +1,7 @@
-#ifndef __SELECTOR_HH__
-#define __SELECTOR_HH__
+#ifndef __FASTJET_SELECTOR_HH__
+#define __FASTJET_SELECTOR_HH__
 
 //STARTHEADER
-// $Id: Selector.hh 2687 2011-11-14 11:17:51Z soyez $
+// $Id: Selector.hh 3203 2013-09-15 07:49:50Z salam $
 //
 // Copyright (c) 2009-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -31,5 +31,7 @@
 
 #include "fastjet/PseudoJet.hh"
+#ifndef __FJCORE__
 #include "fastjet/RangeDefinition.hh"  // for initialisation from a RangeDefinition
+#endif  // __FJCORE__
 #include <limits>
 #include <cmath>
@@ -150,4 +152,5 @@
 
 
+#ifndef __FJCORE__
   /// ctor from a RangeDefinition
   ///
@@ -160,4 +163,5 @@
   /// the direct use of this constructor.
   Selector(const RangeDefinition &range);
+#endif  // __FJCORE__
 
   /// dummy virtual dtor
@@ -229,4 +233,5 @@
   }
 
+#ifndef __FJCORE__
   /// returns the rapidity-phi area associated with the Selector
   /// (throws InvalidArea if the area does not make sense).
@@ -248,4 +253,5 @@
   ///
   double area(double ghost_area) const;
+#endif  // __FJCORE__
 
   /// returns a (reference to) the underlying worker's shared pointer
@@ -455,7 +461,9 @@
 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__
 
 /// @}
@@ -463,4 +471,4 @@
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
 
-#endif // __SELECTOR_HH__
-
+#endif // __FASTJET_SELECTOR_HH__
+
Index: trunk/external/fastjet/SharedPtr.hh
===================================================================
--- trunk/external/fastjet/SharedPtr.hh	(revision 1094)
+++ trunk/external/fastjet/SharedPtr.hh	(revision 1332)
@@ -3,5 +3,5 @@
 
 //STARTHEADER
-// $Id: SharedPtr.hh 2680 2011-11-12 17:12:05Z soyez $
+// $Id: SharedPtr.hh 3129 2013-06-05 08:48:36Z salam $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -35,13 +35,13 @@
 // for testing purposes, the following define makes it possible
 // for our SharedPtr simply to be derived from the STL TR1 one.
-// #define USETR1SHAREDPTR
-
-#ifdef USETR1SHAREDPTR
+// #define __FASTJET_USETR1SHAREDPTR
+
+#ifdef __FASTJET_USETR1SHAREDPTR
 #include <tr1/memory>
-#endif // USETR1SHAREDPTR
+#endif // __FASTJET_USETR1SHAREDPTR
 
 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
 
-#ifdef USETR1SHAREDPTR
+#ifdef __FASTJET_USETR1SHAREDPTR
 
 /// @ingroup advanced_usage
@@ -78,5 +78,5 @@
 
 
-#else // USETR1SHAREDPTR
+#else // __FASTJET_USETR1SHAREDPTR
 
 /**
@@ -390,5 +390,5 @@
 }
 
-#endif // USETR1SHAREDPTR
+#endif // __FASTJET_USETR1SHAREDPTR
 
 FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
Index: trunk/external/fastjet/VERSION
===================================================================
--- trunk/external/fastjet/VERSION	(revision 1094)
+++ trunk/external/fastjet/VERSION	(revision 1332)
@@ -1,1 +1,1 @@
-3.0.3
+3.0.6
Index: trunk/external/fastjet/config_auto.h
===================================================================
--- trunk/external/fastjet/config_auto.h	(revision 1094)
+++ trunk/external/fastjet/config_auto.h	(revision 1332)
@@ -147,5 +147,5 @@
 /* Define to the full name and version of this package. */
 #ifndef FASTJET_PACKAGE_STRING 
-#define FASTJET_PACKAGE_STRING  "FastJet 3.0.3" 
+#define FASTJET_PACKAGE_STRING  "FastJet 3.0.6" 
 #endif
 
@@ -155,12 +155,7 @@
 #endif
 
-/* Define to the home page for this package. */
-#ifndef FASTJET_PACKAGE_URL 
-#define FASTJET_PACKAGE_URL  "" 
-#endif
-
 /* Define to the version of this package. */
 #ifndef FASTJET_PACKAGE_VERSION 
-#define FASTJET_PACKAGE_VERSION  "3.0.3" 
+#define FASTJET_PACKAGE_VERSION  "3.0.6" 
 #endif
 
@@ -172,5 +167,5 @@
 /* Version number of package */
 #ifndef FASTJET_VERSION 
-#define FASTJET_VERSION  "3.0.3" 
+#define FASTJET_VERSION  "3.0.6" 
 #endif
  
Index: trunk/external/fastjet/config_raw.h
===================================================================
--- trunk/external/fastjet/config_raw.h	(revision 1094)
+++ trunk/external/fastjet/config_raw.h	(revision 1332)
@@ -88,14 +88,11 @@
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "FastJet 3.0.3"
+#define PACKAGE_STRING "FastJet 3.0.6"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "fastjet"
 
-/* Define to the home page for this package. */
-#define PACKAGE_URL ""
-
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "3.0.3"
+#define PACKAGE_VERSION "3.0.6"
 
 /* Define to 1 if you have the ANSI C header files. */
@@ -103,3 +100,3 @@
 
 /* Version number of package */
-#define VERSION "3.0.3"
+#define VERSION "3.0.6"
Index: trunk/external/fastjet/config_win.h
===================================================================
--- trunk/external/fastjet/config_win.h	(revision 1094)
+++ trunk/external/fastjet/config_win.h	(revision 1332)
@@ -1,4 +1,4 @@
-#define FASTJET_PACKAGE_STRING  "FastJet 3.0.3"
-#define FASTJET_PACKAGE_VERSION  "3.0.3"
+#define FASTJET_PACKAGE_STRING  "FastJet 3.0.6"
+#define FASTJET_PACKAGE_VERSION  "3.0.6"
 
 /* The ATLASCone plugin is disabled by default*/
Index: trunk/external/fastjet/internal/ClusterSequence_N2.icc
===================================================================
--- trunk/external/fastjet/internal/ClusterSequence_N2.icc	(revision 1094)
+++ trunk/external/fastjet/internal/ClusterSequence_N2.icc	(revision 1332)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-#ifndef __CLUSTERQUENCE_N2_ICC__
-#define __CLUSTERQUENCE_N2_ICC__
+#ifndef __FASTJET_CLUSTERQUENCE_N2_ICC__
+#define __FASTJET_CLUSTERQUENCE_N2_ICC__
 #include "fastjet/ClusterSequence.hh"
 
@@ -196,5 +196,5 @@
 FASTJET_END_NAMESPACE
 
-#endif // __CLUSTERQUENCE_N2_ICC__
-
-
+#endif // __FASTJET_CLUSTERQUENCE_N2_ICC__
+
+
Index: trunk/external/fastjet/internal/IsBase.hh
===================================================================
--- trunk/external/fastjet/internal/IsBase.hh	(revision 1094)
+++ trunk/external/fastjet/internal/IsBase.hh	(revision 1332)
@@ -1,4 +1,4 @@
 //STARTHEADER
-// $Id: IsBase.hh 2622 2011-10-05 22:13:23Z soyez $
+// $Id: IsBase.hh 3071 2013-04-01 12:52:46Z cacciari $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -163,5 +163,5 @@
 template<class B, class D>
 B* cast_if_derived(D* d){
-  return IsBaseAndDerived<B,D>::value ? (B*)(d) : NULL;
+  return IsBaseAndDerived<B,D>::value ? (B*)(d) : 0;
 }
 
Index: trunk/external/fastjet/internal/SearchTree.hh
===================================================================
--- trunk/external/fastjet/internal/SearchTree.hh	(revision 1094)
+++ trunk/external/fastjet/internal/SearchTree.hh	(revision 1332)
@@ -1,4 +1,4 @@
 //STARTHEADER
-// $Id: SearchTree.hh 2577 2011-09-13 15:11:38Z salam $
+// $Id: SearchTree.hh 3107 2013-05-03 15:47:47Z salam $
 //
 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
@@ -89,5 +89,5 @@
   // tracking the depth may have some speed overhead -- so leave it 
   // out for the time being...
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
   /// the max depth the tree has ever reached
   inline unsigned int max_depth() const {return _max_depth;};
@@ -129,5 +129,5 @@
 
   
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
   unsigned int _max_depth;
 #endif
@@ -189,5 +189,6 @@
 
   // so that it can access out _node object;
-  friend class SearchTree<T>::const_circulator;
+  // note: "class U" needed for clang (v1.1 branches/release_27) compilation
+  template<class U> friend class SearchTree<U>::const_circulator;
   friend class SearchTree<T>;
 
@@ -340,5 +341,5 @@
   //_available_nodes.reserve();
 
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
   _max_depth     = 0;
 #endif
@@ -390,5 +391,5 @@
 					 ) {
 
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
   // keep track of tree depth for checking things stay reasonable...
   _max_depth = max(depth, _max_depth);
@@ -565,9 +566,9 @@
   bool             on_left = true; // (init not needed -- but soothes g++4)
   // work through tree until we reach its end
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
   unsigned int depth = 0;
 #endif
   while(location != NULL) {
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
     depth++;
 #endif
@@ -577,5 +578,5 @@
     else {location = location->right;}
   }
-#ifdef TRACK_DEPTH
+#ifdef __FASTJET_SEARCHTREE_TRACK_DEPTH
   _max_depth = max(depth, _max_depth);
 #endif
Index: trunk/external/fastjet/plugins/CDFCones/JetCluAlgorithm.cc
===================================================================
--- trunk/external/fastjet/plugins/CDFCones/JetCluAlgorithm.cc	(revision 1094)
+++ trunk/external/fastjet/plugins/CDFCones/JetCluAlgorithm.cc	(revision 1332)
@@ -28,4 +28,5 @@
 #include <algorithm>
 #include <cmath>
+#include <cstdlib>
 
 #include <fastjet/internal/base.hh>
@@ -79,6 +80,6 @@
 	  if ((iEtaPreClusterTower >= 8 && iEtaPreClusterTower < 14) || (iEtaPreClusterTower >= 38 && iEtaPreClusterTower < 44))
 	    iPhiPreClusterTower = iPhiPreClusterTower/2;
-	  int dIEta = abs(iEtaSeedTower - iEtaPreClusterTower);
-	  int dIPhi = abs(iPhiSeedTower - iPhiPreClusterTower);
+	  int dIEta = std::abs(iEtaSeedTower - iEtaPreClusterTower);
+	  int dIPhi = std::abs(iPhiSeedTower - iPhiPreClusterTower);
 	  if(dIPhi > 12)
 	    dIPhi = 24 - dIPhi;
Index: trunk/external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh
===================================================================
--- trunk/external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh	(revision 1094)
+++ trunk/external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh	(revision 1332)
@@ -30,5 +30,5 @@
 //ENDHEADER
 
-#include "D0RunIBaseConePlugin.hh"
+#include "fastjet/D0RunIBaseConePlugin.hh"
 
 // questionable whether this should be in fastjet namespace or not...
Index: trunk/external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh
===================================================================
--- trunk/external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh	(revision 1094)
+++ trunk/external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh	(revision 1332)
@@ -30,5 +30,5 @@
 //ENDHEADER
 
-#include "D0RunIBaseConePlugin.hh"
+#include "fastjet/D0RunIBaseConePlugin.hh"
 
 // questionable whether this should be in fastjet namespace or not...
Index: trunk/external/fastjet/plugins/D0RunIICone/ConeSplitMerge.hpp
===================================================================
--- trunk/external/fastjet/plugins/D0RunIICone/ConeSplitMerge.hpp	(revision 1094)
+++ trunk/external/fastjet/plugins/D0RunIICone/ConeSplitMerge.hpp	(revision 1332)
@@ -75,5 +75,5 @@
 {
 public:
-  bool operator()(const ProtoJet<Item> & first, const ProtoJet<Item> & second)
+  bool operator()(const ProtoJet<Item> & first, const ProtoJet<Item> & second) const
   {
     if ( first.pT() > second.pT() ) return true;
Index: trunk/external/fastjet/plugins/GridJet/fastjet/GridJetPlugin.hh
===================================================================
--- trunk/external/fastjet/plugins/GridJet/fastjet/GridJetPlugin.hh	(revision 1094)
+++ trunk/external/fastjet/plugins/GridJet/fastjet/GridJetPlugin.hh	(revision 1332)
@@ -75,4 +75,13 @@
   virtual double R() const;
 
+  /// 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;}
+
 private:
 
Index: trunk/external/fastjet/plugins/SISCone/AUTHORS
===================================================================
--- trunk/external/fastjet/plugins/SISCone/AUTHORS	(revision 1094)
+++ trunk/external/fastjet/plugins/SISCone/AUTHORS	(revision 1332)
@@ -7,5 +7,4 @@
 
 	 (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.
 
@@ -14,3 +13,3 @@
 
 email  : soyez@fastjet.fr
-         salam@lpthe.jussieu.fr
+         gavin.salam@cern.ch
Index: trunk/external/fastjet/plugins/SISCone/SISConePlugin.cc
===================================================================
--- trunk/external/fastjet/plugins/SISCone/SISConePlugin.cc	(revision 1094)
+++ trunk/external/fastjet/plugins/SISCone/SISConePlugin.cc	(revision 1332)
@@ -5,6 +5,6 @@
 
 // sisocne stuff
-#include "momentum.h"
-#include "siscone.h"
+#include "siscone/momentum.h"
+#include "siscone/siscone.h"
 
 // other stuff
Index: trunk/external/fastjet/plugins/SISCone/config.h
===================================================================
--- trunk/external/fastjet/plugins/SISCone/config.h	(revision 1094)
+++ trunk/external/fastjet/plugins/SISCone/config.h	(revision 1332)
@@ -49,5 +49,5 @@
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "SISCone 2.0.5"
+#define PACKAGE_STRING "SISCone 2.0.6"
 
 /* Define to the one symbol short name of this package. */
@@ -55,8 +55,8 @@
 
 /* Define to the home page for this package. */
-#define PACKAGE_URL ""
+/* #undef PACKAGE_URL */
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.0.5"
+#define PACKAGE_VERSION "2.0.6"
 
 /* Define to 1 if you have the ANSI C header files. */
@@ -64,3 +64,3 @@
 
 /* Version number of package */
-#define VERSION "2.0.5"
+#define VERSION "2.0.6"
Index: trunk/external/fastjet/plugins/SISCone/siscone.cc
===================================================================
--- trunk/external/fastjet/plugins/SISCone/siscone.cc	(revision 1094)
+++ trunk/external/fastjet/plugins/SISCone/siscone.cc	(revision 1332)
@@ -29,5 +29,5 @@
 //#else
 //#define PACKAGE_NAME "SISCone"
-//#define VERSION "1.4.0-devel"
+//#define VERSION "2.0.6"
 //#warning "No config.h file available, using preset values"
 //#endif
Index: trunk/external/fastjet/tools/JHTopTagger.cc
===================================================================
--- trunk/external/fastjet/tools/JHTopTagger.cc	(revision 1094)
+++ trunk/external/fastjet/tools/JHTopTagger.cc	(revision 1332)
@@ -68,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: trunk/external/fastjet/tools/MassDropTagger.cc
===================================================================
--- trunk/external/fastjet/tools/MassDropTagger.cc	(revision 1094)
+++ trunk/external/fastjet/tools/MassDropTagger.cc	(revision 1332)
@@ -58,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.");
 
