Changeset 49234af in git for external/fastjet/PseudoJet.cc
- Timestamp:
- Dec 9, 2014, 1:27:13 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 37deb3b, 9e991f8
- Parents:
- f6b6ee7 (diff), e7e90df (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/PseudoJet.cc
rf6b6ee7 r49234af 1 // STARTHEADER2 // $Id $3 // 4 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez1 //FJSTARTHEADER 2 // $Id: PseudoJet.cc 3652 2014-09-03 13:31:13Z salam $ 3 // 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 5 5 // 6 6 //---------------------------------------------------------------------- … … 13 13 // 14 14 // The algorithms that underlie FastJet have required considerable 15 // development and are described in hep-ph/0512210. If you use 15 // development. They are described in the original FastJet paper, 16 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 16 17 // FastJet as part of work towards a scientific publication, please 17 // include a citation to the FastJet paper. 18 // quote the version you use and include a citation to the manual and 19 // optionally also to hep-ph/0512210. 18 20 // 19 21 // FastJet is distributed in the hope that it will be useful, … … 25 27 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 26 28 //---------------------------------------------------------------------- 27 // ENDHEADER29 //FJENDHEADER 28 30 29 31 … … 176 178 // return the product, coeff * jet 177 179 PseudoJet operator* (double coeff, const PseudoJet & jet) { 180 // see the comment in operator*= about ensuring valid rap phi 181 // before a multiplication to handle case of multiplication by 182 // zero, while maintaining rapidity and phi 183 jet._ensure_valid_rap_phi(); 178 184 //return PseudoJet(coeff*jet.four_mom()); 179 185 // the following code is hopefully more efficient … … 198 204 /// multiply the jet's momentum by the coefficient 199 205 void PseudoJet::operator*=(double coeff) { 206 // operator*= aims to maintain the rapidity and azimuth 207 // for the PseudoJet; if they have already been evaluated 208 // this is fine, but if they haven't and coeff is sufficiently 209 // small as to cause a zero or underflow result, then a subsequent 210 // invocation of rap or phi will lead to a non-sensical result. 211 // So, here, we preemptively ensure that rapidity and phi 212 // are correctly cached 213 _ensure_valid_rap_phi(); 200 214 _px *= coeff; 201 215 _py *= coeff; … … 261 275 262 276 //---------------------------------------------------------------------- 263 /// transform this jet (given in lab) into a jet in the rest264 /// frame of prest277 /// transform this jet (given in the rest frame of prest) into a jet 278 /// in the lab frame 265 279 // 266 280 // NB: code adapted from that in herwig f77 (checked how it worked … … 288 302 289 303 //---------------------------------------------------------------------- 290 /// transform this jet (given in the rest frame of prest) into a jet291 /// in the lab frame;304 /// transform this jet (given in lab) into a jet in the rest 305 /// frame of prest 292 306 // 293 307 // NB: code adapted from that in herwig f77 (checked how it worked … … 587 601 // an Error is thrown if this PseudoJet has no currently valid 588 602 // associated ClusterSequence 589 std::vector<PseudoJet> PseudoJet::exclusive_subjets (const double &dcut) const {603 std::vector<PseudoJet> PseudoJet::exclusive_subjets (const double dcut) const { 590 604 return validated_structure_ptr()->exclusive_subjets(*this, dcut); 591 605 } … … 598 612 // an Error is thrown if this PseudoJet has no currently valid 599 613 // associated ClusterSequence 600 int PseudoJet::n_exclusive_subjets(const double &dcut) const {614 int PseudoJet::n_exclusive_subjets(const double dcut) const { 601 615 return validated_structure_ptr()->n_exclusive_subjets(*this, dcut); 602 616 } … … 847 861 PseudoJet join(const PseudoJet & j1, const PseudoJet & j2){ 848 862 vector<PseudoJet> pieces; 863 pieces.reserve(2); 849 864 pieces.push_back(j1); 850 865 pieces.push_back(j2); … … 855 870 PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3){ 856 871 vector<PseudoJet> pieces; 872 pieces.reserve(3); 857 873 pieces.push_back(j1); 858 874 pieces.push_back(j2); … … 864 880 PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3, const PseudoJet & j4){ 865 881 vector<PseudoJet> pieces; 882 pieces.reserve(4); 866 883 pieces.push_back(j1); 867 884 pieces.push_back(j2);
Note:
See TracChangeset
for help on using the changeset viewer.