Fork me on GitHub

source: git/external/fastjet/tools/MassDropTagger.cc@ 17d0ab8

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 17d0ab8 was b7b836a, checked in by Pavel Demin <pavel-demin@…>, 6 years ago

update FastJet library to 3.3.1 and FastJet Contrib library to 1.036

  • Property mode set to 100644
File size: 3.9 KB
RevLine 
[35cdc46]1//FJSTARTHEADER
[b7b836a]2// $Id: MassDropTagger.cc 4354 2018-04-22 07:12:37Z salam $
[d7d2da3]3//
[b7b836a]4// Copyright (c) 2005-2018, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
[d7d2da3]5//
6//----------------------------------------------------------------------
7// This file is part of FastJet.
8//
9// FastJet is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 2 of the License, or
12// (at your option) any later version.
13//
14// The algorithms that underlie FastJet have required considerable
[35cdc46]15// development. They are described in the original FastJet paper,
16// hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
[d7d2da3]17// FastJet as part of work towards a scientific publication, please
[35cdc46]18// quote the version you use and include a citation to the manual and
19// optionally also to hep-ph/0512210.
[d7d2da3]20//
21// FastJet is distributed in the hope that it will be useful,
22// but WITHOUT ANY WARRANTY; without even the implied warranty of
23// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24// GNU General Public License for more details.
25//
26// You should have received a copy of the GNU General Public License
27// along with FastJet. If not, see <http://www.gnu.org/licenses/>.
28//----------------------------------------------------------------------
[35cdc46]29//FJENDHEADER
[d7d2da3]30
31#include <fastjet/tools/MassDropTagger.hh>
32#include <fastjet/ClusterSequence.hh>
33#include <sstream>
34
35FASTJET_BEGIN_NAMESPACE
36
37LimitedWarning MassDropTagger::_warnings_nonca;
[b7b836a]38LimitedWarning MassDropTagger::_negative_mass_warning;
[d7d2da3]39
40using namespace std;
41
42//----------------------------------------------------------------------
43// MassDropTagger class implementation
44//----------------------------------------------------------------------
45
46//------------------------------------------------------------------------
47// description of the tagger
48string MassDropTagger::description() const{
49 ostringstream oss;
50 oss << "MassDropTagger with mu=" << _mu << " and ycut=" << _ycut;
51 return oss.str();
52}
53
54//------------------------------------------------------------------------
55// returns the tagged PseudoJet if successful, 0 otherwise
56// - jet the PseudoJet to tag
57PseudoJet MassDropTagger::result(const PseudoJet & jet) const{
58 PseudoJet j = jet;
59
60 // issue a warning if the jet is not obtained through a C/A
61 // clustering
62 if ((! j.has_associated_cluster_sequence()) ||
[d69dfe4]63 (j.validated_cs()->jet_def().jet_algorithm() != cambridge_algorithm))
[d7d2da3]64 _warnings_nonca.warn("MassDropTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk.");
65
66
67 PseudoJet j1, j2;
68 bool had_parents;
69
70 // we just ask that we can "walk" in the cluster sequence.
71 // appropriate errors will be thrown automatically if this is not
72 // the case
73 while ((had_parents = j.has_parents(j1,j2))) {
[b7b836a]74 if (j.m2() <= 0) {
75 _negative_mass_warning.warn(
76 "MassDropTagger: parent (sub)jet has mass^2<=0; returning null jet");
77 return PseudoJet();
78 }
[d7d2da3]79 // make parent1 the more massive jet
80 if (j1.m2() < j2.m2()) std::swap(j1,j2);
81
82 // if we pass the conditions on the mass drop and its degree of
83 // asymmetry (kt_dist/m^2 > rtycut [where kt_dist/m^2 \sim
84 // z/(1-z)), then we've found something interesting, so exit the
85 // loop
86 if ( (j1.m2() < _mu*_mu*j.m2()) && (j1.kt_distance(j2) > _ycut*j.m2()) )
87 break;
88 else
89 j = j1;
90 }
91
92 if (!had_parents)
93 // no Higgs found, return an empty PseudoJet
94 return PseudoJet();
95
96 // create the result and its structure
97 PseudoJet result_local = j;
98 MassDropTaggerStructure * s = new MassDropTaggerStructure(result_local);
[b7b836a]99 s->_mu = j1.m() / j.m();
100 s->_y = j1.kt_distance(j2)/j.m2();
[d7d2da3]101
102 result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
103
104 return result_local;
105}
106
107FASTJET_END_NAMESPACE
108
Note: See TracBrowser for help on using the repository browser.