5 #include "DiffusionDistFastJet.h"
7 #include "fastjet/NNH.hh"
13 void init(
const fastjet::PseudoJet &jet ) {
20 double dEta = eta - jt->eta;
21 double dPhi = deltaPhi(phi,jt->phi);
22 double ratio = ( pt < jt->pt ? pt : jt->pt ) / ( pt < jt->pt ? jt->pt : pt );
23 return sqrt(dEta*dEta+dPhi*dPhi) * diffusionFactor2(ratio);
26 double beam_distance()
const {
33 inline double deltaPhi(
const double phi1,
const double phi2)
const {
34 double dPhi = phi1 - phi2;
35 while ( dPhi < -M_PI )
45 void DiffusionDistFastJet::run_clustering(ClusterSequence &seq)
const
53 int njets = seq.jets().size();
54 fastjet::NNH<DiffBriefJet> nnh(seq.jets());
57 const std::vector<PseudoJet> & initialEvent = seq.jets();
62 dij = nnh.dij_min(i,j);
65 seq.plugin_record_ij_recombination(i,j,dij,k);
66 nnh.merge_jets(i,j,seq.jets()[k],k);
69 seq.plugin_record_iB_recombination(i,dij);
75 const std::vector<fastjet::ClusterSequence::history_element> & history = seq.history();
76 const unsigned histSize = history.size();
77 for (
unsigned h=0; h != histSize; h++ ) {
78 const fastjet::ClusterSequence::history_element & el = history[h];
82 seq.plugin_record_iB_recombination(h,DBL_MAX);