Fork me on GitHub

Changeset b7b836a in git for external/fastjet/PseudoJet.hh


Ignore:
Timestamp:
Jun 6, 2018, 10:05:10 PM (6 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
17d0ab8
Parents:
95e6b7a
Message:

update FastJet library to 3.3.1 and FastJet Contrib library to 1.036

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/PseudoJet.hh

    r95e6b7a rb7b836a  
    11//FJSTARTHEADER
    2 // $Id: PseudoJet.hh 4047 2016-03-03 13:21:49Z soyez $
     2// $Id: PseudoJet.hh 4354 2018-04-22 07:12:37Z salam $
    33//
    4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     4// Copyright (c) 2005-2018, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    55//
    66//----------------------------------------------------------------------
     
    8383
    8484  /// constructor from any object that has px,py,pz,E = some_four_vector[0--3],
     85  #ifndef SWIG
    8586  template <class L> PseudoJet(const L & some_four_vector);
    86 
     87  #endif
     88 
    8789  // Constructor that performs minimal initialisation (only that of
    8890  // the shared pointers), of use in certain speed-critical contexts
     
    170172  inline double Et2() const {return (_kt2==0) ? 0.0 : _E*_E/(1.0+_pz*_pz/_kt2);}
    171173
     174  /// cos of the polar angle
     175  /// should we have: min(1.0,max(-1.0,_pz/sqrt(modp2())));
     176  inline double cos_theta() const {
     177    return std::min(1.0, std::max(-1.0, _pz/sqrt(modp2())));
     178  }
     179  /// polar angle
     180  inline double theta() const { return acos(cos_theta()); }
     181
    172182  /// returns component i, where X==0, Y==1, Z==2, E==3
    173183  double operator () (int i) const ;
     
    220230  //----------------------------------------------------------------------
    221231  /// transform this jet (given in the rest frame of prest) into a jet
    222   /// in the lab frame [NOT FULLY TESTED]
     232  /// in the lab frame
    223233  PseudoJet & boost(const PseudoJet & prest);
    224234  /// transform this jet (given in lab) into a jet in the rest
    225   /// frame of prest  [NOT FULLY TESTED]
     235  /// frame of prest
    226236  PseudoJet & unboost(const PseudoJet & prest);
    227237
    228   void operator*=(double);
    229   void operator/=(double);
    230   void operator+=(const PseudoJet &);
    231   void operator-=(const PseudoJet &);
     238  PseudoJet & operator*=(double);
     239  PseudoJet & operator/=(double);
     240  PseudoJet & operator+=(const PseudoJet &);
     241  PseudoJet & operator-=(const PseudoJet &);
    232242
    233243  /// reset the 4-momentum according to the supplied components and
     
    249259  /// (accessible via indexing, [0]==px,...[3]==E) and put the user
    250260  /// and history indices back to their default values.
     261#ifndef SWIG
    251262  template <class L> inline void reset(const L & some_four_vector) {
    252263    // check if some_four_vector can be cast to a PseudoJet
     
    270281    }
    271282  }
     283#endif // SWIG
    272284
    273285  /// reset the PseudoJet according to the specified pt, rapidity,
     
    846858inline double dot_product(const PseudoJet & a, const PseudoJet & b) {
    847859  return a.E()*b.E() - a.px()*b.px() - a.py()*b.py() - a.pz()*b.pz();
     860}
     861
     862/// returns the cosine of the angle between a and b
     863inline double cos_theta(const PseudoJet & a, const PseudoJet & b) {
     864  double dot_3d = a.px()*b.px() + a.py()*b.py() + a.pz()*b.pz();
     865  return std::min(1.0, std::max(-1.0, dot_3d/sqrt(a.modp2()*b.modp2())));
     866}
     867
     868/// returns the angle between a and b
     869inline double theta(const PseudoJet & a, const PseudoJet & b) {
     870  return acos(cos_theta(a,b));
    848871}
    849872
     
    929952// NB: do not know if it really needs to be inline, but when it wasn't
    930953//     linking failed with g++ (who knows what was wrong...)
     954#ifndef SWIG
    931955template <class L> inline  PseudoJet::PseudoJet(const L & some_four_vector) {
    932956  reset(some_four_vector);
    933957}
     958#endif
    934959
    935960//----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.