31 #include <fastjet/tools/JHTopTagger.hh>
32 #include <fastjet/Error.hh>
33 #include <fastjet/JetDefinition.hh>
34 #include <fastjet/ClusterSequence.hh>
38 FASTJET_BEGIN_NAMESPACE
46 LimitedWarning JHTopTagger::_warnings_nonca;
50 string JHTopTagger::description()
const{
52 oss <<
"JHTopTagger with delta_p=" << _delta_p <<
", delta_r=" << _delta_r
53 <<
", cos_theta_W_max=" << _cos_theta_W_max
54 <<
" and mW = " << _mW;
55 oss << description_of_selectors();
67 throw Error(
"JHTopTagger can only be applied on jets having an associated (and valid) ClusterSequence");
73 _warnings_nonca.warn(
"JHTopTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk.");
77 vector<PseudoJet> split0 = _split_once(jet, jet);
78 if (split0.size() == 0)
return PseudoJet();
81 vector<PseudoJet> subjets;
82 for (
unsigned i = 0; i < 2; i++) {
83 vector<PseudoJet> split1 = _split_once(split0[i], jet);
84 if (split1.size() > 0) {
85 subjets.push_back(split1[0]);
86 subjets.push_back(split1[1]);
88 subjets.push_back(split0[i]);
93 if (subjets.size() < 3)
return PseudoJet();
96 double dmW_min = numeric_limits<double>::max();
98 for (
unsigned i = 0 ; i < subjets.size()-1; i++) {
99 for (
unsigned j = i+1 ; j < subjets.size(); j++) {
100 double dmW = abs(_mW - (subjets[i]+subjets[j]).m());
102 dmW_min = dmW; ii = i; jj = j;
112 if (ii>0) std::swap(subjets[ii], subjets[0]);
113 if (jj>1) std::swap(subjets[jj], subjets[1]);
114 if (subjets[0].perp2() < subjets[1].perp2()) std::swap(subjets[0], subjets[1]);
115 if ((subjets.size()>3) && (subjets[2].perp2() < subjets[3].perp2()))
116 std::swap(subjets[2], subjets[3]);
122 PseudoJet W = join(subjets[0], subjets[1], *rec);
124 if (subjets.size()>3) {
125 non_W = join(subjets[2], subjets[3], *rec);
127 non_W = join(subjets[2], *rec);
129 PseudoJet result_local = join<JHTopTaggerStructure>(W, non_W, *rec);
131 s->_cos_theta_w = _cos_theta_W(result_local);
139 if (s->_cos_theta_w >= _cos_theta_W_max ||
140 ! _top_selector.pass(result_local) || ! _W_selector.pass(W)
171 vector<PseudoJet> JHTopTagger::_split_once(
const PseudoJet & jet_to_split,
175 vector<PseudoJet> result_local;
177 if (p2.
perp2() > p1.
perp2()) std::swap(p1,p2);
178 if (p1.
perp() < _delta_p * reference_jet.
perp())
break;
180 if (p2.
perp() < _delta_p * reference_jet.
perp()) {
185 result_local.push_back(p1);
186 result_local.push_back(p2);
195 FASTJET_END_NAMESPACE
double rap() const
returns the rapidity or some large value when the rapidity is infinite
JetAlgorithm jet_algorithm() const
return information about the definition...
PseudoJetStructureBase * structure_non_const_ptr()
return a non-const pointer to the structure (of type PseudoJetStructureBase*) associated with this Ps...
const ClusterSequence * validated_cs() const
shorthand for validated_cluster_sequence()
virtual bool has_parents(PseudoJet &parent1, PseudoJet &parent2) const
check if it is the product of a recombination, in which case return the 2 parents through the 'parent...
const JetDefinition & jet_def() const
return a reference to the jet definition
bool has_valid_cluster_sequence() const
returns true if this PseudoJet has an associated and still valid(ated) ClusterSequence.
base class corresponding to errors that can be thrown by FastJet
const Recombiner * recombiner() const
returns a pointer to the currently defined recombiner.
const ClusterSequence * associated_cluster_sequence() const
get a (const) pointer to the parent ClusterSequence (NULL if inexistent)
double perp() const
returns the scalar transverse momentum
the longitudinally invariant variant of the cambridge algorithm (aka Aachen algoithm).
An abstract base class that will provide the recombination scheme facilities and/or allow a user to e...
double delta_phi_to(const PseudoJet &other) const
returns other.phi() - this.phi(), constrained to be in range -pi .
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
double perp2() const
returns the squared transverse momentum
the structure returned by the JHTopTagger transformer.