Index: contrib/contribs/Nsubjettiness/trunk/NEWS =================================================================== --- contrib/contribs/Nsubjettiness/trunk/NEWS (revision 1399) +++ contrib/contribs/Nsubjettiness/trunk/NEWS (revision 1400) @@ -1,106 +1,108 @@ ------------------------- Version 2 ------------------------- This is a streamlining of the N-subjettiness code, developed mainly by TJ Wilkason. The core functionality is unchanged, but classes have been dramatically reorganized to allow for later expansion. Because the API for Njettiness has changed, we have called this v2 (http://semver.org). Note that we have maintain backwards compatibility for the typical ways that Nsubjettiness was used. In particular, all of the Nsubjettiness class code in the example file from v1.0.3 still compiles, as does the NjettinessPlugin class code that uses the default measure. The key new features are: * NsubjettinessRatio: Direct access to tau_N / tau_M (the most requested feature) * MeasureDefinition to allow access to normalized and unnormalized measures * AxesDefinition to allow for access to more general axes modes * Winner-Take-All recombination axes: a faster way to find axes than beta=1 minimization, but with comparable performance. * TauComponents to get access to the pieces of the N-(sub)jettiness calculation. * TauExtras to get complete access to get partitioning and axes information. * For clarity, split the example file into an example_basic_usage and example_advanced_usage. * In Nsubjettiness, access to seedAxes() and currentAxes() to figure out the axes used before and after minimization. * In Nsubjettiness, access to currentSubjets() to get the subjet fourvectors. * (v2.2) XConePlugin, which improves on the previous NjettinessPlugin to use N-jettiness as a jet finder using the new ConicalGeometric measure. +-- 2.3.1: (February 27, 2024) Fixing unsigned int warning in AxesDefinition.hh + (thanks Gregory Soyez) -- 2.3.0: (February 23, 2024) Changed recommended axes away from OnePass; added HalfKT axes options recommended for beta = 2; updated example files; removed ee testing since ee axes choices are not available -- 2.2.6: (June 13, 2022) Removed "static" for thread safety (thanks Tomek Procter and Andy Buckley) -- 2.2.5: (June 6, 2018) Fixed bug involved undefined pointer for in AxesDefinition (thanks Attila Krasznahorkay) -- 2.2.4: (Jun 14, 2016) Fixed bug where multi-pass minimization could yield pathological axes (thanks Gregory Soyez) -- 2.2.3: (Apr 4, 2016) Fixed bug where a jet with fewer than N constituents could give random value for tau_N (thanks Nathan Hartland) -- 2.2.2: (Mar 29, 2016) Updating SharedPtr interface for FJ 3.2 -- 2.2.1: (Sept 28, 2015) Fix of small Makefile bug -- 2.2.0: (Sept 7, 2015) Inclusion of the XCone jet algorithm, as well as a few new measures, including the "conical geometric" measure and options for e+e- colliders. Improvement of the Measure/AxesDefinition interface to allow for direct use in calculations. * Fixed bug where MultiPass_Axes did not actually minimize * Fixed floating point error with infinity^2 in various measures -- 2.1.0: (July 9, 2014) Inclusion of Measure/AxesDefinition interface. This was the first publicly available version of Nsubjettiness v2. -- 2.0.0: Initial release of v2.0. This was never officially made public. ------------------------- Version 1 ------------------------- This was a new release using FastJet contrib framework, primary developed by Jesse Thaler. -- 1.0.3: Added inlines to fix compile issue (thanks Matthew Low) -- 1.0.2: Fixed potential dependency issue (thanks FJ authors) -- 1.0.1: Fixed memory leak in Njettiness.hh (thanks FJ authors) -- 1.0.0: New release using FastJet contrib framework. This includes a new makefile and a simplified example program. ------------------------- Previous Versions ------------------------- The previous versions of this code were developed initially by Ken Van Tilburg, tweaked by Jesse Thaler, and made into a robust FastJet add on by Chris Vermilion. Previous versions available from: http://jthaler.net/jets/Njettiness-0.5.1.tar.gz (Experimental Version) http://jthaler.net/jets/Njettiness-0.4.1.tar.gz (Stable Version) Previous version history: -- 0.5.1: For Njettiness Plugin, added access to currentTau values and axes via ClusterSequence::Extras class. (thanks to Dinko Ferencek and John Paul Chou) -- 0.5.0: Corrected fatal error in ConstituentTauValue (TauValue unaffected). Started process of allowing for more general measures and alternative minimization schemes. Extremely preliminary inclusion of alternative "geometric" measure. -- 0.4.1: Corrected bug where a too-small value of Rcut would cause the minimization procedure to fail (thanks Marat Freytsis, Brian Shuve) -- 0.4.0: Adding Nsubjettiness FunctionOfPseudoJet. Re-organizing file structure and doing some re-naming to clarify Njettiness vs. Nsubjettiness. Some speedup in UpdateAxes code. (CKV) -- 0.3.2: Returns zero instead of a segmentation fault when the number of particles in a jet is smaller than the N value in tau_N (thanks Grigory Ovanesyan) -- 0.3.2: Fixed -Wshadow errors (thanks Grigory Ovanesyan) -- 0.3.1: Fixed stray comma/semicolon compiler error (thanks Grigory Ovanesyan) -- 0.3.1: Corrected tarbomb issue (thanks Jonathan Walsh) -- 0.3.1: Added anti-kT seeds as option -- 0.3.1: Fixed bug in minimization code with R_cutoff (thanks Chris Vermilion) -- 0.3.1: Added getPartition() and getJets() functions as helper functions for Chris Vermilion. (JT) Index: contrib/contribs/Nsubjettiness/trunk/ChangeLog =================================================================== --- contrib/contribs/Nsubjettiness/trunk/ChangeLog (revision 1399) +++ contrib/contribs/Nsubjettiness/trunk/ChangeLog (revision 1400) @@ -1,345 +1,348 @@ +2024-02-27 + Fixing unsigned int warning in AxesDefinition.hh + Updated README and VERSION getting ready for v2.3.1 release 2024-02-22 Updated README and VERSION getting ready for v2.3.0 release Removed extraneous "-lm" from Makefile Added HalfKT options to AxesDefinition.hh Updated example files with new recommended usage and higher accuracy for OnePass minimization Removed "ee" example file, since it uses ee measure with pp axes (ee axes not available in current version) 2022-06-13 Removed -std=c++11 flag from makefile Updated MeasureDefinition.cc to remove "static thread_local" (since it doesn't really seem to help with timing) 2022-06-10 Updated makefile with -std=c++11 flag Updated MeasureDefinition.cc with thread_local for thread safety 2018-07-06 Updated comments in AxesDefinition.hh about role of JetDefinitionWrapper Updated AUTHORS with JHEP publication information for XCone Prepared VERSION and NEWS for 2.2.5 release 2018-07-05 Fixed bug in AxesDefinition.hh where _recomb was used before it was declared. 2016-06-08 Fixed bug in MeasureDefinition.cc where axes were not completely defined, leading to problems with multi-pass axes 2016-04-04 Fixed Njettiness.cc to give value of _current_tau_components even if less than N constituents Delete extraneous code in example_advanced_usage.cc 2016-03-29 Update for FJ 3.2.0 to deal with SharedPtr () deprecation 2015-09-28 Updated NEWS for 2.2.1 release. 2015-09-18 Fixed duplicate XConePlugin entry in Makefile. 2015-08-20 Trying to fix "abs" bug in ExtraRecombiners.cc 2015-08-19 Adding arXiv numbers to XCone papers Used this_jet in example_basic_usage. Fixed typo in example_advanced_usage header. Added copy/paste code in README file. 2015-08-13 Ready for 2.2.0 release 2015-07-23 Fixed typo in GenET_GenKT_Axes error message Added _too_few_axes_warning to ExclusiveJetAxes and ExclusiveCombinatorialJetAxes Switched to ../data/single_event_ee.dat for make check 2015-07-20 Renamed WinnerTakeAllRecombiner.hh/cc to ExtraRecombiners.hh/cc Added _too_few_axes_warning to HardestJetAxes Added GenKT_Axes and OnePass_GenKT_Axes and Comb_GenKT_Axes (using E-scheme recombination). Added warning about p < 0 or delta <=0 in GenKT axes finders. Added warning about beta <= 0 in all measures. 2015-07-10 Putting in small tweaks in documentation to get ready for 2.2 release candidate 1. 2015-06-15 Starting doxygen file for eventual improved documentation. Starting long process of improving documentation throughout. Made the basic usage file a bit easier to read. Adding in LimitedWarnings for old style constructors 2015-06-12 Synchronized definition of new measures with XCone paper. In MeasureDefinition, added default values of jet_distance_squared and beam_distance_squared for cases where we don't want to optimize specifically. Fixed bug in OriginalGeometricMeasure and ModifiedGeometric Measure Commented out DeprecatedGeometricMeasure and DeprecatedGeometricCutoffMeasure since they were only causing confusion 2015-05-26 Removed axis_scale_factor(), added bool to calculate this value if needed to save computation time Defined small offset in denominator of axis scaling according to accuracy of refinement Updated advanced examples to include tau values and number of jet constituents 2015-05-25 Clean up of AxesDefinition Splitting get_axes into get_starting_axes and get_refined axes Putting in proper noise ranges (hopefully) for MultiPass Clean up of MeasureDefinition, rename jet_gamma to beam_gamma Put in zero checking for jet_distance in ConicalGeometricMeasure Added in ConicalMeasure for consistency Changing OnePass Minimization to allow for temporary uphill 2015-05-24 Added Combinatorial GenET_GenKT_Axes and MultiPass_Manual_Axes Moved Axes refining information into MeasureDefinition, associated each measure with corresponding axes refiner Moved get_one_pass_axes into MeasureDefinition, removed any mention of Npass Moved all information on number of passes to AxesDefinition Made AxesRefiner.hh/.cc into defunct files 2015-05-22 Cleaning out commented text. Renaming classes to be consistent with recommended usage. 2015-05-22 Added XConePlugin as a specific implementation of NjettinessPlugin Added usage of XCone beta = 1.0 and beta = 2.0 to both basic and advanced example files Added OriginalGeometric, ModifiedGeometric, ConicalGeometric, and XCone measures to list of test measures Added OnePass_GenRecomb_GenKT_Axes to list of test axes Added description to XCone measure in MeasureDefinition 2015-05-21 Updated minimization scheme to avoid divide-by-zero errors Fixed various factors of 2 in the definition of the measures 2015-04-19 Fixed bug in minimization scheme for GeneralAxesRefiner Moved measure_type to DefaultMeasure, removed geometric measure from e+e- example file 2015-03-22 Added OriginalGeometricMeasure and ModifiedGeometricMeasure definitions Changed all instances of GeometricMeasure to DeprecatedGeometricMeasure, and added error statements Made GeneralAxesRefiner the default axes refiner for Measure Definition, overwritten by DefaultMeasure and GeometricMeasure Created DefaultMeasure class for all the conical measure subclasses Separated out e+e- and pp measures into separate example files 2015-03-09 Added ConicalGeometric measures with jet_beta and jet_gamma definitions Added XCone measures derived from ConicalGeometric with jet_gamma = 1.0 Added GeneralAxesRefiner for use with any measure (currently defined with XCone measure) Added axes_numerator in MeasureDefinition to define the momentum scaling for minimization (currently only defined for Conical Geometric measure) 2014-11-28 Minor change to default parameters in axes definition 2014-10-08 Updated example file with new e+e- measure definitions Added measure type to measure definition descriptions Changed order of parameters in new axes definitions Added standard C++ epsilon definition to GeneralERecombiner 2014-10-07 Updated example_advanced_usage with new axes choices Reversed inheritance of NormalizedMeasure and NormalizedCutoffMeasure (and Geometric) back to original Storing _RcutoffSq as separate variable, and recalculating it in NormalizedMeasure Cleaning up ExclusiveCombinatorialJetAxes and added comments to explain the process Fixed memory leaks using delete_recombiner_when_unused() Fixed manual axes bug in Njettiness Cleaned up enum definitions 2014-10-01 Added new parameterized recombination scheme to Winner-Take-All recombiner Created Winner-Take-All GenKT and general Recomb GenKT axes finders and onepass versions Created new N choose M minimization axis finder, created N choose M WTA GenKT axis finder as example Removed NPass as constructor argument in AxesDefinition, made it set through protected method Removed TauMode as constructor argument in MeasureDefinition, made it set through protected method Flipped inheritance of NormalizedMeasure and NormalizedCutoffMeasure (same for Geometric) to remove error of squaring the integer maximum Created new MeasureType enum to allow user to choose between pp and ee variables (ee variables need testing) Updated MeasureDefinition constructors to take in extra MeasureType parameter (but defaulted to pp variables) Added new Default TauMode argument Fixed unsigned integers in various places Added setAxes method to NjettinessPlugin 2014-08-26 Enhanced TauComponents to include more infomation NjettinessExtras now inherits from TauComponents Removed getPartition from Njettiness, to avoid code duplication Fixed double calculating issue in NjettinessPlugin::run_clustering() Now AxesDefinition can use measure information without running AxesRefiner Added TauStructure so the jets returned by TauComponents can know their tau value. 2014-08-25 Merged MeasureDefinition and MeasureFunction into new MeasureDefinition. Merged StartingAxesFinder and AxesDefinition into new AxesDefinition. Renamed AxesFinder.cc/hh to AxesRefiner.cc/hh Renamed NjettinessDefinition.cc/hh to AxesDefinition.cc/hh Renamed MeasureFunction.cc/hh to MeasureDefinition.cc/hh Renaming result() function in MeasureDefinition to be consistent with Nsubjettiness interface. Split off TauComponents into separate header Added TauPartition class for readability of partitioning Moved NjettinessExtras into TauComponents, as this will eventually be the logical location Added cross check of new MeasureDefinition and AxesDefinition in example_advanced_usage. Lots of comments updated. Changed version number to 2.2.0-alpha-dev, since this is going to be a bigger update than I had originally thought 2014-08-20 Incorporated code in NjettinessPlugin to handle FJ3.1 treatment of auto_ptr (thanks Gregory) Changed version number to 2.1.1-alpha-dev Split AxesFinder into StartingAxesFinder and RefiningAxesFinder for clarity. Manual axes mode now corresponds to a NULL StartingAxesFinder in Njettiness (so removed AxesFinderFromUserInput) Added AxesRefiningMode to make selection of minimization routine more transparent in Njettiness Moved sq() to more appropriate place in AxesFinder.hh Rearranged Nsubjettiness.hh to make the old code less visible. Renamed AxesFinderFromOnePassMinimization -> AxesFinderFromConicalMinimization Renamed DefaultUnnormalizedMeasureFunction -> ConicalUnnormalizedMeasureFunction Removed supportsMultiPassMinimization() from MeasureDefinition since any One Pass algorithm can be multipass. 2014-07-09 Changed version for 2.1.0 release. Updated NEWS to reflect 2.1.0 release 2014-07-07 Added forward declaration of options in NjettinessDefinition for readability. Updated README with some clarifications Added usage information in the example file Reran svn propset svn:keywords Id *.cc *.hh 2014-06-25 Declaring release candidate of 2.1 2014-06-11 Fixed virtual destructor issue in AxesFinder Changing copy() to create() in NjettinessDefinition for "new" clarity Converted some SharedPtr to regular pointers in NjettinessDefinition to be consistent on meaning of "create" commands. 2014-06-10 Slight modification of example_advanced_usage Fixed bug in GeometricCutoffMeasure (incorrect denominator setting) 2014-06-05 Moved public before private in the .hh files for readability Starting process of switching to SharedPtr internally Clean up of AxesFinderFromGeometricMinimization Simplified AxesFinder interface such that it doesn't know about starting axes finders (this is now handled in Njettiness). Added const qualifiers in Njettiness 2014-06-04 Implemented AxesDefinition class Added descriptions to AxesDefinition and MeasureDefinition Simplified example_advanced_usage with new Definitions Made copy constructor private for Njettiness, to avoid copying 2014-06-03 Implemented remaining suggestions from FJ authors (Thanks!) Fixed bug in example_advanced_usage where wrong beta value was used for NjettinessPlugin tests. Removed NANs as signals for number of parameters in Nsubjettiness and NjettinessPlugin Reduced the number of allowed parameters from 4 to 3. Wrapped NEWS to 80 characters Added MeasureDefinition as way to safely store information about the measures used Converted a few NANs to std::numeric_limits::quiet_NaN() when a parameter shouldn't be used. Added AxesStruct and MeasureStruct to simplify the form of example_advanced_usage Added example_v1p0p3 to check for backwards compatibility with v1.0.3 Changed the names of the MeasureFunctions in order to avoid conflicts with the new MeasureDefinitions Fixed bug in correlation between subjets and tau values in NjettinessPlugin Added currentTauComponents to Nsubjettiness Added subTau information to example_basic_usage Added file NjettinessDefinition to hold MeasureDefinition Changed Njettiness constructors to treat MeasureSpecification as primary object Fixed segmentation fault with ClusterSequenceAreas 2014-06-02 Implemented many suggestions from FJ authors (Thanks!) Removed FastJet 2 specific code Made sq() function into internal namespace (as "inline static" to avoid conflicts with other packages) Made setAxes() take const reference argument Rewrapped README to 80 characters and updated/improved some of the descriptions Clarified NEWS about what parts of the Nsubjettiness code is backwards compatible with v1.0.3 Clarified the para choices in Nsubjettiness constructor 2014-04-30 Added (void)(n_jets) in AxesFinder.hh to fix unused-parameter warning 2014-04-29 Added manual definition of NAN for compilers that don't have it. Removed a few more unused parameters for compilation 2014-04-22 Turned on -Wunused-parameter compiler flag to fix ATLAS compile issues. 2014-04-18 Tweaks to NEWS and README. Preparing for 2.0.0-rc1 release. 2014-04-16 Decided that enough has changed that this should be v2.0 Added Id tags 2014-04-14 Added get_partition_list to MeasureFunction Removed do_cluster from MeasureFunction (no longer needed) Fixed bug with NjettinessPlugin where jets were listed in backwards order from axes. Removed various commented out pieces of code. 2014-03-16 Added partitioning information to Nsubjettiness Partitioning is now calculated in MeasureFunction and stored by Njettiness. Rewrote MeasureFunction result() to call result_from_partition() Added subjet (and constituent counting) information to example_basic_usage Commented out redundant "getJets" function 2014-02-25 Added access to seedAxes used for one-pass minimization routines. Added axes print out to example_basic_usage, and fixed too many PrintJets declarations 2014-02-24 Fixed embarrassing bug with min_axes (error introduced after v1.0 to make it the same as onepass_kt) Simplified GeometricMeasure and added possibility of beta dependence Commented out WTA2 options, since those have not been fully tested (nor do they seem particularly useful at the moment). They can be reinstated if the physics case can be made to use them. Split example into example_basic_usage and example_advanced_usage 2014-01-28 Added new options in WinnerTakeAllRecombiner to use either pT or pT^2/E to recombine particles 2014-01-24 Added access to currentAxes from Nsubjettiness. 2014-01-18 Added beam regions to MeasureFunction, correspondingly renamed functions to have jet and beam regions Renamed functions in TauComponents for consistency with MeasureFunction Adding debugging code to AxesFinderFromOnePassMinimization::getAxes Worked extensively on example.cc to make sure that it tests all available options. Rewrote PrintJets command in example.cc for later improvements Converted some magic numbers to std::numeric_limits::max() 2014-01-17 Rewrote KMeansMinimization to call OnePassMinimization, adding noise explicitly. Removed any nothing of noise from OnePassMinimization Removed Double32_t for root usage is Nsubjettiness Clean up of many comments throughout the code, updating of README file Removed unnecessary establishAxes in Njettiness Removed bare constructor for Njettiness to avoid incompatibility with enum choices, may reinstate later. Also removed setMeasureFunction, setAxesFinder for same reason NjettinessExtras now calls TauComponents 2014-01-16 Moved minimization functions to OnePassMinimization, changed KMeansMinimization class to simply call OnePassMinimization a specified number of times Added extra tau function in TauComponents for users to get tau directly Changed radius parameter in AxesFinderFromExclusiveJet subclasses to use max_allowable_R Updated example.ref to account for changes due to change in radius parameter 2014-01-15 Changed NjettinessComponents to TauComponents Updated MeasureFunction with "result" function that returns TauComponents object TauComponents changed to calculate all tau components given subtaus_numerator and tau_denominator Njettiness updated to return TauComponents object rather than individual components Nsubjettiness and NjettinessPlugin updated to have option for 4th parameter 2014-01-14 Added NjettinessComponents class so Njettiness does not recalculate tau values Removed old Njettiness constructors, updated Nsubjettiness and NjettinessPlugin constructors to use new constructor Added geometric minimization to OnePassAxesFinders Created new Njettiness function to set OnePassAxesFinders to reduce code Updated LightLikeAxis with ConvertToPseudoJet function Updated README with new functionality of code 2014-01-12 Removed NsubGeometricParameters in all functions/constructors, replaced with Rcutoff double Added three new measure mode options where Rcutoff is declared explicitly in parameters Added checks so minimization axes finders are not used for geometric measures AxesFinderFromOnePassMinimization class created as child of AxesFinderFromKmeansMinimization Added new NsubjettinessRatio constructor to include MeasureMode option Moved AxesFinder and MeasureFunction declarations from AxesMode and MeasureMode into separate Njettiness function Removed R0 from AxesFinderFromKmeansMinimization Changed example.cc to get rid of use of NsubGeometricParameters 2014-01-9 Removed NsubParameters in all functions/constructors, replaced with three separate parameters Added checks for correct number of parameters in Njettiness constructor 2014-01-8 Removed normalization information from Nsubjettiness Added flag to MeasureFunction to give option of using the denominator Split DefaultMeasure into separate normalized and unnormalized classes 2014-01-7 Added capability of choosing a specific Measure in Njettiness Added new Nsubjettiness constructor to allow choice of both AxesMode and MeasureMode 2014-01-6 Updated copyright information Fixed bug in WinnerTakeAllRecombiner Moved KMeansParameters to AxesFinder Updated README with descriptions of new header files 2013-12-30 Changed name of MeasureFunctor to MeasureFunction Created separate .hh/.cc files for MeasureFunction, AxesFinder, and WinnerTakeAllRecombiner Updated Makefile to account for new files Removed getMinimumAxes in AxesFinderFromKMeansMinimization, consolidated with getAxes Updated comments on classes and major functions 2013-12-22 Created .cc files and moved all function definitions into .cc files Updated Makefile to account for new .cc files 2013-11-12 Added to fjcontrib svn 2013-11-12 Debugging svn 2013-11-11 Changed MeasureFunctor to separately treat tau numerator and denominator Changed some of the function names in MeasureFunctor. Should not affect users Added more informative function names to Njettiness. Njettiness now allows finding unnormalized tau values Added WTARecombiner to define winner-take-all axes Added various WTA options to AxesMode Added setAxes to Nsubjettiness Added NsubjettinessRatio function 2013-08-26 Added inlines to fix compile issue Put some of the minimization code inside of the AxesFinderFromKmeansMinimization class 2013-02-23 Fixed dependency issue (now using make depend) 2013-02-22 Fixed memory management and failed make check issues. 2013-02-21 First version submitted to fjcontrib 2013-02-20 Initial creation based on previous plugin hosted at http://www.jthaler.net/jets/ Index: contrib/contribs/Nsubjettiness/trunk/AxesDefinition.hh =================================================================== --- contrib/contribs/Nsubjettiness/trunk/AxesDefinition.hh (revision 1399) +++ contrib/contribs/Nsubjettiness/trunk/AxesDefinition.hh (revision 1400) @@ -1,1427 +1,1427 @@ // Nsubjettiness Package // Questions/Comments? jthaler@jthaler.net // // Copyright (c) 2011-14 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason // // $Id$ //---------------------------------------------------------------------- // 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 __FASTJET_CONTRIB_AXES_DEFINITION_HH__ #define __FASTJET_CONTRIB_AXES_DEFINITION_HH__ #include "MeasureDefinition.hh" #include "ExtraRecombiners.hh" #include "fastjet/PseudoJet.hh" #include #include #include #include #include FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh namespace contrib { // The following AxesDefinitions are currently available (and the relevant arguments, if needed) class HalfKT_Axes; class KT_Axes; class CA_Axes; class AntiKT_Axes; // (R0) class WTA_HalfKT_Axes; class WTA_KT_Axes; class WTA_CA_Axes; class GenKT_Axes; // (p, R0 = infinity) class WTA_GenKT_Axes; // (p, R0 = infinity) class GenET_GenKT_Axes; // (delta, p, R0 = infinity) class Manual_Axes; class OnePass_HalfKT_Axes; class OnePass_KT_Axes; class OnePass_CA_Axes; class OnePass_AntiKT_Axes; // (R0) class OnePass_WTA_HalfKT_Axes; class OnePass_WTA_KT_Axes; class OnePass_WTA_CA_Axes; class OnePass_GenKT_Axes; // (p, R0 = infinity) class OnePass_WTA_GenKT_Axes; // (p, R0 = infinity) class OnePass_GenET_GenKT_Axes; // (delta, p, R0 = infinity) class OnePass_Manual_Axes; class MultiPass_Axes; // (NPass) (currently only defined for KT_Axes) class MultiPass_Manual_Axes; // (NPass) class Comb_GenKT_Axes; // (nExtra, p, R0 = infinity) class Comb_WTA_GenKT_Axes; // (nExtra, p, R0 = infinity) class Comb_GenET_GenKT_Axes; // (nExtra, delta, p, R0 = infinity) /////// // // AxesDefinition // /////// ///------------------------------------------------------------------------ /// \class AxesDefinition /// \brief Base class for axes definitions /// /// A generic AxesDefinition first finds a set of seed axes. /// Then, if desired, uses measure information /// (from MeasureDefinition) to refine those axes starting from those seed axes. /// The AxesDefinitions are typically based on sequential jet algorithms. ///------------------------------------------------------------------------ class AxesDefinition { public: /// This function should be overloaded in all derived classes, and defines how to find the seed axes. /// If desired, the measure information (which might be NULL) can be used to test multiple axes choices, but should /// not be used for iterative refining (since that is the job of MeasureDefinition). virtual std::vector get_starting_axes(int n_jets, const std::vector& inputs, const MeasureDefinition * measure) const = 0; /// Short description of AxesDefinitions (and any parameters) virtual std::string short_description() const = 0; /// Long description of AxesDefinitions (and any parameters) virtual std::string description() const = 0; /// This has to be defined in all derived classes, and allows these to be copied around. virtual AxesDefinition* create() const = 0; public: /// Starting from seeds, refine axes using one or more passes. /// Note that in order to do >0 passes, we need information from the MeasureDefinition about how to do the appropriate minimization. std::vector get_refined_axes(int n_jets, const std::vector& inputs, const std::vector& seedAxes, const MeasureDefinition * measure = NULL) const { assert(n_jets == (int)seedAxes.size()); //added int casting to get rid of compiler warning if (_Npass == 0) { // no refining, just use seeds return seedAxes; } else if (_Npass == 1) { if (measure == NULL) throw Error("AxesDefinition: One-pass minimization requires specifying a MeasureDefinition."); // do one pass minimum using measure definition return measure->get_one_pass_axes(n_jets, inputs, seedAxes,_nAttempts,_accuracy); } else { if (measure == NULL) throw Error("AxesDefinition: Multi-pass minimization requires specifying a MeasureDefinition."); return get_multi_pass_axes(n_jets, inputs, seedAxes, measure); } } /// Combines get_starting_axes with get_refined_axes. /// In the Njettiness class, these two steps are done separately in order to store seed axes information. std::vector get_axes(int n_jets, const std::vector& inputs, const MeasureDefinition * measure = NULL) const { std::vector seedAxes = get_starting_axes(n_jets, inputs, measure); return get_refined_axes(n_jets,inputs,seedAxes,measure); } /// Short-hand for the get_axes function. Useful when trying to write terse code. inline std::vector operator() (int n_jets, const std::vector& inputs, const MeasureDefinition * measure = NULL) const { return get_axes(n_jets,inputs,measure); } /// \enum AxesRefiningEnum /// Defines the cases of zero pass and one pass for convenience enum AxesRefiningEnum { UNDEFINED_REFINE = -1, // added to create a default value NO_REFINING = 0, ONE_PASS = 1, MULTI_PASS = 100, }; /// A integer that is used externally to decide how to do multi-pass minimization int nPass() const { return _Npass; } /// A flag that indicates whether results are deterministics. bool givesRandomizedResults() const { return (_Npass > 1); } /// A flag that indicates whether manual axes are being used. bool needsManualAxes() const { return _needsManualAxes; // if there is no starting axes finder } /// Allows user to change number of passes. Also used internally to set nPass. /// Can also specify details of one/multi pass minimziation void setNPass(int nPass, int nAttempts = 1000, double accuracy = 0.0001, double noise_range = 1.0 // only needed for MultiPass minimization ) { _Npass = nPass; _nAttempts = nAttempts; _accuracy = accuracy; _noise_range = noise_range; if (nPass < 0) throw Error("AxesDefinition requires a nPass >= 0"); } /// Destructor virtual ~AxesDefinition() {}; protected: /// Default constructor contains no information. Number of passes has to be set /// manually by derived classes using setNPass function. AxesDefinition() : _Npass(UNDEFINED_REFINE), _nAttempts(0), _accuracy(0.0), _noise_range(0.0), _needsManualAxes(false) {} /// Does multi-pass minimization by randomly jiggling the axes within _noise_range std::vector get_multi_pass_axes(int n_jets, const std::vector& inputs, const std::vector& seedAxes, const MeasureDefinition* measure) const; /// Function to jiggle axes within _noise_range PseudoJet jiggle(const PseudoJet& axis) const; int _Npass; ///< Number of passes (0 = no refining, 1 = one-pass, >1 multi-pass) int _nAttempts; ///< Number of attempts per pass double _accuracy; ///< Accuracy goal per pass double _noise_range; ///< Noise in rapidity/phi (for multi-pass minimization only) bool _needsManualAxes; ///< Flag to indicate special case of manual axes }; ///------------------------------------------------------------------------ /// \class ExclusiveJetAxes /// \brief Base class for axes defined from exclusive jet algorithm /// /// This class finds axes by clustering particles with an exclusive jet definition. /// This can be implemented with different jet algorithms. The user can call this directly /// using their favorite fastjet::JetDefinition ///------------------------------------------------------------------------ class ExclusiveJetAxes : public AxesDefinition { public: /// Constructor takes JetDefinition as an argument ExclusiveJetAxes(fastjet::JetDefinition def) : AxesDefinition(), _def(def) { setNPass(NO_REFINING); // default to no minimization } /// Starting axes obtained by creating a cluster sequenence and running exclusive_jets. virtual std::vector get_starting_axes(int n_jets, const std::vector & inputs, const MeasureDefinition * ) const { fastjet::ClusterSequence jet_clust_seq(inputs, _def); std::vector axes_temp = jet_clust_seq.exclusive_jets_up_to(n_jets); if ((int)axes_temp.size() < n_jets) { _too_few_axes_warning.warn("ExclusiveJetAxes::get_starting_axes: Fewer than N axes found; results are unpredictable."); axes_temp.resize(n_jets); // resize to make sure there are enough axes to not yield an error elsewhere } // Create axes list with extra information stripped (since ClusterSequence will not be kept around) std::vector axes; axes.resize(n_jets); - for (int i = 0; i < axes_temp.size(); i++) { + for (unsigned int i = 0; i < axes_temp.size(); i++) { axes[i].reset_momentum(axes_temp[i]); } return axes; } /// Short description virtual std::string short_description() const { return "ExclAxes";} /// Long description virtual std::string description() const { return "ExclAxes: " + _def.description();} /// To make it possible to copy around. virtual ExclusiveJetAxes* create() const {return new ExclusiveJetAxes(*this);} private: fastjet::JetDefinition _def; ///< Jet definition to use. static LimitedWarning _too_few_axes_warning; }; ///------------------------------------------------------------------------ /// \class ExclusiveCombinatorialJetAxes /// \brief Base class for axes defined from exclusive jet algorithm, checking combinatorial options /// /// This class finds axes by clustering particles with an exclusive jet definition. /// It takes an extra number of jets (specificed by the user via nExtra), and then finds the set of N that minimizes N-jettiness. /// WARNING: If one wants to be guarenteed that results improve by increasing nExtra, then one should use /// winner-take-all-style recombination schemes ///------------------------------------------------------------------------ class ExclusiveCombinatorialJetAxes : public AxesDefinition { public: /// Constructor takes JetDefinition and nExtra as options (nExtra=0 acts the same as ExclusiveJetAxes) ExclusiveCombinatorialJetAxes(fastjet::JetDefinition def, int nExtra = 0) : AxesDefinition(), _def(def), _nExtra(nExtra) { if (nExtra < 0) throw Error("Need nExtra >= 0"); setNPass(NO_REFINING); // default to no minimization } /// Find n_jets + _nExtra axes, and then choose the n_jets subset with the smallest N-(sub)jettiness value. virtual std::vector get_starting_axes(int n_jets, const std::vector & inputs, const MeasureDefinition *measure) const { int starting_number = n_jets + _nExtra; fastjet::ClusterSequence jet_clust_seq(inputs, _def); std::vector starting_axes = jet_clust_seq.exclusive_jets_up_to(starting_number); if ((int)starting_axes.size() < n_jets) { _too_few_axes_warning.warn("ExclusiveCombinatorialJetAxes::get_starting_axes: Fewer than N + nExtra axes found; results are unpredictable."); starting_axes.resize(n_jets); // resize to make sure there are enough axes to not yield an error elsewhere } std::vector final_axes; // check so that no computation time is wasted if there are no extra axes if (_nExtra == 0) final_axes = starting_axes; else { // define string of 1's based on number of desired jets std::string bitmask(n_jets, 1); // expand the array size to the total number of jets with extra 0's at the end, makes string easy to permute bitmask.resize(starting_number, 0); double min_tau = std::numeric_limits::max(); std::vector temp_axes; do { temp_axes.clear(); // only take an axis if it is listed as true (1) in the string for (int i = 0; i < (int)starting_axes.size(); ++i) { if (bitmask[i]) temp_axes.push_back(starting_axes[i]); } double temp_tau = measure->result(inputs, temp_axes); if (temp_tau < min_tau) { min_tau = temp_tau; final_axes = temp_axes; } // permutes string of 1's and 0's according to next lexicographic ordering and returns true // continues to loop through all possible lexicographic orderings // returns false and breaks the loop when there are no more possible orderings } while (std::prev_permutation(bitmask.begin(), bitmask.end())); } return final_axes; } /// Short description virtual std::string short_description() const { return "ExclCombAxes";} /// Long description virtual std::string description() const { return "ExclCombAxes: " + _def.description();} /// To make it possible to copy around. virtual ExclusiveCombinatorialJetAxes* create() const {return new ExclusiveCombinatorialJetAxes(*this);} private: fastjet::JetDefinition _def; ///< Jet definition to use int _nExtra; ///< Extra axes to find static LimitedWarning _too_few_axes_warning; }; ///------------------------------------------------------------------------ /// \class HardestJetAxes /// \brief Base class for axes defined from an inclusive jet algorithm /// /// This class finds axes by running an inclusive algorithm and then finding the n hardest jets. /// This can be implemented with different jet algorithms, and can be called by the user. ///------------------------------------------------------------------------ class HardestJetAxes : public AxesDefinition { public: /// Constructor takes JetDefinition HardestJetAxes(fastjet::JetDefinition def) : AxesDefinition(), _def(def) { setNPass(NO_REFINING); // default to no minimization } /// Finds seed axes by running a ClusterSequence, running inclusive_jets, and finding the N hardest virtual std::vector get_starting_axes(int n_jets, const std::vector & inputs, const MeasureDefinition * ) const { fastjet::ClusterSequence jet_clust_seq(inputs, _def); std::vector axes = sorted_by_pt(jet_clust_seq.inclusive_jets()); if ((int)axes.size() < n_jets) { _too_few_axes_warning.warn("HardestJetAxes::get_starting_axes: Fewer than N axes found; results are unpredictable."); } axes.resize(n_jets); // only keep n hardest return axes; } /// Short description virtual std::string short_description() const { return "HardAxes";} /// Long description virtual std::string description() const { return "HardAxes: " + _def.description();} /// To make it possible to copy around. virtual HardestJetAxes* create() const {return new HardestJetAxes(*this);} private: fastjet::JetDefinition _def; ///< Jet Definition to use. static LimitedWarning _too_few_axes_warning; }; ///------------------------------------------------------------------------ /// \class HalfKT_Axes /// \brief Axes from exclusive generalized kT with p = 1/2 /// /// Axes from a general KT algorithm with p=1/2 (standard E-scheme recombination) ///------------------------------------------------------------------------ class HalfKT_Axes : public ExclusiveJetAxes { public: /// Constructor HalfKT_Axes() : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::genkt_algorithm, fastjet::JetDefinition::max_allowable_R, 0.5)) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "HalfKT"; return stream.str(); }; /// Long descriptions virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Half KT Axes"; return stream.str(); }; /// For copying purposes virtual HalfKT_Axes* create() const {return new HalfKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class KT_Axes /// \brief Axes from exclusive kT /// /// Axes from kT algorithm with E_scheme recombination. ///------------------------------------------------------------------------ class KT_Axes : public ExclusiveJetAxes { public: /// Constructor KT_Axes() : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::kt_algorithm, fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant fastjet::E_scheme, fastjet::Best) ) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "KT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "KT Axes"; return stream.str(); }; /// For copying purposes virtual KT_Axes* create() const {return new KT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class CA_Axes /// \brief Axes from exclusive CA /// /// Axes from CA algorithm with E_scheme recombination. ///------------------------------------------------------------------------ class CA_Axes : public ExclusiveJetAxes { public: /// Constructor CA_Axes() : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::cambridge_algorithm, fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant fastjet::E_scheme, fastjet::Best) ) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "CA"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "CA Axes"; return stream.str(); }; /// For copying purposes virtual CA_Axes* create() const {return new CA_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class AntiKT_Axes /// \brief Axes from inclusive anti-kT /// /// Axes from anti-kT algorithm and E_scheme. /// The one parameter R0 is subjet radius ///------------------------------------------------------------------------ class AntiKT_Axes : public HardestJetAxes { public: /// Constructor. Takes jet radius as argument AntiKT_Axes(double R0) : HardestJetAxes(fastjet::JetDefinition(fastjet::antikt_algorithm, R0, fastjet::E_scheme, fastjet::Best) ), _R0(R0) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "AKT" << _R0; return stream.str(); }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Anti-KT Axes (R0 = " << _R0 << ")"; return stream.str(); }; /// For copying purposes virtual AntiKT_Axes* create() const {return new AntiKT_Axes(*this);} protected: double _R0; ///< AKT jet radius }; ///------------------------------------------------------------------------ /// \class JetDefinitionWrapper /// \brief Wrapper for jet definitions (for memory management) /// /// This class is used by all AxesDefinition with a manual recombiner to /// ensure that the delete_recombiner_when_unused function is always called ///------------------------------------------------------------------------ class JetDefinitionWrapper { public: /// Default Constructor JetDefinitionWrapper(JetAlgorithm jet_algorithm_in, double R_in, double xtra_param_in, const JetDefinition::Recombiner *recombiner) { jet_def = fastjet::JetDefinition(jet_algorithm_in, R_in, xtra_param_in); jet_def.set_recombiner(recombiner); jet_def.delete_recombiner_when_unused(); // added to prevent memory leaks } /// Additional constructor so that build-in FastJet algorithms can also be called JetDefinitionWrapper(JetAlgorithm jet_algorithm_in, double R_in, const JetDefinition::Recombiner *recombiner, fastjet::Strategy strategy_in) { jet_def = fastjet::JetDefinition(jet_algorithm_in, R_in, recombiner, strategy_in); jet_def.delete_recombiner_when_unused(); } /// Return jet definition JetDefinition getJetDef() { return jet_def; } private: JetDefinition jet_def; ///< my jet definition }; ///------------------------------------------------------------------------ /// \class WTA_HalfKT_Axes /// \brief Axes from exclusive generalized kT with p =1/2, winner-take-all recombination /// /// Axes from a general KT algorithm (p = 1/2) with a Winner Take All Recombiner ///------------------------------------------------------------------------ class WTA_HalfKT_Axes : public ExclusiveJetAxes { public: /// Constructor WTA_HalfKT_Axes() : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::genkt_algorithm, fastjet::JetDefinition::max_allowable_R, 0.5, new WinnerTakeAllRecombiner() ).getJetDef()) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "WTA, HalfKT"; return stream.str(); }; /// Long descriptions virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Winner-Take-All Half KT Axes"; return stream.str(); }; /// For copying purposes virtual WTA_HalfKT_Axes* create() const {return new WTA_HalfKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class WTA_KT_Axes /// \brief Axes from exclusive kT, winner-take-all recombination /// /// Axes from kT algorithm and winner-take-all recombination ///------------------------------------------------------------------------ class WTA_KT_Axes : public ExclusiveJetAxes { public: /// Constructor WTA_KT_Axes() : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::kt_algorithm, fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant new WinnerTakeAllRecombiner(), // Needs to be explicitly declared (this will be deleted by JetDefinitionWrapper) fastjet::Best).getJetDef() ) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "WTA KT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Winner-Take-All KT Axes"; return stream.str(); }; /// For copying purposes virtual WTA_KT_Axes* create() const {return new WTA_KT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class WTA_CA_Axes /// \brief Axes from exclusive CA, winner-take-all recombination /// /// Axes from CA algorithm and winner-take-all recombination ///------------------------------------------------------------------------ class WTA_CA_Axes : public ExclusiveJetAxes { public: /// Constructor WTA_CA_Axes() : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::cambridge_algorithm, fastjet::JetDefinition::max_allowable_R, //maximum jet radius constant new WinnerTakeAllRecombiner(), // Needs to be explicitly declared (this will be deleted by JetDefinitionWrapper) fastjet::Best).getJetDef()) { setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "WTA CA"; }; /// Long descriptions virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Winner-Take-All CA Axes"; return stream.str(); }; /// For copying purposes virtual WTA_CA_Axes* create() const {return new WTA_CA_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class GenKT_Axes /// \brief Axes from exclusive generalized kT /// /// Axes from a general KT algorithm (standard E-scheme recombination) /// Requires the power of the KT algorithm to be used and the radius parameter ///------------------------------------------------------------------------ class GenKT_Axes : public ExclusiveJetAxes { public: /// Constructor GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R) : ExclusiveJetAxes(fastjet::JetDefinition(fastjet::genkt_algorithm, R0, p)), _p(p), _R0(R0) { if (p < 0) throw Error("GenKT_Axes: Currently only p >=0 is supported."); setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "GenKT Axes"; return stream.str(); }; /// Long descriptions virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual GenKT_Axes* create() const {return new GenKT_Axes(*this);} protected: double _p; ///< genkT power double _R0; ///< jet radius }; ///------------------------------------------------------------------------ /// \class WTA_GenKT_Axes /// \brief Axes from exclusive generalized kT, winner-take-all recombination /// /// Axes from a general KT algorithm with a Winner Take All Recombiner /// Requires the power of the KT algorithm to be used and the radius parameter ///------------------------------------------------------------------------ class WTA_GenKT_Axes : public ExclusiveJetAxes { public: /// Constructor WTA_GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R) : ExclusiveJetAxes(JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new WinnerTakeAllRecombiner() ).getJetDef()), _p(p), _R0(R0) { if (p < 0) throw Error("WTA_GenKT_Axes: Currently only p >=0 is supported."); setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "WTA, GenKT Axes"; return stream.str(); }; /// Long descriptions virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual WTA_GenKT_Axes* create() const {return new WTA_GenKT_Axes(*this);} protected: double _p; ///< genkT power double _R0; ///< jet radius }; ///------------------------------------------------------------------------ /// \class GenET_GenKT_Axes /// \brief Axes from exclusive kT, generalized Et-scheme recombination /// /// Class using general KT algorithm with a more general recombination scheme /// Requires power of KT algorithm, power of recombination weights, and radius parameter ///------------------------------------------------------------------------ class GenET_GenKT_Axes : public ExclusiveJetAxes { public: /// Constructor GenET_GenKT_Axes(double delta, double p, double R0 = fastjet::JetDefinition::max_allowable_R) : ExclusiveJetAxes((JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new GeneralEtSchemeRecombiner(delta))).getJetDef() ), _delta(delta), _p(p), _R0(R0) { if (p < 0) throw Error("GenET_GenKT_Axes: Currently only p >=0 is supported."); if (delta <= 0) throw Error("GenET_GenKT_Axes: Currently only delta >0 is supported."); setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "GenET, GenKT Axes"; return stream.str(); }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2); // TODO: if _delta is huge, change to "WTA" if (_delta < std::numeric_limits::max()) stream << "General Recombiner (delta = " << _delta << "), " << "General KT (p = " << _p << ") Axes, R0 = " << _R0; else stream << "Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual GenET_GenKT_Axes* create() const {return new GenET_GenKT_Axes(*this);} protected: double _delta; ///< Recombination pT weighting double _p; ///< GenkT power double _R0; ///< jet radius }; ///------------------------------------------------------------------------ /// \class OnePass_HalfKT_Axes /// \brief Axes from exclusive generalized kT (p = 1/2) with one-pass minimization /// /// Onepass minimization, General KT Axes with p = 1/2 (standard E-scheme recombination) ///------------------------------------------------------------------------ class OnePass_HalfKT_Axes : public HalfKT_Axes { public: /// Constructor OnePass_HalfKT_Axes() : HalfKT_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass HalfKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Half KT Axes"; return stream.str(); }; /// For copying purposes virtual OnePass_HalfKT_Axes* create() const {return new OnePass_HalfKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_KT_Axes /// \brief Axes from exclusive kT, with one-pass minimization /// /// Onepass minimization from kt axes ///------------------------------------------------------------------------ class OnePass_KT_Axes : public KT_Axes { public: /// Constructor OnePass_KT_Axes() : KT_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass KT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from KT Axes"; return stream.str(); }; /// For copying purposes virtual OnePass_KT_Axes* create() const {return new OnePass_KT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_CA_Axes /// \brief Axes from exclusive CA, with one-pass minimization /// /// Onepass minimization from CA axes ///------------------------------------------------------------------------ class OnePass_CA_Axes : public CA_Axes { public: /// Constructor OnePass_CA_Axes() : CA_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass CA"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from CA Axes"; return stream.str(); }; /// For copying purposes virtual OnePass_CA_Axes* create() const {return new OnePass_CA_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_AntiKT_Axes /// \brief Axes from inclusive anti-kT, with one-pass minimization /// /// Onepass minimization from AntiKT axes, one parameter R0 ///------------------------------------------------------------------------ class OnePass_AntiKT_Axes : public AntiKT_Axes { public: /// Constructor OnePass_AntiKT_Axes(double R0) : AntiKT_Axes(R0) { setNPass(ONE_PASS); } /// Short Description virtual std::string short_description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "OnePassAKT" << _R0; return stream.str(); }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Anti-KT Axes (R0 = " << _R0 << ")"; return stream.str(); }; /// For copying purposes virtual OnePass_AntiKT_Axes* create() const {return new OnePass_AntiKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_WTA_HalfKT_Axes /// \brief Axes from exclusive generalized kT with p = 1/2, winner-take-all recombination, with one-pass minimization /// /// Onepass minimization from winner-take-all, General KT Axes with p = 1/2 ///------------------------------------------------------------------------ class OnePass_WTA_HalfKT_Axes : public WTA_HalfKT_Axes { public: /// Constructor OnePass_WTA_HalfKT_Axes() : WTA_HalfKT_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass WTA HalfKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Winner-Take-All Half KT Axes"; return stream.str(); }; /// For copying purposes virtual OnePass_WTA_HalfKT_Axes* create() const {return new OnePass_WTA_HalfKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_WTA_KT_Axes /// \brief Axes from exclusive kT, winner-take-all recombination, with one-pass minimization /// /// Onepass minimization from winner-take-all kt axes ///------------------------------------------------------------------------ class OnePass_WTA_KT_Axes : public WTA_KT_Axes { public: /// Constructor OnePass_WTA_KT_Axes() : WTA_KT_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass WTA KT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Winner-Take-All KT Axes"; return stream.str(); }; /// For copying purposes virtual OnePass_WTA_KT_Axes* create() const {return new OnePass_WTA_KT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_WTA_CA_Axes /// \brief Axes from exclusive CA, winner-take-all recombination, with one-pass minimization /// /// Onepass minimization from winner-take-all CA axes ///------------------------------------------------------------------------ class OnePass_WTA_CA_Axes : public WTA_CA_Axes { public: /// Constructor OnePass_WTA_CA_Axes() : WTA_CA_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass WTA CA"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Winner-Take-All CA Axes"; return stream.str(); }; /// For copying purposes virtual OnePass_WTA_CA_Axes* create() const {return new OnePass_WTA_CA_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_GenKT_Axes /// \brief Axes from exclusive generalized kT with one-pass minimization /// /// Onepass minimization, General KT Axes (standard E-scheme recombination) ///------------------------------------------------------------------------ class OnePass_GenKT_Axes : public GenKT_Axes { public: /// Constructor OnePass_GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R) : GenKT_Axes(p, R0) { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass GenKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual OnePass_GenKT_Axes* create() const {return new OnePass_GenKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_WTA_GenKT_Axes /// \brief Axes from exclusive generalized kT, winner-take-all recombination, with one-pass minimization /// /// Onepass minimization from winner-take-all, General KT Axes ///------------------------------------------------------------------------ class OnePass_WTA_GenKT_Axes : public WTA_GenKT_Axes { public: /// Constructor OnePass_WTA_GenKT_Axes(double p, double R0 = fastjet::JetDefinition::max_allowable_R) : WTA_GenKT_Axes(p, R0) { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass WTA GenKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual OnePass_WTA_GenKT_Axes* create() const {return new OnePass_WTA_GenKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_GenET_GenKT_Axes /// \brief Axes from exclusive generalized kT, generalized Et-scheme recombination, with one-pass minimization /// /// Onepass minimization from General Recomb, General KT axes ///------------------------------------------------------------------------ class OnePass_GenET_GenKT_Axes : public GenET_GenKT_Axes { public: /// Constructor OnePass_GenET_GenKT_Axes(double delta, double p, double R0 = fastjet::JetDefinition::max_allowable_R) : GenET_GenKT_Axes(delta, p, R0) { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass GenET, GenKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2); if (_delta < std::numeric_limits::max()) stream << "One-Pass Minimization from General Recombiner (delta = " << _delta << "), " << "General KT (p = " << _p << ") Axes, R0 = " << _R0; else stream << "One-Pass Minimization from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual OnePass_GenET_GenKT_Axes* create() const {return new OnePass_GenET_GenKT_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class Manual_Axes /// \brief Manual axes finding /// /// Allows the user to set the axes manually ///------------------------------------------------------------------------ class Manual_Axes : public AxesDefinition { public: /// Constructor. Note that _needsManualAxes is set to true. Manual_Axes() : AxesDefinition() { setNPass(NO_REFINING); _needsManualAxes = true; } /// This is now a dummy function since this is manual mode virtual std::vector get_starting_axes(int, const std::vector&, const MeasureDefinition *) const; /// Short description virtual std::string short_description() const { return "Manual"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Manual Axes"; return stream.str(); }; /// For copying purposes virtual Manual_Axes* create() const {return new Manual_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class OnePass_Manual_Axes /// \brief Manual axes finding, with one-pass minimization /// /// One pass minimization from manual starting point ///------------------------------------------------------------------------ class OnePass_Manual_Axes : public Manual_Axes { public: /// Constructor. Note that _needsManualAxes is set to true. OnePass_Manual_Axes() : Manual_Axes() { setNPass(ONE_PASS); } /// Short description virtual std::string short_description() const { return "OnePass Manual"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "One-Pass Minimization from Manual Axes"; return stream.str(); }; // For copying purposes virtual OnePass_Manual_Axes* create() const {return new OnePass_Manual_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class MultiPass_Axes /// \brief Manual axes finding, with multi-pass (randomized) minimization /// /// Multi-pass minimization from kT starting point ///------------------------------------------------------------------------ class MultiPass_Axes : public KT_Axes { public: /// Constructor MultiPass_Axes(unsigned int Npass) : KT_Axes() { setNPass(Npass); } /// Short description virtual std::string short_description() const { return "MultiPass"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Multi-Pass Axes (Npass = " << _Npass << ")"; return stream.str(); }; /// For copying purposs virtual MultiPass_Axes* create() const {return new MultiPass_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class MultiPass_Manual_Axes /// \brief Axes finding from exclusive kT, with multi-pass (randomized) minimization /// /// multi-pass minimization from kT starting point ///------------------------------------------------------------------------ class MultiPass_Manual_Axes : public Manual_Axes { public: /// Constructor MultiPass_Manual_Axes(unsigned int Npass) : Manual_Axes() { setNPass(Npass); } /// Short Description virtual std::string short_description() const { return "MultiPass Manual"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "Multi-Pass Manual Axes (Npass = " << _Npass << ")"; return stream.str(); }; /// For copying purposes virtual MultiPass_Manual_Axes* create() const {return new MultiPass_Manual_Axes(*this);} }; ///------------------------------------------------------------------------ /// \class Comb_GenKT_Axes /// \brief Axes from exclusive generalized kT with combinatorial testing /// /// Axes from kT algorithm (standard E-scheme recombination) /// Requires nExtra parameter and returns set of N that minimizes N-jettiness /// Note that this method is not guaranteed to find a deeper minimum than GenKT_Axes ///------------------------------------------------------------------------ class Comb_GenKT_Axes : public ExclusiveCombinatorialJetAxes { public: /// Constructor Comb_GenKT_Axes(int nExtra, double p, double R0 = fastjet::JetDefinition::max_allowable_R) : ExclusiveCombinatorialJetAxes(fastjet::JetDefinition(fastjet::genkt_algorithm, R0, p), nExtra), _p(p), _R0(R0) { if (p < 0) throw Error("Comb_GenKT_Axes: Currently only p >=0 is supported."); setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "N Choose M GenKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "N Choose M Minimization (nExtra = " << _nExtra << ") from General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual Comb_GenKT_Axes* create() const {return new Comb_GenKT_Axes(*this);} private: double _nExtra; ///< Number of extra axes double _p; ///< GenkT power double _R0; ///< jet radius }; ///------------------------------------------------------------------------ /// \class Comb_WTA_GenKT_Axes /// \brief Axes from exclusive generalized kT, winner-take-all recombination, with combinatorial testing /// /// Axes from kT algorithm and winner-take-all recombination /// Requires nExtra parameter and returns set of N that minimizes N-jettiness ///------------------------------------------------------------------------ class Comb_WTA_GenKT_Axes : public ExclusiveCombinatorialJetAxes { public: /// Constructor Comb_WTA_GenKT_Axes(int nExtra, double p, double R0 = fastjet::JetDefinition::max_allowable_R) : ExclusiveCombinatorialJetAxes((JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new WinnerTakeAllRecombiner())).getJetDef(), nExtra), _p(p), _R0(R0) { if (p < 0) throw Error("Comb_WTA_GenKT_Axes: Currently only p >=0 is supported."); setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "N Choose M WTA GenKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2) << "N Choose M Minimization (nExtra = " << _nExtra << ") from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual Comb_WTA_GenKT_Axes* create() const {return new Comb_WTA_GenKT_Axes(*this);} private: double _nExtra; ///< Number of extra axes double _p; ///< GenkT power double _R0; ///< jet radius }; ///------------------------------------------------------------------------ /// \class Comb_GenET_GenKT_Axes /// \brief Axes from exclusive generalized kT, generalized Et-scheme recombination, with combinatorial testing /// /// Axes from kT algorithm and General Et scheme recombination /// Requires nExtra parameter and returns set of N that minimizes N-jettiness ///------------------------------------------------------------------------ class Comb_GenET_GenKT_Axes : public ExclusiveCombinatorialJetAxes { public: /// Constructor Comb_GenET_GenKT_Axes(int nExtra, double delta, double p, double R0 = fastjet::JetDefinition::max_allowable_R) : ExclusiveCombinatorialJetAxes((JetDefinitionWrapper(fastjet::genkt_algorithm, R0, p, new GeneralEtSchemeRecombiner(delta))).getJetDef(), nExtra), _delta(delta), _p(p), _R0(R0) { if (p < 0) throw Error("Comb_GenET_GenKT_Axes: Currently only p >=0 is supported."); if (delta <= 0) throw Error("Comb_GenET_GenKT_Axes: Currently only delta >=0 is supported."); setNPass(NO_REFINING); } /// Short description virtual std::string short_description() const { return "N Choose M GenET GenKT"; }; /// Long description virtual std::string description() const { std::stringstream stream; stream << std::fixed << std::setprecision(2); if (_delta < std::numeric_limits::max()) stream << "N choose M Minimization (nExtra = " << _nExtra << ") from General Recombiner (delta = " << _delta << "), " << "General KT (p = " << _p << ") Axes, R0 = " << _R0; else stream << "N choose M Minimization (nExtra = " << _nExtra << ") from Winner-Take-All General KT (p = " << _p << "), R0 = " << _R0; return stream.str(); }; /// For copying purposes virtual Comb_GenET_GenKT_Axes* create() const {return new Comb_GenET_GenKT_Axes(*this);} private: double _nExtra; ///< Number of extra axes double _delta; ///< Recombination pT weighting exponent double _p; ///< GenkT power double _R0; ///< jet radius }; } // namespace contrib FASTJET_END_NAMESPACE #endif // __FASTJET_CONTRIB_NJETTINESS_HH__ Index: contrib/contribs/Nsubjettiness/trunk/VERSION =================================================================== --- contrib/contribs/Nsubjettiness/trunk/VERSION (revision 1399) +++ contrib/contribs/Nsubjettiness/trunk/VERSION (revision 1400) @@ -1 +1 @@ -2.3.0 \ No newline at end of file +2.3.1 \ No newline at end of file