Index: contrib/contribs/RecursiveTools/trunk/example_recursive_softdrop.ref =================================================================== --- contrib/contribs/RecursiveTools/trunk/example_recursive_softdrop.ref (revision 1387) +++ contrib/contribs/RecursiveTools/trunk/example_recursive_softdrop.ref (revision 1388) @@ -1,83 +1,83 @@ # read an event with 354 particles #-------------------------------------------------------------------------- # FastJet release 3.4.2 # M. Cacciari, G.P. Salam and G. Soyez # A software package for jet finding and analysis at colliders # http://fastjet.fr # # Please cite EPJC72(2012)1896 [arXiv:1111.6097] if you use this package # for scientific work and optionally PLB641(2006)57 [hep-ph/0512210]. # # FastJet is provided without warranty under the GNU GPL v2 or higher. # It uses T. Chan's closest pair algorithm, S. Fortune's Voronoi code # and 3rd party plugin jet algorithms. See COPYING file for details. #-------------------------------------------------------------------------- RecursiveSoftDrop groomer is: recursive application of [Recursive Groomer with a symmetry cut scalar_z > 0.2 (theta/1)^0.5 [SoftDrop], no mass-drop requirement, recursion into the subjet with larger pt], applied N=4 times, with R0 dynamically scaled original jet: pt = 983.387 m = 39.9912 y = -0.867307 phi = 2.90511 RecursiveSoftDropped jet: pt = 811.261 m = 6.45947 y = -0.87094 phi = 2.9083 Prongs with clustering information ---------------------------------- branch branch N_groomed max loc substructure pt mass loc tot zdrop zg thetag - +--> 811.261 6.45947 13 13 0.0294298 0.154333 0.0200353 - +--> 669.635 1.98393 2 2 0 - +--> 141.627 0.765329 0 0 0 0.199906 0.00734861 - +--> 113.316 0.462946 0 0 0 0.208947 0.00550512 - | +--> 89.6387 0.211913 0 0 0 - | +--> 23.6769 0.13957 0 0 0 - +--> 28.3123 0.170026 0 0 0 0.248173 0.00447786 - +--> 21.286 0.13957 0 0 0 - +--> 7.02636 -3.2146e-05 0 0 0 + +--> 811.2615 6.4595 13 13 0.0294 0.1543 0.0200 + +--> 669.6354 1.9839 2 2 0.0000 + +--> 141.6273 0.7653 0 0 0.0000 0.1999 0.0073 + +--> 113.3155 0.4629 0 0 0.0000 0.2089 0.0055 + | +--> 89.6387 0.2119 0 0 0.0000 + | +--> 23.6769 0.1396 0 0 0.0000 + +--> 28.3123 0.1700 0 0 0.0000 0.2482 0.0045 + +--> 21.2860 0.1396 0 0 0.0000 + +--> 7.0264 -0.0000 0 0 0.0000 Prongs without clustering information ------------------------------------- (Raw) list of prongs: pt mass - 0 669.635374 1.983927 - 1 89.638730 0.211913 - 2 21.285962 0.139570 - 3 23.676940 0.139570 - 4 7.026365 -0.000032 + 0 669.6354 1.9839 + 1 89.6387 0.2119 + 2 21.2860 0.1396 + 3 23.6769 0.1396 + 4 7.0264 -0.0000 Groomed prongs information: index zg thetag - 1 0.154333 0.020035 - 2 0.199906 0.007349 - 3 0.208947 0.005505 - 4 0.248173 0.004478 + 1 0.1543 0.0200 + 2 0.1999 0.0073 + 3 0.2089 0.0055 + 4 0.2482 0.0045 -original jet: pt = 908.097875 m = 87.712381 y = 0.219482 phi = 6.034867 -RecursiveSoftDropped jet: pt = 830.517293 m = 4.910352 y = 0.223054 phi = 6.029946 +original jet: pt = 908.0979 m = 87.7124 y = 0.2195 phi = 6.0349 +RecursiveSoftDropped jet: pt = 830.5173 m = 4.9104 y = 0.2231 phi = 6.0299 Prongs with clustering information ---------------------------------- branch branch N_groomed max loc substructure pt mass loc tot zdrop zg thetag - +--> 830.517293 4.910352 12 13 0.023206 0.060784 0.015386 - +--> 778.731354 3.664810 0 1 0.000000 0.235041 0.010138 - | +--> 599.106323 0.403809 1 1 0.000000 - | +--> 179.627749 0.853363 0 1 0.000000 0.257730 0.008717 - | +--> 131.150402 0.378456 1 1 0.060659 0.315246 0.004173 - | | +--> 89.805823 0.107191 0 0 0.000000 - | | +--> 41.344752 0.139570 0 0 0.000000 - | +--> 48.478456 0.139570 0 0 0.000000 - +--> 51.791642 0.139570 0 0 0.000000 + +--> 830.5173 4.9104 12 13 0.0232 0.0608 0.0154 + +--> 778.7314 3.6648 0 1 0.0000 0.2350 0.0101 + | +--> 599.1063 0.4038 1 1 0.0000 + | +--> 179.6277 0.8534 0 1 0.0000 0.2577 0.0087 + | +--> 131.1504 0.3785 1 1 0.0607 0.3152 0.0042 + | | +--> 89.8058 0.1072 0 0 0.0000 + | | +--> 41.3448 0.1396 0 0 0.0000 + | +--> 48.4785 0.1396 0 0 0.0000 + +--> 51.7916 0.1396 0 0 0.0000 Prongs without clustering information ------------------------------------- (Raw) list of prongs: pt mass - 0 599.106323 0.403809 - 1 51.791642 0.139570 - 2 89.805823 0.107191 - 3 48.478456 0.139570 - 4 41.344752 0.139570 + 0 599.1063 0.4038 + 1 51.7916 0.1396 + 2 89.8058 0.1072 + 3 48.4785 0.1396 + 4 41.3448 0.1396 Groomed prongs information: index zg thetag - 1 0.060784 0.015386 - 2 0.235041 0.010138 - 3 0.257730 0.008717 - 4 0.315246 0.004173 + 1 0.0608 0.0154 + 2 0.2350 0.0101 + 3 0.2577 0.0087 + 4 0.3152 0.0042 Index: contrib/contribs/RecursiveTools/trunk/example_recursive_softdrop.cc =================================================================== --- contrib/contribs/RecursiveTools/trunk/example_recursive_softdrop.cc (revision 1387) +++ contrib/contribs/RecursiveTools/trunk/example_recursive_softdrop.cc (revision 1388) @@ -1,240 +1,240 @@ //---------------------------------------------------------------------- /// \file example_recursive_softdrop.cc /// /// This example program is meant to illustrate how the /// fastjet::contrib::RecursiveSoftDrop class is used. /// /// Run this example with /// /// \verbatim /// ./example_recursive_softdrop < ../data/single-event.dat /// \endverbatim //---------------------------------------------------------------------- // $Id$ // // Copyright (c) 2017-, Gavin P. Salam, Gregory Soyez, Jesse Thaler, // Kevin Zhou, Frederic Dreyer // //---------------------------------------------------------------------- // 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/ClusterSequence.hh" #include "RecursiveSoftDrop.hh" // In external code, this should be fastjet/contrib/RecursiveSoftDrop.hh using namespace std; using namespace fastjet; // forward declaration to make things clearer void read_event(vector &event); void print_prongs_with_clustering_info(const PseudoJet &jet, const string &pprefix); void print_raw_prongs(const PseudoJet &jet); ostream & operator<<(ostream &, const PseudoJet &); //---------------------------------------------------------------------- int main(){ //---------------------------------------------------------- // read in input particles vector event; read_event(event); cout << "# read an event with " << event.size() << " particles" << endl; // 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)); //---------------------------------------------------------------------- // give the soft drop groomer a short name // Use a symmetry cut z > z_cut R^beta // By default, there is no mass-drop requirement double z_cut = 0.2; double beta = 0.5; int n=4; // number of layers (-1 <> infinite) contrib::RecursiveSoftDrop rsd(beta, z_cut, n, R); // keep addittional structure info (used below) rsd.set_verbose_structure(true); // (optionally) use the same-depth variant // // instead of recursing into the largest Delta R branch until "n+1" // branches hav ebeen found, the same-depth variant recurses n times // into all the branches found in the previous iteration // //rsd.set_fixed_depth_mode(); // (optionally) use a dynamical R0 // // Instead of being normalised by the initial jet radios R0, angles // are notrmalised by the delta R of the previous iteration // rsd.set_dynamical_R0(); // (optionally) recurse only in the hardest branch // // Instead of recursing into both branches found by the previous // iteration, only keep recursing into the hardest one // //rsd.set_hardest_branch_only(); //---------------------------------------------------------------------- cout << "RecursiveSoftDrop groomer is: " << rsd.description() << endl; for (unsigned ijet = 0; ijet < jets.size(); ijet++) { // Run SoftDrop and examine the output PseudoJet rsd_jet = rsd(jets[ijet]); cout << endl; cout << "original jet: " << jets[ijet] << endl; cout << "RecursiveSoftDropped jet: " << rsd_jet << endl; assert(rsd_jet != 0); //because soft drop is a groomer (not a tagger), it should always return a soft-dropped jet // print the prong structure of the jet // // This can be done in 2 ways: // // - either keeping the clustering information and get the // branches as a succession of 2->1 recombinations (this is // done calling "pieces" recursively) cout << endl << "Prongs with clustering information" << endl << "----------------------------------" << endl; print_prongs_with_clustering_info(rsd_jet, " "); // // - or getting all the branches in a single go (done directly // through the jet associated structure) cout << endl << "Prongs without clustering information" << endl << "-------------------------------------" << endl; print_raw_prongs(rsd_jet); cout << "Groomed prongs information:" << endl; cout << "index zg thetag" << endl; vector > ztg = rsd_jet.structure_of().sorted_zg_and_thetag(); for (unsigned int i=0; i(); double dR = structure.delta_R(); cout << " " << left << setw(14) << (prefix.substr(0, prefix.size()-1)+"+--> ") << right << setw(8) << jet.pt() << setw(14) << jet.m() << setw(5) << structure.dropped_count(false) << setw(5) << structure.dropped_count() << setw(11) << structure.max_dropped_symmetry(false); if (structure.has_substructure()){ cout << setw(11) << structure.symmetry() << setw(11) << structure.delta_R(); } cout << endl; if (dR>=0){ vector pieces = jet.pieces(); assert(pieces.size()==2); print_prongs_with_clustering_info(pieces[0], prefix+" |"); print_prongs_with_clustering_info(pieces[1], prefix+" "); } } //---------------------------------------------------------------------- // print all the prongs inside the jet (no clustering info) void print_raw_prongs(const PseudoJet &jet){ cout << "(Raw) list of prongs:" << endl; if (!jet.has_structure_of()){ cout << " None (bad structure)" << endl; return; } cout << setw(5) << " " << setw(11) << "pt" << setw(14) << "mass" << endl; vector prongs = contrib::recursive_soft_drop_prongs(jet); for (unsigned int iprong=0; iprong(); cout << fixed << setw(5) << iprong << setw(11) << prong.pt() << setw(14) << prong.m() << endl; assert(!structure.has_substructure()); } cout << endl; } //---------------------------------------------------------------------- /// 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); } } //---------------------------------------------------------------------- /// overloaded jet info output ostream & operator<<(ostream & ostr, const PseudoJet & jet) { if (jet == 0) { ostr << " 0 "; } else { ostr << " pt = " << jet.pt() << " m = " << jet.m() << " y = " << jet.rap() << " phi = " << jet.phi(); } return ostr; }