Page MenuHomeHEPForge

No OneTemporary

Index: contrib/contribs/RecursiveTools/trunk/example_recluster.cc
===================================================================
--- contrib/contribs/RecursiveTools/trunk/example_recluster.cc (revision 1428)
+++ contrib/contribs/RecursiveTools/trunk/example_recluster.cc (revision 1429)
@@ -1,173 +1,177 @@
//----------------------------------------------------------------------
/// \file example_recluster.cc
///
/// This example program is meant to illustrate how the
-/// fastjet::contrib::ModifiedMassDropTagger class is used.
+/// fastjet::contrib::Recluster class is used.
///
/// Run this example with
///
/// \verbatim
/// ./example_recluster < ../data/single-event.dat
/// \endverbatim
+///
+/// Note that fastjet::contrib::Recluster is deprecated and you
+/// are advised to use fastjet::Recluster instead, which can be
+/// obtained by include "fastjet/tools/Recluster.hh".
//----------------------------------------------------------------------
// $Id$
//
// Copyright (c) 2014, Gavin P. Salam
//
//----------------------------------------------------------------------
// 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 <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
#include <iostream>
#include <sstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include "fastjet/ClusterSequence.hh"
#include "Recluster.hh" // In external code, this should be fastjet/contrib/Recluster.hh
using namespace std;
using namespace fastjet;
// forward declaration to make things clearer
void read_event(vector<PseudoJet> &event);
ostream & operator<<(ostream &, const PseudoJet &);
//----------------------------------------------------------------------
int main(){
//----------------------------------------------------------
// read in input particles
vector<PseudoJet> event;
read_event(event);
cout << "# read an event with " << event.size() << " particles" << endl;
double R = 1.0;
double ptmin = 20.0;
double Rsub = 0.3;
//----------------------------------------------------------
// start with an example from anti-kt jets
cout << "--------------------------------------------------" << endl;
JetDefinition jet_def_akt(antikt_algorithm, R);
ClusterSequence cs_akt(event, jet_def_akt);
vector<PseudoJet> jets_akt = sorted_by_pt(cs_akt.inclusive_jets(ptmin));
PseudoJet jet_akt = jets_akt[0];
cout << "Starting from a jet obtained from: " << jet_def_akt.description() << endl
<< " " << jet_akt << endl << endl;
// recluster with C/A ("infinite" radius)
contrib::Recluster recluster_ca_inf(cambridge_algorithm, JetDefinition::max_allowable_R);
PseudoJet rec_jet_ca_inf = recluster_ca_inf(jet_akt);
cout << "Reclustering with: " << recluster_ca_inf.description() << endl
<< " " << rec_jet_ca_inf << endl << endl;;
// recluster with C/A (small radius), keeping all subjets
contrib::Recluster recluster_ca_sub(cambridge_algorithm, Rsub, false);
PseudoJet rec_jet_ca_sub = recluster_ca_sub(jet_akt);
cout << "Reclustering with: " << recluster_ca_sub.description() << endl
<< " " << rec_jet_ca_sub << endl;
vector<PseudoJet> pieces = rec_jet_ca_sub.pieces();
cout << " subjets: " << endl;
for (unsigned int i=0;i<pieces.size();i++)
cout << " " << pieces[i] << endl;
cout << endl;
// recluster with kt (small radius), keeping all subjets
contrib::Recluster recluster_kt_sub(kt_algorithm, Rsub, false);
PseudoJet rec_jet_kt_sub = recluster_kt_sub(jet_akt);
cout << "Reclustering with: " << recluster_kt_sub.description() << endl
<< " " << rec_jet_kt_sub << endl;
pieces = rec_jet_kt_sub.pieces();
cout << " subjets: " << endl;
for (unsigned int i=0;i<pieces.size();i++)
cout << " " << pieces[i] << endl;
cout << endl;
//----------------------------------------------------------
// now an example starting from C/A jets
cout << "--------------------------------------------------" << endl;
JetDefinition jet_def_ca(cambridge_algorithm, R);
ClusterSequence cs_ca(event, jet_def_ca);
vector<PseudoJet> jets_ca = sorted_by_pt(cs_ca.inclusive_jets(ptmin));
PseudoJet jet_ca = jets_ca[0];
cout << "Starting from a jet obtained from: " << jet_def_ca.description() << endl
<< " " << jet_ca << endl << endl;
// recluster with C/A ("infinite" radius)
rec_jet_ca_inf = recluster_ca_inf(jet_ca);
cout << "Reclustering with: " << recluster_ca_inf.description() << endl
<< " " << rec_jet_ca_inf << endl << endl;
// recluster with C/A (small radius), keeping all subjets
rec_jet_ca_sub = recluster_ca_sub(jet_ca);
cout << "Reclustering with: " << recluster_ca_sub.description() << endl
<< " " << rec_jet_ca_sub << endl;
pieces = rec_jet_ca_sub.pieces();
cout << " subjets: " << endl;
for (unsigned int i=0;i<pieces.size();i++)
cout << " " << pieces[i] << endl;
cout << endl;
// recluster with kt (small radius), keeping all subjets
rec_jet_kt_sub = recluster_kt_sub(jet_ca);
cout << "Reclustering with: " << recluster_kt_sub.description() << endl
<< " " << rec_jet_kt_sub << endl;
pieces = rec_jet_kt_sub.pieces();
cout << " subjets: " << endl;
for (unsigned int i=0;i<pieces.size();i++)
cout << " " << pieces[i] << endl;
cout << endl;
return 0;
}
//----------------------------------------------------------------------
/// read in input particles
void read_event(vector<PseudoJet> &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()
<< " ClusSeq = " << (jet.has_associated_cs() ? "yes" : "no");
}
return ostr;
}
Index: contrib/contribs/RecursiveTools/trunk/NEWS
===================================================================
--- contrib/contribs/RecursiveTools/trunk/NEWS (revision 1428)
+++ contrib/contribs/RecursiveTools/trunk/NEWS (revision 1429)
@@ -1,15 +1,16 @@
+2024/10/04: release of version 2.0.3, resolving use of wrong Recluster.hh in RecursiveSoftDrop.hh
2024/02/22: release of version 2.0.2, addressing rounding issue in recursive soft drop example
2021/08/21: release of version 2.0.1, addressing rare divide-by-zero in calculation of mu2
2020/03/03: release of version 2.0.0 with updated readme
2018/05/31: release of version 2.0.0-beta2 with corrected syntax
2017/10/10: release of version 2.0.0-beta1 including implementations of
* RecursiveSoftDrop (see example_rsd.hh for usage)
* IteratedSoftDrop (see example_isd.hh for usage)
* e+e- version of the recursive tools (see example_mmdt_ee.hh for usage)
* BottomUpSoftDrop (see example_bottomup_softdrop.cc for usage)
2014/07/09: release of version 1.0.0 of RecursiveTools including
ModifiedMassDropTagger and SoftDrop (as well as Recluster)
Index: contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.hh
===================================================================
--- contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.hh (revision 1428)
+++ contrib/contribs/RecursiveTools/trunk/RecursiveSoftDrop.hh (revision 1429)
@@ -1,212 +1,214 @@
// $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 <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
#ifndef __RECURSIVESOFTDROP_HH__
#define __RECURSIVESOFTDROP_HH__
+#include "fastjet/config.h"
+
// 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 <iostream>
#include <queue>
#include <vector>
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<PseudoJet> * 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<double>::infinity(),
RecursionChoice recursion_choice = larger_pt,
const FunctionOfPseudoJet<PseudoJet> * 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<PseudoJet> 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/ChangeLog
===================================================================
--- contrib/contribs/RecursiveTools/trunk/ChangeLog (revision 1428)
+++ contrib/contribs/RecursiveTools/trunk/ChangeLog (revision 1429)
@@ -1,718 +1,740 @@
+2024-10-04 Fri <gavin.salam@physics.ox.ac.uk>
+
+ * VERSION:
+ * NEWS:
+ prepared for release of version 2.0.3
+
+ * RecursiveSoftDrop.hh:
+ added missing #include "fastjet/config.h"; without it the wrong
+ Recluster.hh was being used (contrib rather than fastjet/tools)
+ which was inconsistent with derivation from SoftDrop. This was
+ the cause of a bug reported at https://bugs.gentoo.org/863278
+ and followed up by Eli Schwartz.
+
+ * Recluster.hh:
+ * example_recluster.cc:
+ added comments labelling this contrib/s Recluster.hh as deprecated
+ (but did not explicitly add C++ deprecation warnings yet). Use
+ fastjet::Recluster from "fastjet/tools/Recluster.hh" instead
+ (available since fj 3.1.0).
+
+
+
2024-02-22 Jesse Thaler <jthaler@jthaler.net>
* Makefile
Removing extraneous "-lm"
* NEWS:
* VERSION:
Changed version to 2.0.2 in preparation for release.
* example_recursive_softdrop.cc
* example_recursive_softdrop.ref
Added "fixed" and "setprecision" to output
2021-08-21 Sat <gavin.salam@physics.ox.ac.uk>
* NEWS:
* VERSION:
Changed version to 2.0.1 in preparation for release.
2021-08-16 Mon <gavin.salam@physics.ox.ac.uk>
* RecursiveSymmetryCutBase.cc:
added fix for issue signalled by Pierre-Antoine Delsart
(rare divide by zero in calculation of mu2; now mu2 gets set to -1
when the parent mass is <= 0)
2018-11-02 Jesse Thaler <jthaler@jthaler.net>
* AUTHORS: updated journal for RecursiveSoftDrop
2018-10-30 Gregory Soyez <soyez@fastjet.fr>
* 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 <jthaler@jthaler.net>
* README
Fixed incorrect order of zcut and beta in the README for SoftDrop example.
2018-05-29 Jesse Thaler <jthaler@jthaler.net>
* VERSION
* NEWS
Changed to 2.0.0-beta2, noted in news
2018-04-21 Jesse Thaler <jthaler@jthaler.net>
* AUTHORS: updated arxiv number for RecursiveSoftDrop
2018-04-21 Gavin Salam <gavin.salam@cern.ch>
* README: updated arxiv number for RecursiveSoftDrop & Bottom-up
Soft Drop.
2018-04-04 Gregory Soyez <soyez@fastjet.fr>
* RecursiveSoftDrop.cc (contrib):
fixed syntax of calls to structure_of<...>
(thanks to Attila Krasznahorkay)
2018-01-24 Gregory Soyez <soyez@fastjet.fr>
* RecursiveSoftDrop.cc:
for the (dafault) dynamical R0 implementation, the dynamical R0 is
evolved independently in each branch.
2017-10-10 Jesse Thaler <jthaler@jthaler.net>
* AUTHORS
Added mention of BUSD
* README
Some tweaks to the wording
2017-10-11 Gregory Soyez <soyez@fastjet.fr>
* IteratedSoftDrop.hh:
IteratedSoftDropInfo::size() and multiplicity() now return an
unsigned int instead of a double
2017-10-10 Jesse Thaler <jthaler@jthaler.net>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* example_isd.ref:
updated to the latest version of the example
2017-09-18 Gregory Soyez <soyez@fastjet.fr>
* 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<pair<double,double> >)
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* RecursiveSoftDrop.{hh,cc}:
have IteratedSoftDDrop returning by default an object of type
IteratedSoftDropInfo; added several helpers
2017-09-08 Gregory Soyez <soyez@fastjet.fr>
* 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 <frederic.dreyer@gmail.com>
* BottomUpSoftDrop.hh:
added the global_grooming method to process full event
2017-09-07 Gregory Soyez <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* RecursiveSoftDrop.cc:
fixed trivial typo in variable name
>>>>>>> .r1071
2017-08-04 Gregory Soyez <soyez@fastjet.fr>
* RecursiveSoftDrop.cc:
do not impose an angular cut in IterativeSD if it is -ve.
2017-08-01 Gregory Soyez <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <knzhou@mit.edu>
* IteratedSoftDrop.hh
. Added Doxygen documentation
* RecursiveSymmetryCutBase.hh
. Added references to ISD
2017-04-25 Jesse Thaler <jthaler@jthaler.net>
* 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 <knzhou@mit.edu>
* 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 <soyez@fastjet.fr>
* Recluster.hh: fixed the name of the #define for the header
2014-07-09 Gregory Soyez <soyez@fastjet.fr> + Jesse
* NEWS:
release of RecursiveTools v1.0.0
* VERSION:
switched version number to 1.0.0
2014-07-08 Gavin Salam <gavin.salam@cern.ch>
* 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 <soyez@fastjet.fr> + Jesse
* README:
partially rewrote the description of set_subtractor
2014-07-07 Gregory Soyez <soyez@fastjet.fr> + 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 <jthaler@jthaler.net>
* VERSION
. Ready for alpha release
2014-06-17 Jesse Thaler <jthaler@jthaler.net>
* 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 <soyez@fastjet.fr>
* Makefile:
also install the RecursiveSymmetryuCutBase.hh header
2014-06-13 Jesse Thaler <jthaler@jthaler.net>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
* 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 <soyez@fastjet.fr>
branch started at revision 611 to start including SoftDrop in the
Recursivetols contrib
2014-04-24 Gregory Soyez <soyez@fastjet.fr>
* 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 <gavin.salam@cern.ch>
* 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 <gavin.salam@cern.ch>
* 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 <gavin.salam@cern.ch>
* example_mmdt_sub.cc:
* Makefile:
added an extra example illustrating functionality with pileup
subtraction.
2014-01-24 Gavin Salam <gavin.salam@cern.ch>
* 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 <gavin.salam@cern.ch>
* 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 <gavin.salam@cern.ch>
* 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 <gavin.salam@cern.ch> + 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 <gavin.salam@cern.ch>
* 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 <gavin.salam@cern.ch>
* ModifiedMassDropTagger.cc|hh:
* many other files
Initial creation, with basic code for MMDT
Index: contrib/contribs/RecursiveTools/trunk/Recluster.hh
===================================================================
--- contrib/contribs/RecursiveTools/trunk/Recluster.hh (revision 1428)
+++ contrib/contribs/RecursiveTools/trunk/Recluster.hh (revision 1429)
@@ -1,183 +1,186 @@
#ifndef __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__
#define __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__
// $Id$
//
// Copyright (c) 2014-, Matteo Cacciari, Gavin P. Salam and 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 <http://www.gnu.org/licenses/>.
//----------------------------------------------------------------------
#include <fastjet/JetDefinition.hh>
#include <fastjet/CompositeJetStructure.hh> // to derive the ReclusterStructure from CompositeJetStructure
#include <fastjet/tools/Transformer.hh> // to derive Recluster from Transformer
#include <iostream>
#include <string>
FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
namespace contrib{
//----------------------------------------------------------------------
/// \class Recluster
-/// Class that helps reclustering a jet with a new jet definition
+/// Class that helps reclustering a jet with a new jet definition.
+///
+/// **This class is DEPRECATED and you are advised to use the
+/// fastjet::Recluster class instead, from "fastjet/tools/Recluster.hh".**
///
/// The result of the reclustering is returned as a single PseudoJet
/// with a CompositeJet structure. The pieces of that PseudoJet will
/// be the individual subjets
///
/// When constructed from a JetDefinition, that definition will be
/// used to obtain the subjets. When constructed from a JetAlgorithm
/// and parameters (0 parameters for e+e-, just R or R and an extra
/// parameter for others) the recombination scheme will be taken as
/// the same one used to initially cluster the original jet.
///
/// The result of this transformer depends on its usage. There are two
/// typical use-cases: either we recluster one fat jet into subjets,
/// OR, we recluster the jet with a different jet alg. When Recluster
/// is created from a full jet definition. The last parameter of the
/// constructors below dicatate that behaviour: if "single" is true
/// (the default), a single jet, issued from a regular clustering is
/// returned (if there are more than one, the hardest is taken);
/// otherwise (single==false), the result will be a composite jet with
/// each subjet as pieces
///
/// Open points for discussion:
///
/// - do we add an option to force area support? [could be useful
/// e.g. for the filter with a subtractor where area support is
/// mandatory]
///
class Recluster : public Transformer {
public:
/// define a recluster that decomposes a jet into subjets using a
/// generic JetDefinition
///
/// \param subjet_def the jet definition applied to obtain the subjets
/// \param single when true, cluster the jet in a single jet (the
/// hardest one) with an associated ClusterSequence,
/// otherwise return a composite jet with subjets
/// as pieces.
Recluster(const JetDefinition & subjet_def, bool single=true)
: _subjet_def(subjet_def), _use_full_def(true), _single(single) {}
/// define a recluster that decomposes a jet into subjets using a
/// JetAlgorithm and its parameters
///
/// \param subjet_alg the jet algorithm applied to obtain the subjets
/// \param subjet_radius the jet radius if required
/// \param subjet_extra optional extra parameters for the jet algorithm (only when needed)
/// \param single when true, cluster the jet in a single jet (the
/// hardest one) with an associated ClusterSequence,
/// otherwise return a composite jet with subjets
/// as pieces.
///
/// Typically, for e+e- algoriothm you should use the third version
/// below with no parameters, for "standard" pp algorithms, just the
/// clustering radius has to be specified and for genkt-type of
/// algorithms, both the radius and the extra parameter have to be
/// specified.
Recluster(JetAlgorithm subjet_alg, double subjet_radius, double subjet_extra,
bool single=true)
: _subjet_alg(subjet_alg), _use_full_def(false),
_subjet_radius(subjet_radius), _has_subjet_radius(true),
_subjet_extra(subjet_extra), _has_subjet_extra(true), _single(single) {}
Recluster(JetAlgorithm subjet_alg, double subjet_radius, bool single=true)
: _subjet_alg(subjet_alg), _use_full_def(false),
_subjet_radius(subjet_radius), _has_subjet_radius(true),
_has_subjet_extra(false), _single(single) {}
Recluster(JetAlgorithm subjet_alg, bool single=true)
: _subjet_alg(subjet_alg), _use_full_def(false),
_has_subjet_radius(false), _has_subjet_extra(false), _single(single) {}
/// default dtor
virtual ~Recluster(){};
//----------------------------------------------------------------------
// standard Transformer behaviour inherited from the base class
// (i.e. result(), description() and structural info)
/// runs the reclustering and sets kept and rejected to be the jets of interest
/// (with non-zero rho, they will have been subtracted).
///
/// \param jet the jet that gets reclustered
/// \return the reclustered jet
virtual PseudoJet result(const PseudoJet & jet) const;
/// class description
virtual std::string description() const;
// the type of the associated structure
typedef CompositeJetStructure StructureType;
private:
/// set the reclustered elements in the simple case of C/A+C/A
void _recluster_cafilt(const std::vector<PseudoJet> & all_pieces,
std::vector<PseudoJet> & subjets,
double Rfilt) const;
/// set the reclustered elements in the generic re-clustering case
void _recluster_generic(const PseudoJet & jet,
std::vector<PseudoJet> & subjets,
const JetDefinition & subjet_def,
bool do_areas) const;
// a series of checks
//--------------------------------------------------------------------
/// get the pieces down to the fundamental pieces
bool _get_all_pieces(const PseudoJet &jet, std::vector<PseudoJet> &all_pieces) const;
/// get the common recombiner to all pieces (NULL if none)
const JetDefinition::Recombiner* _get_common_recombiner(const std::vector<PseudoJet> &all_pieces) const;
/// construct the proper jet definition ensuring that the recombiner
/// is taken from the underlying pieces (an error is thrown if the
/// pieces do no share a common recombiner)
void _build_jet_def_with_recombiner(const std::vector<PseudoJet> &all_pieces,
JetDefinition &subjet_def) const;
/// check if one can apply the simplified trick for C/A subjets
bool _check_ca(const std::vector<PseudoJet> &all_pieces,
const JetDefinition &subjet_def) const;
/// check if the jet (or all its pieces) have explicit ghosts
/// (assuming the jet has area support
///
/// Note that if the jet has an associated cluster sequence that is no
/// longer valid, an error will be thrown
bool _check_explicit_ghosts(const std::vector<PseudoJet> &all_pieces) const;
JetDefinition _subjet_def; ///< the jet definition to use to extract the subjets
JetAlgorithm _subjet_alg; ///< the jet algorithm to be used
bool _use_full_def; ///< true when the full JetDefinition is supplied to the ctor
double _subjet_radius; ///< the jet radius (only if needed for the jet alg)
bool _has_subjet_radius; ///< the subjet radius has been specified
double _subjet_extra; ///< the jet alg extra param (only if needed)
bool _has_subjet_extra; ///< the extra param has been specified
bool _single; ///< (true) return a single jet with a
///< regular clustering or (false) a
///< composite jet with subjets as pieces
static LimitedWarning _explicit_ghost_warning;
};
} // namespace contrib
FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh
#endif // __FASTJET_CONTRIB_TOOLS_RECLUSTER_HH__
Index: contrib/contribs/RecursiveTools/trunk/VERSION
===================================================================
--- contrib/contribs/RecursiveTools/trunk/VERSION (revision 1428)
+++ contrib/contribs/RecursiveTools/trunk/VERSION (revision 1429)
@@ -1 +1 @@
-2.0.2
+2.0.3

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 6:34 PM (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805619
Default Alt Text
(48 KB)

Event Timeline