Index: external/fastjet/contribs/SoftKiller/AUTHORS
===================================================================
--- external/fastjet/contribs/SoftKiller/AUTHORS	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/AUTHORS	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,9 @@
+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 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/COPYING	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,343 @@
+======================================================================
+======================================================================
+======================================================================
+		    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 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/ChangeLog	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,99 @@
+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/Makefile
===================================================================
--- external/fastjet/contribs/SoftKiller/Makefile	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/Makefile	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,81 @@
+# If you are using this Makefile standalone and fastjet-config is not
+# in your path, edit this line to specify the full path
+FASTJETCONFIG=fastjet-config
+PREFIX=`$(FASTJETCONFIG) --prefix`
+CXX=g++
+CXXFLAGS= -O3 -Wall -g
+install_script = $(SHELL) ../utils/install-sh
+check_script = ../utils/check.sh
+
+# global contrib-wide Makefile include may override some of the above
+# variables (leading "-" means don't give an error if you can't find
+# the file)
+-include ../.Makefile.inc
+
+#------------------------------------------------------------------------
+# things that are specific to this contrib
+NAME=SoftKiller
+SRCS=SoftKiller.cc
+EXAMPLES=example
+INSTALLED_HEADERS=SoftKiller.hh
+#------------------------------------------------------------------------
+
+CXXFLAGS+= $(shell $(FASTJETCONFIG) --cxxflags)
+LDFLAGS += -lm $(shell $(FASTJETCONFIG) --libs)
+
+OBJS  = $(SRCS:.cc=.o)
+EXAMPLES_SRCS  = $(EXAMPLES:=.cc)
+
+install_HEADER  = $(install_script) -c -m 644
+install_LIB     = $(install_script) -c -m 644
+install_DIR     = $(install_script) -d
+install_DATA    = $(install_script) -c -m 644
+install_PROGRAM = $(install_script) -c -s
+install_SCRIPT  = $(install_script) -c
+
+.PHONY: clean distclean examples check install
+
+# compilation of the code (default target)
+all: lib$(NAME).a
+
+lib$(NAME).a: $(OBJS) 
+	ar cru lib$(NAME).a $(OBJS)
+	ranlib lib$(NAME).a
+
+# building the examples
+examples: $(EXAMPLES)
+
+# the following construct makes it possible to automatically build
+# each of the examples listed in $EXAMPLES
+$(EXAMPLES): % : %.o all
+	$(CXX) -o $@ $< -L. -l$(NAME) $(LDFLAGS)
+
+# check that everything went fine
+check: examples
+	@for prog in $(EXAMPLES); do\
+	  $(check_script) $${prog} ../data/Pythia-Zp2jets-lhc-pileup-1ev.dat || exit 1; \
+	done
+	@echo "All tests successful"
+
+# cleaning the directory
+clean:
+	rm -f *~ *.o
+
+distclean: clean
+	rm -f lib$(NAME).a $(EXAMPLES)
+
+# install things in PREFIX/...
+install: all
+	$(install_DIR) $(PREFIX)/include/fastjet/contrib
+	for header in $(INSTALLED_HEADERS); do\
+	  $(install_HEADER) $$header $(PREFIX)/include/fastjet/contrib/;\
+	done
+	$(install_DIR) $(PREFIX)/lib
+	$(install_LIB) lib$(NAME).a $(PREFIX)/lib
+
+depend:
+	makedepend -Y --   -- $(SRCS) $(EXAMPLES_SRCS)
+# DO NOT DELETE
+
+SoftKiller.o: SoftKiller.hh
+example.o: SoftKiller.hh
Index: external/fastjet/contribs/SoftKiller/NEWS
===================================================================
--- external/fastjet/contribs/SoftKiller/NEWS	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/NEWS	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,2 @@
+2014/08/17: initial release, version 1.0.0
+
Index: external/fastjet/contribs/SoftKiller/README
===================================================================
--- external/fastjet/contribs/SoftKiller/README	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/README	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,70 @@
+------------------------------------------------------------------------
+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 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/SoftKiller.cc	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,345 @@
+// $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 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/SoftKiller.hh	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,157 @@
+// $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/SoftKiller/VERSION
===================================================================
--- external/fastjet/contribs/SoftKiller/VERSION	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
+++ external/fastjet/contribs/SoftKiller/VERSION	(revision 35cdc461e095e63247ab9dded070d76bc2c888e2)
@@ -0,0 +1,1 @@
+1.0.0
