ktjet is hosted by Hepforge, IPPP Durham
next up previous
Next: Optimisation issues Up: KtJet Previous: Advanced features of the

Using KtJet

In this section we demonstrate a simple example analysis using the KtJet library. We run the inclusive $K_\perp~$algorithm on a proton-proton collision and do a subjet analysis on the highest $E_t$ jet in the event.
// This header file must be included.
#include "KtJet.h"

std::vector<KtLorentzVector> jetvec;

// Loop over input particles.
for (int i=0; i<npart; i++) {
  KtLorentzVector  r = KtLorentzVector(p[i][0],p[i][1],p[i][2],p[i][3]);
  jetvec.push_back(r);
}
// We now have a vector of KtLorentzVector, jetvec,
// containing all the particle 4-vectors, p, in the event.

// Run the inclusive KT algorithm in PP mode using the covariant E-scheme
// (type=4, angle=2, recom=1, rparameter=1).
KtEvent ev(jetvec,4,2,1,1.0);

// Get jets, sorted in Et.
std::vector<KtLorentzVector> jetsEt = ev.getJetsEt();

// Perform subject analysis on highest Et jet (angle=2, recom=1).
KtEvent jet1(jetsEt[0],2,1);

// Decompose jet1 into 2 subjets.
jet1.findJetsN(2);

// Get the KtLorentzVectors of the 2 subjets
std::vector<KtLorentzVector> subjetsEt = jet1.getJetsEt();

// Write out the pseudorapidity of the highest Et subjet.
cout << subjetsEt[0].eta() << endl;


Jonathan Couchman 2002-10-02