Index: contrib/contribs/LundPlane/trunk/ChangeLog =================================================================== --- contrib/contribs/LundPlane/trunk/ChangeLog (revision 1240) +++ contrib/contribs/LundPlane/trunk/ChangeLog (revision 1241) @@ -1,31 +1,37 @@ +2020-02-23 Gavin Salam + + * example.cc: + changed outfile open(filename) to outfile.open(filename.c_str()); + to attempt to solve issue reported by Steven Schramm. + 2018-10-26 Gavin Salam * read_lund_json.py: removed extraneous normalisation of zeroth bin in the LundImage class. Added documentation. 2018-08-30 Gavin Salam * VERSION: * NEWS: Release of version 1.0.1 2018-08-23 Gavin Salam * LundWithSecondary.hh: * LundWithSecondary.cc: added secondary_index(...), removed virtual qualifier from various functions * example_secondary.cc: * example_secondary.ref: example now prints out index of the primary declustering being used for the secondary. Referemce file updated accordingly. 2018-08-09 Frédéric Dreyer First version of LundPlane. Index: contrib/contribs/LundPlane/trunk/example.cc =================================================================== --- contrib/contribs/LundPlane/trunk/example.cc (revision 1240) +++ contrib/contribs/LundPlane/trunk/example.cc (revision 1241) @@ -1,118 +1,118 @@ //---------------------------------------------------------------------- /// \file example.cc /// /// This example program is meant to illustrate how the /// fastjet::contrib::LundGenerator class is used. /// /// Run this example with /// /// \verbatim /// ./example < ../data/single-event.dat /// \endverbatim //---------------------------------------------------------------------- // $Id$ // // Copyright (c) -, Frederic A. Dreyer, Gavin P. Salam, Gregory Soyez // //---------------------------------------------------------------------- // 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 "fastjet/PseudoJet.hh" #include #include "LundGenerator.hh" // In external code, this should be fastjet/contrib/LundGenerator.hh #include "LundJSON.hh" // In external code, this should be fastjet/contrib/LundJSON.hh using namespace std; using namespace fastjet; // forward declaration to make things clearer void read_event(vector &event); //---------------------------------------------------------------------- int main(){ //---------------------------------------------------------- // read in input particles vector event; read_event(event); string filename = "jets.json"; cout << "# read an event with " << event.size() << " particles" << endl; cout << "# writing declusterings of primary and secondary plane to file " << filename << endl; ofstream outfile; - outfile.open(filename); + outfile.open(filename.c_str()); // first get some anti-kt jets double R = 1.0, ptmin = 100.0; JetDefinition jet_def(antikt_algorithm, R); ClusterSequence cs(event, jet_def); vector jets = sorted_by_pt(cs.inclusive_jets(ptmin)); //---------------------------------------------------------- // create an instance of LundGenerator, with default options contrib::LundGenerator lund; cout << lund.description() << endl; for (unsigned ijet = 0; ijet < jets.size(); ijet++) { cout << endl << "Lund coordinates ( ln 1/Delta, ln kt ) of declusterings of jet " << ijet << " are:" << endl; vector declusts = lund(jets[ijet]); for (int idecl = 0; idecl < declusts.size(); idecl++) { pair coords = declusts[idecl].lund_coordinates(); cout << "(" << coords.first << ", " << coords.second << ")"; if (idecl < declusts.size() - 1) cout << "; "; } cout << endl; // outputs the primary Lund plane lund_to_json(outfile, declusts); outfile << endl; // outputs the full Lund tree //to_json(cout, lund_gen, jets[ijet]); cout << endl; } cout << endl << "File " << filename << " written." << endl; 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 is 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); } }