// Example showing basic usage of JetsWithoutJets classes.
//
// Compile it with "make example_basic_usage" and run it with
//
// ./example_basic_usage < ../data/single-event.dat
//
// Copyright (c) 2013
// Daniele Bertolini and Jesse Thaler
//
// $Id$
//----------------------------------------------------------------------
// 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
#include
#include
#include "fastjet/PseudoJet.hh"
#include "fastjet/ClusterSequence.hh"
#include "fastjet/JetDefinition.hh"
#include "fastjet/tools/Filter.hh"
#include "JetsWithoutJets.hh" // In external code, this should be fastjet/contrib/JetsWithoutJets.hh
using namespace std;
using namespace fastjet;
using namespace fastjet::jwj;
// forward declaration to make things clearer
void read_event(vector &event);
void analyze(const vector & input_particles);
//----------------------------------------------------------------------
int main(){
//----------------------------------------------------------
// read in input particles
vector event;
read_event(event);
cout << "#########" << endl;
cout << "## Read an event with " << event.size() << " particles" << endl;
//----------------------------------------------------------
// illustrate how this JetsWithoutJets contrib works
analyze(event);
return 0;
}
// read in input particles
void read_event(vector &event){
string line;
while (getline(cin, line)) {
istringstream linestream(line);
// take substrings to avoid problems when there are extra "pollution"
// characters (e.g. line-feed).
if (line.substr(0,4) == "#END") {return;}
if (line.substr(0,1) == "#") {continue;}
double px,py,pz,E;
linestream >> px >> py >> pz >> E;
PseudoJet particle(px,py,pz,E);
// push event onto back of full_event vector
event.push_back(particle);
}
}
// Main code
void analyze(const vector & input_particles) {
// Jet parameters.
double Rjet = 1.0;
double pTcut = 200.0;
// Subjet parameters. Need for trimming.
double Rsub = 0.2;
double fcut = 0.05;
//////////
// Basic event shape analysis
//////////
// Classes derived from JetLikeEventShape take as input a vector
// representing the event, and return a number.
// The simplest constructor requires you to specify Rjet and pTcut.
ShapeJetMultiplicity Nj(Rjet,pTcut);// ShapeJetMultiplicity = jet counting
ShapeScalarPt HT(Rjet,pTcut);// ShapeScalarPt = HT (summed jet pT)
ShapeMissingPt HTmiss(Rjet,pTcut);// ShapeMissingPt = missing pT
cout << setprecision(6);
cout << "#########" << endl;
cout << "## Example of basic event shape analysis" << endl;
cout << "#########" << endl;
cout << "Jet parameters: R_jet=" << Rjet << ", pTcut=" << pTcut <