Fork me on GitHub

source: git/external/fastjet/contribs/Nsubjettiness/WinnerTakeAllRecombiner.cc@ 50d7259

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 50d7259 was 35cdc46, checked in by Pavel Demin <demin@…>, 10 years ago

upgrade FastJet to version 3.1.0-beta.1, upgrade Nsubjettiness to version 2.1.0, add SoftKiller version 1.0.0

  • Property mode set to 100644
File size: 2.8 KB
RevLine 
[9687203]1// Nsubjettiness Package
2// Questions/Comments? jthaler@jthaler.net
3//
4// Copyright (c) 2011-14
5// Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
6//
[35cdc46]7// $Id: WinnerTakeAllRecombiner.cc 597 2014-04-16 23:07:55Z jthaler $
[9687203]8//----------------------------------------------------------------------
9// This file is part of FastJet contrib.
10//
11// It is free software; you can redistribute it and/or modify it under
12// the terms of the GNU General Public License as published by the
13// Free Software Foundation; either version 2 of the License, or (at
14// your option) any later version.
15//
16// It is distributed in the hope that it will be useful, but WITHOUT
17// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
18// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
19// License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this code. If not, see <http://www.gnu.org/licenses/>.
23//----------------------------------------------------------------------
24
25#include "WinnerTakeAllRecombiner.hh"
26
27FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
28
29namespace contrib{
30
31std::string WinnerTakeAllRecombiner::description() const {
32 return "Winner Take All scheme recombination";
33}
34
35// recombine pa and pb by creating pab with energy of the sum of particle energies in the direction of the harder particle
36// updated recombiner to use more general form of a metric equal to E*(pT/E)^(alpha), which reduces to pT*cosh(rap)^(1-alpha)
37// alpha is specified by the user. The default is alpha = 1, which is the typical behavior. alpha = 2 provides a metric which more
38// favors central jets
39void WinnerTakeAllRecombiner::recombine(const fastjet::PseudoJet & pa, const fastjet::PseudoJet & pb, fastjet::PseudoJet & pab) const {
40 double a_pt = pa.perp(), b_pt = pb.perp(), a_rap = pa.rap(), b_rap = pb.rap();
41
42 // special case of alpha = 1, everything is just pt (made separate so that pow function isn't called)
43 if (_alpha == 1.0) {
44 if (a_pt >= b_pt) {
45 pab.reset_PtYPhiM(a_pt + b_pt, a_rap, pa.phi());
46 }
47 else if (b_pt > a_pt) {
48 pab.reset_PtYPhiM(a_pt + b_pt, b_rap, pb.phi());
49 }
50 }
51
52 // every other case uses additional cosh(rap) term
53 else {
54 double a_metric = a_pt*pow(cosh(a_rap), 1.0-_alpha);
55 double b_metric = b_pt*pow(cosh(b_rap), 1.0-_alpha);
56 if (a_metric >= b_metric) {
57 double new_pt = a_pt + b_pt*pow(cosh(b_rap)/cosh(a_rap), 1.0-_alpha);
58 pab.reset_PtYPhiM(new_pt, a_rap, pa.phi());
59 }
60 if (b_metric > a_metric) {
61 double new_pt = b_pt + a_pt*pow(cosh(a_rap)/cosh(b_rap), 1.0-_alpha);
62 pab.reset_PtYPhiM(new_pt, b_rap, pb.phi());
63 }
64 }
65}
66
67} //namespace contrib
68
69FASTJET_END_NAMESPACE
Note: See TracBrowser for help on using the repository browser.