Fork me on GitHub

Changeset 273e668 in git for external


Ignore:
Timestamp:
Oct 15, 2014, 10:55:55 AM (10 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
35b9204, b25d4cf
Parents:
f14bd6a
git-author:
Pavel Demin <pavel.demin@…> (10/10/14 08:56:40)
git-committer:
Pavel Demin <pavel.demin@…> (10/15/14 10:55:55)
Message:

upgrade FastJet to version 3.1.0

Location:
external/fastjet
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/AUTHORS

    rf14bd6a r273e668  
    3535Chris Vermilion
    3636Markus Wobisch
     37Christopher Young
    3738
    3839----------------------------------------------------------------------
  • external/fastjet/ClusterSequence.cc

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: ClusterSequence.cc 3619 2014-08-13 14:17:19Z salam $
     2// $Id: ClusterSequence.cc 3685 2014-09-11 20:15:00Z salam $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3737#include "fastjet/internal/LazyTiling9.hh"
    3838#include "fastjet/internal/LazyTiling25.hh"
     39#ifndef __FJCORE__
    3940#include "fastjet/internal/LazyTiling9SeparateGhosts.hh"
     41#endif  // __FJCORE__
    4042#include<iostream>
    4143#include<sstream>
     
    370372    _plugin_activated = false;
    371373
     374#ifndef __FJCORE__
    372375  } else if (_strategy == N2MHTLazy9AntiKtSeparateGhosts) {
    373376    // attempt to use an external tiling routine -- it manipulates
     
    377380    tiling.run();
    378381    _plugin_activated = false;
     382#else
     383    throw Error("N2MHTLazy9AntiKtSeparateGhosts strategy not supported with FJCORE");
     384#endif  // __FJCORE__
    379385
    380386  } else if (_strategy == NlnN) {
  • external/fastjet/ClusterSequence.hh

    rf14bd6a r273e668  
    33
    44//FJSTARTHEADER
    5 // $Id: ClusterSequence.hh 3619 2014-08-13 14:17:19Z salam $
     5// $Id: ClusterSequence.hh 3709 2014-09-29 13:19:11Z soyez $
    66//
    77// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    641641  Strategy _best_strategy() const;
    642642 
     643  /// \if internal_doc
     644  /// \class _Parabola
    643645  /// returns c*(a*R**2 + b*R + 1);
    644646  /// Written as a class in case we want to give names to different
    645647  /// parabolas
     648  /// \endif
    646649  class _Parabola {
    647650  public:
     
    652655  };
    653656
     657  /// \if internal_doc
     658  /// \class _Line
    654659  /// operator()(R) returns a*R+b;
     660  /// \endif
    655661  class _Line {
    656662  public:
  • external/fastjet/CompositeJetStructure.hh

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: CompositeJetStructure.hh 3453 2014-07-25 07:44:32Z soyez $
     2// $Id: CompositeJetStructure.hh 3652 2014-09-03 13:31:13Z salam $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    244244                                    const JetDefinition::Recombiner & recombiner){
    245245  std::vector<PseudoJet> pieces;
     246  pieces.reserve(2);
    246247  pieces.push_back(j1);
    247248  pieces.push_back(j2);
     
    255256                                    const JetDefinition::Recombiner & recombiner){
    256257  std::vector<PseudoJet> pieces;
     258  pieces.reserve(3);
    257259  pieces.push_back(j1);
    258260  pieces.push_back(j2);
     
    267269                                    const JetDefinition::Recombiner & recombiner){
    268270  std::vector<PseudoJet> pieces;
     271  pieces.reserve(4);
    269272  pieces.push_back(j1);
    270273  pieces.push_back(j2);
  • external/fastjet/Error.cc

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: Error.cc 3433 2014-07-23 08:17:03Z salam $
     2// $Id: Error.cc 3695 2014-09-18 13:57:56Z cacciari $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3333#include <sstream>
    3434
     35#ifndef __FJCORE__
    3536// printing the stack would need execinfo
    3637#ifdef FASTJET_HAVE_EXECINFO_H
    3738#include <execinfo.h>
    3839#include <cstdlib>
    39 #endif
     40#ifdef FASTJET_HAVE_DEMANGLING_SUPPORT
     41#include <cstdio>
     42#include <cxxabi.h>
     43#endif // FASTJET_HAVE_DEMANGLING_SUPPORT
     44#endif // FASTJET_HAVE_EXECINFO_H
     45#endif  // __FJCORE__
    4046
    4147FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
     
    4652bool Error::_print_backtrace = false;
    4753ostream * Error::_default_ostr = & cerr;
     54#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
     55  LimitedWarning Error::_execinfo_undefined;
     56#endif
    4857
     58//----------------------------------------------------------------------
     59#ifndef __FJCORE__
     60
     61// demangling only is included, i.e. --enable-demangling is specified
     62// at configure time, execinfo.h is present and the GNU C++ ABI is
     63// supported
     64#if defined(FASTJET_HAVE_EXECINFO_H) && defined(FASTJET_HAVE_DEMANGLING_SUPPORT)
     65// demangle a given backtrace symbol
     66//
     67// Notes:
     68//  - at the moment, only the symbol is parsed.
     69//  - one can get the offset by using
     70//      "%*[^(]%*[^_]%127[^+)]%64[+x0123456789abcdef]", symbol, offset
     71//    and checking if sscanf returns 0, 1 or 2
     72//    (offset includes the leading +)
     73//  - Similarly one could exctract the address and try to convert it
     74//    into a filename+line number like addr2line does but this seems
     75//    to require exteral dependencies. If we want to go down that
     76//    route, one could look into the inplementation o faddr2line(.c)
     77//    and/or dladdr.
     78string Error::_demangle(const char* symbol) {
     79  size_t size;
     80  int status;
     81  char temp[128];
     82  char* demangled;
     83  // first, try to demangle a c++ name
     84  // decryption:
     85  //   %*[^(]  matches any number of characters different from "("
     86  //           the * tells not to store in input var
     87  //   %*[^_]  matches any number of characters different from "_"
     88  //           the * tells not to store in input var
     89  //   %127[^)+]  matches at most 127 characters different from "+"
     90  //              match is stored
     91  if (1 == sscanf(symbol, "%*[^(]%*[^_]%127[^)+]", temp)) {
     92    //cout << symbol << " -> " << temp << endl;
     93    if (NULL != (demangled = abi::__cxa_demangle(temp, NULL, &size, &status))) {
     94      string result(demangled);
     95      free(demangled);
     96      return result;
     97    }
     98  }
     99  //if that didn't work, try to get a regular c symbol
     100  if (1 == sscanf(symbol, "%127s", temp)) {
     101    return temp;
     102  }
     103 
     104  //if all else fails, just return the symbol
     105  return symbol;
     106}
     107#endif  // FASTJET_HAVE_DEMANGLING_SUPPORT && FASTJET_HAVE_EXECINFO_H
     108#endif  // __FJCORE__
     109
     110
     111//----------------------------------------------------------------------
    49112Error::Error(const std::string & message_in) {
    50113  _message = message_in;
     114
    51115  if (_print_errors && _default_ostr){
    52116    ostringstream oss;
    53117    oss << "fastjet::Error:  "<< message_in << endl;
    54118
     119#ifndef __FJCORE__
    55120    // only print the stack if execinfo is available and stack enabled
    56121#ifdef FASTJET_HAVE_EXECINFO_H
     
    64129      oss << "stack:" << endl;
    65130      for (int i = 1; i < size && messages != NULL; ++i){
     131#ifdef FASTJET_HAVE_DEMANGLING_SUPPORT
     132        oss << "  #" << i << ": " << _demangle(messages[i])
     133            << " [" << messages[i]  << "]" << endl;
     134#else
    66135        oss << "  #" << i << ": " << messages[i] << endl;
     136#endif
    67137      }
    68138      free(messages);
    69139    }
    70 #endif
     140#endif  // FASTJET_HAVE_EXECINFO_H
     141#endif  // __FJCORE__
    71142
    72143    *_default_ostr << oss.str();
     
    85156}
    86157
     158//----------------------------------------------------------------------
     159void Error::set_print_backtrace(bool enabled) {
     160#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
     161  if (enabled) {
     162    _execinfo_undefined.warn("Error::set_print_backtrace(true) will not work with this build of FastJet");
     163  }
     164#endif   
     165  _print_backtrace = enabled;
     166}
     167
    87168FASTJET_END_NAMESPACE
    88169
  • external/fastjet/Error.hh

    rf14bd6a r273e668  
    33
    44//FJSTARTHEADER
    5 // $Id: Error.hh 3433 2014-07-23 08:17:03Z salam $
     5// $Id: Error.hh 3694 2014-09-18 13:21:54Z soyez $
    66//
    77// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3535#include<string>
    3636#include "fastjet/internal/base.hh"
     37#include "fastjet/config.h"
     38#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
     39#include "fastjet/LimitedWarning.hh"
     40#endif
    3741
    3842FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
     
    6569  /// controls whether the backtrace is printed out with the error message or not.
    6670  /// The default is "false".
    67   static void set_print_backtrace(bool enabled) {_print_backtrace = enabled;}
     71  static void set_print_backtrace(bool enabled);
    6872
    6973  /// sets the default output stream for all errors; by default
     
    7478
    7579private:
     80
     81#ifndef __FJCORE__
     82#if defined(FASTJET_HAVE_EXECINFO_H) && defined(FASTJET_HAVE_DEMANGLING_SUPPORT)
     83  /// demangle a given backtrace symbol
     84  std::string _demangle(const char* symbol);
     85#endif
     86#endif
     87
    7688  std::string _message;                ///< error message
    7789  static bool _print_errors;           ///< do we print anything?
    7890  static bool _print_backtrace;        ///< do we print the backtrace?
    7991  static std::ostream * _default_ostr; ///< the output stream (cerr if not set)
     92#if (!defined(FASTJET_HAVE_EXECINFO_H)) || defined(__FJCORE__)
     93  static LimitedWarning _execinfo_undefined;
     94#endif
    8095};
    8196
  • external/fastjet/JetDefinition.cc

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: JetDefinition.cc 3492 2014-07-30 16:58:20Z soyez $
     2// $Id: JetDefinition.cc 3677 2014-09-09 22:45:25Z soyez $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    270270  case BIpt2_scheme:
    271271    return "boost-invariant pt2 scheme recombination";
     272  case WTA_pt_scheme:
     273    return "pt-ordered Winner-Takes-All recombination";
     274  // Energy-ordering can lead to dangerous situations with particles at
     275  // rest. We instead implement the WTA_modp_scheme
     276  //
     277  //   case WTA_E_scheme:
     278  //     return "energy-ordered Winner-Takes-All recombination";
     279  case WTA_modp_scheme:
     280    return "|3-momentum|-ordered Winner-Takes-All recombination";
    272281  default:
    273282    ostringstream err;
     
    309318    weightb = pb.perp2();
    310319    break;
     320  case WTA_pt_scheme:{
     321    const PseudoJet & phard = (pa.pt2() >= pb.pt2()) ? pa : pb;
     322    /// keep y,phi and m from the hardest, sum pt
     323    pab.reset_PtYPhiM(pa.pt()+pb.pt(),
     324                      phard.rap(), phard.phi(), phard.m());
     325    return;}
     326  // Energy-ordering can lead to dangerous situations with particles at
     327  // rest. We instead implement the WTA_modp_scheme
     328  //
     329  //   case WTA_E_scheme:{
     330  //     const PseudoJet & phard = (pa.E() >= pb.E()) ? pa : pb;
     331  //     /// keep 3-momentum direction and mass from the hardest, sum energies
     332  //     ///
     333  //     /// If the particle with the largest energy is at rest, the sum
     334  //     /// remains at rest, implying that the mass of the sum is larger
     335  //     /// than the mass of pa.
     336  //     double Eab = pa.E() + pb.E();
     337  //     double scale = (phard.modp2()==0.0)
     338  //       ? 0.0
     339  //       : sqrt((Eab*Eab - phard.m2())/phard.modp2());
     340  //     pab.reset(phard.px()*scale, phard.py()*scale, phard.pz()*scale, Eab);
     341  //     return;}
     342  case WTA_modp_scheme:{
     343    // Note: we need to compute both a and b modp. And we need pthard
     344    // and its modp. If we want to avoid repeating the test and do
     345    // only 2 modp calculations, we'd have to duplicate the code (or
     346    // use a pair<const PJ&>). An alternative is to write modp_soft as
     347    // modp_ab-modp_hard but this could suffer from larger rounding
     348    // errors
     349    bool a_hardest = (pa.modp2() >= pb.modp2());
     350    const PseudoJet & phard = a_hardest ? pa : pb;
     351    const PseudoJet & psoft = a_hardest ? pb : pa;
     352    /// keep 3-momentum direction and mass from the hardest, sum modp
     353    ///
     354    /// If the hardest particle is at rest, the sum remains at rest
     355    /// (the energy of the sum is therefore the mass of pa)
     356    double modp_hard = phard.modp();
     357    double modp_ab = modp_hard + psoft.modp();
     358    if (phard.modp2()==0.0){
     359      pab.reset(0.0, 0.0, 0.0, phard.m());
     360    } else {
     361      double scale = modp_ab/modp_hard;
     362      pab.reset(phard.px()*scale, phard.py()*scale, phard.pz()*scale,
     363                sqrt(modp_ab*modp_ab + phard.m2()));
     364    }
     365    return;}
    311366  default:
    312367    ostringstream err;
     
    344399  case BIpt_scheme:
    345400  case BIpt2_scheme:
     401  case WTA_pt_scheme:
     402  //case WTA_E_scheme:
     403  case WTA_modp_scheme:
    346404    break;
    347405  case pt_scheme:
  • external/fastjet/JetDefinition.hh

    rf14bd6a r273e668  
    33
    44//FJSTARTHEADER
    5 // $Id: JetDefinition.hh 3523 2014-08-02 13:15:21Z salam $
     5// $Id: JetDefinition.hh 3677 2014-09-09 22:45:25Z soyez $
    66//
    77// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    181181
    182182//======================================================================
    183 /// the various recombination schemes
     183/// The various recombination schemes
     184///
     185/// Note that the schemes that recombine with non-linear weighting of
     186/// the directions (e.g. pt2, winner-takes-all) are collinear safe
     187/// only for algorithms with a suitable ordering of the
     188/// recombinations: orderings in which, for particles of comparable
     189/// energies, small-angle clusterings take place before large-angle
     190/// clusterings. This property is satisfied by all gen-kt algorithms.
     191///
    184192enum RecombinationScheme {
    185193  /// summing the 4-momenta
     
    203211  /// no preprocessing
    204212  BIpt2_scheme=6,
     213  /// pt-based Winner-Takes-All (WTA) recombination: the
     214  /// result of the recombination has the rapidity, azimuth and mass
     215  /// of the the PseudoJet with the larger pt, and a pt equal to the
     216  /// sum of the two pt's
     217  WTA_pt_scheme=7,
     218  /// mod-p-based Winner-Takes-All (WTA) recombination: the result of
     219  /// the recombination gets the 3-vector direction and mass of the
     220  /// PseudoJet with the larger |3-momentum| (modp), and a
     221  /// |3-momentum| equal to the scalar sum of the two |3-momenta|.
     222  WTA_modp_scheme=8,
     223  // Energy-ordering can lead to dangerous situations with particles at
     224  // rest. We instead implement the WTA_modp_scheme
     225  //
     226  // // energy-based Winner-Takes-All (WTA) recombination: the result of
     227  // // the recombination gets the 3-vector direction and mass of the
     228  // // PseudoJet with the larger energy, and an energy equal to the
     229  // // to the sum of the two energies
     230  // WTA_E_scheme=8,
    205231  /// for the user's external scheme
    206232  external_scheme = 99
  • external/fastjet/PseudoJet.cc

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: PseudoJet.cc 3565 2014-08-11 15:24:39Z salam $
     2// $Id: PseudoJet.cc 3652 2014-09-03 13:31:13Z salam $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    861861PseudoJet join(const PseudoJet & j1, const PseudoJet & j2){
    862862  vector<PseudoJet> pieces;
     863  pieces.reserve(2);
    863864  pieces.push_back(j1);
    864865  pieces.push_back(j2);
     
    869870PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3){
    870871  vector<PseudoJet> pieces;
     872  pieces.reserve(3);
    871873  pieces.push_back(j1);
    872874  pieces.push_back(j2);
     
    878880PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3, const PseudoJet & j4){
    879881  vector<PseudoJet> pieces;
     882  pieces.reserve(4);
    880883  pieces.push_back(j1);
    881884  pieces.push_back(j2);
  • external/fastjet/RectangularGrid.hh

    rf14bd6a r273e668  
    8888  ///  \param rapmax     the maximal absolute rapidity extent of the grid
    8989  ///  \param cell_size  the grid spacing (equivalently, cell size)
    90   RectangularGrid(double rapmax, double cell_size) :
    91       _ymax(rapmax), _ymin(-rapmax),
     90  RectangularGrid(double rapmax_in, double cell_size) :
     91      _ymax(rapmax_in), _ymin(-rapmax_in),
    9292      _requested_drap(cell_size), _requested_dphi(cell_size) {
    9393    _setup_grid();
     
    103103  ///                        a massless 4-vector at the center of the tile passes
    104104  ///                        the selection
    105   RectangularGrid(double rapmin, double rapmax, double drap, double dphi,
     105  RectangularGrid(double rapmin_in, double rapmax_in, double drap_in, double dphi_in,
    106106                  Selector tile_selector = Selector())
    107     : _ymax(rapmax), _ymin(rapmin),
    108       _requested_drap(drap), _requested_dphi(dphi),
     107    : _ymax(rapmax_in), _ymin(rapmin_in),
     108      _requested_drap(drap_in), _requested_dphi(dphi_in),
    109109      _tile_selector(tile_selector)
    110110  {
  • external/fastjet/Selector.hh

    rf14bd6a r273e668  
    33
    44//FJSTARTHEADER
    5 // $Id: Selector.hh 3504 2014-08-01 06:07:54Z soyez $
     5// $Id: Selector.hh 3711 2014-09-29 13:54:51Z salam $
    66//
    77// Copyright (c) 2009-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    305305  }
    306306
    307   /// class that gets throw when a Selector is applied despite it not
     307  /// class that gets thrown when a Selector is applied despite it not
    308308  /// having a valid underlying worker.
    309309  class InvalidWorker : public Error {
     
    312312  };
    313313
    314   /// class that gets throw when a Selector is applied despite it not
    315   /// having a valid underlying worker.
     314  /// class that gets thrown when the area is requested from a Selector for which
     315  /// the area is not meaningful
    316316  class InvalidArea : public Error {
    317317  public:
  • external/fastjet/VERSION

    rf14bd6a r273e668  
    1 3.1.0-beta.1
     13.1.0
  • external/fastjet/config_auto.h

    rf14bd6a r273e668  
    6464#endif
    6565
     66/* defined if demangling is enabled at configure time and is supported through
     67   the GNU C++ ABI */
     68/* #undef HAVE_DEMANGLING_SUPPORT */
     69
    6670/* Define to 1 if you have the <dlfcn.h> header file. */
    6771#ifndef FASTJET_HAVE_DLFCN_H
     
    147151/* Define to the full name and version of this package. */
    148152#ifndef FASTJET_PACKAGE_STRING
    149 #define FASTJET_PACKAGE_STRING  "FastJet 3.1.0-beta.1"
     153#define FASTJET_PACKAGE_STRING  "FastJet 3.1.0"
    150154#endif
    151155
     
    157161/* Define to the version of this package. */
    158162#ifndef FASTJET_PACKAGE_VERSION
    159 #define FASTJET_PACKAGE_VERSION  "3.1.0-beta.1"
     163#define FASTJET_PACKAGE_VERSION  "3.1.0"
    160164#endif
    161165
     
    167171/* Version number of package */
    168172#ifndef FASTJET_VERSION
    169 #define FASTJET_VERSION  "3.1.0-beta.1"
     173#define FASTJET_VERSION  "3.1.0"
    170174#endif
    171175
     
    182186/* Version of the package under the form XYYZZ (instead of X.Y.Z) */
    183187#ifndef FASTJET_VERSION_NUMBER
    184 #define FASTJET_VERSION_NUMBER  30103
     188#define FASTJET_VERSION_NUMBER  30100
    185189#endif
    186190
    187191/* Patch version of this package */
    188192#ifndef FASTJET_VERSION_PATCHLEVEL
    189 #define FASTJET_VERSION_PATCHLEVEL  3
     193#define FASTJET_VERSION_PATCHLEVEL  0
    190194#endif
    191195
    192196/* Pre-release version of this package */
    193 #ifndef FASTJET_VERSION_PRERELEASE
    194 #define FASTJET_VERSION_PRERELEASE  ".1.0-beta.1"
    195 #endif
     197/* #undef VERSION_PRERELEASE */
    196198 
    197199/* once: _INCLUDE_FASTJET_CONFIG_AUTO_H */
  • external/fastjet/config_raw.h

    rf14bd6a r273e668  
    3737/* The TrackJet plugin is enabled */
    3838#define ENABLE_PLUGIN_TRACKJET /**/
     39
     40/* defined if demangling is enabled at configure time and is supported through
     41   the GNU C++ ABI */
     42/* #undef HAVE_DEMANGLING_SUPPORT */
    3943
    4044/* Define to 1 if you have the <dlfcn.h> header file. */
     
    8892
    8993/* Define to the full name and version of this package. */
    90 #define PACKAGE_STRING "FastJet 3.1.0-beta.1"
     94#define PACKAGE_STRING "FastJet 3.1.0"
    9195
    9296/* Define to the one symbol short name of this package. */
     
    9498
    9599/* Define to the version of this package. */
    96 #define PACKAGE_VERSION "3.1.0-beta.1"
     100#define PACKAGE_VERSION "3.1.0"
    97101
    98102/* Define to 1 if you have the ANSI C header files. */
     
    100104
    101105/* Version number of package */
    102 #define VERSION "3.1.0-beta.1"
     106#define VERSION "3.1.0"
    103107
    104108/* Major version of this package */
     
    109113
    110114/* Version of the package under the form XYYZZ (instead of X.Y.Z) */
    111 #define VERSION_NUMBER 30103
     115#define VERSION_NUMBER 30100
    112116
    113117/* Patch version of this package */
    114 #define VERSION_PATCHLEVEL 3
     118#define VERSION_PATCHLEVEL 0
    115119
    116120/* Pre-release version of this package */
    117 #define VERSION_PRERELEASE ".1.0-beta.1"
     121/* #undef VERSION_PRERELEASE */
  • external/fastjet/config_win.h

    rf14bd6a r273e668  
    1 #define FASTJET_PACKAGE_STRING  "FastJet 3.1.0-beta.1"
    2 #define FASTJET_PACKAGE_VERSION  "3.1.0-beta.1"
    3 #define FASTJET_VERSION  "3.1.0-beta.1"
     1#define FASTJET_PACKAGE_STRING  "FastJet 3.1.0"
     2#define FASTJET_PACKAGE_VERSION  "3.1.0"
     3#define FASTJET_VERSION  "3.1.0"
    44#define FASTJET_VERSION_MAJOR       3
    55#define FASTJET_VERSION_MINOR       1
    6 #define FASTJET_VERSION_PATCHLEVEL  3
    7 #define FASTJET_VERSION_PRERELEASE  ".1.0-beta.1"
    8 #define FASTJET_VERSION_NUMBER      30103
     6#define FASTJET_VERSION_PATCHLEVEL  0
     7#define FASTJET_VERSION_NUMBER      30100
    98
    109/* The ATLASCone plugin is disabled by default*/
  • external/fastjet/plugins/D0RunICone/fastjet/D0RunIConePlugin.hh

    rf14bd6a r273e668  
    3232//FJENDHEADER
    3333
     34#include "fastjet/internal/base.hh" // namespace macros (include explicitly to help Doxygen)
    3435#include "D0RunIBaseConePlugin.hh"
    3536
  • external/fastjet/plugins/D0RunICone/fastjet/D0RunIpre96ConePlugin.hh

    rf14bd6a r273e668  
    3232//FJENDHEADER
    3333
     34#include "fastjet/internal/base.hh" // namespace macros (include explicitly to help Doxygen)
    3435#include "D0RunIBaseConePlugin.hh"
    3536
  • external/fastjet/plugins/SISCone/SISConePlugin.cc

    rf14bd6a r273e668  
    2121                      four_vector.E);
    2222}
     23
     24//======================================================================
     25// wrap-up around siscone's user-defined scales
     26namespace siscone_plugin_internal{
     27  /// @ingroup internal
     28  /// \class SISConeUserScale
     29  /// class that makes the transition between the internal SISCone
     30  /// user-defined scale choice (using SISCone's Cjet) and
     31  /// user-defined scale choices in the plugn above (using FastJet's
     32  /// PseudoJets)
     33  class SISConeUserScale  : public siscone::Csplit_merge::Cuser_scale_base{
     34  public:
     35    /// ctor takes the "fastjet-style" user-defined scale as well as a
     36    /// reference to the current cluster sequence (to access the
     37    /// particles if needed)
     38    SISConeUserScale(const SISConePlugin::UserScaleBase *user_scale,
     39                     const ClusterSequence &cs)
     40      : _user_scale(user_scale), _cs(cs){}
     41
     42    /// returns the scale associated to a given jet
     43    virtual double operator()(const siscone::Cjet &jet) const{
     44      return _user_scale->result(_build_PJ_from_Cjet(jet));
     45    }
     46
     47    /// returns true id the scasle associated to jet a is larger than
     48    /// the scale associated to jet b
     49    virtual bool is_larger(const siscone::Cjet &a, const siscone::Cjet &b) const{
     50      return _user_scale->is_larger(_build_PJ_from_Cjet(a), _build_PJ_from_Cjet(b));
     51    }
     52
     53  private:
     54    /// constructs a PseudoJet from a siscone::Cjet
     55    ///
     56    /// Note that it is tempting to overload the PseudoJet ctor. This
     57    /// would not work because down the line we need to access the
     58    /// original PseudoJet through the ClusterSequence and therefore
     59    /// the PseudoJet structure needs to be aware of the
     60    /// ClusterSequence.
     61    PseudoJet _build_PJ_from_Cjet(const siscone::Cjet &jet) const{
     62      PseudoJet j(jet.v.px, jet.v.py, jet.v.pz, jet.v.E);
     63      j.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(
     64                                   new SISConePlugin::UserScaleBaseStructureType<siscone::Cjet>(jet,_cs)));     
     65      return j;
     66    }
     67
     68    const SISConePlugin::UserScaleBase *_user_scale;
     69    const ClusterSequence & _cs;
     70  };
     71}
     72
     73// end of the internal material
     74//======================================================================
    2375
    2476
     
    4597  desc << "SISCone jet algorithm with " ;
    4698  desc << "cone_radius = "       << cone_radius        () << ", ";
    47   desc << "overlap_threshold = " << overlap_threshold  () << ", ";
     99  if (_progressive_removal)
     100    desc << "progressive-removal mode, ";
     101  else 
     102    desc << "overlap_threshold = " << overlap_threshold  () << ", ";
    48103  desc << "n_pass_max = "        << n_pass_max         () << ", ";
    49104  desc << "protojet_ptmin = "    << protojet_ptmin()      << ", ";
    50   desc <<  sm_scale_string                                << ", ";
    51   desc << "caching turned "      << (caching() ? on : off);
    52   desc << ", SM stop scale = "     << _split_merge_stopping_scale;
     105  if (_progressive_removal && _user_scale) {
     106    desc << "using a user-defined scale for ordering of stable cones";
     107    string user_scale_desc = _user_scale->description();
     108    if (user_scale_desc != "") desc << " (" << user_scale_desc << ")";
     109  } else {
     110    desc <<  sm_scale_string;
     111  }
     112  if (!_progressive_removal){
     113    desc << ", caching turned "      << (caching() ? on : off);
     114    desc << ", SM stop scale = "     << _split_merge_stopping_scale;
     115  }
    53116
    54117  // add a note to the description if we use the pt-weighted splitting
     
    85148  bool new_siscone = true; // by default we'll be running it
    86149
    87   if (caching()) {
     150  if (caching() && !_progressive_removal) {
    88151
    89152    // Establish if we have a cached run with the same R, npass and
     
    138201    // run the jet finding
    139202    //cout << "plg sms: " << split_merge_scale() << endl;
    140     siscone->compute_jets(siscone_momenta, cone_radius(), overlap_threshold(),
    141                           n_pass_max(), protojet_or_ghost_ptmin(),
    142                           Esplit_merge_scale(split_merge_scale()));
     203    if (_progressive_removal){
     204      // handle the optional user-defined scale choice
     205      SharedPtr<siscone_plugin_internal::SISConeUserScale> internal_scale;
     206      if (_user_scale){
     207        internal_scale.reset(new siscone_plugin_internal::SISConeUserScale(_user_scale, clust_seq));
     208        siscone->set_user_scale(internal_scale.get());
     209      }
     210      siscone->compute_jets_progressive_removal(siscone_momenta, cone_radius(),
     211                                                n_pass_max(), protojet_or_ghost_ptmin(),
     212                                                Esplit_merge_scale(split_merge_scale()));
     213    } else {
     214      siscone->compute_jets(siscone_momenta, cone_radius(), overlap_threshold(),
     215                            n_pass_max(), protojet_or_ghost_ptmin(),
     216                            Esplit_merge_scale(split_merge_scale()));
     217    }
    143218  } else {
    144219    // rerun the jet finding
     
    155230  SISConeExtras * extras = new SISConeExtras(n);
    156231
     232  // the ordering in which the inclusive jets are transfered here is
     233  // deliberate and ensures that when a user asks for
     234  // inclusive_jets(), they are provided in the order in which SISCone
     235  // created them.
    157236  for (int ijet = njet-1; ijet >= 0; ijet--) {
    158237    const Cjet & jet = siscone->jets[ijet]; // shorthand
     
    220299}
    221300
     301// //======================================================================
     302// // material to handle user-defined scales
     303//
     304// //--------------------------------------------------
     305// // SISCone structure type
     306//
     307// // the textual descripotion
     308// std::string SISConePlugin::UserScaleBase::StructureType::description() const{
     309//   return "PseudoJet wrapping a siscone::Cjet stable cone";
     310// }
     311//
     312// // retrieve the constituents
     313// //
     314// // if you simply need to iterate over the constituents, it will be
     315// // faster to access them via constituent(i)
     316// vector<PseudoJet> SISConePlugin::UserScaleBase::StructureType::constituents(const PseudoJet &) const{
     317//   vector<PseudoJet> constits;
     318//   constits.reserve(_jet.n);
     319//   for (unsigned int i=0; i<(unsigned int)_jet.n;i++)
     320//     constits.push_back(constituent(i));
     321//   return constits;
     322// }
     323//
     324// // returns the number of constituents
     325// unsigned int SISConePlugin::UserScaleBase::StructureType::size() const{
     326//   return _jet.n;
     327// }
     328//
     329// // returns the index (in the original particle list) of the ith
     330// // constituent
     331// int SISConePlugin::UserScaleBase::StructureType::constituent_index(unsigned int i) const{
     332//   return _jet.contents[i];
     333// }
     334//
     335// // returns the ith constituent (as a PseusoJet)
     336// const PseudoJet & SISConePlugin::UserScaleBase::StructureType::constituent(unsigned int i) const{
     337//   return _cs.jets()[_jet.contents[i]];
     338// }
     339//
     340// // returns the scalar pt of this stable cone
     341// double SISConePlugin::UserScaleBase::StructureType::pt_tilde() const{
     342//   return _jet.pt_tilde;
     343// }
     344//
     345// // returns the sm_var2 (signed ordering variable squared) for this stable cone
     346// double SISConePlugin::UserScaleBase::StructureType::ordering_var2() const{
     347//   return _jet.sm_var2;
     348// }
     349
     350
    222351FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
  • external/fastjet/plugins/SISCone/config.h

    rf14bd6a r273e668  
    4949
    5050/* Define to the full name and version of this package. */
    51 #define PACKAGE_STRING "SISCone 2.0.6"
     51#define PACKAGE_STRING "SISCone 3.0.0"
    5252
    5353/* Define to the one symbol short name of this package. */
    5454#define PACKAGE_TARNAME "siscone"
    5555
     56/* Define to the home page for this package. */
     57/* #undef PACKAGE_URL */
     58
    5659/* Define to the version of this package. */
    57 #define PACKAGE_VERSION "2.0.6"
     60#define PACKAGE_VERSION "3.0.0"
    5861
    5962/* Define to 1 if you have the ANSI C header files. */
     
    6164
    6265/* Version number of package */
    63 #define VERSION "2.0.6"
     66#define VERSION "3.0.0"
  • external/fastjet/plugins/SISCone/fastjet/SISConeBasePlugin.hh

    rf14bd6a r273e668  
    4343  SISConeBasePlugin (){
    4444    _use_jet_def_recombiner = false;
     45    set_progressive_removal(false);
    4546  }
    4647
     
    4950    *this = plugin;
    5051  }
     52
     53  /// set whether to use SISCone with progressive removal instead of
     54  /// the default split_merge step.
     55  ///
     56  /// If progressive removal is enabled, the following SISCone
     57  /// variables are not used:
     58  ///
     59  /// - overlap_threshold
     60  /// - caching
     61  /// - split_merge_stopping_scale
     62  ///
     63  /// The split_merge_scale choice is reinterpreted as the ordering
     64  /// variable for progressive removal. It is also possible for the
     65  /// user to supply his/her own function for the scale that orders
     66  /// progressive removal, with set_user_scale(...)
     67  void set_progressive_removal(bool progressive_removal_in=true){
     68    _progressive_removal = progressive_removal_in;
     69  }
     70
     71  /// returns true if progressive_removal is enabled
     72  bool progressive_removal() const{ return _progressive_removal;}
    5173
    5274  /// the cone radius
     
    105127  }
    106128
     129  // user-defined scale for progressive removal
     130  //------------------------------------------------------------
     131
     132  /// \class UserScaleBase
     133  /// base class for user-defined ordering of stable cones (used for
     134  /// prorgessive removal)
     135  ///
     136  /// derived classes have to implement the () operator that returns
     137  /// the scale associated with a given jet.
     138  ///
     139  /// It is also highly recommended to implement the is_larger()
     140  /// method whenever possible, in order to avoid rounding issues
     141  /// known to lead to possible infrared unsafeties.
     142  ///
     143  /// The jets that are passed to this class will carry the structure
     144  /// of type SISConePlugin::StructureType which allows to retreive
     145  /// easily the following information:
     146  ///
     147  ///   vector<PseudoJet> constituents = jet.constituents();
     148  ///   unsigned int n_constituents = jet.structure_of<SISConePlugin::UserScaleBase>().size();
     149  ///   int index = jet.structure_of<SISConePlugin::UserScaleBase>().constituent_index(index i);
     150  ///   const PseudoJet & p = jet.structure_of<SISConePlugin::UserScaleBase>().constituent(index i);
     151  ///   double scalar_pt = jet.structure_of<SISConePlugin::UserScaleBase>().pt_tilde();
     152  ///
     153  /// see SISConePlugin::StructureType below for further details
     154  class UserScaleBase : public FunctionOfPseudoJet<double>{
     155  public:
     156    /// empty virtual dtor
     157    virtual ~UserScaleBase(){}
     158
     159    /// returns the scale associated with a given jet
     160    ///
     161    /// "progressive removal" iteratively removes the stable cone with
     162    /// the largest scale
     163    virtual double result(const PseudoJet & jet) const = 0;
     164
     165    /// returns true when the scale associated with jet a is larger than
     166    /// the scale associated with jet b
     167    ///
     168    /// By default this does a simple direct comparison but it can be
     169    /// overloaded for higher precision [recommended if possible]
     170    virtual bool is_larger(const PseudoJet & a, const PseudoJet & b) const;
     171
     172    class StructureType; // defined below
     173  };
     174
     175  // template class derived from UserScaleBase::StryctureType that
     176  // works for both SISCone jet classes
     177  // implemented below
     178  template<class Tjet>
     179  class UserScaleBaseStructureType;
     180
     181  /// set a user-defined scale for stable-cone ordering in
     182  /// progressive removal
     183  void set_user_scale(const UserScaleBase *user_scale_in){ _user_scale = user_scale_in;}
     184
     185  /// returns the user-defined scale in use (0 if none)
     186  const UserScaleBase * user_scale() const{ return _user_scale;}
     187
     188
    107189  // the things that one MUST overload required by base class
    108190  //---------------------------------------------------------
     
    120202  double _split_merge_stopping_scale;
    121203  bool   _use_jet_def_recombiner;
     204  bool   _progressive_removal;
    122205
    123206  mutable double _ghost_sep_scale;
     
    126209  /// call the re-clustering itself
    127210  virtual void reset_stored_plugin() const =0;
     211
     212  const UserScaleBase * _user_scale;
    128213
    129214};
     
    185270inline SISConeBaseExtras::~SISConeBaseExtras(){}
    186271
     272//----------------------------------------------------------------------
     273// implementation of the structure type associated with the UserScaleBase class
     274
     275/// \class SISConeBasePlugin::UserScaleBase::StructureType
     276/// the structure that allows to store the information contained
     277/// into a siscone::Cjet (built internally in SISCone from a stable
     278/// cone) into a PseudoJet
     279class SISConeBasePlugin::UserScaleBase::StructureType : public PseudoJetStructureBase {
     280public:
     281  /// base ctor (constructed from a ClusterSequence tin order to have
     282  /// access to the initial particles
     283  StructureType(const ClusterSequence &cs)
     284    : _cs(cs){}
     285
     286  /// empty virtual dtor
     287  virtual ~StructureType(){}
     288 
     289  //--------------------------------------------------
     290  // members inherited from the base class
     291  /// the textual descripotion
     292  virtual std::string description() const{
     293    return "PseudoJet wrapping a siscone jet from a stable cone";
     294  }
     295
     296  /// this structure has constituents
     297  virtual bool has_constituents() const {return true;}
     298
     299  /// retrieve the constituents
     300  ///
     301  /// if you simply need to iterate over the constituents, it will be
     302  /// faster to access them via constituent(i)
     303  virtual std::vector<PseudoJet> constituents(const PseudoJet & /*reference*/) const{
     304    std::vector<PseudoJet> constits;
     305    constits.reserve(size());
     306    for (unsigned int i=0; i<size();i++)
     307      constits.push_back(constituent(i));
     308    return constits;
     309  }
     310 
     311  //--------------------------------------------------
     312  // additional information relevant for this structure
     313
     314  /// returns the number of constituents
     315  virtual unsigned int size() const = 0;
     316
     317  /// returns the index (in the original particle list) of the ith
     318  /// constituent
     319  virtual int constituent_index(unsigned int i) const = 0;
     320
     321  /// returns the ith constituent (as a PseusoJet)
     322  const PseudoJet & constituent(unsigned int i) const{
     323    return _cs.jets()[constituent_index(i)];
     324  }
     325
     326  // /// returns the scalar pt of this stable cone
     327  // virtual double pt_tilde() const = 0;
     328
     329  /// returns the sm_var2 (signed ordering variable squared) for this stable cone
     330  virtual double ordering_var2() const = 0;
     331
     332protected:
     333  const ClusterSequence &_cs; ///< a reference to the CS (for access to the particles)
     334};
     335
     336
     337///@ingroup internal
     338/// template class derived from UserScaleBase::StryctureType that
     339/// works for both SISCone jet classes
     340/// implemented below
     341template<class Tjet>
     342class SISConeBasePlugin::UserScaleBaseStructureType : public UserScaleBase::StructureType{
     343public:
     344  UserScaleBaseStructureType(const Tjet &jet, const ClusterSequence &cs)
     345    : UserScaleBase::StructureType(cs), _jet(jet){}
     346
     347  /// empty virtual dtor
     348  virtual ~UserScaleBaseStructureType(){}
     349
     350  //--------------------------------------------------
     351  // additional information relevant for this structure
     352
     353  /// returns the number of constituents
     354  virtual unsigned int size() const{
     355    return _jet.n;
     356  }
     357
     358  /// returns the index (in the original particle list) of the ith
     359  /// constituent
     360  virtual int constituent_index(unsigned int i) const{
     361    return _jet.contents[i];
     362  }
     363
     364  // /// returns the scalar pt of this stable cone
     365  // virtual double pt_tilde() const{
     366  //   return _jet.pt_tilde;
     367  // }
     368
     369  /// returns the sm_var2 (signed ordering variable squared) for this stable cone
     370  virtual double ordering_var2() const{
     371    return _jet.sm_var2;
     372  }
     373
     374protected:
     375  const Tjet &_jet; ///< a reference to the internal jet in SISCone
     376};
     377
    187378
    188379FASTJET_END_NAMESPACE        // defined in fastjet/internal/base.hh
  • external/fastjet/plugins/SISCone/fastjet/SISConePlugin.hh

    rf14bd6a r273e668  
    77namespace siscone{
    88  class Csiscone;
     9  class Cjet;
    910}
    1011
     
    7475  /// enum for the different split-merge scale choices;
    7576  /// Note that order _must_ be the same as in siscone
    76   enum SplitMergeScale {SM_pt,     ///< transverse momentum (E-scheme), IR unsafe
    77                         SM_Et,     ///< transverse energy (E-scheme), not long. boost invariant
    78                                    ///< original run-II choice [may not be implemented]
    79                         SM_mt,     ///< transverse mass (E-scheme), IR safe except
    80                                    ///< in decays of two identical narrow heavy particles
    81                         SM_pttilde ///< pt-scheme pt = \sum_{i in jet} |p_{ti}|, should
    82                                    ///< be IR safe in all cases
     77  enum SplitMergeScale {
     78    SM_pt,     ///< transverse momentum (E-scheme), IR unsafe
     79    SM_Et,     ///< transverse energy (E-scheme), not long. boost invariant
     80               ///< original run-II choice [may not be implemented]
     81    SM_mt,     ///< transverse mass (E-scheme), IR safe except
     82               ///< in decays of two identical narrow heavy particles
     83    SM_pttilde ///< pt-scheme pt = \sum_{i in jet} |p_{ti}|, should
     84               ///< be IR safe in all cases
    8385  };
    8486
     
    108110    _split_merge_stopping_scale = split_merge_stopping_scale_in;
    109111    _ghost_sep_scale       = 0.0;
    110     _use_pt_weighted_splitting = false;}
     112    _use_pt_weighted_splitting = false;
     113    _user_scale = 0;}
    111114
    112115
     
    125128    _split_merge_stopping_scale = 0.0;
    126129    _split_merge_scale     = split_merge_on_transverse_mass_in ? SM_mt : SM_pttilde;
    127     _ghost_sep_scale       = 0.0;}
     130    _ghost_sep_scale       = 0.0;
     131    _user_scale = 0;}
    128132 
    129133  /// backwards compatible constructor for the SISCone Plugin class
     
    141145    _split_merge_stopping_scale = 0.0;
    142146    _ghost_sep_scale       = 0.0;
    143     _use_pt_weighted_splitting = false;}
     147    _use_pt_weighted_splitting = false;
     148    _user_scale = 0;}
    144149
    145150  /// minimum pt for a protojet to be considered in the split-merge step
     
    191196};
    192197
     198
     199/////\class SISConePlugin::UserScaleBase::StructureType
     200///// the structure that allows to store the information contained
     201///// into a siscone::Cjet (built internally in SISCone from a stable
     202///// cone) into a PseudoJet
     203//class SISConePlugin::UserScaleBase::StructureType : public PseudoJetStructureBase {
     204//public:
     205//  StructureType(const siscone::Cjet & jet, const ClusterSequence &cs)
     206//    : _jet(jet), _cs(cs){}
     207//
     208//  //--------------------------------------------------
     209//  // members inherited from the base class
     210//  /// the textual descripotion
     211//  virtual std::string description() const;
     212//
     213//  /// this structure has constituents
     214//  virtual bool has_constituents() const {return true;}
     215//
     216//  /// retrieve the constituents
     217//  ///
     218//  /// if you simply need to iterate over the constituents, it will be
     219//  /// faster to access them via constituent(i)
     220//  virtual std::vector<PseudoJet> constituents(const PseudoJet & /*reference*/) const;
     221//
     222//  //--------------------------------------------------
     223//  // additional information relevant for this structure
     224//
     225//  /// returns the number of constituents
     226//  unsigned int size() const;
     227//
     228//  /// returns the index (in the original particle list) of the ith
     229//  /// constituent
     230//  int constituent_index(unsigned int i) const;
     231//
     232//  /// returns the ith constituent (as a PseusoJet)
     233//  const PseudoJet & constituent(unsigned int i) const;
     234//
     235//  /// returns the scalar pt of this stable cone
     236//  double pt_tilde() const;
     237//
     238//  /// returns the sm_var2 (signed ordering variable squared) for this stable cone
     239//  double ordering_var2() const;
     240//
     241//protected:
     242//  const siscone::Cjet &_jet;  ///< a dreference to the internal jet in SISCone
     243//  const ClusterSequence &_cs; ///< a reference to the CS (for access to the particles)
     244//};
    193245
    194246//======================================================================
  • external/fastjet/plugins/SISCone/siscone.cc

    rf14bd6a r273e668  
    2121// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2222//                                                                           //
    23 // $Revision:: 341                                                          $//
    24 // $Date:: 2013-04-08 12:21:06 +0200 (Mon, 08 Apr 2013)                     $//
     23// $Revision:: 371                                                          $//
     24// $Date:: 2014-09-09 10:05:32 +0200 (Tue, 09 Sep 2014)                     $//
    2525///////////////////////////////////////////////////////////////////////////////
    2626
     
    2929//#else
    3030//#define PACKAGE_NAME "SISCone"
    31 //#define VERSION "2.0.6"
     31//#define VERSION "3.0.0"
    3232//#warning "No config.h file available, using preset values"
    3333//#endif
     
    8787                           int _n_pass_max, double _ptmin,
    8888                           Esplit_merge_scale _split_merge_scale){
    89   // initialise random number generator
    90   if (!init_done){
    91     // initialise random number generator
    92     ranlux_init();
    93 
    94     // do not do this again
    95     init_done=true;
    96 
    97     // print the banner
    98     if (_banner_ostr != 0){
    99       (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
    100       (*_banner_ostr) << "#                    SISCone   version " << setw(28) << left << siscone_version() << "o" << endl;
    101       (*_banner_ostr) << "#              http://projects.hepforge.org/siscone                o" << endl;
    102       (*_banner_ostr) << "#                                                                  o" << endl;
    103       (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm   o" << endl;
    104       (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez             o" << endl;
    105       (*_banner_ostr) << "# It is released under the terms of the GNU General Public License o" << endl;
    106       (*_banner_ostr) << "#                                                                  o" << endl;
    107       (*_banner_ostr) << "# A description of the algorithm is available in the publication   o" << endl;
    108       (*_banner_ostr) << "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)].                   o" << endl;
    109       (*_banner_ostr) << "# Please cite it if you use SISCone.                               o" << endl;
    110       (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
    111       (*_banner_ostr) << endl;
    112 
    113       _banner_ostr->flush();
    114     }
    115   }
     89  _initialise_if_needed();
    11690
    11791  // run some general safety tests (NB: f will be checked in split-merge)
     
    174148}
    175149
     150
     151/*
     152 * compute the jets from a given particle set doing multiple passes
     153 * such pass N looks for jets among all particles not put into jets
     154 * during previous passes.
     155 *  - _particles   list of particles
     156 *  - _radius      cone radius
     157 *  - _n_pass_max  maximum number of runs
     158 *  - _ptmin       minimum pT of the protojets
     159 *  - _ordering_scale    the ordering scale to decide which stable
     160 *                       cone is removed
     161 * return the number of jets found.
     162 **********************************************************************/
     163int Csiscone::compute_jets_progressive_removal(vector<Cmomentum> &_particles, double _radius,
     164                                               int _n_pass_max, double _ptmin,
     165                                               Esplit_merge_scale _ordering_scale){
     166  _initialise_if_needed();
     167
     168  // run some general safety tests (NB: f will be checked in split-merge)
     169  if (_radius <= 0.0 || _radius >= 0.5*M_PI) {
     170    ostringstream message;
     171    message << "Illegal value for cone radius, R = " << _radius
     172            << " (legal values are 0<R<pi/2)";
     173    throw Csiscone_error(message.str());
     174  }
     175
     176  ptcomparison.split_merge_scale = _ordering_scale;
     177  partial_clear(); // make sure some things are initialised properly
     178
     179  // init the split_merge algorithm with the initial list of particles
     180  // this initialises particle list p_left of remaining particles to deal with
     181  //
     182  // this stores the "processed" particles in p_uncol_hard
     183  init_particles(_particles);
     184  jets.clear();
     185
     186  bool unclustered_left;
     187  rerun_allowed = false;
     188  protocones_list.clear();
     189
     190  do{
     191    //cout << n_left << " particle left" << endl;
     192
     193    // initialise stable_cone finder
     194    // here we use the list of remaining particles
     195    // AFTER COLLINEAR CLUSTERING !!!!!!
     196    Cstable_cones::init(p_uncol_hard);
     197
     198    // get stable cones (stored in 'protocones')
     199    unclustered_left = get_stable_cones(_radius);
     200
     201    // add the hardest stable cone to the list of jets
     202    if (add_hardest_protocone_to_jets(&protocones, R2, _ptmin)) break;
     203 
     204    _n_pass_max--;
     205  } while ((unclustered_left) && (n_left>0) && (_n_pass_max!=0));
     206
     207  // split & merge
     208  return jets.size();
     209}
     210
     211
    176212/*
    177213 * recompute the jets with a different overlap parameter.
     
    205241
    206242
     243// ensure things are initialised
     244void Csiscone::_initialise_if_needed(){
     245  // initialise random number generator
     246  if (init_done) return;
     247
     248  // initialise random number generator
     249  ranlux_init();
     250
     251  // do not do this again
     252  init_done=true;
     253
     254  // print the banner
     255  if (_banner_ostr != 0){
     256    (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
     257    (*_banner_ostr) << "#                    SISCone   version " << setw(28) << left << siscone_version() << "o" << endl;
     258    (*_banner_ostr) << "#              http://projects.hepforge.org/siscone                o" << endl;
     259    (*_banner_ostr) << "#                                                                  o" << endl;
     260    (*_banner_ostr) << "# This is SISCone: the Seedless Infrared Safe Cone Jet Algorithm   o" << endl;
     261    (*_banner_ostr) << "# SISCone was written by Gavin Salam and Gregory Soyez             o" << endl;
     262    (*_banner_ostr) << "# It is released under the terms of the GNU General Public License o" << endl;
     263    (*_banner_ostr) << "#                                                                  o" << endl;
     264    (*_banner_ostr) << "# A description of the algorithm is available in the publication   o" << endl;
     265    (*_banner_ostr) << "# JHEP 05 (2007) 086 [arXiv:0704.0292 (hep-ph)].                   o" << endl;
     266    (*_banner_ostr) << "# Please cite it if you use SISCone.                               o" << endl;
     267    (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
     268    (*_banner_ostr) << endl;
     269
     270    _banner_ostr->flush();
     271  }
     272}
    207273
    208274// finally, a bunch of functions to access to
  • external/fastjet/plugins/SISCone/siscone.h

    rf14bd6a r273e668  
    2222// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2323//                                                                           //
    24 // $Revision:: 325                                                          $//
    25 // $Date:: 2011-11-25 12:41:17 +0100 (Fri, 25 Nov 2011)                     $//
     24// $Revision:: 369                                                          $//
     25// $Date:: 2014-09-04 16:57:55 +0200 (Thu, 04 Sep 2014)                     $//
    2626///////////////////////////////////////////////////////////////////////////////
    2727
     
    7979
    8080  /**
     81   * compute the jets from a given particle set.
     82   * We are doing multiple passes such pass n_pass looks for jets among
     83   * all particles not put into jets during previous passes.
     84   * By default the number of passes is infinite (0).
     85   * \param _particles   list of particles
     86   * \param _radius      cone radius
     87   * \param _n_pass_max  maximum number of passes (0=full search)
     88   * \param _ptmin       minimum pT of the protojets
     89   * \param _ordering_scale    the ordering scale to decide which stable
     90   *                           cone is removed
     91   *
     92   * Note that the Csplit_merge::SM_var2_hardest_cut_off cut is not
     93   * used in the progressive removal variant.
     94   *
     95   * \return the number of jets found.
     96   */
     97  int compute_jets_progressive_removal(std::vector<Cmomentum> &_particles, double _radius,
     98                                       int _n_pass_max=0, double _ptmin=0.0,
     99                                       Esplit_merge_scale _ordering_scale=SM_pttilde);
     100
     101  /**
    81102   * recompute the jets with a different overlap parameter.
    82103   * we use the same particles and R as in the preceeding call.
     
    93114                     Esplit_merge_scale _split_merge_scale=SM_pttilde);
    94115
    95   /// list of protocones found pass-by-pass
     116  /// list of protocones found pass-by-pass (not filled by compute_jets_progressive_removal)
    96117  std::vector<std::vector<Cmomentum> > protocones_list;
    97118
     
    125146  bool rerun_allowed;         ///< is recompute_jets allowed ?
    126147  static std::ostream * _banner_ostr; ///< stream to use for banners
     148
     149  /// ensure things are initialised
     150  void _initialise_if_needed();
     151
    127152};
    128153
  • external/fastjet/plugins/SISCone/split_merge.cc

    rf14bd6a r273e668  
    2121// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2222//                                                                           //
    23 // $Revision:: 322                                                          $//
    24 // $Date:: 2011-11-15 10:12:36 +0100 (Tue, 15 Nov 2011)                     $//
     23// $Revision:: 370                                                          $//
     24// $Date:: 2014-09-04 17:03:15 +0200 (Thu, 04 Sep 2014)                     $//
    2525///////////////////////////////////////////////////////////////////////////////
    2626
     
    2828#include "siscone_error.h"
    2929#include "momentum.h"
    30 #include <math.h>
    3130#include <limits>   // for max
    3231#include <iostream>
     
    3433#include <sstream>
    3534#include <cassert>
     35#include <cmath>
    3636
    3737namespace siscone{
     
    229229#endif
    230230#endif
     231  _user_scale = NULL;
    231232  indices = NULL;
    232233
     
    237238
    238239  // no hardest cut (col-unsafe)
    239   SM_var2_hardest_cut_off = -1.0;
     240  SM_var2_hardest_cut_off = -numeric_limits<double>::max();
    240241
    241242  // no pt cutoff for the particles to put in p_uncol_hard
     
    555556}
    556557
     558
     559/*
     560 * remove the hardest protocone and declare it a a jet
     561 *  - protocones  list of protocones (initial jet candidates)
     562 *  - R2          cone radius (squared)
     563 *  - ptmin       minimal pT allowed for jets
     564 * return 0 on success, 1 on error
     565 *
     566 * The list of remaining particles (and the uncollinear-hard ones)
     567 * is updated.
     568 */
     569int Csplit_merge::add_hardest_protocone_to_jets(std::vector<Cmomentum> *protocones, double R2, double ptmin){
     570
     571  int i;
     572  Cmomentum *c;
     573  Cmomentum *v;
     574  double eta, phi;
     575  double dx, dy;
     576  double R;
     577  Cjet jet, jet_candidate;
     578  bool found_jet = false;
     579
     580  if (protocones->size()==0)
     581    return 1;
     582
     583  pt_min2 = ptmin*ptmin;
     584  R = sqrt(R2);
     585
     586  // browse protocones
     587  // for each of them, build the list of particles in them
     588  for (vector<Cmomentum>::iterator p_it = protocones->begin();p_it != protocones->end();p_it++){
     589    // initialise variables
     590    c = &(*p_it);
     591
     592    // note: cones have been tested => their (eta,phi) coordinates are computed
     593    eta = c->eta;
     594    phi = c->phi;
     595
     596    // NOTE: this is common to this method and add_protocones, so it
     597    // could be moved into a 'build_jet_from_protocone' method
     598    //
     599    // browse particles to create cone contents
     600    jet_candidate.v = Cmomentum();
     601    jet_candidate.pt_tilde=0;
     602    jet_candidate.contents.clear();
     603    for (i=0;i<n_left;i++){
     604      v = &(p_remain[i]);
     605      // for security, avoid including particles with infinite rapidity)
     606      // NO NEEDED ANYMORE SINCE REMOVED FROM p_remain FROM THE BEGINNING
     607      //if (fabs(v->pz)!=v->E){
     608      dx = eta - v->eta;
     609      dy = fabs(phi - v->phi);
     610      if (dy>M_PI)
     611        dy -= twopi;
     612      if (dx*dx+dy*dy<R2){
     613        jet_candidate.contents.push_back(v->parent_index);
     614        jet_candidate.v+= *v;
     615        jet_candidate.pt_tilde+= pt[v->parent_index];
     616        v->index=0;
     617      }
     618    }
     619    jet_candidate.n=jet_candidate.contents.size();
     620
     621    // set the momentum in protocones
     622    // (it was only known through eta and phi up to now)
     623    *c = jet_candidate.v;
     624    c->eta = eta; // restore exact original coords
     625    c->phi = phi; // to avoid rounding error inconsistencies
     626
     627    // set the jet range
     628    jet_candidate.range=Ceta_phi_range(eta,phi,R);
     629
     630    // check that the protojet has large enough pt
     631    if (jet_candidate.v.perp2()<pt_min2)
     632      continue;
     633
     634    // assign the split-merge (or progressive-removal) squared scale variable
     635    if (_user_scale) {
     636      // sm_var2 is the signed square of the user scale returned
     637      // for the jet candidate
     638      jet_candidate.sm_var2 = (*_user_scale)(jet_candidate);
     639      jet_candidate.sm_var2 *= abs(jet_candidate.sm_var2);
     640    } else {
     641      jet_candidate.sm_var2 = get_sm_var2(jet_candidate.v, jet_candidate.pt_tilde);
     642    }
     643
     644    // now check if it is possibly the hardest
     645    if ((! found_jet) ||
     646        (_user_scale ? _user_scale->is_larger(jet_candidate, jet)
     647                     : ptcomparison(jet_candidate, jet))){
     648      jet = jet_candidate;
     649      found_jet = true;
     650    }
     651  }
     652
     653  // make sure at least one of the jets has passed the selection
     654  if (!found_jet) return 1; 
     655 
     656  // add the jet to the list of jets
     657  jets.push_back(jet);
     658  jets[jets.size()-1].v.build_etaphi();
     659
     660#ifdef DEBUG_SPLIT_MERGE
     661  cout << "PR-Jet " << jets.size() << " [size " << next_jet.contents.size() << "]:";
     662#endif
     663   
     664  // update the list of what particles are left
     665  int p_remain_index = 0;
     666  int contents_index = 0;
     667  //sort(next_jet.contents.begin(),next_jet.contents.end());
     668  for (int index=0;index<n_left;index++){
     669    if ((contents_index<(int) jet.contents.size()) &&
     670        (p_remain[index].parent_index == jet.contents[contents_index])){
     671      // this particle belongs to the newly found jet
     672      // set pass in initial list
     673      particles[p_remain[index].parent_index].index = n_pass;
     674#ifdef DEBUG_SPLIT_MERGE
     675      cout << " " << jet.contents[contents_index];
     676#endif
     677      contents_index++;
     678    } else {
     679      // this particle still has to be clustered
     680      p_remain[p_remain_index] = p_remain[index];
     681      p_remain[p_remain_index].parent_index = p_remain[index].parent_index;
     682      p_remain[p_remain_index].index=1;
     683      p_remain_index++;
     684    }
     685  }
     686  p_remain.resize(n_left-jet.contents.size());
     687  n_left = p_remain.size();
     688  jets[jets.size()-1].pass = particles[jet.contents[0]].index;
     689
     690  // increase the pass index
     691  n_pass++;
     692
     693#ifdef DEBUG_SPLIT_MERGE
     694  cout << endl;
     695#endif
     696
     697  // male sure the list of uncol_hard particles (used for the next
     698  // stable cone finding) is updated [could probably be more
     699  // efficient]
     700  merge_collinear_and_remove_soft();
     701 
     702  return 0;
     703}
    557704
    558705/*
  • external/fastjet/plugins/SISCone/split_merge.h

    rf14bd6a r273e668  
    2222// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2323//                                                                           //
    24 // $Revision:: 268                                                          $//
    25 // $Date:: 2009-03-12 21:24:16 +0100 (Thu, 12 Mar 2009)                     $//
     24// $Revision:: 367                                                          $//
     25// $Date:: 2014-09-04 15:57:37 +0200 (Thu, 04 Sep 2014)                     $//
    2626///////////////////////////////////////////////////////////////////////////////
    2727
     
    141141  /// the split-merge process i.e. the variable we use for
    142142  ///  1. ordering jet candidates;
    143   ///  2. computing te overlap fraction of two candidates.
     143  ///  2. computing the overlap fraction of two candidates.
    144144  /// The default value uses pttile (p-scheme pt). Other alternatives are
    145145  /// pt, mt=sqrt(pt^2+m^2)=sqrt(E^2-pz^2) or Et.
     
    151151  ///   the default value i.e.  to use pt only for the purpose of
    152152  ///   investigating the IR issue
    153   /// - using Et is safe but do not respect boost invariance
     153  /// - using Et is safe but does not respect boost invariance
    154154  /// - using mt solves the IR unsafety issues with the pt variable
    155155  ///   for QCD jets but the IR unsafety remains for nack-to-back
     
    234234  int full_clear();
    235235
     236  ///////////////////////////////////////
     237  // user-defined stable-cone ordering //
     238  ///////////////////////////////////////
     239
     240  /// \class Cuser_scale_base
     241  /// base class for user-defined ordering of stable cones
     242  ///
     243  /// derived classes have to implement the () operator that returns
     244  /// the scale associated with a given jet.
     245  class Cuser_scale_base{
     246  public:
     247    /// empty virtual dtor
     248    virtual ~Cuser_scale_base(){}
     249
     250    /// the scale associated with a given jet
     251    ///
     252    /// "progressive removal" iteratively removes the stable cone with
     253    /// the largest scale
     254    virtual double operator()(const Cjet & jet) const = 0;
     255
     256    /// returns true when the scale associated with jet a is larger than
     257    /// the scale associated with jet b
     258    ///
     259    /// By default this does a simple direct comparison but it can be
     260    /// overloaded for higher precision [recommended if possible]
     261    ///
     262    /// This function assumes that a.sm_var2 and b.sm_var2 have been
     263    /// correctly initialised with the signed squared output of
     264    /// operator(), as is by default the case when is_larger is called
     265    /// from within siscone.
     266    virtual bool is_larger(const Cjet & a, const Cjet & b) const{
     267      return (a.sm_var2 > b.sm_var2);
     268    }
     269  };
     270
     271  /// associate a user-defined scale to order the stable cones
     272  ///
     273  /// Note that this is only used in "progressive-removal mode",
     274  /// e.g. in add_hardest_protocone_to_jets().
     275  void set_user_scale(const Cuser_scale_base * user_scale_in){
     276    _user_scale = user_scale_in;
     277  }
     278
     279  /// return the user-defined scale (NULL if none)
     280  const Cuser_scale_base * user_scale() const { return _user_scale; }
     281
    236282
    237283  /////////////////////////////////
     
    256302   */
    257303  int add_protocones(std::vector<Cmomentum> *protocones, double R2, double ptmin=0.0);
     304
     305  /**
     306   * remove the hardest protocone and declare it a jet
     307   * \param protocones  list of protocones (initial jet candidates)
     308   * \param R2          cone radius (squared)
     309   * \param ptmin       minimal pT allowed for jets
     310   * \return 0 on success, 1 on error
     311   *
     312   * The list of remaining particles (and the uncollinear-hard ones)
     313   * is updated.
     314   */
     315  int add_hardest_protocone_to_jets(std::vector<Cmomentum> *protocones, double R2, double ptmin=0.0);
    258316
    259317  /**
     
    314372  Csplit_merge_ptcomparison ptcomparison;
    315373
    316   /// stop split--merge when the SM_var of the hardest protojet
    317   /// is below this cut-off.
     374  /// stop split--merge or progressive-removal when the squared SM_var
     375  /// of the hardest protojet is below this cut-off. Note that this is
     376  /// a signed square (ie SM_var*|SM_var|) to be able to handle
     377  /// negative values.
     378  ///
     379  /// Note that the cut-off is set on the variable squared.
     380  double SM_var2_hardest_cut_off;
     381
     382  /// pt cutoff for the particles to put in p_uncol_hard
     383  /// this is meant to allow removing soft particles in the
     384  /// stable-cone search.
     385  ///
    318386  /// This is not collinear-safe so you should not use this
    319387  /// variable unless you really know what you are doing
    320388  /// Note that the cut-off is set on the variable squared.
    321   double SM_var2_hardest_cut_off;
    322 
    323   /// pt cutoff for the particles to put in p_uncol_hard
    324   /// this is meant to allow removing soft particles in the
    325   /// stable-cone search.
    326389  double stable_cone_soft_pt2_cutoff;
    327390
     
    390453  bool use_pt_weighted_splitting;
    391454
     455  /// use a user-defined scale to order the stable cones and jet
     456  /// candidates
     457  const Cuser_scale_base *_user_scale;
     458
    392459#ifdef ALLOW_MERGE_IDENTICAL_PROTOCONES
    393460  /// checkxor for the candidates (to avoid having twice the same contents)
  • external/fastjet/tools/Recluster.hh

    rf14bd6a r273e668  
    22#define __FASTJET_TOOLS_RECLUSTER_HH__
    33
    4 // $Id: Recluster.hh 3632 2014-08-15 10:42:53Z salam $
     4// $Id: Recluster.hh 3714 2014-09-30 09:47:31Z soyez $
    55//
    66// Copyright (c) 2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3838
    3939//----------------------------------------------------------------------
     40/// @ingroup tools_generic
    4041/// \class Recluster
    4142/// Recluster a jet's constituents with a new jet definition.
  • external/fastjet/tools/Subtractor.cc

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: Subtractor.cc 3594 2014-08-12 15:25:11Z soyez $
     2// $Id: Subtractor.cc 3670 2014-09-08 14:17:59Z soyez $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    4343// ctor
    4444Subtractor::Subtractor(double rho) : _bge(0), _rho(rho) {
    45   assert(_rho>0.0);
     45  if (_rho<0.0) throw Error("Subtractor(rho) was passed a negative rho value; rho should be >= 0");
    4646  set_defaults();
    4747}
    4848
    4949//----------------------------------------------------------------------
     50// ctor
     51Subtractor::Subtractor(double rho, double rho_m) : _bge(0), _rho(rho) {
     52  if (_rho<0.0) throw Error("Subtractor(rho, rho_m) was passed a negative rho value; rho should be >= 0");
     53  if (rho_m<0.0) throw Error("Subtractor(rho, rho_m) was passed a negative rho_m value; rho_m should be >= 0");
     54  set_defaults();
     55  _rho_m = rho_m;
     56  set_use_rho_m(true);
     57}
     58
     59//----------------------------------------------------------------------
    5060void Subtractor::set_defaults(){
     61  _rho_m = _invalid_rho;
    5162  _use_rho_m = false; // likely to change in future releases!!
    5263  _safe_mass = false; // likely to change in future releases!!
     
    6071PseudoJet Subtractor::result(const PseudoJet & jet) const {
    6172  if (!jet.has_area()){
    62     throw Error("Trying to subtract a jet without area support");
     73    throw Error("Subtractor::result(...): Trying to subtract a jet without area support");
    6374  }
    6475
     
    152163    ostringstream ostr;
    153164    ostr << "Subtractor that uses a fixed value of rho = " << _rho;
     165    if (use_rho_m()) ostr << " and rho_m = " << _rho_m;
    154166    return ostr.str();
    155167  } else {
     
    169181    rho = _rho;
    170182  } else {
    171     throw Error("default Subtractor does not have any information about the background, which is needed to perform the subtraction");
     183    throw Error("Subtractor::_amount_to_subtract(...): default Subtractor does not have any information about the background, needed to perform the subtraction");
    172184  }
    173185
     
    178190
    179191  // add an optional contribution from the unknown particles masses
    180   if (_use_rho_m){
    181     assert(_bge != 0); // test done in "set_use_rho_m()"
    182     to_subtract += _bge->rho_m(jet) * PseudoJet(0.0, 0.0, area.pz(), area.E());
     192  if (_use_rho_m) {
     193    double rho_m;
     194   
     195    if (_bge != 0) {
     196      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");
     197      rho_m = _bge->rho_m(jet);
     198    } else if (_rho_m != _invalid_rho) {
     199      rho_m = _rho_m;
     200    } else {
     201      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");
     202    }
     203    to_subtract += rho_m * PseudoJet(0.0, 0.0, area.pz(), area.E());
    183204  } else if (_bge &&
    184205             _bge->has_rho_m() &&
    185206             _bge->rho_m(jet) > rho_m_warning_threshold * rho) {
    186     _unused_rho_m_warning.warn("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");
     207    _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");
    187208  }
    188209
  • external/fastjet/tools/Subtractor.hh

    rf14bd6a r273e668  
    11//FJSTARTHEADER
    2 // $Id: Subtractor.hh 3584 2014-08-12 12:40:10Z soyez $
     2// $Id: Subtractor.hh 3670 2014-09-08 14:17:59Z soyez $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3232#define __FASTJET_TOOLS_SUBTRACTOR_HH__
    3333
     34#include "fastjet/internal/base.hh"     // namespace macros (include explicitly to help Doxygen)
    3435#include "fastjet/tools/Transformer.hh" // to derive Subtractor from Transformer
    3536#include "fastjet/tools/BackgroundEstimatorBase.hh" // used as a ctor argument
     
    6970  Subtractor(double rho);
    7071
     72  /// define a subtractor that uses a fixed value of rho and rho_m;
     73  /// both must be >= 0;
     74  Subtractor(double rho, double rho_m);
     75
    7176  /// default constructor
    7277  Subtractor() : _bge(0), _rho(_invalid_rho) { set_defaults(); }
     
    96101  /// in a future release of FastJet
    97102  void set_use_rho_m(bool use_rho_m_in = true){
    98     if (_bge == 0) {
    99       throw Error("Subtractor: rho_m support works only for Subtractors constructed with background estimator");
     103    if (_bge == 0  && _rho_m < 0) {
     104      throw Error("Subtractor: rho_m support works only for Subtractors constructed with a background estimator or an explicit rho_m value");
    100105    }
    101106    _use_rho_m=use_rho_m_in;
     
    176181  /// if has to be mutable in case its underlying selector takes a reference jet
    177182  mutable BackgroundEstimatorBase * _bge;
    178   /// the fixed value of rho to use if the user has selected that option
    179   double _rho;
     183  /// the fixed value of rho and/or rho_m to use if the user has selected that option
     184  double _rho, _rho_m;
    180185
    181186  // configuration parameters/flags
Note: See TracChangeset for help on using the changeset viewer.