#include #include #include #include "fastjet/ClusterSequence.hh" #include "UWEvent.hh" #include "print_jets.hh" #include "SimpleHist.hh" using namespace std; using namespace fastjet; // // Run this program with // gunzip -c ../event-files/pythia-dijet.UW.gz | ./01-antikt // int main() { // max number of events read in (even if input file contains more) int maxiev = 10000; // initialize histogram SimpleHist inclusive_jets(0.0,100.0,1.0); // filename containing the events // string datafile = "./data/"; // datafile += "pythia-dijets.UW"; // select the anti-kt algorithm with R=0.6 RecombinationScheme recomb = E_scheme; // Strategy strategy = N3Dumb; Strategy strategy = Best; JetDefinition jet_def(antikt_algorithm,0.6,recomb,strategy); // read file containing events // ifstream input_file; // input_file.open(datafile.c_str()); int iev=0; vector input_particles; while (readUWEvent(cin, input_particles) && ++iev <= maxiev) { // while (readUWEvent(input_file, input_particles) && ++iev <= maxiev) { cerr << "Event " << iev << ", size = " << input_particles.size() << endl; // cluster the input particles ClusterSequence cs(input_particles, jet_def); // extract the jets vector jets = sorted_by_pt(cs.inclusive_jets()); // add ALL jets to histogram for (unsigned int i=0; i < jets.size(); i++) { inclusive_jets.add_entry(jets[i].perp()); } // print out jets in first few events if (iev < 5 ) { print_jets(jets); } // in print_jets.hh } // output the histogram, redirecting to file "outfile" string outfile = "01-antikt.hist"; ofstream output_file; output_file.open(outfile.c_str()); output(inclusive_jets,&output_file); // in SimpleHist.hh output_file.close(); }