29 #include <fastjet/tools/CASubJetTagger.hh>
30 #include <fastjet/ClusterSequence.hh>
38 FASTJET_BEGIN_NAMESPACE
41 LimitedWarning CASubJetTagger::_non_ca_warnings;
45 string CASubJetTagger::description()
const{
47 oss <<
"CASubJetTagger with z_threshold=" << _z_threshold ;
48 if (_absolute_z_cut) oss <<
" (defined wrt original jet)";
49 oss <<
" and scale choice ";
50 switch (_scale_choice) {
51 case kt2_distance: oss <<
"kt2_distance";
break;
52 case jade_distance: oss <<
"jade_distance";
break;
53 case jade2_distance: oss <<
"jade2_distance";
break;
54 case plain_distance: oss <<
"plain_distance";
break;
55 case mass_drop_distance: oss <<
"mass_drop_distance";
break;
56 case dot_product_distance: oss <<
"dot_product_distance";
break;
58 throw Error(
"unrecognized scale choice");
70 _non_ca_warnings.warn(
"CASubJetTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk");
75 aux.aux_distance = -numeric_limits<double>::max();
78 _recurse_through_jet(jet, aux, jet);
85 if (result_local ==
PseudoJet())
return result_local;
113 switch (_scale_choice) {
130 case mass_drop_distance:
132 dist = jet.
m() - std::max(parent1.
m(),parent2.
m());
134 case dot_product_distance:
138 dist = dot_product(parent1, parent2);
141 throw Error(
"unrecognized scale choice");
150 if (parent1.
perp2() < parent2.
perp2()) std::swap(parent1,parent2);
152 if (_absolute_z_cut) {
153 z2 = parent2.
perp() / original_jet.
perp();
154 zcut1 = parent1.
perp() / original_jet.
perp() >= _z_threshold;
158 zcut2 = z2 >= _z_threshold;
161 if (dist > aux.aux_distance){
163 aux.aux_distance = dist;
169 if (zcut1) _recurse_through_jet(parent1, aux, original_jet);
170 if (zcut2) _recurse_through_jet(parent2, aux, original_jet);
173 FASTJET_END_NAMESPACE
bool _absolute_z
whether z is computed wrt to the original jet or not
double squared_distance(const PseudoJet &other) const
returns squared cylinder (rap-phi) distance between this jet and another
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
@ cambridge_algorithm
the longitudinally invariant variant of the cambridge algorithm (aka Aachen algoithm).
double perp() const
returns the scalar transverse momentum
const ClusterSequence * validated_cs() const
shorthand for validated_cluster_sequence()
double kt_distance(const PseudoJet &other) const
returns kt distance (R=1) between this jet and another
class that contains the result internally
JetAlgorithm jet_algorithm() const
return information about the definition...
void set_structure_shared_ptr(const SharedPtr< PseudoJetStructureBase > &structure)
set the associated structure
double m() const
returns the invariant mass (If m2() is negative then -sqrt(-m2()) is returned, as in CLHEP)
double _z
the transverse momentum fraction
CASubJetTagger::ScaleChoice _scale_choice
the user scale choice
double _distance
the maximal distance associated with the result
double perp2() const
returns the squared transverse momentum