Changeset 273e668 in git for external/fastjet/tools
- 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)
- Location:
- external/fastjet/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/tools/Recluster.hh
rf14bd6a r273e668 2 2 #define __FASTJET_TOOLS_RECLUSTER_HH__ 3 3 4 // $Id: Recluster.hh 3 632 2014-08-15 10:42:53Z salam$4 // $Id: Recluster.hh 3714 2014-09-30 09:47:31Z soyez $ 5 5 // 6 6 // Copyright (c) 2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 38 38 39 39 //---------------------------------------------------------------------- 40 /// @ingroup tools_generic 40 41 /// \class Recluster 41 42 /// Recluster a jet's constituents with a new jet definition. -
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 -
external/fastjet/tools/Subtractor.hh
rf14bd6a r273e668 1 1 //FJSTARTHEADER 2 // $Id: Subtractor.hh 3 584 2014-08-12 12:40:10Z soyez $2 // $Id: Subtractor.hh 3670 2014-09-08 14:17:59Z soyez $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 32 32 #define __FASTJET_TOOLS_SUBTRACTOR_HH__ 33 33 34 #include "fastjet/internal/base.hh" // namespace macros (include explicitly to help Doxygen) 34 35 #include "fastjet/tools/Transformer.hh" // to derive Subtractor from Transformer 35 36 #include "fastjet/tools/BackgroundEstimatorBase.hh" // used as a ctor argument … … 69 70 Subtractor(double rho); 70 71 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 71 76 /// default constructor 72 77 Subtractor() : _bge(0), _rho(_invalid_rho) { set_defaults(); } … … 96 101 /// in a future release of FastJet 97 102 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"); 100 105 } 101 106 _use_rho_m=use_rho_m_in; … … 176 181 /// if has to be mutable in case its underlying selector takes a reference jet 177 182 mutable BackgroundEstimatorBase * _bge; 178 /// the fixed value of rho to use if the user has selected that option179 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; 180 185 181 186 // configuration parameters/flags
Note:
See TracChangeset
for help on using the changeset viewer.