Fork me on GitHub

Changeset 273e668 in git for external/fastjet/tools


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/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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.