// To run this example, use the following command: // // ./simple-example // //---------------------------------------------------------------------- // $Id$ // // Copyright (c) 2016, // Jesse Thaler // //---------------------------------------------------------------------- // This file is part of FastJet contrib. // // It is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the // Free Software Foundation; either version 2 of the License, or (at // your option) any later version. // // It is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public // License for more details. // // You should have received a copy of the GNU General Public License // along with this code. If not, see . //---------------------------------------------------------------------- #include #include "CartesianJet.hh" // In external code, this should be fastjet/contrib/CartesianJet.hh using namespace std; using namespace fastjet; using namespace fastjet::contrib; //---------------------------------------------------------------------- int main(){ // create a vector of CartesianJet objects vector coords_input; // each one has an x-coordinate, a y-coordinate and an optional // intensity (default=1) coords_input.push_back(CartesianCoordinate(0.0, 0.0, 1.0)); coords_input.push_back(CartesianCoordinate(0.5, 0.5, 1.0)); coords_input.push_back(CartesianCoordinate(2.0, 2.0, 1.0)); // clustering takes place up to a given radius double cartesian_radius = 1.0; CartesianJetDefinition cjdef(cartesian_radius); // perform the clustering vector cjs_output = cjdef(coords_input); cout << "------- Input objects are (format: x y intensity) ------" << endl; for (unsigned i = 0; i < coords_input.size(); i++) { cout << setw(8) << coords_input[i].x() << " " << setw(8) << coords_input[i].y() << " " << setw(8) << coords_input[i].intensity() << endl; } cout << endl << endl; cout << "------- Output objects are (format: x y intensity) ------" << endl; for (unsigned i = 0; i < cjs_output.size(); i++) { cout << setw(8) << cjs_output[i].x() << " " << setw(8) << cjs_output[i].y() << " " << setw(8) << cjs_output[i].intensity() << endl; } cout << endl; return 0; }