31 #include <fastjet/tools/RestFrameNSubjettinessTagger.hh>
32 #include <fastjet/tools/Boost.hh>
33 #include <fastjet/ClusterSequence.hh>
38 FASTJET_BEGIN_NAMESPACE
46 string RestFrameNSubjettinessTagger::description()
const{
48 oss <<
"RestFrameNSubjettiness tagger that performs clustering in the jet rest frame with "
49 << _subjet_def.description()
50 <<
", supplemented with cuts tau_2 < " << _t2cut
51 <<
" and cos(theta_s) < " << _costscut;
62 throw(
"The jet you try to tag needs to have accessible constituents");
66 for (
unsigned int i=0; i<rest_input.size(); i++)
67 rest_input[i].unboost(jet);
70 vector<PseudoJet> subjets = (_use_exclusive)
81 double ct0 = (j0.px()*jet.px() + j0.py()*jet.py() + j0.pz()*jet.pz())
83 double ct1 = (j1.px()*jet.px() + j1.py()*jet.py() + j1.pz()*jet.pz())
85 if ((ct0 > _costscut) || (ct1 > _costscut))
return PseudoJet();
89 for (
unsigned int i=0; i<rest_input.size(); i++)
90 tau2 += min(dot_product(rest_input[i], j0),
91 dot_product(rest_input[i], j1));
93 tau2 *= (2.0/jet.
m2());
106 PseudoJet subjet_lab1 = cs_structure->
jets()[cs_rest.
history()[subjets[0].cluster_hist_index()].jetp_index];
107 PseudoJet subjet_lab2 = cs_structure->
jets()[cs_rest.
history()[subjets[0].cluster_hist_index()].jetp_index];
109 PseudoJet result_local = join<StructureType>(subjet_lab1,subjet_lab2);
113 s->_costhetas = max(ct0, ct1);
122 FASTJET_END_NAMESPACE
const std::vector< PseudoJet > & jets() const
allow the user to access the internally stored _jets() array, which contains both the initial particl...
std::vector< PseudoJet > exclusive_jets(const double dcut) const
return a vector of all jets (in the sense of the exclusive algorithm) that would be obtained when run...
std::vector< PseudoJet > inclusive_jets(const double ptmin=0.0) const
return a vector of all jets (in the sense of the inclusive algorithm) with pt >= ptmin.
the structure returned by the RestFrameNSubjettinessTagger transformer.
PseudoJetStructureBase * structure_non_const_ptr()
return a non-const pointer to the structure (of type PseudoJetStructureBase*) associated with this Ps...
virtual bool has_constituents() const
returns true if the PseudoJet has constituents
double m2() const
returns the squared invariant mass // like CLHEP
const std::vector< history_element > & history() const
allow the user to access the raw internal history.
vector< PseudoJet > sorted_by_E(const vector< PseudoJet > &jets)
return a vector of jets sorted into decreasing energy
double modp2() const
return the squared 3-vector modulus = px^2+py^2+pz^2
void delete_self_when_unused()
by calling this routine you tell the ClusterSequence to delete itself when all the Pseudojets associa...
virtual std::vector< PseudoJet > constituents() const
retrieve the constituents.
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
Class to boost a PseudoJet.
void transfer_from_sequence(const ClusterSequence &from_seq, const FunctionOfPseudoJet< PseudoJet > *action_on_jets=0)
transfer the sequence contained in other_seq into our own; any plugin "extras" contained in the from_...