- Timestamp:
- Oct 9, 2015, 2:47:38 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 8713dee
- Parents:
- f118021
- Location:
- external/fastjet
- Files:
-
- 9 added
- 8 deleted
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/ClusterSequence.hh
rf118021 r973b92a 3 3 4 4 //FJSTARTHEADER 5 // $Id: ClusterSequence.hh 3 709 2014-09-29 13:19:11Z soyez$5 // $Id: ClusterSequence.hh 3911 2015-07-02 12:09:58Z salam $ 6 6 // 7 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 991 991 // implementation of JetDefinition::operator() is here to avoid nasty 992 992 // issues of order of implementations and includes 993 #ifndef __CINT__ 993 994 template<class L> 994 995 std::vector<PseudoJet> JetDefinition::operator()(const std::vector<L> & particles) const { … … 1015 1016 return jets; 1016 1017 } 1017 1018 #endif // __CINT__ 1018 1019 1019 1020 -
external/fastjet/ClusterSequence_Delaunay.cc
rf118021 r973b92a 1 1 //FJSTARTHEADER 2 // $Id: ClusterSequence_Delaunay.cc 3 475 2014-07-29 11:57:23Z salam $2 // $Id: ClusterSequence_Delaunay.cc 3918 2015-07-03 14:19:13Z salam $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 70 70 // initialise our DNN structure with the set of points 71 71 auto_ptr<DynamicNearestNeighbours> DNN; 72 bool verbose = false; 72 73 #ifndef DROP_CGAL // strategy = NlnN* are not supported if we drop CGAL... 73 bool verbose = false;74 74 bool ignore_nearest_is_mirror = (_Rparam < twopi); 75 75 if (_strategy == NlnN4pi) { … … 126 126 jet_i = SmallestDijPair.first; 127 127 jet_j = SmallestDijPair.second; 128 if (verbose) cout << "CS_Delaunay found recombination candidate: " << jet_i << " " << jet_j << " " << SmallestDij << endl; // GPS debugging 128 129 // distance is immediately removed regardless of whether or not 129 130 // it is used. … … 139 140 if (!recombine_with_beam) {Valid2 = DNN->Valid(jet_j);} 140 141 else {Valid2 = true;} 141 142 if (verbose) cout << "CS_Delaunay validities i & j: " << DNN->Valid(jet_i) << " " << Valid2 << endl; 142 143 } while ( !DNN->Valid(jet_i) || !Valid2); 143 144 … … 148 149 if (! recombine_with_beam) { 149 150 int nn; // will be index of new jet 151 if (verbose) cout << "CS_Delaunay call _do_ij_recomb: " << jet_i << " " << jet_j << " " << SmallestDij << endl; // GPS debug 150 152 _do_ij_recombination_step(jet_i, jet_j, SmallestDij, nn); 151 153 //OBS // merge the two jets, add new jet, remove old ones … … 169 171 } else { 170 172 // recombine the jet with the beam 173 if (verbose) cout << "CS_Delaunay call _do_iB_recomb: " << jet_i << " " << SmallestDij << endl; // GPS debug 171 174 _do_iB_recombination_step(jet_i, SmallestDij); 172 175 //OBS _add_step_to_history(n+i,_jets[jet_i].cluster_hist_index(),BeamJet, -
external/fastjet/DnnPlane.cc
rf118021 r973b92a 1 1 //FJSTARTHEADER 2 // $Id: DnnPlane.cc 3 442 2014-07-24 07:20:49Z salam $2 // $Id: DnnPlane.cc 3918 2015-07-03 14:19:13Z salam $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 260 260 // to reflect the fact that the points are no longer valid. 261 261 _TR.remove(_supervertex[index].vertex); 262 if (_verbose) cout << "DnnPlane about to set _supervertex["<< index<<"].vertex to NULL" << endl; 262 263 _supervertex[index].vertex = NULL; 264 if (_verbose) cout << " value is " << (_is_not_null(_supervertex[index].vertex)) << endl; 263 265 } 264 266 … … 297 299 int index = _supervertex.size()-1; 298 300 indices_added.push_back(index); 299 if (_verbose) cout << " adding " << index << endl; 301 if (_verbose) cout << " adding " << index << " at " 302 << points_to_add[ia].first<< " " << points_to_add[ia].second << endl; 300 303 301 304 //if (indices_to_remove.size() > 0) { -
external/fastjet/VERSION
rf118021 r973b92a 1 3.1. 21 3.1.3 -
external/fastjet/config_auto.h
rf118021 r973b92a 64 64 #endif 65 65 66 /* defined if C++11 features have been enabled */ 67 /* #undef HAVE_CXX11_FEATURES */ 68 66 69 /* defined if demangling is enabled at configure time and is supported through 67 70 the GNU C++ ABI */ … … 151 154 /* Define to the full name and version of this package. */ 152 155 #ifndef FASTJET_PACKAGE_STRING 153 #define FASTJET_PACKAGE_STRING "FastJet 3.1. 2"156 #define FASTJET_PACKAGE_STRING "FastJet 3.1.3" 154 157 #endif 155 158 … … 161 164 /* Define to the version of this package. */ 162 165 #ifndef FASTJET_PACKAGE_VERSION 163 #define FASTJET_PACKAGE_VERSION "3.1. 2"166 #define FASTJET_PACKAGE_VERSION "3.1.3" 164 167 #endif 165 168 … … 171 174 /* Version number of package */ 172 175 #ifndef FASTJET_VERSION 173 #define FASTJET_VERSION "3.1. 2"176 #define FASTJET_VERSION "3.1.3" 174 177 #endif 175 178 … … 186 189 /* Version of the package under the form XYYZZ (instead of X.Y.Z) */ 187 190 #ifndef FASTJET_VERSION_NUMBER 188 #define FASTJET_VERSION_NUMBER 3010 2191 #define FASTJET_VERSION_NUMBER 30103 189 192 #endif 190 193 191 194 /* Patch version of this package */ 192 195 #ifndef FASTJET_VERSION_PATCHLEVEL 193 #define FASTJET_VERSION_PATCHLEVEL 2196 #define FASTJET_VERSION_PATCHLEVEL 3 194 197 #endif 195 198 -
external/fastjet/config_raw.h
rf118021 r973b92a 37 37 /* The TrackJet plugin is enabled */ 38 38 #define ENABLE_PLUGIN_TRACKJET /**/ 39 40 /* defined if C++11 features have been enabled */ 41 /* #undef HAVE_CXX11_FEATURES */ 39 42 40 43 /* defined if demangling is enabled at configure time and is supported through … … 92 95 93 96 /* Define to the full name and version of this package. */ 94 #define PACKAGE_STRING "FastJet 3.1. 2"97 #define PACKAGE_STRING "FastJet 3.1.3" 95 98 96 99 /* Define to the one symbol short name of this package. */ … … 98 101 99 102 /* Define to the version of this package. */ 100 #define PACKAGE_VERSION "3.1. 2"103 #define PACKAGE_VERSION "3.1.3" 101 104 102 105 /* Define to 1 if you have the ANSI C header files. */ … … 104 107 105 108 /* Version number of package */ 106 #define VERSION "3.1. 2"109 #define VERSION "3.1.3" 107 110 108 111 /* Major version of this package */ … … 113 116 114 117 /* Version of the package under the form XYYZZ (instead of X.Y.Z) */ 115 #define VERSION_NUMBER 3010 2118 #define VERSION_NUMBER 30103 116 119 117 120 /* Patch version of this package */ 118 #define VERSION_PATCHLEVEL 2121 #define VERSION_PATCHLEVEL 3 119 122 120 123 /* Pre-release version of this package */ -
external/fastjet/config_win.h
rf118021 r973b92a 1 #define FASTJET_PACKAGE_STRING "FastJet 3.1.2" 2 #define FASTJET_PACKAGE_VERSION "3.1.2" 3 #define FASTJET_VERSION "3.1.2" 4 #define FASTJET_VERSION_MAJOR 3 5 #define FASTJET_VERSION_MINOR 1 6 #define FASTJET_VERSION_PATCHLEVEL 2 7 #define FASTJET_VERSION_NUMBER 30102 1 #define FASTJET_PACKAGE_STRING "FastJet 3.1.3" 2 #define FASTJET_PACKAGE_VERSION "3.1.3" 3 #define FASTJET_VERSION "3.1.3" 4 #define FASTJET_VERSION_MAJOR 3.1.3 5 #define FASTJET_VERSION_MINOR 3.1.3 6 #define FASTJET_VERSION_PATCHLEVEL 3.1.3 7 #define FASTJET_VERSION_PRERELEASE "3.1.3" 8 #define FASTJET_VERSION_NUMBER 00000 8 9 9 10 /* The ATLASCone plugin is disabled by default*/ -
external/fastjet/contribs/Nsubjettiness/AUTHORS
rf118021 r973b92a 1 The Nsubjettiness FastJet contrib was written and is maintained and developed by: 1 ------------------------------------------------------------------------------- 2 2 3 Jesse Thaler <jthaler@jthaler.net> 3 The Nsubjettiness FastJet contrib was written, maintained, and developed by: 4 5 Jesse Thaler <jthaler@mit.edu> 4 6 Ken Van Tilburg <kenvt@stanford.edu> 5 7 Christopher K. Vermilion <christopher.vermilion@gmail.com> 6 8 TJ Wilkason <tjwilk@mit.edu> 7 9 8 Questions and comments should be directed to: jthaler@ jthaler.net.10 Questions and comments should be directed to: jthaler@mit.edu. 9 11 10 For physics details, see: 12 ------------------------------------------------------------------------------- 13 14 For physics details on N-subjettiness, see: 11 15 12 16 Identifying Boosted Objects with N-subjettiness. … … 20 24 New in v2.0 is the winner-take-all axis, described in: 21 25 26 Jet Observables Without Jet Algorithms. 27 Daniele Bertolini, Tucker Chan, and Jesse Thaler. 28 JHEP 1404:013 (2014), arXiv:1310.7584. 29 22 30 Jet Shapes with the Broadening Axis. 23 31 Andrew J. Larkoski, Duff Neill, and Jesse Thaler. 24 32 JHEP 1404:017 (2014), arXiv:1401.2158. 25 33 26 as well as in unpublished work by Gavin Salam.34 Unpublished work by Gavin Salam. 27 35 28 ---------------------------------------------------------------------- 36 New in v2.2 is the XCone jet algorithm, described in: 37 38 XCone: N-jettiness as an Exclusive Cone Jet Algorithm. 39 Iain W. Stewart, Frank J. Tackmann, Jesse Thaler, 40 Christopher K. Vermilion, and Thomas F. Wilkason. 41 arXiv:1508.01516. 42 43 Resolving Boosted Jets with XCone. 44 Jesse Thaler and Thomas F. Wilkason. 45 arXiv:1508.01518. 46 47 ------------------------------------------------------------------------------- -
external/fastjet/contribs/Nsubjettiness/COPYING
rf118021 r973b92a 12 12 to 13 13 14 N-subjettiness: 14 15 arXiv:1011.2268 15 16 arXiv:1108.2701 16 17 18 Winner-take-all axes: 19 arXiv:1310.7584 20 arXiv:1401.2158 21 22 XCone: 23 arXiv:1508.01516 24 arXiv:1508.01518 17 25 18 26 -
external/fastjet/contribs/Nsubjettiness/ChangeLog
rf118021 r973b92a 1 2015-09-28 <jthaler> 2 Updated NEWS for 2.2.1 release. 3 2015-09-18 <jthaler> 4 Fixed duplicate XConePlugin entry in Makefile. 5 2015-08-20 <jthaler> 6 Trying to fix "abs" bug in ExtraRecombiners.cc 7 2015-08-19 <jthaler> 8 Adding arXiv numbers to XCone papers 9 Used this_jet in example_basic_usage. 10 Fixed typo in example_advanced_usage header. 11 Added copy/paste code in README file. 12 2015-08-13 <jthaler> 13 Ready for 2.2.0 release 14 2015-07-23 <jthaler> 15 Fixed typo in GenET_GenKT_Axes error message 16 Added _too_few_axes_warning to ExclusiveJetAxes and ExclusiveCombinatorialJetAxes 17 Switched to ../data/single_event_ee.dat for make check 18 2015-07-20 <jthaler> 19 Renamed WinnerTakeAllRecombiner.hh/cc to ExtraRecombiners.hh/cc 20 Added _too_few_axes_warning to HardestJetAxes 21 Added GenKT_Axes and OnePass_GenKT_Axes and Comb_GenKT_Axes (using E-scheme recombination). 22 Added warning about p < 0 or delta <=0 in GenKT axes finders. 23 Added warning about beta <= 0 in all measures. 24 2015-07-10 <jthaler> 25 Putting in small tweaks in documentation to get ready for 2.2 release candidate 1. 26 2015-06-15 <jthaler> 27 Starting doxygen file for eventual improved documentation. 28 Starting long process of improving documentation throughout. 29 Made the basic usage file a bit easier to read. 30 Adding in LimitedWarnings for old style constructors 31 2015-06-12 <jthaler> 32 Synchronized definition of new measures with XCone paper. 33 In MeasureDefinition, added default values of jet_distance_squared and beam_distance_squared for cases where we don't want to optimize specifically. 34 Fixed bug in OriginalGeometricMeasure and ModifiedGeometric Measure 35 Commented out DeprecatedGeometricMeasure and DeprecatedGeometricCutoffMeasure since they were only causing confusion 36 2015-05-26 <TJW> 37 Removed axis_scale_factor(), added bool to calculate this value if needed to save computation time 38 Defined small offset in denominator of axis scaling according to accuracy of refinement 39 Updated advanced examples to include tau values and number of jet constituents 40 2015-05-25 <jthaler> 41 Clean up of AxesDefinition 42 Splitting get_axes into get_starting_axes and get_refined axes 43 Putting in proper noise ranges (hopefully) for MultiPass 44 Clean up of MeasureDefinition, rename jet_gamma to beam_gamma 45 Put in zero checking for jet_distance in ConicalGeometricMeasure 46 Added in ConicalMeasure for consistency 47 Changing OnePass Minimization to allow for temporary uphill 48 2015-05-24 <TJW> 49 Added Combinatorial GenET_GenKT_Axes and MultiPass_Manual_Axes 50 Moved Axes refining information into MeasureDefinition, associated each measure with corresponding axes refiner 51 Moved get_one_pass_axes into MeasureDefinition, removed any mention of Npass 52 Moved all information on number of passes to AxesDefinition 53 Made AxesRefiner.hh/.cc into defunct files 54 2015-05-22 <jthaler> 55 Cleaning out commented text. Renaming classes to be consistent with recommended usage. 56 2015-05-22 <TJW> 57 Added XConePlugin as a specific implementation of NjettinessPlugin 58 Added usage of XCone beta = 1.0 and beta = 2.0 to both basic and advanced example files 59 Added OriginalGeometric, ModifiedGeometric, ConicalGeometric, and XCone measures to list of test measures 60 Added OnePass_GenRecomb_GenKT_Axes to list of test axes 61 Added description to XCone measure in MeasureDefinition 62 2015-05-21 <TJW> 63 Updated minimization scheme to avoid divide-by-zero errors 64 Fixed various factors of 2 in the definition of the measures 65 2015-04-19 <TJW> 66 Fixed bug in minimization scheme for GeneralAxesRefiner 67 Moved measure_type to DefaultMeasure, removed geometric measure from e+e- example file 68 2015-03-22 <TJW> 69 Added OriginalGeometricMeasure and ModifiedGeometricMeasure definitions 70 Changed all instances of GeometricMeasure to DeprecatedGeometricMeasure, and added error statements 71 Made GeneralAxesRefiner the default axes refiner for Measure Definition, overwritten by DefaultMeasure and GeometricMeasure 72 Created DefaultMeasure class for all the conical measure subclasses 73 Separated out e+e- and pp measures into separate example files 74 2015-03-09 <TJW> 75 Added ConicalGeometric measures with jet_beta and jet_gamma definitions 76 Added XCone measures derived from ConicalGeometric with jet_gamma = 1.0 77 Added GeneralAxesRefiner for use with any measure (currently defined with XCone measure) 78 Added axes_numerator in MeasureDefinition to define the momentum scaling for minimization (currently only defined for Conical Geometric measure) 79 2014-11-28 <TJW> 80 Minor change to default parameters in axes definition 81 2014-10-08 <TJW> 82 Updated example file with new e+e- measure definitions 83 Added measure type to measure definition descriptions 84 Changed order of parameters in new axes definitions 85 Added standard C++ epsilon definition to GeneralERecombiner 86 2014-10-07 <TJW> 87 Updated example_advanced_usage with new axes choices 88 Reversed inheritance of NormalizedMeasure and NormalizedCutoffMeasure (and Geometric) back to original 89 Storing _RcutoffSq as separate variable, and recalculating it in NormalizedMeasure 90 Cleaning up ExclusiveCombinatorialJetAxes and added comments to explain the process 91 Fixed memory leaks using delete_recombiner_when_unused() 92 Fixed manual axes bug in Njettiness 93 Cleaned up enum definitions 94 2014-10-01 <TJW> 95 Added new parameterized recombination scheme to Winner-Take-All recombiner 96 Created Winner-Take-All GenKT and general Recomb GenKT axes finders and onepass versions 97 Created new N choose M minimization axis finder, created N choose M WTA GenKT axis finder as example 98 Removed NPass as constructor argument in AxesDefinition, made it set through protected method 99 Removed TauMode as constructor argument in MeasureDefinition, made it set through protected method 100 Flipped inheritance of NormalizedMeasure and NormalizedCutoffMeasure (same for Geometric) to remove error of squaring the integer maximum 101 Created new MeasureType enum to allow user to choose between pp and ee variables (ee variables need testing) 102 Updated MeasureDefinition constructors to take in extra MeasureType parameter (but defaulted to pp variables) 103 Added new Default TauMode argument 104 Fixed unsigned integers in various places 105 Added setAxes method to NjettinessPlugin 106 2014-08-26 <JDT> 107 Enhanced TauComponents to include more infomation 108 NjettinessExtras now inherits from TauComponents 109 Removed getPartition from Njettiness, to avoid code duplication 110 Fixed double calculating issue in NjettinessPlugin::run_clustering() 111 Now AxesDefinition can use measure information without running AxesRefiner 112 Added TauStructure so the jets returned by TauComponents can know their tau value. 113 2014-08-25 <JDT> 114 Merged MeasureDefinition and MeasureFunction into new MeasureDefinition. 115 Merged StartingAxesFinder and AxesDefinition into new AxesDefinition. 116 Renamed AxesFinder.cc/hh to AxesRefiner.cc/hh 117 Renamed NjettinessDefinition.cc/hh to AxesDefinition.cc/hh 118 Renamed MeasureFunction.cc/hh to MeasureDefinition.cc/hh 119 Renaming result() function in MeasureDefinition to be consistent with Nsubjettiness interface. 120 Split off TauComponents into separate header 121 Added TauPartition class for readability of partitioning 122 Moved NjettinessExtras into TauComponents, as this will eventually be the logical location 123 Added cross check of new MeasureDefinition and AxesDefinition in example_advanced_usage. 124 Lots of comments updated. 125 Changed version number to 2.2.0-alpha-dev, since this is going to be a bigger update than I had originally thought 126 2014-08-20 <JDT> 127 Incorporated code in NjettinessPlugin to handle FJ3.1 treatment of auto_ptr (thanks Gregory) 128 Changed version number to 2.1.1-alpha-dev 129 Split AxesFinder into StartingAxesFinder and RefiningAxesFinder for clarity. 130 Manual axes mode now corresponds to a NULL StartingAxesFinder in Njettiness (so removed AxesFinderFromUserInput) 131 Added AxesRefiningMode to make selection of minimization routine more transparent in Njettiness 132 Moved sq() to more appropriate place in AxesFinder.hh 133 Rearranged Nsubjettiness.hh to make the old code less visible. 134 Renamed AxesFinderFromOnePassMinimization -> AxesFinderFromConicalMinimization 135 Renamed DefaultUnnormalizedMeasureFunction -> ConicalUnnormalizedMeasureFunction 136 Removed supportsMultiPassMinimization() from MeasureDefinition since any One Pass algorithm can be multipass. 1 137 2014-07-09 <JDT> 2 138 Changed version for 2.1.0 release. -
external/fastjet/contribs/Nsubjettiness/ExtraRecombiners.cc
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: WinnerTakeAllRecombiner.cc 597 2014-04-16 23:07:55Z jthaler $7 // $Id: ExtraRecombiners.cc 842 2015-08-20 13:44:31Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 23 23 //---------------------------------------------------------------------- 24 24 25 #include " WinnerTakeAllRecombiner.hh"25 #include "ExtraRecombiners.hh" 26 26 27 27 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh 28 28 29 29 namespace contrib{ 30 31 std::string GeneralEtSchemeRecombiner::description() const { 32 return "General Et-scheme recombination"; 33 } 34 35 // recombine pa and pb according to a generalized Et-scheme parameterized by the power delta 36 void GeneralEtSchemeRecombiner::recombine(const fastjet::PseudoJet & pa, const fastjet::PseudoJet & pb, fastjet::PseudoJet & pab) const { 37 38 // Define new weights for recombination according to delta 39 // definition of ratio done so that we do not encounter issues about numbers being too large for huge values of delta 40 double ratio; 41 if (std::abs(_delta - 1.0) < std::numeric_limits<double>::epsilon()) ratio = pb.perp()/pa.perp(); // save computation time of pow() 42 else ratio = pow(pb.perp()/pa.perp(), _delta); 43 double weighta = 1.0/(1.0 + ratio); 44 double weightb = 1.0/(1.0 + 1.0/ratio); 45 46 double perp_ab = pa.perp() + pb.perp(); 47 // reweight the phi and rap sums according to the weights above 48 if (perp_ab != 0.0) { 49 double y_ab = (weighta * pa.rap() + weightb * pb.rap()); 50 51 double phi_a = pa.phi(), phi_b = pb.phi(); 52 if (phi_a - phi_b > pi) phi_b += twopi; 53 if (phi_a - phi_b < -pi) phi_b -= twopi; 54 double phi_ab = (weighta * phi_a + weightb * phi_b); 55 56 pab.reset_PtYPhiM(perp_ab, y_ab, phi_ab); 57 58 } 59 else { 60 pab.reset(0.0,0.0,0.0,0.0); 61 } 62 } 63 30 64 31 65 std::string WinnerTakeAllRecombiner::description() const { 32 return "Winner Take All schemerecombination";66 return "Winner-Take-All recombination"; 33 67 } 34 68 -
external/fastjet/contribs/Nsubjettiness/NEWS
rf118021 r973b92a 10 10 Note that we have maintain backwards compatibility for the typical ways that 11 11 Nsubjettiness was used. In particular, all of the Nsubjettiness class code in 12 the example file v1.0.3 fromstill compiles, as does the NjettinessPlugin class12 the example file from v1.0.3 still compiles, as does the NjettinessPlugin class 13 13 code that uses the default measure. 14 14 … … 17 17 * NsubjettinessRatio: Direct access to tau_N / tau_M (the most requested 18 18 feature) 19 * MeasureDefinition to allow access to bothnormalized and unnormalized measures19 * MeasureDefinition to allow access to normalized and unnormalized measures 20 20 * AxesDefinition to allow for access to more general axes modes 21 * Winner-Take-All recombination axes: a faster way to find axes than beta =121 * Winner-Take-All recombination axes: a faster way to find axes than beta=1 22 22 minimization, but with comparable performance. 23 23 * TauComponents to get access to the pieces of the N-(sub)jettiness 24 24 calculation. 25 * TauExtras to get complete access to get partitioning and axes information. 25 26 * For clarity, split the example file into an example_basic_usage and 26 example_advanced_usage 27 example_advanced_usage (and example_advanced_usage_ee for e+e- collisions). 27 28 * In Nsubjettiness, access to seedAxes() and currentAxes() to figure out the 28 29 axes used before and after minimization. 29 30 * In Nsubjettiness, access to currentSubjets() to get the subjet fourvectors. 31 * (v2.2) XConePlugin, which improves on the previous NjettinessPlugin to use 32 N-jettiness as a jet finder using the new ConicalGeometric measure. 30 33 34 -- 2.2.1: (Sept 28, 2015) Fix of small Makefile bug 35 -- 2.2.0: (Sept 7, 2015) Inclusion of the XCone jet algorithm, as well as a 36 few new measures, including the "conical geometric" measure and 37 options for e+e- colliders. Improvement of the 38 Measure/AxesDefinition interface to allow for direct 39 use in calculations. 40 * Fixed bug where MultiPass_Axes did not actually minimize 41 * Fixed floating point error with infinity^2 in various measures 31 42 32 -- 2.1.0: (July 9, 2014) Inclusion of Measure Definition/AxesDefinition interface.43 -- 2.1.0: (July 9, 2014) Inclusion of Measure/AxesDefinition interface. 33 44 This was the first publicly available version of Nsubjettiness v2. 34 45 -- 2.0.0: Initial release of v2.0. This was never officially made public. -
external/fastjet/contribs/Nsubjettiness/Njettiness.cc
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: Njettiness.cc 677 2014-06-12 18:56:46Z jthaler $7 // $Id: Njettiness.cc 821 2015-06-15 18:50:53Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 36 36 /////// 37 37 38 LimitedWarning Njettiness::_old_measure_warning; 39 LimitedWarning Njettiness::_old_axes_warning; 40 41 42 // Constructor 38 43 Njettiness::Njettiness(const AxesDefinition & axes_def, const MeasureDefinition & measure_def) 39 : _axes_def(axes_def.create()), _measure_def(measure_def.create()) { 40 setMeasureFunctionAndAxesFinder(); // call helper function to do the hard work 41 } 42 44 : _axes_def(axes_def.create()), _measure_def(measure_def.create()) {} 45 46 // setAxes for Manual mode 47 void Njettiness::setAxes(const std::vector<fastjet::PseudoJet> & myAxes) { 48 if (_axes_def()->needsManualAxes()) { 49 _currentAxes = myAxes; 50 } else { 51 throw Error("You can only use setAxes for manual AxesDefinitions"); 52 } 53 } 54 55 // Calculates and returns all TauComponents that user would want. 56 // This information is stored in _current_tau_components for later access as well. 57 TauComponents Njettiness::getTauComponents(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const { 58 if (inputJets.size() <= n_jets) { //if not enough particles, return zero 59 _currentAxes = inputJets; 60 _currentAxes.resize(n_jets,fastjet::PseudoJet(0.0,0.0,0.0,0.0)); 61 _current_tau_components = TauComponents(); 62 _seedAxes = _currentAxes; 63 _currentPartition = TauPartition(n_jets); // empty partition 64 } else { 65 assert(_axes_def()); // this should never fail. 66 67 if (_axes_def()->needsManualAxes()) { // if manual mode 68 // take current axes as seeds 69 _seedAxes = _currentAxes; 70 71 // refine axes if requested 72 _currentAxes = _axes_def->get_refined_axes(n_jets,inputJets,_seedAxes, _measure_def()); 73 } else { // non-manual axes 74 75 //set starting point for minimization 76 _seedAxes = _axes_def->get_starting_axes(n_jets,inputJets,_measure_def()); 77 78 // refine axes as needed 79 _currentAxes = _axes_def->get_refined_axes(n_jets,inputJets,_seedAxes, _measure_def()); 80 81 // NOTE: The above two function calls are combined in "AxesDefinition::get_axes" 82 // but are separated here to allow seed axes to be stored. 83 } 84 85 // Find and store partition 86 _currentPartition = _measure_def->get_partition(inputJets,_currentAxes); 87 88 // Find and store tau value 89 _current_tau_components = _measure_def->component_result_from_partition(_currentPartition, _currentAxes); // sets current Tau Values 90 } 91 return _current_tau_components; 92 } 93 94 95 /////// 96 // 97 // Below is code for backward compatibility to use the old interface. 98 // May be deleted in a future version 99 // 100 /////// 101 43 102 Njettiness::Njettiness(AxesMode axes_mode, const MeasureDefinition & measure_def) 44 : _axes_def(createAxesDef(axes_mode)), _measure_def(measure_def.create()) { 45 setMeasureFunctionAndAxesFinder(); // call helper function to do the hard work 46 } 47 103 : _axes_def(createAxesDef(axes_mode)), _measure_def(measure_def.create()) {} 104 48 105 // Convert from MeasureMode enum to MeasureDefinition 49 106 // This returns a pointer that will be claimed by a SharedPtr 50 107 MeasureDefinition* Njettiness::createMeasureDef(MeasureMode measure_mode, int num_para, double para1, double para2, double para3) const { 51 108 109 _old_measure_warning.warn("Njettiness::createMeasureDef: You are using the old MeasureMode way of specifying N-subjettiness measures. This is deprecated as of v2.1 and will be removed in v3.0. Please use MeasureDefinition instead."); 110 52 111 // definition of maximum Rcutoff for non-cutoff measures, changed later by other measures 53 112 double Rcutoff = std::numeric_limits<double>::max(); //large number … … 77 136 break; 78 137 case geometric_measure: 79 beta = para1; 80 if (num_para == 1) { 81 return new GeometricMeasure(beta); 82 } else { 83 throw Error("geometric_measure needs 1 parameter (beta)"); 84 } 138 throw Error("This class has been removed. Please use OriginalGeometricMeasure, ModifiedGeometricMeasure, or ConicalGeometricMeasure with the new Njettiness constructor."); 85 139 break; 86 140 case normalized_cutoff_measure: … … 104 158 break; 105 159 case geometric_cutoff_measure: 106 beta = para1; 107 Rcutoff = para2; //Rcutoff parameter is 2nd parameter in geometric_cutoff_measure 108 if(num_para == 2) { 109 return new GeometricCutoffMeasure(beta,Rcutoff); 110 } else { 111 throw Error("geometric_cutoff_measure has 2 parameters (beta, Rcutoff)"); 112 } 113 break; 160 throw Error("This class has been removed. Please use OriginalGeometricMeasure, ModifiedGeometricMeasure, or ConicalGeometricMeasure with the new Njettiness constructor."); 114 161 default: 115 162 assert(false); … … 122 169 // This returns a pointer that will be claimed by a SharedPtr 123 170 AxesDefinition* Njettiness::createAxesDef(Njettiness::AxesMode axes_mode) const { 171 172 _old_axes_warning.warn("Njettiness::createAxesDef: You are using the old AxesMode way of specifying N-subjettiness axes. This is deprecated as of v2.1 and will be removed in v3.0. Please use AxesDefinition instead."); 173 124 174 125 175 switch (axes_mode) { … … 156 206 } 157 207 158 159 // Parsing needed for constructor to set AxesFinder and MeasureFunction 160 // All of the parameter handling is here, and checking that number of parameters is correct. 161 void Njettiness::setMeasureFunctionAndAxesFinder() { 162 // Get the correct MeasureFunction and AxesFinders 163 _measureFunction.reset(_measure_def->createMeasureFunction()); 164 _startingAxesFinder.reset(_axes_def->createStartingAxesFinder(*_measure_def)); 165 _finishingAxesFinder.reset(_axes_def->createFinishingAxesFinder(*_measure_def)); 166 } 167 168 // setAxes for Manual mode 169 void Njettiness::setAxes(const std::vector<fastjet::PseudoJet> & myAxes) { 170 if (_axes_def->supportsManualAxes()) { 171 _currentAxes = myAxes; 172 } else { 173 throw Error("You can only use setAxes for manual AxesDefinitions"); 174 } 175 } 176 177 // Calculates and returns all TauComponents that user would want. 178 // This information is stored in _current_tau_components for later access as well. 179 TauComponents Njettiness::getTauComponents(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const { 180 if (inputJets.size() <= n_jets) { //if not enough particles, return zero 181 _currentAxes = inputJets; 182 _currentAxes.resize(n_jets,fastjet::PseudoJet(0.0,0.0,0.0,0.0)); 183 _current_tau_components = TauComponents(); 184 _seedAxes = _currentAxes; 185 _currentJets = _currentAxes; 186 _currentBeam = PseudoJet(0.0,0.0,0.0,0.0); 187 } else { 188 189 _seedAxes = _startingAxesFinder->getAxes(n_jets,inputJets,_currentAxes); //sets starting point for minimization 190 if (_finishingAxesFinder) { 191 _currentAxes = _finishingAxesFinder->getAxes(n_jets,inputJets,_seedAxes); 192 } else { 193 _currentAxes = _seedAxes; 194 } 195 196 // Find partition and store information 197 // (jet information in _currentJets, beam in _currentBeam) 198 _currentJets = _measureFunction->get_partition(inputJets,_currentAxes,&_currentBeam); 199 200 // Find tau value and store information 201 _current_tau_components = _measureFunction->result_from_partition(_currentJets, _currentAxes,&_currentBeam); // sets current Tau Values 202 } 203 return _current_tau_components; 204 } 205 206 207 // Partition a list of particles according to which N-jettiness axis they are closest to. 208 // Return a vector of length _currentAxes.size() (which should be N). 209 // Each vector element is a list of ints corresponding to the indices in 210 // particles of the particles belonging to that jet. 211 std::vector<std::list<int> > Njettiness::getPartitionList(const std::vector<fastjet::PseudoJet> & particles) const { 212 // core code is in MeasureFunction 213 return _measureFunction->get_partition_list(particles,_currentAxes); 214 } 215 208 209 210 216 211 217 212 } // namespace contrib -
external/fastjet/contribs/Nsubjettiness/Njettiness.hh
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: Njettiness.hh 670 2014-06-06 01:24:42Z jthaler $7 // $Id: Njettiness.hh 822 2015-06-15 23:52:57Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 27 27 28 28 29 #include "Measure Function.hh"30 #include "Axes Finder.hh"31 #include " NjettinessDefinition.hh"29 #include "MeasureDefinition.hh" 30 #include "AxesDefinition.hh" 31 #include "TauComponents.hh" 32 32 33 33 #include "fastjet/PseudoJet.hh" … … 42 42 43 43 namespace contrib { 44 44 45 /** \mainpage Nsubjettiness Documentation 46 * 47 * These Doxygen pages provide automatically generated documentation for the 48 * Nsubjettiness FastJet contrib. This documentation is being slowly improved. 49 * 50 * \section core_classes Core Classes 51 * 52 * - Nsubjettiness: Calculating N-subjettiness jet shapes 53 * - NsubjettinessRatio: Calculating N-subjettiness ratios 54 * - XConePlugin: Running the XCone jet algorithm 55 * - NjettinessPlugin: Running generic N-jettiness as a jet algorithm 56 * 57 * \subsection core_classes_helper Helper Classes for Core 58 * - Njettiness: Core code for all N-(sub)jettiness calculations 59 * - NjettinessExtras: Way to access additional N-jettiness information 60 * - TauComponents: Output format for all N-(sub)jettiness information 61 * - TauPartition: Access to N-(sub)jettiness partitioning information 62 * - PseudoXConePlugin: Testing code to compare to XConePlugin (doesn't use one-pass minimization) 63 * 64 * \section axes_classes Axes Definitions 65 * 66 * \subsection axes_classes_base Base Classes 67 * - AxesDefinition: Defines generic axes definition 68 * - ExclusiveJetAxes: Axes finder from exclusive jet algorithm 69 * - ExclusiveCombinatorialJetAxes: Axes finder from exclusive jet algorithm (with extra axes to test combinatoric options) 70 * - HardestJetAxes: Axes finder from inclusive jet algorithm 71 * 72 * \subsection axes_classes_derived Derived Classes 73 * 74 * \b OnePass means iterative improvement to a (local) N-(sub)jettiness minimum. 75 * 76 * \b MultiPass means using multiple random seed inputs 77 * 78 * \b Comb means checking N + Nextra choose N combinatorial options 79 * 80 * - KT_Axes / OnePass_KT_Axes: Axes from exclusive kT 81 * - CA_Axes / OnePass_CA_Axes: Axes from exclusive Cambridge/Aachen 82 * - AntiKT_Axes / OnePass_AntiKT_Axes: Axes from inclusive anti-kT 83 * - WTA_KT_Axes / OnePass_WTA_KT_Axes: Axes from exclusive kT, using winner-take-all recombination 84 * - WTA_CA_Axes / OnePass_WTA_CA_Axes: Axes from exclusive CA, using winner-take-all recombination 85 * 86 * - GenET_GenKT_Axes / OnePass_GenET_GenKT_Axes / Comb_GenET_GenKT_Axes: Axes from exclusive generalized kt, with generalized Et recombination 87 * - WTA_GenKT_Axes / OnePass_WTA_GenKT_Axes / Comb_WTA_GenKT_Axes: Axes from exclusive generalized kt, with winner-take-all recombination 88 * 89 * - Manual_Axes / OnePass_Manual_Axes / MultiPass_Manual_Axes: Use manual axes 90 * - MultiPass_Axes: Multiple passes with random input seeds 91 * 92 * \subsection axes_classes_helper Helper Classes for Axes 93 * - GeneralEtSchemeRecombiner: Generalized Et-scheme recombiner 94 * - WinnerTakeAllRecombiner: Winner-take-all recombiner (similar functionality now in FastJet 3.1) 95 * - JetDefinitionWrapper: Wrapper for Jet Definitions to handle memory management 96 * 97 * \section measure_classes Measure Definitions 98 * 99 * \subsection measure_classes_bases Base Classes 100 * - MeasureDefinition: Defines generic measures 101 * - DefaultMeasure: Base class for the original N-subjettiness measures 102 * 103 * \subsection measure_classes_derived Derived Classes 104 * - NormalizedMeasure / UnnormalizedMeasure / NormalizedCutoffMeasure / UnnormalizedCutoffMeasure : Variants on the default N-subjettiness measure. 105 * - ConicalMeasure: Similar to default measure, but intended as N-jettiness event shape 106 * - ConicalGeometricMeasure / XConeMeasure: Measure used in XCone jet algorithm 107 * - OriginalGeometricMeasure / ModifiedGeometricMeasure: Dot product measures useful for theoretical calcualtions 108 * 109 * \subsection measure_classes_helper Helper Classes for Measures 110 * - LightLikeAxis : Defines light-like axis 111 */ 112 45 113 /////// 46 114 // … … 49 117 /////// 50 118 51 // ------------------------------------------------------------------------119 ///------------------------------------------------------------------------ 52 120 /// \class Njettiness 53 // Njettiness uses AxesFinder and MeasureFunction together in order to find tau_N for the event. The user specifies 54 // which AxesFinder and which MeasureFunction to use in the calculation, and then Njettiness returns tau_N for the event. 55 // It also can return information about the axes and jets it used in the calculation, as well as information about 56 // how the event was partitioned. 121 /// \brief Core class for N-(sub)jettiness calculations 122 /// 123 /** 124 * The N-jettiness event shape. 125 * 126 * This is the core class used to perform N-jettiness jet finding (via NjettinessPlugin or XConePluggin) 127 * as well as find the N-subjettiness jet shape (via Nsubjettiness). 128 * 129 * In general, the user should never need to call this object. In addition, its API should not be considered 130 * fixed, since all code improvements effectively happen from reorganizing this class. 131 * 132 * Njettiness uses AxesDefinition and MeasureDefinition together in order to find tau_N for the event. 133 * It also can return information about the axes and jets it used in the calculation, as well as 134 * information about how the event was partitioned. 135 */ 57 136 class Njettiness { 58 137 public: 59 138 60 // The various axes choices available to the user 61 // It is recommended to use AxesDefinition instead of these. 139 /// Main constructor that uses AxesMode and MeasureDefinition to specify measure 140 /// Unlike Nsubjettiness or NjettinessPlugin, the value N is not chosen 141 Njettiness(const AxesDefinition & axes_def, const MeasureDefinition & measure_def); 142 143 /// Destructor 144 ~Njettiness() {}; 145 146 /// setAxes for Manual mode 147 void setAxes(const std::vector<fastjet::PseudoJet> & myAxes); 148 149 /// Calculates and returns all TauComponents that user would want. 150 /// This information is stored in _current_tau_components for later access as well. 151 TauComponents getTauComponents(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const; 152 153 /// Calculates the value of N-subjettiness, 154 /// but only returns the tau value from _current_tau_components 155 double getTau(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const { 156 return getTauComponents(n_jets, inputJets).tau(); 157 } 158 159 /// Return all relevant information about tau components 160 TauComponents currentTauComponents() const {return _current_tau_components;} 161 /// Return axes found by getTauComponents. 162 std::vector<fastjet::PseudoJet> currentAxes() const { return _currentAxes;} 163 /// Return seedAxes used if onepass minimization (otherwise, same as currentAxes) 164 std::vector<fastjet::PseudoJet> seedAxes() const { return _seedAxes;} 165 /// Return jet partition found by getTauComponents. 166 std::vector<fastjet::PseudoJet> currentJets() const {return _currentPartition.jets();} 167 /// Return beam partition found by getTauComponents. 168 fastjet::PseudoJet currentBeam() const {return _currentPartition.beam();} 169 /// Return beam partition found by getTauComponents. 170 TauPartition currentPartition() const {return _currentPartition;} 171 172 173 private: 174 175 /// AxesDefinition to use. Implemented as SharedPtrs to avoid memory management headaches 176 SharedPtr<const AxesDefinition> _axes_def; 177 /// MeasureDefinition to use. Implemented as SharedPtrs to avoid memory management headaches 178 SharedPtr<const MeasureDefinition> _measure_def; 179 180 181 // Information about the current information 182 // Defined as mutables, so user should be aware that these change when getTau is called. 183 // TODO: These are not thread safe and should be fixed somehow 184 mutable TauComponents _current_tau_components; //automatically set to have components of 0; these values will be set by the getTau function call 185 mutable std::vector<fastjet::PseudoJet> _currentAxes; //axes found after minimization 186 mutable std::vector<fastjet::PseudoJet> _seedAxes; // axes used prior to minimization (if applicable) 187 mutable TauPartition _currentPartition; //partitioning information 188 189 /// Warning if the user tries to use v1.0.3 measure style. 190 static LimitedWarning _old_measure_warning; 191 /// Warning if the user tries to use v1.0.3 axes style. 192 static LimitedWarning _old_axes_warning; 193 194 195 public: 196 197 // These interfaces are included for backwards compability, and will be deprecated in a future release (scheduled for deletion in v3.0) 198 199 /// \deprecated 200 /// Deprecated enum to determine axes mode 201 /// The various axes choices available to the user 202 /// It is recommended to use AxesDefinition instead of these. 62 203 enum AxesMode { 63 204 kt_axes, // exclusive kt axes … … 69 210 onepass_ca_axes, // one-pass minimization from ca starting point 70 211 onepass_antikt_0p2_axes, // one-pass minimization from antikt-0.2 starting point 71 onepass_wta_kt_axes, //one-pass minimization of WTA axes with kt 72 onepass_wta_ca_axes, //one-pass minimization of WTA axes with ca 212 onepass_wta_kt_axes, //one-pass minimization of WTA axes with kt 213 onepass_wta_ca_axes, //one-pass minimization of WTA axes with ca 73 214 min_axes, // axes that minimize N-subjettiness (100 passes by default) 74 215 manual_axes, // set your own axes with setAxes() 75 216 onepass_manual_axes // one-pass minimization from manual starting point 76 // These options are commented out because they have not been fully tested77 // wta2_kt_axes, // Winner Take All (alpha = 2) with kt78 // wta2_ca_axes, // Winner Take All (alpha = 2) with CA79 // onepass_wta2_kt_axes, //one-pass minimization of WTA (alpha = 2) axes with kt80 // onepass_wta2_ca_axes, //one-pass minimization of WTA (alpha = 2) axes with ca81 217 }; 82 83 // The measures available to the user. 84 // "normalized_cutoff_measure" was the default in v1.0 of Nsubjettiness 85 // "unnormalized_measure" is now the recommended default usage 86 // But it is recommended to use MeasureDefinition instead of these. 218 219 /// \deprecated 220 /// Deprecated enum to determine measure mode 221 /// The measures available to the user. 222 /// "normalized_cutoff_measure" was the default in v1.0 of Nsubjettiness 223 /// "unnormalized_measure" is now the recommended default usage 224 /// But it is recommended to use MeasureDefinition instead of these. 87 225 enum MeasureMode { 88 226 normalized_measure, //default normalized measure … … 93 231 geometric_cutoff_measure //geometric measure with explicit Rcutoff 94 232 }; 95 96 // Main constructor that uses AxesMode and MeasureDefinition to specify measure 97 // Unlike Nsubjettiness or NjettinessPlugin, the value N is not chosen 98 Njettiness(const AxesDefinition & axes_def, const MeasureDefinition & measure_def); 99 100 // Intermediate constructor (needed to enable v1.0.3 backwards compatibility?) 233 234 /// \deprecated 235 /// Intermediate constructor (needed to enable v1.0.3 backwards compatibility?) 101 236 Njettiness(AxesMode axes_mode, const MeasureDefinition & measure_def); 102 103 // Alternative constructor which takes axes/measure information as enums with measure parameters 104 // This version is not recommended 237 238 /// \deprecated 239 /// Old-style constructor which takes axes/measure information as enums with measure parameters 240 /// This version absolutely is not recommended 105 241 Njettiness(AxesMode axes_mode, 106 242 MeasureMode measure_mode, … … 110 246 double para3 = std::numeric_limits<double>::quiet_NaN()) 111 247 : _axes_def(createAxesDef(axes_mode)), _measure_def(createMeasureDef(measure_mode, num_para, para1, para2, para3)) { 112 setMeasureFunctionAndAxesFinder(); // call helper function to do the hard work113 248 } 114 115 // destructor 116 ~Njettiness() {}; 117 118 // setAxes for Manual mode 119 void setAxes(const std::vector<fastjet::PseudoJet> & myAxes); 120 121 // Calculates and returns all TauComponents that user would want. 122 // This information is stored in _current_tau_components for later access as well. 123 TauComponents getTauComponents(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const; 124 125 // Calculates the value of N-subjettiness, 126 // but only returns the tau value from _current_tau_components 127 double getTau(unsigned n_jets, const std::vector<fastjet::PseudoJet> & inputJets) const { 128 return getTauComponents(n_jets, inputJets).tau(); 129 } 130 131 // Return all relevant information about tau components 132 TauComponents currentTauComponents() const {return _current_tau_components;} 133 // Return axes found by getTauComponents. 134 std::vector<fastjet::PseudoJet> currentAxes() const { return _currentAxes;} 135 // Return seedAxes used if onepass minimization (otherwise, same as currentAxes) 136 std::vector<fastjet::PseudoJet> seedAxes() const { return _seedAxes;} 137 // Return jet partition found by getTauComponents. 138 std::vector<fastjet::PseudoJet> currentJets() const {return _currentJets;} 139 // Return beam partition found by getTauComponents. 140 fastjet::PseudoJet currentBeam() const {return _currentBeam;} 141 142 // partition inputs by Voronoi (each vector stores indices corresponding to inputJets) 143 std::vector<std::list<int> > getPartitionList(const std::vector<fastjet::PseudoJet> & inputJets) const; 144 145 private: 146 147 // Information about Axes and Measures to be Used 148 // Implemented as SharedPtrs to avoid memory management headaches 149 SharedPtr<const AxesDefinition> _axes_def; 150 SharedPtr<const MeasureDefinition> _measure_def; 151 152 // The chosen axes/measure mode workers 153 // Implemented as SharedPtrs to avoid memory management headaches 154 // TODO: make into a SharedPtr<const AxesFinder>? 155 SharedPtr<MeasureFunction> _measureFunction; // The chosen measure 156 SharedPtr<AxesFinder> _startingAxesFinder; // The initial axes finder 157 SharedPtr<AxesFinder> _finishingAxesFinder; // A possible minimization step 158 159 // Information about the current information 160 // Defined as mutables, so user should be aware that these change when getTau is called. 161 mutable TauComponents _current_tau_components; //automatically set to have components of 0; these values will be set by the getTau function call 162 mutable std::vector<fastjet::PseudoJet> _currentAxes; //axes found after minimization 163 mutable std::vector<fastjet::PseudoJet> _seedAxes; // axes used prior to minimization (if applicable) 164 mutable std::vector<fastjet::PseudoJet> _currentJets; //partitioning information 165 mutable fastjet::PseudoJet _currentBeam; //return beam, if requested 166 167 // created separate function to set MeasureFunction and AxesFinder in order to keep constructor cleaner. 168 void setMeasureFunctionAndAxesFinder(); 169 170 // Convert old style enums into new style MeasureDefinition 249 250 /// \deprecated 251 /// Convert old style enums into new style MeasureDefinition 171 252 AxesDefinition* createAxesDef(AxesMode axes_mode) const; 172 253 173 // Convert old style enums into new style MeasureDefinition 254 /// \deprecated 255 /// Convert old style enums into new style MeasureDefinition 174 256 MeasureDefinition* createMeasureDef(MeasureMode measure_mode, int num_para, double para1, double para2, double para3) const; 175 257 -
external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.cc
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: NjettinessPlugin.cc 663 2014-06-03 21:26:41Z jthaler $7 // $Id: NjettinessPlugin.cc 821 2015-06-15 18:50:53Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 29 29 namespace contrib{ 30 30 31 31 LimitedWarning NjettinessPlugin::_old_constructor_warning; 32 32 33 33 std::string NjettinessPlugin::description() const {return "N-jettiness jet finder";} … … 48 48 49 49 50 _njettinessFinder.getTau(_N, particles);51 52 std::vector<std::list<int> > partition = _njettinessFinder.getPartitionList(particles);53 54 std::vector< fastjet::PseudoJet> jet_indices_for_extras;50 TauComponents tau_components = _njettinessFinder.getTauComponents(_N, particles); 51 TauPartition tau_partition = _njettinessFinder.currentPartition(); 52 std::vector<std::list<int> > partition = tau_partition.jets_list(); 53 54 std::vector<int> jet_indices_for_extras; 55 55 56 56 // output clusterings for each jet … … 73 73 int finalJet = indices.back(); 74 74 cs.plugin_record_iB_recombination(finalJet, fakeDib); 75 jet_indices_for_extras.push_back(cs.jets()[finalJet] ); // Get the four vector for the final jets to compare later.75 jet_indices_for_extras.push_back(cs.jets()[finalJet].cluster_hist_index()); // Get the four vector for the final jets to compare later. 76 76 } 77 77 … … 79 79 reverse(jet_indices_for_extras.begin(),jet_indices_for_extras.end()); 80 80 81 NjettinessExtras * extras = new NjettinessExtras(_njettinessFinder.currentTauComponents(),jet_indices_for_extras,_njettinessFinder.currentAxes()); 81 // Store extra information about jets 82 NjettinessExtras * extras = new NjettinessExtras(tau_components,jet_indices_for_extras); 83 84 #if FASTJET_VERSION_NUMBER>=30100 85 cs.plugin_associate_extras(extras); 86 #else 87 // auto_ptr no longer supported, apparently 82 88 cs.plugin_associate_extras(std::auto_ptr<ClusterSequence::Extras>(extras)); 83 89 #endif 90 84 91 } 85 92 -
external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: NjettinessPlugin.hh 671 2014-06-10 17:47:52Z jthaler $7 // $Id: NjettinessPlugin.hh 822 2015-06-15 23:52:57Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 26 26 #define __FASTJET_CONTRIB_NJETTINESSPLUGIN_HH__ 27 27 28 #include <fastjet/config.h> 29 28 30 #include "Njettiness.hh" 29 #include "MeasureFunction.hh" 30 #include "AxesFinder.hh" 31 #include "MeasureDefinition.hh" 32 #include "AxesDefinition.hh" 33 #include "TauComponents.hh" 31 34 32 35 #include "fastjet/ClusterSequence.hh" … … 41 44 namespace contrib { 42 45 43 //------------------------------------------------------------------------44 /// \class NjettinessExtras45 // This class contains the same information as Njettiness, but redoes it in terms of the ClusterSequence::Extras class.46 // This is done in order to help improve the interface for the main NjettinessPlugin class.47 // TODO: This class should probably be merged with TauComponents, since both have access48 // to similar information49 class NjettinessExtras : public ClusterSequence::Extras {50 51 public:52 NjettinessExtras(TauComponents tau_components, std::vector<fastjet::PseudoJet> jets, std::vector<fastjet::PseudoJet> axes) : _tau_components(tau_components), _jets(jets), _axes(axes) {}53 54 double totalTau() const {return _tau_components.tau();}55 std::vector<double> subTaus() const {return _tau_components.jet_pieces();}56 std::vector<fastjet::PseudoJet> jets() const {return _jets;}57 std::vector<fastjet::PseudoJet> axes() const {return _axes;}58 59 double totalTau(const fastjet::PseudoJet& /*jet*/) const {60 return _tau_components.tau();61 }62 63 double subTau(const fastjet::PseudoJet& jet) const {64 if (labelOf(jet) == -1) return std::numeric_limits<double>::quiet_NaN(); // nonsense65 return _tau_components.jet_pieces()[labelOf(jet)];66 }67 68 double beamTau() const {69 return _tau_components.beam_piece();70 }71 72 fastjet::PseudoJet axis(const fastjet::PseudoJet& jet) const {73 return _axes[labelOf(jet)];74 }75 46 76 bool has_njettiness_extras(const fastjet::PseudoJet& jet) const { 77 return (labelOf(jet) >= 0); 78 } 79 80 private: 81 82 TauComponents _tau_components; 83 std::vector<fastjet::PseudoJet> _jets; 84 std::vector<fastjet::PseudoJet> _axes; 85 86 int labelOf(const fastjet::PseudoJet& jet) const { 87 int thisJet = -1; 88 for (unsigned int i = 0; i < _jets.size(); i++) { 89 if (_jets[i].cluster_hist_index() == jet.cluster_hist_index()) { 90 thisJet = i; 91 break; 92 } 93 } 94 return thisJet; 95 } 96 }; 97 98 inline const NjettinessExtras * njettiness_extras(const fastjet::PseudoJet& jet) { 99 const ClusterSequence * myCS = jet.associated_cluster_sequence(); 100 if (myCS == NULL) return NULL; 101 const NjettinessExtras* extras = dynamic_cast<const NjettinessExtras*>(myCS->extras()); 102 return extras; 103 } 104 105 inline const NjettinessExtras * njettiness_extras(const fastjet::ClusterSequence& myCS) { 106 const NjettinessExtras* extras = dynamic_cast<const NjettinessExtras*>(myCS.extras()); 107 return extras; 108 } 109 110 /// The Njettiness jet algorithm 47 /// \class NjettinessPlugin 48 /// \brief Implements the N-jettiness Jet Algorithm 111 49 /** 112 50 * An exclusive jet finder that identifies N jets; first N axes are found, then … … 114 52 * corresponding jet is simply the four-momentum sum of these particles. 115 53 * 116 * A xes can be found in several ways, specified by the AxesMode argument. The117 * recommended choices are54 * As of version 2.2, it is recommended to use the XConePlugin, which has 55 * sensible default values for jet finding. 118 56 * 119 * kt_axes : exclusive kT 120 * wta_kt_axes : exclusive kT with winner-take-all-recombination 121 * onepass_kt_axes : one-pass minimization seeded by kt (pretty good) 122 * onepass_wta_kt_axes : one-pass minimization seeded by wta_kt 57 * Axes can be found in several ways, specified by the AxesDefinition argument. 58 * The recommended AxesDefinitions for jet finding (different than for jet shapes) 59 * OnePass_AntiKT(R0) : one-pass minimization from anti-kT starting point 60 * OnePass_GenET_GenKT_Axes(delta, p, R0) : one-pass min. from GenET/KT 61 * OnePass_WTA_GenKT_Axes(p, R0) : one-pass min from WTA/GenKT 62 * For recommendations on which axes to use, please see the README file. 63 * 64 * Jet regions are determined by the MeasureDefinition. The recommended choices 65 * for jet finding are 66 * ConicalMeasure(beta,R0) : perfect cones in rapidity/azimuth plane 67 * XConeMeasure(beta,R0) : approximate cones based on dot product distances. 123 68 * 124 * For the UnnormalizedMeasure(beta), N-jettiness is defined as: 125 * 126 * tau_N = Sum_{all particles i} p_T^i min((DR_i1)^beta, (DR_i2)^beta, ...) 127 * 128 * DR_ij is the distance sqrt(Delta_phi^2 + Delta_rap^2) between particle i 129 * and jet j. 69 * Other measures introduced in version 2.2 include OriginalGeometricMeasure, 70 * ModifiedGeometricMeasure, and ConicalGeometricMeasure, which define N-jettiness 71 * through dot products of particle momenta with light-like axes. OriginalGeometricMeasure 72 * produces football-shaped jets due to its central weighting of the beam measure, 73 * but ModifiedGeometric and ConicalGeometric both deform the original geometric measure 74 * to allow for cone-shaped jets. The size of these cones can be controlled through Rcutoff 75 * just as in the other measures. See the README file or MeasureDefinition.hh for information 76 * on how to call these measures. 130 77 * 131 * The NormalizedMeausure include an extra parameter R0, and the various cutoff132 * measures include an Rcutoff, which effectively defines an angular cutoff133 * similar in effect to a cone-jet radius.134 *135 78 */ 136 137 79 class NjettinessPlugin : public JetDefinition::Plugin { 138 80 public: 139 81 140 // Constructor with same arguments as Nsubjettiness.82 /// Constructor with same arguments as Nsubjettiness (N, AxesDefinition, MeasureDefinition) 141 83 NjettinessPlugin(int N, 142 84 const AxesDefinition & axes_def, … … 144 86 : _njettinessFinder(axes_def, measure_def), _N(N) {} 145 87 88 89 /// Description 90 virtual std::string description () const; 91 /// Jet radius (this does not make sense yet) 92 virtual double R() const {return -1.0;} // TODO: make this not stupid 93 94 /// The actually clustering, which first called Njettiness and then creates a dummy ClusterSequence 95 virtual void run_clustering(ClusterSequence&) const; 96 97 /// For using manual axes with Njettiness Plugin 98 void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) { 99 // Cross check that manual axes are being used is in Njettiness 100 _njettinessFinder.setAxes(myAxes); 101 } 102 103 /// Destructor 104 virtual ~NjettinessPlugin() {} 105 106 private: 107 108 Njettiness _njettinessFinder; ///< The core Njettiness that does the heavy lifting 109 int _N; ///< Number of exclusive jets to find. 110 111 /// Warning if the user tries to use v1.0.3 constructor. 112 static LimitedWarning _old_constructor_warning; 146 113 114 public: 115 147 116 // Alternative constructors that define the measure via enums and parameters 148 // These constructors are likely be removed 117 // These constructors are deprecated and will be removed in a future version. 118 119 /// \deprecated 120 /// Old-style constructor with 0 arguments (DEPRECATED) 149 121 NjettinessPlugin(int N, 150 Njettiness::AxesMode axes_mode, 151 Njettiness::MeasureMode measure_mode) 152 : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {} 122 Njettiness::AxesMode axes_mode, 123 Njettiness::MeasureMode measure_mode) 124 : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) { 125 _old_constructor_warning.warn("NjettinessPlugin: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead."); 126 } 153 127 128 /// \deprecated 129 /// Old-style constructor with 1 argument (DEPRECATED) 130 NjettinessPlugin(int N, 131 Njettiness::AxesMode axes_mode, 132 Njettiness::MeasureMode measure_mode, 133 double para1) 134 : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) { 135 _old_constructor_warning.warn("NjettinessPlugin: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead."); 154 136 137 } 138 139 /// \deprecated 140 /// Old-style constructor with 2 arguments (DEPRECATED) 155 141 NjettinessPlugin(int N, 156 Njettiness::AxesMode axes_mode, 157 Njettiness::MeasureMode measure_mode, 158 double para1) 159 : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {} 142 Njettiness::AxesMode axes_mode, 143 Njettiness::MeasureMode measure_mode, 144 double para1, 145 double para2) 146 : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) { 147 _old_constructor_warning.warn("NjettinessPlugin: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead."); 160 148 149 } 161 150 151 /// \deprecated 152 /// Old-style constructor with 3 arguments (DEPRECATED) 162 153 NjettinessPlugin(int N, 163 Njettiness::AxesMode axes_mode, 164 Njettiness::MeasureMode measure_mode, 165 double para1, 166 double para2) 167 : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) {} 154 Njettiness::AxesMode axes_mode, 155 Njettiness::MeasureMode measure_mode, 156 double para1, 157 double para2, 158 double para3) 159 : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) { 160 _old_constructor_warning.warn("NjettinessPlugin: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead."); 161 } 168 162 169 170 NjettinessPlugin(int N, 171 Njettiness::AxesMode axes_mode, 172 Njettiness::MeasureMode measure_mode, 173 double para1, 174 double para2, 175 double para3) 176 : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) {} 177 178 179 // Old constructor for backwards compatibility with v1.0, 180 // where NormalizedCutoffMeasure was the only option 163 /// \deprecated 164 /// Old-style constructor for backwards compatibility with v1.0, when NormalizedCutoffMeasure was the only option 181 165 NjettinessPlugin(int N, 182 166 Njettiness::AxesMode mode, … … 184 168 double R0, 185 169 double Rcutoff=std::numeric_limits<double>::max()) 186 : _njettinessFinder(mode, NormalizedCutoffMeasure(beta, R0, Rcutoff)), _N(N) {} 170 : _njettinessFinder(mode, NormalizedCutoffMeasure(beta, R0, Rcutoff)), _N(N) { 171 _old_constructor_warning.warn("NjettinessPlugin: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the NjettinessPlugin constructor based on AxesDefinition and MeasureDefinition instead."); 172 } 187 173 188 189 190 // The things that are required by base class.191 virtual std::string description () const;192 virtual double R() const {return -1.0;} // TODO: make this not stupid193 virtual void run_clustering(ClusterSequence&) const;194 195 virtual ~NjettinessPlugin() {}196 197 private:198 199 Njettiness _njettinessFinder;200 int _N;201 174 202 175 }; -
external/fastjet/contribs/Nsubjettiness/Nsubjettiness.cc
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: Nsubjettiness.cc 597 2014-04-16 23:07:55Z jthaler $7 // $Id: Nsubjettiness.cc 821 2015-06-15 18:50:53Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 29 29 namespace contrib { 30 30 31 LimitedWarning Nsubjettiness::_old_constructor_warning; 32 33 31 34 //result returns tau_N with normalization dependent on what is specified in constructor 32 35 double Nsubjettiness::result(const PseudoJet& jet) const { -
external/fastjet/contribs/Nsubjettiness/Nsubjettiness.hh
rf118021 r973b92a 5 5 // Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason 6 6 // 7 // $Id: Nsubjettiness.hh 670 2014-06-06 01:24:42Z jthaler $7 // $Id: Nsubjettiness.hh 822 2015-06-15 23:52:57Z jthaler $ 8 8 //---------------------------------------------------------------------- 9 9 // This file is part of FastJet contrib. … … 38 38 namespace contrib { 39 39 40 //------------------------------------------------------------------------ 40 // Classes defined in this file. 41 class Nsubjettiness; 42 class NsubjettinessRatio; 43 44 ///------------------------------------------------------------------------ 41 45 /// \class Nsubjettiness 42 /// Nsubjettiness extends the concept of Njettiness to a jet shape, but other 43 /// than the set of particles considered, they are identical. This class 44 /// wraps the core Njettiness code to provide the fastjet::FunctionOfPseudoJet 45 /// interface for convenience in larger analyses. See NjettinessPlugin.hh for 46 /// definitions of tau_N and the constructor options. 46 /// \brief Implements the N-subjettiness jet shape 47 /// 48 /** 49 * The N-jettiness jet shape. 50 * 51 * Nsubjettiness extends the concept of Njettiness to a jet shape, but other 52 * than the set of particles considered, they are identical. This class 53 * wraps the core Njettiness code to provide the fastjet::FunctionOfPseudoJet 54 * interface for convenience in larger analyses. 55 * 56 * The recommended AxesDefinitions are: 57 * KT_Axes : exclusive kt axes 58 * WTA_KT_Axes : exclusive kt with winner-take-all recombination 59 * OnePass_KT_Axes : one-pass minimization from kt starting point 60 * OnePass_WTA_KT_Axes : one-pass min. from wta_kt starting point 61 * More AxesDefinitions are listed in the README and defined in AxesDefinition.hh 62 * 63 * The recommended MeasureDefinitions are (with the corresponding parameters) 64 * NormalizedMeasure(beta,R0) 65 * : This was the original N-subjettiness measure (dimensionless) 66 * UnnormalizedMeasure(beta) 67 * : This is the new recommended default, same as above but without 68 * : the normalization factor, and hence has units of GeV 69 * NormalizedCutoffMeasure(beta,R0,Rcutoff) 70 * : Same as normalized_measure, but cuts off at Rcutoff 71 * UnnormalizedCutoffMeasure(beta,Rcutoff) 72 * : Same as unnormalized_measure, but cuts off at Rcutoff 73 * More MeasureDefinitions are listed in the README and defined in MeasureDefinition.hh 74 * 75 * For example, for the UnnormalizedMeasure(beta), N-subjettiness is defined as: 76 * 77 * tau_N = Sum_{i in jet} p_T^i min((DR_i1)^beta, (DR_i2)^beta, ...) 78 * 79 * DR_ij is the distance sqrt(Delta_phi^2 + Delta_rap^2) between particle i 80 * and jet j. 81 * 82 * The NormalizedMeausure include an extra parameter R0, and the various cutoff 83 * measures include an Rcutoff, which effectively defines an angular cutoff 84 * similar in effect to a cone-jet radius. 85 */ 47 86 class Nsubjettiness : public FunctionOfPseudoJet<double> { 48 87 49 88 public: 50 51 52 // Main constructor, which takes N, the AxesDefiniation, and the MeasureDefinition. 53 // The Definitions are given in NjettinessDefinition.hh 54 // 55 // The recommended AxesDefinitions are (more are available as listed in the README 56 // and defined in NjettinessDefinition.hh): 57 // KT_Axes : exclusive kt axes 58 // WTA_KT_Axes : exclusive kt with winner-take-all recombination 59 // OnePass_KT_Axes : one-pass minimization from kt starting point 60 // OnePass_WTA_KT_Axes : one-pass min. from wta_kt starting point 61 // 62 // The recommended measure definitions are (with the corresponding parameters) 63 // NormalizedMeasure(beta,R0) 64 // : This was the original N-subjettiness measure (dimensionless) 65 // UnnormalizedMeasure(beta) 66 // : This is the new recommended default, same as above but without 67 // : the normalization factor, and hence has units of GeV 68 // NormalizedCutoffMeasure(beta,R0,Rcutoff) 69 // : Same as normalized_measure, but cuts off at Rcutoff 70 // UnnormalizedCutoffMeasure(beta,Rcutoff) 71 // : Same as unnormalized_measure, but cuts off at Rcutoff 89 90 /// Main constructor, which takes N, the AxesDefinition, and the MeasureDefinition. 91 /// The Definitions are given in AxesDefinition.hh and MeasureDefinition.hh 72 92 Nsubjettiness(int N, 73 93 const AxesDefinition& axes_def, … … 75 95 : _njettinessFinder(axes_def,measure_def), _N(N) {} 76 96 77 78 // Alternative constructors that define the measure via enums and parameters 79 // These constructors are likely be removed 80 // Zero parameter arguments 81 // (Currently, no measure uses this) 97 /// Returns tau_N, measured on the constituents of this jet 98 double result(const PseudoJet& jet) const; 99 100 /// Returns components of tau_N, so that user can find individual tau values. 101 TauComponents component_result(const PseudoJet& jet) const; 102 103 /// To set axes in manual mode 104 void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) { 105 // Note that cross check that manual mode has been set is in Njettiness 106 _njettinessFinder.setAxes(myAxes); 107 } 108 109 /// returns seed axes used for onepass minimization (otherwise same as currentAxes) 110 std::vector<fastjet::PseudoJet> seedAxes() const { 111 return _njettinessFinder.seedAxes(); 112 } 113 114 /// returns current axes found by result() calculation 115 std::vector<fastjet::PseudoJet> currentAxes() const { 116 return _njettinessFinder.currentAxes(); 117 } 118 119 /// returns subjet regions found by result() calculation (these have valid constituents) 120 /// Note that the axes and the subjets are not the same 121 std::vector<fastjet::PseudoJet> currentSubjets() const { 122 return _njettinessFinder.currentJets(); 123 } 124 125 /// returns components of tau_N without recalculating anything 126 TauComponents currentTauComponents() const { 127 return _njettinessFinder.currentTauComponents(); 128 } 129 130 /// returns components of tau_N without recalculating anything 131 TauPartition currentPartition() const { 132 return _njettinessFinder.currentPartition(); 133 } 134 135 private: 136 137 /// Core Njettiness code that is called 138 Njettiness _njettinessFinder; // TODO: should muck with this so result can be const without this mutable 139 /// Number of subjets to find 140 int _N; 141 142 /// Warning if the user tries to use v1.0.3 constructor. 143 static LimitedWarning _old_constructor_warning; 144 145 public: 146 147 // The following interfaces are included for backwards compatibility, but no longer recommended. 148 // They may be deleted in a future release 149 150 /// \deprecated 151 /// Alternative constructors that define the measure via enums and parameters 152 /// These constructors will be removed in v3.0 153 /// Zero parameter arguments 154 /// (Currently, no measure uses this) 82 155 Nsubjettiness(int N, 83 156 Njettiness::AxesMode axes_mode, 84 157 Njettiness::MeasureMode measure_mode) 85 : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {} 86 87 // One parameter argument 88 // (for unnormalized_measure, para1=beta) 158 : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) { 159 _old_constructor_warning.warn("Nsubjettiness: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead."); 160 } 161 162 /// \deprecated 163 /// Construcotr for one parameter argument 164 /// (for unnormalized_measure, para1=beta) 89 165 Nsubjettiness(int N, 90 166 Njettiness::AxesMode axes_mode, 91 167 Njettiness::MeasureMode measure_mode, 92 168 double para1) 93 : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) {} 94 95 // Two parameter arguments 96 // (for normalized_measure, para1=beta, para2=R0) 97 // (for unnormalized_cutoff_measure, para1=beta, para2=Rcutoff) 169 : _njettinessFinder(axes_mode, measure_mode, 1, para1), _N(N) { 170 _old_constructor_warning.warn("Nsubjettiness: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead."); 171 } 172 173 /// \deprecated 174 /// Constructor for two parameter arguments 175 /// (for normalized_measure, para1=beta, para2=R0) 176 /// (for unnormalized_cutoff_measure, para1=beta, para2=Rcutoff) 98 177 Nsubjettiness(int N, 99 178 Njettiness::AxesMode axes_mode, … … 101 180 double para1, 102 181 double para2) 103 : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) {} 104 105 // Three parameter arguments 106 // (for unnormalized_cutoff_measure, para1=beta, para2=R0, para3=Rcutoff) 182 : _njettinessFinder(axes_mode, measure_mode, 2, para1, para2), _N(N) { 183 _old_constructor_warning.warn("Nsubjettiness: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead."); 184 } 185 186 /// \deprecated 187 /// Constructor for three parameter arguments 188 /// (for unnormalized_cutoff_measure, para1=beta, para2=R0, para3=Rcutoff) 107 189 Nsubjettiness(int N, 108 190 Njettiness::AxesMode axes_mode, … … 111 193 double para2, 112 194 double para3) 113 : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) {} 114 115 // Old constructor for backwards compatibility with v1.0, 116 // where normalized_cutoff_measure was the only option 195 : _njettinessFinder(axes_mode, measure_mode, 3, para1, para2, para3), _N(N) { 196 _old_constructor_warning.warn("Nsubjettiness: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead."); 197 } 198 199 /// \deprecated 200 /// Old constructor for backwards compatibility with v1.0, 201 /// where normalized_cutoff_measure was the only option 117 202 Nsubjettiness(int N, 118 203 Njettiness::AxesMode axes_mode, … … 120 205 double R0, 121 206 double Rcutoff=std::numeric_limits<double>::max()) 122 : _njettinessFinder(axes_mode, NormalizedCutoffMeasure(beta,R0,Rcutoff)), _N(N) {} 123 124 /// returns tau_N, measured on the constituents of this jet 125 double result(const PseudoJet& jet) const; 126 127 /// returns components of tau_N, so that user can find individual tau values. 128 TauComponents component_result(const PseudoJet& jet) const; 129 130 /// returns current axes found by result() calculation 131 std::vector<fastjet::PseudoJet> currentAxes() const { 132 return _njettinessFinder.currentAxes(); 133 } 134 135 /// returns seed axes used for onepass minimization (otherwise same as currentAxes) 136 std::vector<fastjet::PseudoJet> seedAxes() const { 137 return _njettinessFinder.seedAxes(); 138 } 139 140 /// returns subjet regions found by result() calculation (these have valid constituents) 141 /// Note that the axes and the subjets are not the same 142 std::vector<fastjet::PseudoJet> currentSubjets() const { 143 return _njettinessFinder.currentJets(); 144 } 145 146 /// returns components of tau_N without recalculating anything 147 TauComponents currentTauComponents() const { 148 return _njettinessFinder.currentTauComponents(); 149 } 150 151 // To set axes for manual use 152 void setAxes(const std::vector<fastjet::PseudoJet> & myAxes) { 153 // Cross check that manual axes are being used is in Njettiness 154 _njettinessFinder.setAxes(myAxes); 155 } 156 157 158 private: 159 160 Njettiness _njettinessFinder; // TODO: should muck with this so result can be const without this mutable 161 int _N; 162 207 : _njettinessFinder(axes_mode, NormalizedCutoffMeasure(beta,R0,Rcutoff)), _N(N) { 208 _old_constructor_warning.warn("Nsubjettiness: You are using the old style constructor. This is deprecated as of v2.1 and will be removed in v3.0. Please use the Nsubjettiness constructor based on AxesDefinition and MeasureDefinition instead."); 209 } 210 163 211 }; 164 212 165 213 166 // ------------------------------------------------------------------------214 ///------------------------------------------------------------------------ 167 215 /// \class NsubjettinessRatio 168 // NsubjettinessRatio uses the results from Nsubjettiness to calculate the ratio 169 // tau_N/tau_M, where N and M are specified by the user. The ratio of different tau values 170 // is often used in analyses, so this class is helpful to streamline code. 216 /// \brief Implements ratios of N-subjettiness jet shapes 217 /// 218 /// NsubjettinessRatio uses the results from Nsubjettiness to calculate the ratio 219 /// tau_N/tau_M, where N and M are specified by the user. The ratio of different tau values 220 /// is often used in analyses, so this class is helpful to streamline code. Note that 221 /// manual axis mode is not supported 171 222 class NsubjettinessRatio : public FunctionOfPseudoJet<double> { 172 223 public: 173 224 174 // Main constructor. Apart from specifying both N and M, the same options as Nsubjettiness225 /// Main constructor. Apart from specifying both N and M, the same options as Nsubjettiness 175 226 NsubjettinessRatio(int N, 176 227 int M, … … 178 229 const MeasureDefinition & measure_def) 179 230 : _nsub_numerator(N,axes_def,measure_def), 180 _nsub_denominator(M,axes_def,measure_def) {} 181 182 // Alternative constructor with enums and parameters 183 // Again, likely to be removed 231 _nsub_denominator(M,axes_def,measure_def) { 232 if (axes_def.needsManualAxes()) { 233 throw Error("NsubjettinessRatio does not support ManualAxes mode."); 234 } 235 } 236 237 /// Returns tau_N/tau_M based off the input jet using result function from Nsubjettiness 238 double result(const PseudoJet& jet) const; 239 240 private: 241 242 Nsubjettiness _nsub_numerator; ///< Function for numerator 243 Nsubjettiness _nsub_denominator; ///< Function for denominator 244 245 public: 246 247 // The following interfaces are included for backwards compatibility, but no longer recommended. 248 // They may be deprecated at some point. 249 250 /// \deprecated 251 /// Old-style constructor for zero arguments 252 /// Alternative constructor with enums and parameters 253 /// Again, likely to be removed 184 254 NsubjettinessRatio(int N, 185 255 int M, … … 188 258 : _nsub_numerator(N, axes_mode, measure_mode), 189 259 _nsub_denominator(M, axes_mode, measure_mode) {} 190 191 260 261 /// \deprecated 262 /// Old-style constructor for one argument 192 263 NsubjettinessRatio(int N, 193 264 int M, … … 197 268 : _nsub_numerator(N, axes_mode, measure_mode, para1), 198 269 _nsub_denominator(M, axes_mode, measure_mode, para1) {} 199 270 271 /// \deprecated 272 /// Old-style constructor for 2 arguments 200 273 NsubjettinessRatio(int N, 201 274 int M, … … 207 280 _nsub_denominator(M, axes_mode, measure_mode, para1, para2) {} 208 281 282 /// \deprecated 283 /// Old-style constructor for 3 arguments 209 284 NsubjettinessRatio(int N, 210 285 int M, … … 217 292 _nsub_denominator(M, axes_mode, measure_mode, para1, para2, para3) {} 218 293 219 //returns tau_N/tau_M based off the input jet using result function from Nsubjettiness 220 double result(const PseudoJet& jet) const; 221 222 private: 223 224 Nsubjettiness _nsub_numerator; 225 Nsubjettiness _nsub_denominator; 226 294 227 295 }; 228 296 -
external/fastjet/contribs/Nsubjettiness/README
rf118021 r973b92a 15 15 New in v2.0 is the winner-take-all axis, which is described in: 16 16 17 Jet Observables Without Jet Algorithms. 18 Daniele Bertolini, Tucker Chan, and Jesse Thaler. 19 JHEP 1404:013 (2014), arXiv:1310.7584. 20 17 21 Jet Shapes with the Broadening Axis. 18 22 Andrew J. Larkoski, Duff Neill, and Jesse Thaler. 19 23 JHEP 1404:017 (2014), arXiv:1401.2158. 20 24 21 as well as in unpublished work by Gavin Salam. 25 Unpublished work by Gavin Salam 26 27 New in v2.2 are new measures used in the XCone jet algorithm, described in: 28 29 XCone: N-jettiness as an Exclusive Cone Jet Algorithm. 30 Iain W. Stewart, Frank J. Tackmann, Jesse Thaler, 31 Christopher K. Vermilion, and Thomas F. Wilkason. 32 arXiv:1508.01516. 33 34 Resolving Boosted Jets with XCone. 35 Jesse Thaler and Thomas F. Wilkason. 36 arXiv:1508.01518. 22 37 23 38 -------------------------------------------------------------------------------- … … 29 44 30 45 Nsubjettiness [Nsubjettiness.hh]: 31 A FunctionOfPseudoJet<double> interface to measure N-subjettiness 46 A FunctionOfPseudoJet<double> interface to measure the 47 N-subjettiness jet shape 32 48 (Recommended for most users) 49 33 50 NsubjettinessRatio [Nsubjettiness.hh]: 34 51 A FunctionOfPseudoJet<double> interface to measure ratios of 35 52 two different N-subjettiness (i.e. tau3/tau2) 53 (Recommended for most users) 54 55 XConePlugin [XConePlugin.hh]: 56 A FastJet plugin for using the XCone jet algorithm. 57 (Recommended for most users) 58 36 59 NjettinessPlugin [NjettinessPlugin.hh]: 37 A FastJet plugin for finding jets by minimizing N-jettiness 38 (Recommended for advanced users) 60 A FastJet plugin for finding jets by minimizing N-jettiness. 61 Same basic philosophy as XCone, but many more options. 62 (Recommended for advanced users only.) 63 39 64 Njettiness [Njettiness.hh]: 40 65 Access to the core Njettiness code. 41 66 (Not recommended for users, since the interface might change) 42 67 43 The code assumes that you have FastJet 3 .68 The code assumes that you have FastJet 3, but does not (yet) require FastJet 3.1 44 69 45 70 -------------------------------------------------------------------------------- … … 64 89 // N and M give tau_N / tau_M, all other options the same 65 90 91 For example, if you just want the tau_2/tau_1 value of a jet, using recommended 92 parameter choices, do this: 93 94 PseudoJet this_jet = /*from your favorite jet algorithm*/; 95 double beta = 1.0; 96 NsubjettinessRatio nSub21(2,1, 97 OnePass_WTA_KT_Axes(), 98 UnnormalizedMeasure(beta)); 99 double tau21 = nSub21(this_jet); 100 66 101 -------------------------------------------------------------------------------- 67 102 AxesDefinition [NjettinessDefinition.hh] … … 72 107 recommended. Arguments in parentheses are parameters that the user must set. 73 108 74 Axes can be found using standard recursive clustering procedures. New is the 75 option to use the "winner-take-all" recombination scheme: 76 (*) KT_Axes // exclusive kt axes 77 CA_Axes // exclusive ca axes 78 AntiKT_Axes(R0) // inclusive hardest axes with antikt, R0 = radius 79 (*) WTA_KT_Axes // exclusive kt with winner-take-all recombination 80 WTA_CA_Axes // exclusive ca with winner-take-all recombination 81 82 One can also run a minimization routine to find a (local) minimum of 83 N-(sub)jettiness: 109 Axes can be found using standard recursive clustering procedures. New in v2 is 110 the option to use the "winner-take-all" recombination scheme: 111 (*) KT_Axes // exclusive kt axes 112 CA_Axes // exclusive ca axes 113 AntiKT_Axes(R0) // inclusive hardest axes with antikt, R0 = radius 114 (*) WTA_KT_Axes // exclusive kt with winner-take-all recombination 115 WTA_CA_Axes // exclusive ca with winner-take-all recombination 116 117 New in v2.2 are generalized recombination/clustering schemes: 118 GenET_GenKT_Axes(delta, p, R0 = inf) 119 WTA_GenKT_Axes(p, R0 = inf) 120 GenKT_Axes(p, R0 = inf) 121 Here, delta > 0 labels the generalized ET recombination scheme (delta = 1 for 122 standard ET scheme, delta = 2 for ET^2 scheme, delta = infinity for WTA scheme) 123 p >= 0 labels the generalized KT clustering metric (p = 0 for ca, p = 1 for kt), 124 R0 is the radius parameter, and the clustering is run in exclusive mode. The 125 GenKT_Axes mode uses standard E-scheme recombination. By default the value of 126 R0 is set to "infinity", namely fastjet::JetDefinition::max_allowable_R. 127 128 Also new in v2.2 is option of identifying nExtra axes through exclusive 129 clustering and then looking at all (N + nExtra) choose N axes and finding the 130 one that gives the smallest N-(sub)jettiness value: 131 Comb_GenET_GenKT_Axes(nExtra, delta, p, R0 = inf) 132 Comb_WTA_GenKT_Axes(nExtra, p, R0 = inf) 133 Comb_GenKT_Axes(nExtra, p, R0 = inf) 134 These modes are not recommended for reasons of speed. 135 136 Starting from any set of seed axes, one can run a minimization routine to find 137 a (local) minimum of N-(sub)jettiness. Note that the one-pass minimization 138 routine is tied to the choice of MeasureDefinition. 84 139 (*) OnePass_KT_Axes // one-pass minimization from kt starting point 85 140 OnePass_CA_Axes // one-pass min. from ca starting point … … 87 142 (*) OnePass_WTA_KT_Axes // one-pass min. from wta_kt starting point 88 143 OnePass_WTA_CA_Axes // one-pass min. from wta_ca starting point 89 90 In general, it is difficult to finding the global minimum, but this mode 91 attempts to do so 92 MultiPass_Axes(Npass) // axes that (attempt to) minimize N-subjettiness 93 // (NPass = 100 is typical) 144 OnePass_GenET_GenKT_Axes(delta, p, R0 = inf) // one-pass min. from GenET/KT 145 OnePass_WTA_GenKT_Axes(p, R0 = inf) // one-pass min from WTA/GenKT 146 OnePass_GenKT_Axes(p, R0 = inf) // one-pass min from GenKT 147 148 For one-pass minimization, OnePass_CA_Axes and OnePass_WTA_CA_Axes are not 149 recommended as they provide a poor choice of seed axes. 150 151 In general, it is difficult to find the global minimum, but this mode attempts 152 to do so: 153 MultiPass_Axes(NPass) // axes that (attempt to) minimize N-subjettiness 154 // (NPass = 100 is typical) 155 This does multi-pass minimization from KT_Axes starting points. 94 156 95 157 Finally, one can set manual axes: 96 Manual_Axes // set your own axes with setAxes() 97 OnePass_Manual_Axes // one-pass minimization from manual starting point 158 Manual_Axes // set your own axes with setAxes() 159 OnePass_Manual_Axes // one-pass minimization from manual starting point 160 MultiPass_Manual_Axes(Npass) // multi-pass min. from manual 161 162 If one wants to change the number of passes used by any of the axes finders, one 163 can call the function 164 setNPass(NPass,nAttempts,accuracy,noise_range) 165 where NPass = 0 only uses the seed axes, NPass = 1 is one-pass minimization, and 166 NPass = 100 is the default multi-pass. nAttempts is the number of iterations to 167 use in each pass, accuracy is how close to the minimum one tries to get, and 168 noise_range is how much in rapidity/azimuth the random axes are jiggled. 98 169 99 170 For most cases, running with OnePass_KT_Axes or OnePass_WTA_KT_Axes gives 100 171 reasonable results (and the results are IRC safe). Because it uses random 101 number seeds, MultiPass_Axes is not IRC safe (and the code is rather slow). Note102 that for the minimization routines, beta = 1.1 is faster than beta = 1, with 103 comparable performance.172 number seeds, MultiPass_Axes is not IRC safe (and the code is rather slow). 173 Note that for the minimization routines, beta = 1.1 is faster than beta = 1, 174 with comparable performance. 104 175 105 176 -------------------------------------------------------------------------------- … … 107 178 -------------------------------------------------------------------------------- 108 179 109 At the moment, there are only a few measures. Note that each one has a 110 different number of parameters. The one indicated by (*) 111 is the one recommended for use by users new to Nsubjettiness. 180 The value of N-(sub)jettiness depends crucially on the choice of measure. Each 181 measure has a different number of parameters, so one has to be careful when 182 switching between measures The one indicated by (*) is the one recommended for 183 use by users new to Nsubjettiness. 112 184 113 185 The original N-subjettiness measures are: … … 122 194 UnnormalizedCutoffMeasure(beta,Rcutoff) //unnormalized measure with 123 195 //additional Rcutoff 124 125 In beta testing are "geometric" measures where distances are measured using the 126 Lorentz dot product (N.B. the formula for the geometric measure is likely to 127 change since there should be separate beam and jet beta factors.) 128 GeometricMeasure(beta) //geometric measure with exponent beta 129 GeometricCutoffMeasure(beta,Rcutoff) //geometric measure with Rcutoff 196 197 For all of the above measures, there is an optional argument to change from the 198 ordinary pt_R distance measure recommended for pp collisions to an 199 E_theta distance measure recommended for ee collisions. There are also 200 lorentz_dot and perp_lorentz_dot distance measures recommended only for 201 advanced users. 202 203 New for v2.2 is a set of measures defined in arXiv:1508.01516. First, there is 204 the "conical measure": 205 206 ConicalMeasure(beta,R0) // same jets as UnnormalizedCutoffMeasure 207 // but differs in normalization and specifics 208 // of one-pass minimization 209 210 Next, there is the geometric measure (as well as a modified version to yield 211 more conical jet regions): 212 213 OriginalGeometricMeasure(R) // not recommended for analysis 214 ModifiedGeometricMeasure(R) 215 216 (Prior to v2.2, there was a "GeometricMeasure" which unfortunately had the wrong 217 definition. These have been commented out in the code as 218 "DeprecatedGeometricMeasure" and "DeprecatedGeometricCutoffMeasure", but they 219 should not be used.) 220 221 Next, there is a "conical geometric" measure: 222 223 ConicalGeometricMeasure(beta, gamma, Rcutoff) 224 225 This is a hybrid between the conical and geometric measures and is the basis for 226 the XCone jet algorithm. Finally, setting to the gamma = 1 default gives the 227 XCone default measure, which is used in the XConePlugin jet finder 228 229 (*) XConeMeasure(beta,Rcutoff) 230 231 where beta = 2 is the recommended default value and beta = 1 is the recoil-free 232 default. 130 233 131 234 -------------------------------------------------------------------------------- … … 138 241 139 242 beta = 1: aka broadening/girth/width measure 243 the axes behave like the "median" in that they point to the hardest cluster 140 244 wta_kt_axes are approximately the same as minimizing beta = 1 measure 141 245 142 246 beta = 2: aka thrust/mass measure 247 the axes behave like the "mean" in that they point along the jet momentum 143 248 kt_axes are approximately the same as minimizing beta = 2 measure 144 249 … … 149 254 150 255 -------------------------------------------------------------------------------- 151 TauComponents [MeasureFunction.hh] 152 -------------------------------------------------------------------------------- 153 154 For most users, they will only need the value of N-subjettiness (i.e. tau) 155 itself. For advanced users, they can access individual tau components (i.e. 156 the individual numerator pieces, the denominator, etc.) 157 158 TauComponents tauComp = nSub.component_result(jet); 159 vector<double> numer = tauComp.jet_pieces_numerator(); //tau for each subjet 160 double denom = tauComp.denominator(); //normalization factor 161 162 -------------------------------------------------------------------------------- 163 WinnerTakeAllRecombiner [WinnerTakeAllRecombiner.hh] 164 -------------------------------------------------------------------------------- 165 166 New for version 2.0 of Nsubjettiness are winner-take-all axes. They are found 167 with the help of the WinnerTakeAllRecombiner. This class defines a new 168 recombination scheme for clustering particles. This scheme recombines two 169 PseudoJets into a PseudoJet with pT of the sum of the two input PseudoJet pTs 170 and direction of the harder PseudoJet. This is a "recoil-free" recombination 171 scheme that guarantees that the axes is aligned with one of the input particles. 172 It is IRC safe. Axes found with the standard E-scheme recombiner at similar to 173 the beta = 2 minimization, while winner-take-all is similar to the beta = 1 174 measure. 175 176 Note that the WinnerTakeAllRecombiner can be used outside of Nsubjettiness 177 itself for jet finding. For example, the direction of anti-kT jets found 178 with the WinnerTakeAllRecombiner is particularly robust against soft jet 179 contamination. 256 XConePlugin [XConePlugin.hh] 257 -------------------------------------------------------------------------------- 258 259 The XCone FastJet plugin is an exclusive cone jet finder which yields a 260 fixed N number of jets which approximately conical boundaries. The algorithm 261 finds N axes, and jets are simply the sum of particles closest to a given axis 262 (or unclustered if they are closest to the beam). Unlike the NjettinessPlugin 263 below, the user is restricted to using the XConeMeasure. 264 265 XConePlugin plugin(N,R,beta=2); 266 JetDefinition def(&plugin); 267 ClusterSequence cs(vector<PseudoJet>,def); 268 vector<PseudoJet> jets = cs.inclusive_jets(); 269 270 Note that despite being an exclusive jet algorithm, one finds the jets using the 271 inclusive_jets() call. 272 273 The AxesDefinition and MeasureDefinition are defaulted in this measure to 274 OnePass_GenET_GenKT_Axes and XConeMeasure, respectively. The parameters chosen 275 for the OnePass_GenET_GenKT_Axes are defined according to the chosen value of 276 beta as delta = 1/(beta - 1) and p = 1/beta. These have been shown to give the 277 optimal choice of seed axes. The R value for finding the axes is chosen to be 278 the same as the R for the jet algorithm, although in principle, these two radii 279 could be different. 280 281 N.B.: The order of the R, beta arguments is *reversed* from the XConeMeasure 282 itself, since this ordering is the more natural one to use for Plugins. We 283 apologize in advance for any confusion this might cause. 180 284 181 285 -------------------------------------------------------------------------------- … … 183 287 -------------------------------------------------------------------------------- 184 288 185 The Njettiness FastJet plugin represents an exclusive jet finder (yielding a 186 fixed N number of jets). The algorithm finds N axes, and jets are simply the sum 187 of particles closest to a given axis (or unclustered if they are closest to the 188 beam). The axes finding methods and measures are the same as for Nsubjettiness. 289 Same as the XConePlugin, but the axes finding methods and measures are the same 290 as for Nsubjettiness, allowing more flexibility. 189 291 190 292 NjettinessPlugin plugin(N, AxesDefinition, MeasureDefinition); … … 193 295 vector<PseudoJet> jets = cs.inclusive_jets(); 194 296 195 Note that despite being an exclusive jet algorithm, one finds the jets using the196 inclusive_jets() call.197 198 297 -------------------------------------------------------------------------------- 199 298 Very Advanced Usage: Njettiness [Njettiness.hh] … … 202 301 Most users will want to use the Nsubjettiness or NjettinessPlugin classes to 203 302 access N-(sub)jettiness information. For direct access to the Njettiness class, 204 one can use Njettiness.hh directly. This class is still evolving, so users who 205 wish to extend its functionality should contact the authors first. 303 one can use Njettiness.hh directly. This class is in constant evolution, so 304 users who wish to extend its functionality should contact the authors first. 305 306 -------------------------------------------------------------------------------- 307 TauComponents [MeasureDefinition.hh] 308 -------------------------------------------------------------------------------- 309 310 For most users, they will only need the value of N-subjettiness (i.e. tau) 311 itself. For advanced users, they can access individual tau components (i.e. 312 the individual numerator pieces, the denominator, etc.) 313 314 TauComponents tauComp = nSub.component_result(jet); 315 vector<double> numer = tauComp.jet_pieces_numerator(); //tau for each subjet 316 double denom = tauComp.denominator(); //normalization factor 317 318 -------------------------------------------------------------------------------- 319 Extra Recombiners [ExtraRecombiners.hh] 320 -------------------------------------------------------------------------------- 321 322 New in v2.0 are winner-take-all axes. (These have now been included in 323 FastJet 3.1, but we have left the code here to allow the plugin to work under 324 FJ 3.0). These axes are found with the help of the WinnerTakeAllRecombiner. 325 This class defines a new recombination scheme for clustering particles. This 326 scheme recombines two PseudoJets into a PseudoJet with pT of the sum of the two 327 input PseudoJet pTs and direction of the harder PseudoJet. This is a 328 "recoil-free" recombination scheme that guarantees that the axes is aligned with 329 one of the input particles. It is IRC safe. Axes found with the standard 330 E-scheme recombiner at similar to the beta = 2 minimization, while 331 winner-take-all is similar to the beta = 1 measure. 332 333 New in v2.2 is the GeneralEtSchemeRecombiner, as defined in arxiv:1506.XXXX. 334 This functions similarly to the Et-scheme defined in Fastjet, but the reweighting 335 of the sum of rap and phi is parameterized by an exponent delta. Thus, delta = 1 336 is the normal Et-scheme recombination, delta = 2 is Et^2 recombination, and 337 delta = infinity is the winner-take-all recombination. This recombination scheme 338 is used in GenET_GenKT_Axes, and we find that optimal seed axes for minimization 339 can be found by using delta = 1/(beta - 1). 340 341 Note that the WinnerTakeAllRecombiner can be used outside of Nsubjettiness 342 itself for jet finding. For example, the direction of anti-kT jets found 343 with the WinnerTakeAllRecombiner is particularly robust against soft jet 344 contamination. That said, this functionality is now included in FJ 3.1, so this 345 code is likely to be deprecated in a future version. 206 346 207 347 -------------------------------------------------------------------------------- … … 213 353 N-(sub)jettiness: 214 354 215 Axes Finder.hh:216 217 The Axes Finderclass (and derived classes) defines the axes used in the355 AxesDefinition.hh: 356 357 The AxesDefinition class (and derived classes) defines the axes used in the 218 358 calculation of N-(sub)jettiness. These axes can be defined from the exclusive 219 359 jets from a kT or CA algorithm, the hardest jets from an anti-kT algorithm, … … 223 363 AxesDefinition. 224 364 225 Measure Function.hh:226 227 The Measure Function class (and derived classes) defines the measure by which365 MeasureDefinition.hh: 366 367 The MeasureDefinition class (and derived classes) defines the measure by which 228 368 N-(sub)jettiness is calculated. This measure is calculated between each 229 369 particle and its corresponding axis, and then summed and normalized to … … 232 372 and its axis, and beta is the angular exponent. Again, in the future the user 233 373 will be able to write their own measures, but for the time being, only the 234 predefined MeasureDefinition values should be used. 374 predefined MeasureDefinition values should be used. Note that the one-pass 375 minimization algorithms are defined within MeasureDefinition, since they are 376 measure specific. 235 377 236 378 -------------------------------------------------------------------------------- … … 240 382 -- The MultiPass_Axes mode gives different answers on different runs, since 241 383 random numbers are used. 242 -- In rare cases, one pass minimization can give a larger value of Njettiness 243 than without minimization. 384 -- For the default measures, in rare cases, one pass minimization can give a 385 larger value of Njettiness than without minimization. The reason is due 386 to the fact that axes in default measure are not defined as light-like 244 387 -- Nsubjettiness is not thread safe, since there are mutables in Njettiness. 388 -- If the AxesDefinition does not find N axes, then it adds zero vectors to the 389 list of axes to get the total up to N. This can lead to unpredictable 390 results (including divide by zero issues), and a warning is thrown to alert 391 the user. 392 393 -------------------------------------------------------------------------------- 394 -------------------------------------------------------------------------------- -
external/fastjet/contribs/Nsubjettiness/VERSION
rf118021 r973b92a 1 2. 1.01 2.2.1 -
external/fastjet/internal/DnnPlane.hh
rf118021 r973b92a 1 1 //FJSTARTHEADER 2 // $Id: DnnPlane.hh 3 442 2014-07-24 07:20:49Z salam $2 // $Id: DnnPlane.hh 3918 2015-07-03 14:19:13Z salam $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 190 190 // no crash... that's done by checking (near != NULL) 191 191 if ((std::abs(dist-mindist)<DISTANCE_FOR_CGAL_CHECKS) && 192 (near != NULL) &&192 _is_not_null(near) && // GPS cf. note below about != NULL with clang/CGAL 193 193 (_euclid_distance(candidate, near->point())<DISTANCE_FOR_CGAL_CHECKS)){ 194 194 // we're in a situation where there might be a rounding issue, … … 222 222 /// then use CGAL to compare the distances. 223 223 static const double DISTANCE_FOR_CGAL_CHECKS; 224 225 226 /// small routine to check if if a vertex handle is not null. 227 /// 228 /// This is centralised here because of the need for a not-very 229 /// readable workaround for certain CGAL/clang++ compiler 230 /// combinations. 231 inline static bool _is_not_null(const Vertex_handle & vh) { 232 // as found in issue 2015-07-clang61+CGAL, the form 233 // vh != NULL 234 // appears to be broken with CGAL-3.6 and clang-3.6.0/.1 235 // 236 // The not very "readable" 237 // vh.operator->() 238 // does the job instead 239 return vh.operator->(); 240 } 224 241 225 242 }; … … 237 254 inline bool DnnPlane::Valid(const int index) const { 238 255 if (index >= 0 && index < static_cast<int>(_supervertex.size())) { 239 return (_supervertex[index].vertex != NULL);} else {return false;} } 256 return _is_not_null(_supervertex[index].vertex); 257 } 258 else { 259 return false; 260 } 261 } 262 240 263 241 264 inline EtaPhi DnnPlane::etaphi(const int i) const {
Note:
See TracChangeset
for help on using the changeset viewer.