Index: contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.hh =================================================================== --- contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.hh (revision 1191) +++ contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.hh (revision 1192) @@ -1,207 +1,212 @@ // $Id$ // // Copyright (c) 2014-, 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 . //---------------------------------------------------------------------- #ifndef __RECURSIVESOFTDROP_HH__ #define __RECURSIVESOFTDROP_HH__ +// we'll use the native FJ class for reculstering if available +#if FASTJET_VERSION_NUMBER >= 30100 +#include "fastjet/tools/Recluster.hh" +#else #include "Recluster.hh" +#endif #include "SoftDrop.hh" #include "fastjet/WrappedStructure.hh" #include #include #include FASTJET_BEGIN_NAMESPACE namespace contrib{ //------------------------------------------------------------------------ /// \class RecursiveSoftDrop /// An implementation of the RecursiveSoftDrop. /// /// Recursive Soft Drop will recursively groom a jet, removing /// particles that fail the criterion /// \f[ /// z > z_{\rm cut} (\theta/R0)^\beta /// \f] /// until n subjets have been found. /// /// Several variants are supported: /// - set_fixed_depth_mode() switches to fixed depth on all branches /// of the clustering tree /// - set_dynamical_R0() switches to dynamical R0 implementation of /// RSD /// - set_hardest_branch_only() switches to following only the /// hardest branch (e.g. for Iterated Soft Drop) /// - set_min_deltaR_square(val) sets a minimum angle considered for /// substructure (e.g. for Iterated Soft Drop) /// /// Notes: /// /// - Even though the calls to "set_tagging_mode()" or /// "set_grooming_mode(false)" are allowed, they should not be used /// with n=-1, and the default grooming_mode has to remain /// untouched (except for beta<0 and finite n). /// //---------------------------------------------------------------------- class RecursiveSoftDrop : public SoftDrop { public: /// Simplified constructor. This takes the value of the "beta" /// parameter and the symmetry cut (applied by default on the /// scalar_z variable, as for the mMDT). It also takes an optional /// subtractor. /// /// n is the number of times we require the SoftDrop condition to be /// satisfied. n=-1 means infinity, i.e. we recurse into the jet /// until individual constituents /// /// If the (optional) pileup subtractor can be supplied, then see /// also the documentation for the set_input_jet_is_subtracted() member /// function. /// /// \param beta the value of the beta parameter /// \param symmetry_cut the value of the cut on the symmetry measure /// \param n the requested number of iterations /// \param R0 the angular distance normalisation [1 by default] RecursiveSoftDrop(double beta, double symmetry_cut, int n = -1, double R0 = 1, const FunctionOfPseudoJet * subtractor = 0) : SoftDrop(beta, symmetry_cut, R0, subtractor), _n(n) { set_defaults(); } /// Full constructor, which takes the following parameters: /// /// \param beta the value of the beta parameter /// \param symmetry_cut the value of the cut on the symmetry measure /// \param symmetry_measure the choice of measure to use to estimate the symmetry /// \param n the requested number of iterations /// \param R0 the angular distance normalisation [1 by default] /// \param mu_cut the maximal allowed value of mass drop variable mu = m_heavy/m_parent /// \param recursion_choice the strategy used to decide which subjet to recurse into /// \param subtractor an optional pointer to a pileup subtractor (ignored if zero) RecursiveSoftDrop(double beta, double symmetry_cut, SymmetryMeasure symmetry_measure, int n = -1, double R0 = 1.0, double mu_cut = std::numeric_limits::infinity(), RecursionChoice recursion_choice = larger_pt, const FunctionOfPseudoJet * subtractor = 0) : SoftDrop(beta, symmetry_cut, symmetry_measure, R0, mu_cut, recursion_choice, subtractor), _n(n) { set_defaults(); } /// default destructor virtual ~RecursiveSoftDrop(){} //---------------------------------------------------------------------- // access to class info int n() const { return _n; } //---------------------------------------------------------------------- // on top of the tweaks that we inherit from SoftDrop (via // RecursiveSymmetryBase): // - set_verbose_structure() // - set_subtractor() // - set_input_jet_is_subtracted() // we provide several other knobs, given below /// initialise all the flags below to their default value void set_defaults(); /// switch to using the "same depth" variant where instead of /// recursing from large to small angles and requiring n SD /// conditions to be met (our default), we recurse simultaneously in /// all the branches found during the previous iteration, up to a /// maximum depth of n. /// default: false void set_fixed_depth_mode(bool value=true) { _fixed_depth = value; } bool fixed_depth_mode() const { return _fixed_depth; } /// switch to using a dynamical R0 (used for the normalisation of /// the symmetry measure) set by the last deltaR at which some /// substructure was found. /// default: false void set_dynamical_R0(bool value=true) { _dynamical_R0 = value; } bool use_dynamical_R0() const { return _dynamical_R0; } /// when finding some substructure, only follow the hardest branch /// for the recursion /// default: false (i.e. recurse in both branches) void set_hardest_branch_only(bool value=true) { _hardest_branch_only = value; } bool use_hardest_branch_only() const { return _hardest_branch_only; } /// set the minimum angle (squared) that we should consider for /// substructure /// default: -1.0 (i.e. no minimum) void set_min_deltaR_squared(double value=-1.0) { _min_dR2 = value; } double min_deltaR_squared() const { return _min_dR2; } /// description of the tool virtual std::string description() const; //---------------------------------------------------------------------- /// action on a single jet with RecursiveSoftDrop. /// /// uses "result_fixed_tags" by default (i.e. recurse from R0 to /// smaller angles until n SD conditions have been met), or /// "result_fixed_depth" where each of the previous SD branches are /// recirsed into down to a depth of n. virtual PseudoJet result(const PseudoJet &jet) const; /// this routine applies the Soft Drop criterion recursively on the /// CA tree until we find n subjets (or until it converges), and /// adds them together into a groomed PseudoJet PseudoJet result_fixed_tags(const PseudoJet &jet) const; /// this routine applies the Soft Drop criterion recursively on the /// CA tree, recursing into all the branches found during the previous iteration /// until n layers have been found (or until it converges) PseudoJet result_fixed_depth(const PseudoJet &jet) const; protected: /// return false if we reached desired layer of grooming _n bool continue_grooming(int current_n) const { return ((_n < 0) or (current_n < _n)); } private: int _n; ///< the value of n // behaviour tweaks bool _fixed_depth; ///< look in parallel into each all branches until depth n bool _dynamical_R0; ///< when true, use the last deltaR with substructure as D0 bool _hardest_branch_only; ///< recurse only in the hardest branch /// when substructure is found double _min_dR2; ///< the min allowed angle to search for substructure }; // helper to get the (linear) list of prongs inside a jet resulting // from RecursiveSoftDrop. This would avoid having amnually to go // through the successive pairwise compositeness std::vector recursive_soft_drop_prongs(const PseudoJet & rsd_jet); } FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh #endif // __RECURSIVESOFTDROP_HH__ Index: contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.cc =================================================================== --- contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.cc (revision 1191) +++ contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.cc (revision 1192) @@ -1,482 +1,475 @@ // $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 "RecursiveSoftDrop.hh" #include "fastjet/ClusterSequence.hh" using namespace std; FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh namespace contrib{ namespace internal_recursive_softdrop{ //======================================================================== /// \class RSDHistoryElement /// a helper class to help keeping track od the RSD tree /// /// The element is created at the top of a branch and updated each /// time one grooms something away. class RSDHistoryElement{ public: RSDHistoryElement(const PseudoJet &jet, const RecursiveSoftDrop* rsd_ptr, double R0sqr) : R0_squared(R0sqr), child1_in_history(-1), child2_in_history(-1), symmetry(-1.0), mu2(-1.0){ reset(jet, rsd_ptr); } void reset(const PseudoJet &jet, const RecursiveSoftDrop* rsd_ptr){ current_in_ca_tree = jet.cluster_hist_index(); PseudoJet piece1, piece2; theta_squared = (jet.has_parents(piece1, piece2)) ? rsd_ptr->squared_geometric_distance(piece1,piece2) : 0.0; } int current_in_ca_tree; ///< (history) index of the current particle in the C/A tree double theta_squared; ///< squared angle at which this decays double R0_squared; ///< squared angle at the top of the branch ///< (used for RSD with dynamic_R0) int child1_in_history; ///< hardest of the 2 decay products (-1 if untagged) int child2_in_history; ///< softest of the 2 decay products (-1 if untagged) // info about what has been dropped and the local substructure vector dropped_delta_R; vector dropped_symmetry; vector dropped_mu; double symmetry, mu2; }; /// \class OrderRSDHistoryElements /// angular ordering of (pointers to) the history elements /// /// our priority queue will use pointers to these elements that are /// ordered in angle (of the objects they point to) class OrderRSDHistoryElements{ public: bool operator()(const RSDHistoryElement *e1, const RSDHistoryElement *e2) const { return e1->theta_squared < e2->theta_squared; } }; } // internal_recursive_softdrop //======================================================================== // initialise all the flags and parameters to their default value void RecursiveSoftDrop::set_defaults(){ set_fixed_depth_mode(false); set_dynamical_R0(false); set_hardest_branch_only(false); set_min_deltaR_squared(-1.0); } // description of the tool string RecursiveSoftDrop::description() const{ ostringstream res; res << "recursive application of [" << RecursiveSymmetryCutBase::description() << "]"; if (_fixed_depth){ res << ", recursively applied down to a maximal depth of N="; if (_n==-1) res << "infinity"; else res << _n; } else { res << ", applied N="; if (_n==-1) res << "infinity"; else res << _n; res << " times"; } if (_dynamical_R0) res << ", with R0 dynamically scaled"; else res << ", with R0 kept fixed"; if (_hardest_branch_only) res << ", following only the hardest branch"; if (_min_dR2>0) res << ", with minimal angle (squared) = " << _min_dR2; return res.str(); } // action on a single jet with RecursiveSoftDrop. // // uses "result_fixed_tags" by default (i.e. recurse from R0 to // smaller angles until n SD conditions have been met), or // "result_fixed_depth" where each of the previous SD branches are // recirsed into down to a depth of n. PseudoJet RecursiveSoftDrop::result(const PseudoJet &jet) const{ return _fixed_depth ? result_fixed_depth(jet) : result_fixed_tags(jet); } // this routine applies the Soft Drop criterion recursively on the // CA tree until we find n subjets (or until it converges), and // adds them together into a groomed PseudoJet PseudoJet RecursiveSoftDrop::result_fixed_tags(const PseudoJet &jet) const { // start by reclustering jet with C/A algorithm PseudoJet ca_jet = _recluster_if_needed(jet); if (! ca_jet.has_valid_cluster_sequence()){ throw Error("RecursiveSoftDrop can only be applied to jets associated to a (valid) cluster sequence"); } const ClusterSequence *cs = ca_jet.validated_cluster_sequence(); const vector &cs_history = cs->history(); const vector &cs_jets = cs->jets(); - // initialize counter to 1 subjet (i.e. the full ca_jet) + // initialise counter to 1 subjet (i.e. the full ca_jet) int n_tagged = 0; int max_njet = ca_jet.constituents().size(); // create the list of branches unsigned int max_history_size = 2*max_njet; if ((_n>0) && (_n history; history.reserve(max_history_size); // could be one shorter history.push_back(internal_recursive_softdrop::RSDHistoryElement(ca_jet, this, _R0sqr)); // create a priority queue containing the subjets and a comparison definition - // initialise to the full ca_jet priority_queue, internal_recursive_softdrop::OrderRSDHistoryElements> active_branches; active_branches.push(& (history[0])); PseudoJet parent, piece1, piece2; double sym, mu2; - - // which R0 to use - //double R0sqr = _R0sqr; // loop over C/A tree until we reach the appropriate number of subjets while ((continue_grooming(n_tagged)) && (active_branches.size())) { - // get the element corresponding to the max dR - // and the associated PJ + // get the element corresponding to the max dR and the associated PJ internal_recursive_softdrop::RSDHistoryElement * elm = active_branches.top(); PseudoJet parent = cs_jets[cs_history[elm->current_in_ca_tree].jetp_index]; // do one step of SD RecursionStatus status = recurse_one_step(parent, piece1, piece2, sym, mu2, &elm->R0_squared); // check if we passed the SD condition if (status==recursion_success){ // check for the optional angular cut if ((_min_dR2 > 0) && (squared_geometric_distance(piece1,piece2) < _min_dR2)) break; // both subjets are kept in the list for potential further de-clustering elm->child1_in_history = history.size(); elm->child2_in_history = history.size()+1; elm->symmetry = sym; elm->mu2 = mu2; active_branches.pop(); // update the history double next_R0_squared = (_dynamical_R0) ? piece1.squared_distance(piece2) : elm->R0_squared; internal_recursive_softdrop::RSDHistoryElement elm1(piece1, this, next_R0_squared); history.push_back(elm1); active_branches.push(&(history.back())); internal_recursive_softdrop::RSDHistoryElement elm2(piece2, this, next_R0_squared); history.push_back(elm2); if (!_hardest_branch_only){ active_branches.push(&(history.back())); } ++n_tagged; } else if (status==recursion_dropped){ // check for the optional angular cut if ((_min_dR2 > 0) && (squared_geometric_distance(piece1,piece2) < _min_dR2)) break; active_branches.pop(); // tagging failed and the softest branch should be dropped - // keep track of what has een groomed away + // keep track of what has been groomed away max_njet -= piece2.constituents().size(); elm->dropped_delta_R .push_back((elm->theta_squared >= 0) ? sqrt(elm->theta_squared) : -sqrt(elm->theta_squared)); elm->dropped_symmetry.push_back(sym); elm->dropped_mu .push_back((mu2>=0) ? sqrt(mu2) : -sqrt(mu2)); - // keep the hardest bhanch in the recursion + // keep the hardest branch in the recursion elm->reset(piece1, this); active_branches.push(elm); } else if (status==recursion_no_parents){ if (_min_dR2 > 0) break; active_branches.pop(); // nothing specific to do: we just keep the curent jet as a "leaf" } else { // recursion_issue active_branches.pop(); // we've met an issue // if the piece2 is null as well, it means we've had a critical problem. // In that case, return an empty PseudoJet if (piece2 == 0) return PseudoJet(); // otherwise, we should consider "piece2" as a final particle // not to be recursed into if (_min_dR2 > 0) break; max_njet -= (piece2.constituents().size()-1); break; } // If the missing number of tags is exactly the number of objects // we have left in the recursion, stop if (n_tagged == max_njet) break; } // now we have a bunch of history elements that we can use to build the final jet vector mapped_to_history(history.size()); unsigned int history_index = history.size(); do { --history_index; const internal_recursive_softdrop::RSDHistoryElement & elm = history[history_index]; - // two kinds of events: either just a final leave, poteitially with grooming + // two kinds of events: either just a final leave, potentially with grooming // or a brandhing (also with potential grooming at the end) if (elm.child1_in_history<0){ - // this is a leaf, i.e. with no further sustructure + // this is a leaf, i.e. with no further substructure PseudoJet & subjet = mapped_to_history[history_index] = cs_jets[cs_history[elm.current_in_ca_tree].jetp_index]; StructureType * structure = new StructureType(subjet); if (has_verbose_structure()){ structure->set_verbose(true); structure->set_dropped_delta_R (elm.dropped_delta_R); structure->set_dropped_symmetry(elm.dropped_symmetry); structure->set_dropped_mu (elm.dropped_mu); } subjet.set_structure_shared_ptr(SharedPtr(structure)); } else { PseudoJet & subjet = mapped_to_history[history_index] = join(mapped_to_history[elm.child1_in_history], mapped_to_history[elm.child2_in_history]); StructureType * structure = new StructureType(subjet, sqrt(elm.theta_squared), elm.symmetry, sqrt(elm.mu2)); if (has_verbose_structure()){ structure->set_verbose(true); structure->set_dropped_delta_R (elm.dropped_delta_R); structure->set_dropped_symmetry(elm.dropped_symmetry); structure->set_dropped_mu (elm.dropped_mu); } subjet.set_structure_shared_ptr(SharedPtr(structure)); } } while (history_index>0); return mapped_to_history[0]; } // this routine applies the Soft Drop criterion recursively on the // CA tree, recursing into all the branches found during the previous iteration // until n layers have been found (or until it converges) PseudoJet RecursiveSoftDrop::result_fixed_depth(const PseudoJet &jet) const { // start by reclustering jet with C/A algorithm PseudoJet ca_jet = _recluster_if_needed(jet); if (! ca_jet.has_valid_cluster_sequence()){ throw Error("RecursiveSoftDrop can only be applied to jets associated to a (valid) cluster sequence"); } const ClusterSequence *cs = ca_jet.validated_cluster_sequence(); const vector &cs_history = cs->history(); const vector &cs_jets = cs->jets(); - // initialize counter to 1 subjet (i.e. the full ca_jet) + // initialise counter to 1 subjet (i.e. the full ca_jet) int n_depth = 0; int max_njet = ca_jet.constituents().size(); // create the list of branches unsigned int max_history_size = 2*max_njet; //if ((_n>0) && (_n history; history.reserve(max_history_size); // could be one shorter history.push_back(internal_recursive_softdrop::RSDHistoryElement(ca_jet, this, _R0sqr)); history.back().theta_squared = _R0sqr; // create a priority queue containing the subjets and a comparison definition - // initialize counter to 1 subjet (i.e. the full ca_jet) list active_branches; active_branches.push_back(& (history[0])); PseudoJet parent, piece1, piece2; while ((continue_grooming(n_depth)) && (active_branches.size())) { // loop over all the branches and look for substructure list::iterator hist_it=active_branches.begin(); while (hist_it!=active_branches.end()){ - // get the element corresponding to the max dR - // and the associated PJ + // get the element corresponding to the max dR and the associated PJ internal_recursive_softdrop::RSDHistoryElement * elm = (*hist_it); PseudoJet parent = cs_jets[cs_history[elm->current_in_ca_tree].jetp_index]; // we need to iterate this branch until we find some substructure PseudoJet result_sd; if (_dynamical_R0){ SoftDrop sd(_beta, _symmetry_cut, symmetry_measure(), sqrt(elm->theta_squared), mu_cut(), recursion_choice(), subtractor()); sd.set_reclustering(false); sd.set_verbose_structure(has_verbose_structure()); result_sd = sd(parent); } else { result_sd = SoftDrop::result(parent); } // if we had an empty PJ, that means we ran into some problems. // just return an empty PJ ourselves if (result_sd == 0) return PseudoJet(); // update the history element to reflect our iteration elm->current_in_ca_tree = result_sd.cluster_hist_index(); if (has_verbose_structure()){ elm->dropped_delta_R = result_sd.structure_of().dropped_delta_R(); elm->dropped_symmetry = result_sd.structure_of().dropped_symmetry(); elm->dropped_mu = result_sd.structure_of().dropped_mu(); } // if some substructure was found: if (result_sd.structure_of().has_substructure()){ // update the history element to reflect our iteration elm->child1_in_history = history.size(); elm->child2_in_history = history.size()+1; elm->theta_squared = result_sd.structure_of().delta_R(); elm->theta_squared *= elm->theta_squared; elm->symmetry = result_sd.structure_of().symmetry(); elm->mu2 = result_sd.structure_of().mu(); elm->mu2 *= elm->mu2; // the next iteration will have to handle 2 new history // elements (the R0squared argument here is unused) result_sd.has_parents(piece1, piece2); internal_recursive_softdrop::RSDHistoryElement elm1(piece1, this, _R0sqr); history.push_back(elm1); // insert it in the active branches if needed if (elm1.theta_squared>0) active_branches.insert(hist_it,&(history.back())); // insert just before internal_recursive_softdrop::RSDHistoryElement elm2(piece2, this, _R0sqr); history.push_back(elm2); if ((!_hardest_branch_only) && (elm2.theta_squared>0)){ active_branches.insert(hist_it,&(history.back())); // insert just before } } // otherwise we've just reached the end of the recursion the // history information has been updated above // // we just need to make sure that we do not recurse into that // element any longer list::iterator current = hist_it; ++hist_it; active_branches.erase(current); } // loop over branches at current depth ++n_depth; } // loop over depth // now we have a bunch of history elements that we can use to build the final jet vector mapped_to_history(history.size()); unsigned int history_index = history.size(); do { --history_index; const internal_recursive_softdrop::RSDHistoryElement & elm = history[history_index]; // two kinds of events: either just a final leave, poteitially with grooming // or a brandhing (also with potential grooming at the end) if (elm.child1_in_history<0){ // this is a leaf, i.e. with no further sustructure PseudoJet & subjet = mapped_to_history[history_index] = cs_jets[cs_history[elm.current_in_ca_tree].jetp_index]; StructureType * structure = new StructureType(subjet); if (has_verbose_structure()){ structure->set_verbose(true); } subjet.set_structure_shared_ptr(SharedPtr(structure)); } else { PseudoJet & subjet = mapped_to_history[history_index] = join(mapped_to_history[elm.child1_in_history], mapped_to_history[elm.child2_in_history]); StructureType * structure = new StructureType(subjet, sqrt(elm.theta_squared), elm.symmetry, sqrt(elm.mu2)); if (has_verbose_structure()){ structure->set_verbose(true); structure->set_dropped_delta_R (elm.dropped_delta_R); structure->set_dropped_symmetry(elm.dropped_symmetry); structure->set_dropped_mu (elm.dropped_mu); } subjet.set_structure_shared_ptr(SharedPtr(structure)); } } while (history_index>0); return mapped_to_history[0]; } //======================================================================== // implementation of the helpers //======================================================================== // helper to get all the prongs in a jet that has been obtained using // RecursiveSoftDrop (instead of recursively parsing the 1->2 // composite jet structure) vector recursive_soft_drop_prongs(const PseudoJet & rsd_jet){ // make sure that the jet has the appropriate RecursiveSoftDrop structure if (!rsd_jet.has_structure_of()) return vector(); // if this jet has no substructure, just return a 1-prong object if (!rsd_jet.structure_of().has_substructure()) return vector(1, rsd_jet); // otherwise fill a vector with all the prongs (no specific ordering) vector prongs; // parse the list of PseudoJet we still need to deal with vector to_parse = rsd_jet.pieces(); // valid both for a C/A recombination step or a RSD join unsigned int i_parse = 0; while (i_parse()) && (current.structure_of().has_substructure())){ // if this has some deeper substructure, add it to the list of // things to further process vector pieces = current.pieces(); assert(pieces.size() == 2); to_parse[i_parse] = pieces[0]; to_parse.push_back(pieces[1]); } else { // no further substructure, just add this as a branch prongs.push_back(current); ++i_parse; } } return prongs; } } FASTJET_END_NAMESPACE Index: contrib/contribs/RecursiveTools/trunk/ChangeLog =================================================================== --- contrib/contribs/RecursiveTools/trunk/ChangeLog (revision 1191) +++ contrib/contribs/RecursiveTools/trunk/ChangeLog (revision 1192) @@ -1,679 +1,688 @@ +2018-10-30 Gregory Soyez + + * RecursiveSoftDrop.cc: + fixed a few typos in comments + + * RecursiveSoftDrop.hh: + used the native FJ Recluster tool when available (did create + conflicts in some cases) + 2018-06-18 Jesse Thaler * README Fixed incorrect order of zcut and beta in the README for SoftDrop example. 2018-05-29 Jesse Thaler * VERSION * NEWS Changed to 2.0.0-beta2, noted in news 2018-04-21 Jesse Thaler * AUTHORS: updated arxiv number for RecursiveSoftDrop 2018-04-21 Gavin Salam * README: updated arxiv number for RecursiveSoftDrop & Bottom-up Soft Drop. 2018-04-04 Gregory Soyez * RecursiveSoftDrop.cc (contrib): fixed syntax of calls to structure_of<...> (thanks to Attila Krasznahorkay) 2018-01-24 Gregory Soyez * RecursiveSoftDrop.cc: for the (dafault) dynamical R0 implementation, the dynamical R0 is evolved independently in each branch. 2017-10-10 Jesse Thaler * AUTHORS Added mention of BUSD * README Some tweaks to the wording 2017-10-11 Gregory Soyez * IteratedSoftDrop.hh: IteratedSoftDropInfo::size() and multiplicity() now return an unsigned int instead of a double 2017-10-10 Jesse Thaler * AUTHORS Updated journal reference for ISD * example_isd.{cc,ref}: Included soft drop multiplicity in example * README Added warning at top that documentation has not been updated * VERSION Changed to 2.0.0-beta1 2017-10-10 Gregory Soyez * example_isd.ref: updated to reflect the bugfix below * IteratedSoftDrop.cc: fixed issue in description (was taking sqrt of -ve number when there were no angular cut) * NEWS: drafted for RecursiveTools-2.0.0-beta1 * TODO: updated list in view of a beta release * example_isd.cc: pointed to the right header for IteratedSoftDrop * RecursiveSoftDrop.{hh,cc}: * IteratedSoftDrop.{hh,cc}: moved IteratedSoftDrop to its own file (replacing the old implementation) * example_advanced_usage.ref: updated reference file following the fix below. 2017-09-28 Gregory Soyez * RecursiveSymmetryCutBase.cc: when no substructure is found, keep the _symmetry, _delta_R and _mu structure variables at -1. This for example allows one to trigger on substructure by checking if delta_R>=0. Note: we could set it to 0 (as it was before) and trigger using _delta_R>0 but there might be some genuine substructure exactly collinear. 2017-09-19 Gregory Soyez * example_isd.ref: updated to the latest version of the example 2017-09-18 Gregory Soyez * Makefile: updating make check to use all the examples (failing on ISD as expected, see below) * example_bottomup_softdrop.cc: fixed typo * example_bottomup_softdrop.ref: * example_recursive_softdrop.ref: added reference output for this example * RecursiveSoftDrop.{hh,cc}: * RecursiveSymmetryCutBase.{cc,hh}: moved the "all_prongs" method from the base structure t oa standalone function in RecursiveSoftDrop.hh In practice, this is irrelevant for mMDT and SD (since pieces() gets the job done, and the substructure class does not have (as is) reliable info to get the full structure) * RecursiveSymmetryCutBase.cc: revamped a series of requests for substructure info to better handle possible recursion into deeper jet substructure. * RecursiveSoftDrop.{hh,cc}: updated "description" to reuse the info from the base class * example_isd.cc: updated to use the newer implementation of ISD. Checked that it gives the same results as the former implementation. Note: make check still needs fixing because the example now computes a different set of angularities * RecursiveSoftDrop.hh: added a few helpers to IteratedSoftDropInfo ([] operator and size, meaning it can be used as a vector >) * RecursiveSymmetryCutBase.cc: . fixed bugs in the calculation of the geometric distances for ee coordinates . fixed bug in the computation of the (zg,thetag) pairs [it was returning the groomed ones instead of the ones passing the condition] * example_recursive_softdrop.cc: set the R0 parameter to the original jet radius 2017-09-13 Gregory Soyez * example_recursive_softdrop.cc: tied up a few comments and the code output * RecursiveSymmetryCutBase.{hh,cc}: removed the unneeded _is_composite * RecursiveSoftDrop.cc: fixed issue with "verbose" dropped info on branches with no further substructure 2017-09-11 Gregory Soyez * RecursiveSoftDrop.{hh,cc}: have IteratedSoftDDrop returning by default an object of type IteratedSoftDropInfo; added several helpers 2017-09-08 Gregory Soyez * RecursiveSoftDrop.{hh,cc}: updated IteratedSoftDrop to give it the flexibility of RecursiveSoftDrop * RecursiveSymmetryCutBase.hh: fixed typo in comment * example_mmdt_ee.cc: *** ADDED *** added an example to illustrat usage in ee collisions * example_isd.cc: * BottomUpSoftDrop.cc: * IteratedSoftDrop.cc: * RecursiveSoftDrop.cc: Fixed compilation issues with FJ 3.0 (mostly the usage of features introduced only in FJ3.1) * RecursiveSymmetryCutBase.{hh,cc}: used the internal Recluster class for FJ<3.1.0 and the FJ antive one for FJ>=3.1.0 * BottomUpSoftDrop.{hh,cc}: moved the implementation of global_grooming to the source file and fixed a few trivial compilation errors 2017-09-08 Frédéric Dreyer * BottomUpSoftDrop.hh: added the global_grooming method to process full event 2017-09-07 Gregory Soyez * RecursiveSoftDrop.cc: cleaned (mostly by removing older commented-out code) * RecursiveSoftDrop.{hh,cc}: * RecursiveSymmetryCutBase.{hh,cc}: * SoftDrop.cc: added support for ee coordinates. For that, the symmetry measure has to be set to either theta_E (which uses the 3-vector angle theta) or to cos_theta_E which uses sqrt(2*[1-cos(theta)]) Accordingly, the recursion_choice can be set to larger_E to recurse into the branch with the largest energy. The larger_m mode, recorsing into the larger-mass branch is also possible but not advised (for the same reason as the pp version). * RecursiveSymmetryCutBase.{hh,cc}: switched to the Recluster class provided with FastJet. ASlso included the recluster description to RecursiveSymmetryCutBase when it is user-defined. 2017-09-06 Gregory Soyez * BottomUpSoftDrop.{hh,cc}: . renamed SoftDropStructure -> BottomUpSoftDropStructure SoftDropRecombiner -> BottomUpSoftDropRecombiner SoftDropPlugin -> BottomUpSoftDropPlugin . moved 'description' to source file (instead of header) . kept the "area" information when available (jets will just appear as having a 0 area) . added most class description (main class still missing) * RecursiveSoftDrop.cc: . put internal classes to handle CS history in an internal namespace . replaced the "switch" in the mail loop by a series of if (allows us a few simplificatins/cleaning) . more uniform treatment of issues in the presence of an angular cut (as part of the above reorganisation) * example_advanced_usage.ref: updated reference output file following the bugfix (missing "grooming mode" initialisation in one of the SoftDrop ctors) on 2017-08-01 * RecursiveSymmetryCutBase.cc: removed redundent code 2017-08-10 Gregory Soyez * RecursiveSoftDrop.cc: fixed trivial typo in variable name >>>>>>> .r1071 2017-08-04 Gregory Soyez * RecursiveSoftDrop.cc: do not impose an angular cut in IterativeSD if it is -ve. 2017-08-01 Gregory Soyez * example_recursive_softdrop.cc: added a series of optional flags * RecursiveSoftDrop.cc: fixed a few issues with the fixed depth version * RecursiveSymmetryCutBase.hh: a jet is now considered as havig substructure if deltaR>0 (coherent with released version) * SoftDrop.hh: bugfix: set the "grooming mode" by default in all ctors EDIT: caused issue with make check, fixed on 2017-09-069 (see above) * RecursiveSoftDrop.{hh,cc}: added support for the "same depth" variant * RecursiveSymmetryCutBase.cc: also associate a RecursiveSymmetryCutBase::StructureType structure to the result jet in case it is just a single particle (in grooming mode) 2017-07-31 Gregory Soyez * RecursiveSymmetryCutBase.{hh,cc}: added the option to pass an extra parameter to the symmetry cut function * RecursiveSymmetryCutBase.{hh,cc}: * ModifiedMassDropTagger.hh * SoftDrop.hh: minor adaptions due to the above change + added a few methods to query the class information (symmetry cut, beta, ...) * RecursiveSoftDrop.{hh,cc}: Added support for - a dynamical R0 - recursing only in the hardest branch - imposing a min deltaR cut Added a tentative IterativeSoftDrop class 2017-07-28 Gregory Soyez * RecursiveSoftDrop.cc: adapted to the latest changes in RecursiveSymmetryCutBase * RecursiveSymmetryCutBase.{hh,cc}: reorganised the output of the recursion step (recurse_one_step) using an enum to make iot more readable (and to fix issues where the dropped prong is actually 0, e.g. after subtraction) 2017-07-26 Gregory Soyez * example_recursive_softdrop.cc: *** ADDED *** added a draft example for the use of RecursiveSoftDrop * RecursiveSoftDrop.{hh,cc}: *** ADDED *** added a first pass at an implementation of RecursiveSoftDrop. This is based on Frederic's initial version but keeps the branching structure of the jet. Some of the features, like dynamical R0, direct access to the substructure or the same depth variant, are still unsupported. * SoftDrop.hh: declared _beta, _symmetry_cut and _R0sqr as protected (was private) so they ca n be used by RecursiveSoftDrop * RecursiveSymmetryCutBase.{hh,cc}: extracted from result() the part that performs one step of the resursion (implemented as recurse_one_step()). This is repeatedly called by result(). It has specific conventions to indicate whether or not some substructure has been found or if one ran into some issue. 2017-04-25 Kevin Zhou * IteratedSoftDrop.hh . Added Doxygen documentation * RecursiveSymmetryCutBase.hh . Added references to ISD 2017-04-25 Jesse Thaler * AUTHORS, COPYING: . Added ISD arXiv number * example_isd.{cc,ref} . Added ISD arXiv number . Changing z_cut to be optimal value (with Lambda = 1 GeV) . Tweaked formatting * IteratedSoftDrop.{hh,cc} . Added ISD arXiv number . Assert added if recluster does not return one jet. * README . Added ISD arXiv number and tweaked wording 2017-04-20 Kevin Zhou * example_isd.{cc,ref} ** ADDED ** * IteratedSoftDrop.{cc,hh} ** ADDED ** * Makefile . Added IteratedSoftDrop (ISD) as appropriate * AUTHORS . Added myself to author list . Added placeholder for ISD paper * COPYING . Added placeholder for ISD paper * README . Added description of ISD * TODO . Added tasks to integrate ISD with other classes, e.g. SD, Recluster, and the future RecursiveSoftDrop (RSD) * NEWS . Added dummy for release of 1.1.0 * VERSION: . Switched version number to 1.1.0-dev * example_advanced_usage.cc: . Added $Id$ tag, didn't change anything else 2014-07-30 Gregory Soyez * Recluster.hh: fixed the name of the #define for the header 2014-07-09 Gregory Soyez + Jesse * NEWS: release of RecursiveTools v1.0.0 * VERSION: switched version number to 1.0.0 2014-07-08 Gavin Salam * README (RecursionChoice): added ref to .hh for constness specs of virtual functions (to reduce risk of failed overloading due to wrong constness). 2014-07-08 Gregory Soyez + Jesse * README: partially rewrote the description of set_subtractor 2014-07-07 Gregory Soyez + Jesse * example_advanced_usage.cc: * example_softdrop.cc: a few small fixed in the header of the files * VERSION: switched over to 1.0.0-alpha2-devel * README: Reordered a few things and added a few details. * Makefile (check): Be quiter during "make check" * Recluster.cc (contrib): Documented the "single" ctor argument * RecursiveSymmetryCutBase.cc (contrib): If the user sets himself the reclustering, disable the "non-CA" warning (we assume that he knows what he is doing). Mentioned in the comments that non-CA reclustering has to be used at the user's risk. Also throw when th input jet has no constituents or when there is no cluster sequence after reclustering. * Recluster.cc (contrib): replaced a remaining mention to "filtering" by reclustering 2014-07-04 Jesse Thaler * VERSION . Ready for alpha release 2014-06-17 Jesse Thaler * example_advanced_usage.{cc,ref} ** ADDED ** * Makefile . New example file to test a bunch of soft drop options . Put in makefile as well . Fixed nasty memory bug with pointers to Recluster * RecursiveSymmetryCutBase.cc * example_softdrop.ref . description() now says Groomer vs. Tagger * RecursiveSymmetryCutBase.{cc,hh} . Added optional verbose logging information about kinematics of dropped branches * example_softdrop.cc * example_advanced_usage.cc . Fixed 2014-06-16 Gregory Soyez * Makefile: also install the RecursiveSymmetryuCutBase.hh header 2014-06-13 Jesse Thaler * AUTHORS . Added myself to author list . Put complete bibliographic details on papers * COPYING . Added boilerplate MC/GPLv2 statement * example.cc: ** REMOVED ** renamed to... * example_mmdt.cc ** ADDED ** * Makefile . Made name change for consistency . Made corresponding changes in Makefile * example_mmdt_sub.cc: * example_mmdt.cc: * example_recluster.cc: . light editing of comments * example_softdrop.cc: . light editing of comments . added assert for sdjet != 0, since SoftDrop is a groomer * ModifiedMassDropTagger.hh * Recluster.{cc,hh} * RecursiveSymmetryCutBase.{cc,hh} * SoftDrop.hh . Updated some comments * README . Updated to include basic usage description and some technical details * TODO: . Added some discussion points. 2014-06-13 Gregory Soyez * example_softdrop.{cc,ref}: added an example for SoftDrop * SoftDrop.{hh,cc}: * ModifiedMassDropTagger.{hh,cc}: * RecursiveSymmetryCutBase.{hh,cc}: *** ADDED *** . added a base class for both the mMDT and SoftDrop . made mMDT and SoftDrop inherit from RecursiveSymmetryCutBase . moved the reclustering to the base class. By default, both mMDT and SoftDrop now recluster the jet with C/A . added set_grooming_mode and set_tagging_mode methods to the base class * Merging the development branch 1.0-beta1-softdrop-addition back into the trunk (will correspond to revision 682) * VERSION: switched back to 1.0.0-devel * SoftDrop.{hh,cc}: added support for re-clustering through set_reclustering(bool, Recluster*). By default, reclustering is done with Cambridge/Aachen. * example_recluster.{cc,ref}: *** ADDED *** added an example of reclustering * Recluster.{hh,cc}: added a 'single' ctor argument [true by default]. When true, the hardest jet after reclustering is returned, otherwise, the result is a composite jet with all the subjets as its pieces. 2014-05-15 Gregory Soyez * VERSION: set version number to 1.0-alpha-PUWS14.1 in preparation for a fastjet-contrib release for the pileup-workshop at CERN on May 2014. 2014-04-25 Gregory Soyez * ModifiedMassDropTagger.hh: * ModifiedMassDropTagger.cc: Added comments at various places * AUTHORS: * README: Updated info about what is now included in this contrib * SoftDrop.hh: *** ADDED *** * SoftDrop.cc: *** ADDED *** * Recluster.hh: *** ADDED *** * Recluster.cc; *** ADDED *** Added tools for reclustering and softDrop 2014-04-25 Gregory Soyez branch started at revision 611 to start including SoftDrop in the Recursivetols contrib 2014-04-24 Gregory Soyez * ModifiedMassDropTagger.hh: added a mention of the fact that when result is called in the presence of a subtractor, then the output is a subtracted PseudoJet. * ModifiedMassDropTagger.hh: declared _symmetry_cut as protected (rather than provate) so it can be accessed if symmetry_cut_description() is overloaded. * example.cc: trivial typo fixed in a comment 2014-02-04 Gavin Salam * VERSION: upped it to 1.0-beta1 * example_mmdt_sub.cc (main): added an #if to make sure FJ3.1 features are only used if FJ3.1 is available. (Currently FJ3.1 is only available to FJ developers). 2014-01-26 Gavin Salam * VERSION: renamed to 1.0-beta0 * ModifiedMassDropTagger.hh: * README: added info on author names * example_mmdt_sub.ref: *** ADDED *** added reference output for the pileup test. 2014-01-25 Gavin Salam * example_mmdt_sub.cc: * Makefile: added an extra example illustrating functionality with pileup subtraction. 2014-01-24 Gavin Salam * ModifiedMassDropTagger.cc: Reorganised code so that (sub)jet.m2()>0 check is only used when absolutely necessary: so if using a scalar_z symmetry measure, whenever scalar_z < zcut, then there is no point checking the mu condition. This means that there's no issue if the (sub)jet mass is negative, and one simply recurses down into the jet. (Whereas before it would bail out, reducing the tagging efficiency). Also removed the verbose code. 2014-01-23 Gavin Salam * ModifiedMassDropTagger.cc|hh: * example.cc replaced "asymmetry" with "symmetry" in a number of places; implemented the structural information and added it to the example; added a new simplified constructor; improved doxygen documentation; started renaming -> RecursiveTools * README some tidying * VERSION 1.0-b0 2014-01-22 Gavin Salam * ModifiedMassDropTagger.cc (contrib): -ve mass now bails out also when using the "y" asymmetry measure. Also, default my is now infinite. 2014-01-20 Gavin Salam + Gregory * ModifiedMassDropTagger.cc|hh: introduced a virtual asymmetry_cut_fn (essentially a dummy function returning a constant), to allow for derived classes to do fancier things. added warning about non-C/A clustering. explicitly labelled some (inherited) virtual functions as virtual. 2014-01-20 Gavin Salam * example.ref: * example.cc (main): got a first working example and make check setup. * ModifiedMassDropTagger.cc|hh: improved doxygen comments; added option whereby input jet is assumed already subtracted 2014-01-19 Gavin Salam * ModifiedMassDropTagger.cc|hh: * many other files Initial creation, with basic code for MMDT