Changeset 273e668 in git for external/fastjet/tools/Subtractor.cc
- Timestamp:
- Oct 15, 2014, 10:55:55 AM (10 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/tools/Subtractor.cc
rf14bd6a r273e668 1 1 //FJSTARTHEADER 2 // $Id: Subtractor.cc 3 594 2014-08-12 15:25:11Z soyez $2 // $Id: Subtractor.cc 3670 2014-09-08 14:17:59Z soyez $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 43 43 // ctor 44 44 Subtractor::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"); 46 46 set_defaults(); 47 47 } 48 48 49 49 //---------------------------------------------------------------------- 50 // ctor 51 Subtractor::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 //---------------------------------------------------------------------- 50 60 void Subtractor::set_defaults(){ 61 _rho_m = _invalid_rho; 51 62 _use_rho_m = false; // likely to change in future releases!! 52 63 _safe_mass = false; // likely to change in future releases!! … … 60 71 PseudoJet Subtractor::result(const PseudoJet & jet) const { 61 72 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"); 63 74 } 64 75 … … 152 163 ostringstream ostr; 153 164 ostr << "Subtractor that uses a fixed value of rho = " << _rho; 165 if (use_rho_m()) ostr << " and rho_m = " << _rho_m; 154 166 return ostr.str(); 155 167 } else { … … 169 181 rho = _rho; 170 182 } else { 171 throw Error(" default Subtractor does not have any information about the background, which isneeded 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"); 172 184 } 173 185 … … 178 190 179 191 // 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()); 183 204 } else if (_bge && 184 205 _bge->has_rho_m() && 185 206 _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"); 187 208 } 188 209
Note:
See TracChangeset
for help on using the changeset viewer.