Fork me on GitHub

Changeset 49234af in git for external/fastjet/PseudoJet.cc


Ignore:
Timestamp:
Dec 9, 2014, 1:27:13 PM (10 years ago)
Author:
Michele <michele.selvaggi@…>
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.
Message:

Merge branch 'TestFastJet310b1'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/PseudoJet.cc

    rf6b6ee7 r49234af  
    1 //STARTHEADER
    2 // $Id$
    3 //
    4 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     1//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
    55//
    66//----------------------------------------------------------------------
     
    1313//
    1414//  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
    1617//  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.
    1820//
    1921//  FastJet is distributed in the hope that it will be useful,
     
    2527//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    2628//----------------------------------------------------------------------
    27 //ENDHEADER
     29//FJENDHEADER
    2830
    2931
     
    176178// return the product, coeff * jet
    177179PseudoJet 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();
    178184  //return PseudoJet(coeff*jet.four_mom());
    179185  // the following code is hopefully more efficient
     
    198204/// multiply the jet's momentum by the coefficient
    199205void 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();
    200214  _px *= coeff;
    201215  _py *= coeff;
     
    261275
    262276//----------------------------------------------------------------------
    263 /// transform this jet (given in lab) into a jet in the rest
    264 /// frame of prest
     277/// transform this jet (given in the rest frame of prest) into a jet
     278/// in the lab frame
    265279//
    266280// NB: code adapted from that in herwig f77 (checked how it worked
     
    288302
    289303//----------------------------------------------------------------------
    290 /// transform this jet (given in the rest frame of prest) into a jet
    291 /// in the lab frame;
     304/// transform this jet (given in lab) into a jet in the rest
     305/// frame of prest 
    292306//
    293307// NB: code adapted from that in herwig f77 (checked how it worked
     
    587601// an Error is thrown if this PseudoJet has no currently valid
    588602// associated ClusterSequence
    589 std::vector<PseudoJet> PseudoJet::exclusive_subjets (const double & dcut) const {
     603std::vector<PseudoJet> PseudoJet::exclusive_subjets (const double dcut) const {
    590604  return validated_structure_ptr()->exclusive_subjets(*this, dcut);
    591605}
     
    598612// an Error is thrown if this PseudoJet has no currently valid
    599613// associated ClusterSequence
    600 int PseudoJet::n_exclusive_subjets(const double & dcut) const {
     614int PseudoJet::n_exclusive_subjets(const double dcut) const {
    601615  return validated_structure_ptr()->n_exclusive_subjets(*this, dcut);
    602616}
     
    847861PseudoJet join(const PseudoJet & j1, const PseudoJet & j2){
    848862  vector<PseudoJet> pieces;
     863  pieces.reserve(2);
    849864  pieces.push_back(j1);
    850865  pieces.push_back(j2);
     
    855870PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3){
    856871  vector<PseudoJet> pieces;
     872  pieces.reserve(3);
    857873  pieces.push_back(j1);
    858874  pieces.push_back(j2);
     
    864880PseudoJet join(const PseudoJet & j1, const PseudoJet & j2, const PseudoJet & j3, const PseudoJet & j4){
    865881  vector<PseudoJet> pieces;
     882  pieces.reserve(4);
    866883  pieces.push_back(j1);
    867884  pieces.push_back(j2);
Note: See TracChangeset for help on using the changeset viewer.