Fork me on GitHub

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.