Fork me on GitHub

Ignore:
Timestamp:
Oct 9, 2015, 2:47:38 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
8713dee
Parents:
f118021
Message:

update FastJet library to 3.1.3 and Nsubjettiness library to 2.2.1

File:
1 moved

Legend:

Unmodified
Added
Removed
  • external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.cc

    rf118021 r973b92a  
    55//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
    66//
    7 //  $Id: WinnerTakeAllRecombiner.cc 597 2014-04-16 23:07:55Z jthaler $
     7//  $Id: ExtraRecombiners.cc 842 2015-08-20 13:44:31Z jthaler $
    88//----------------------------------------------------------------------
    99// This file is part of FastJet contrib.
     
    2323//----------------------------------------------------------------------
    2424
    25 #include "WinnerTakeAllRecombiner.hh"
     25#include "ExtraRecombiners.hh"
    2626
    2727FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
    2828
    2929namespace contrib{
     30 
     31std::string GeneralEtSchemeRecombiner::description() const {
     32   return "General Et-scheme recombination";
     33}
     34
     35// recombine pa and pb according to a generalized Et-scheme parameterized by the power delta
     36void GeneralEtSchemeRecombiner::recombine(const fastjet::PseudoJet & pa, const fastjet::PseudoJet & pb, fastjet::PseudoJet & pab) const {
     37   
     38   // Define new weights for recombination according to delta
     39   // definition of ratio done so that we do not encounter issues about numbers being too large for huge values of delta
     40   double ratio;
     41   if (std::abs(_delta - 1.0) < std::numeric_limits<double>::epsilon()) ratio = pb.perp()/pa.perp(); // save computation time of pow()
     42   else ratio = pow(pb.perp()/pa.perp(), _delta);
     43   double weighta = 1.0/(1.0 + ratio);
     44   double weightb = 1.0/(1.0 + 1.0/ratio);
     45   
     46   double perp_ab = pa.perp() + pb.perp();
     47   // reweight the phi and rap sums according to the weights above
     48   if (perp_ab != 0.0) {
     49      double y_ab = (weighta * pa.rap() + weightb * pb.rap());
     50     
     51      double phi_a = pa.phi(), phi_b = pb.phi();
     52      if (phi_a - phi_b > pi)  phi_b += twopi;
     53      if (phi_a - phi_b < -pi) phi_b -= twopi;
     54      double phi_ab = (weighta * phi_a + weightb * phi_b);
     55     
     56      pab.reset_PtYPhiM(perp_ab, y_ab, phi_ab);
     57     
     58   }
     59   else {
     60      pab.reset(0.0,0.0,0.0,0.0);
     61   }
     62}
     63
    3064
    3165std::string WinnerTakeAllRecombiner::description() const {
    32    return "Winner Take All scheme recombination";
     66   return "Winner-Take-All recombination";
    3367}
    3468
Note: See TracChangeset for help on using the changeset viewer.