Fork me on GitHub

Changeset 1d208a2 in git for external/fastjet/plugins


Ignore:
Timestamp:
Aug 30, 2016, 12:36:00 AM (8 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
6be4bc0
Parents:
d091310
Message:

update FastJet library to 3.2.1 and Nsubjettiness library to 2.2.4

Location:
external/fastjet/plugins
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/plugins/Jade/JadePlugin.cc

    rd091310 r1d208a2  
    11//FJSTARTHEADER
    2 // $Id: JadePlugin.cc 3433 2014-07-23 08:17:03Z salam $
     2// $Id: JadePlugin.cc 4063 2016-03-04 10:31:40Z salam $
    33//
    44// Copyright (c) 2007-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    3535//#include "fastjet/internal/ClusterSequence_N2.icc"
    3636#include "fastjet/NNH.hh"
     37#include "fastjet/NNFJN2Plain.hh"
    3738
    3839// other stuff
     
    5152//----------------------------------------------------------------------
    5253/// class to help run a JADE algorithm
     54///
     55/// This class works both with NNH and NNFJN2Plain clustering
     56/// helpers. They both use the same init(...) call, but for the
     57/// clustering:
     58///
     59/// - NNH uses distance(...) and beam_distance()
     60/// - NNFJPlainN2 uses geometrical_distance(...), momentum_factor()
     61///   and geometrical_beam_distance()
     62///
     63/// For NNFJPlainN2 the 2 E_i E_j (1-cos theta_{ij}) factor
     64/// gets broken up into
     65///
     66///     sqrt(2)*min(E_i,E_j) * [sqrt(2)*max(E_i,E_j) (1 - cos \theta_{ij})]
     67///
     68/// The second factor is what we call the "geometrical_distance" even
     69/// though it isn't actually purely geometrical. But the fact that it
     70/// gets multiplied by min(E_i,E_j) to get the full distance is
     71/// sufficient for the validity of the FJ lemma, allowing for the use
     72/// of NNFJN2Plain.
    5373class JadeBriefJet {
    5474public:
     
    6989  }
    7090
     91  double geometrical_distance(const JadeBriefJet * jet) const {
     92    double dij = 1 - nx*jet->nx
     93                   - ny*jet->ny
     94                   - nz*jet->nz;
     95    dij *= max(rt2E,jet->rt2E);
     96    return dij;
     97  }
     98
     99  double momentum_factor() const {
     100    return rt2E;
     101  }
     102 
    71103  double beam_distance() const {
    72104    return numeric_limits<double>::max();
    73105  }
    74106
     107  double geometrical_beam_distance() const {
     108    // get a number that is almost the same as max(), just a little
     109    // smaller so as to ensure that when we divide it by rt2E and then
     110    // multiply it again, we won't get an overflow
     111    const double almost_max = numeric_limits<double>::max() * (1 - 1e-13);
     112    return almost_max / rt2E;
     113  }
     114 
    75115private:
    76116  double rt2E, nx, ny, nz;
     
    82122  ostringstream desc;
    83123  desc << "e+e- JADE algorithm plugin";
     124  switch(_strategy) {
     125  case strategy_NNH:
     126    desc << ", using NNH strategy"; break;
     127  case strategy_NNFJN2Plain:
     128    desc << ", using NNFJN2Plain strategy"; break;
     129  default:
     130    throw Error("Unrecognized strategy in JadePlugin");
     131  }
     132
    84133  return desc.str();
    85134}
    86135
    87 //----------------------------------------------------------------------
    88 void JadePlugin::run_clustering(ClusterSequence & cs) const {
     136// //----------------------------------------------------------------------
     137// void JadePlugin::run_clustering(ClusterSequence & cs) const {
     138//   int njets = cs.jets().size();
     139//
     140//   //SharedPtr<NNBase<> > nn;
     141//   NNBase<> * nn;
     142//   switch(_strategy) {
     143//   case strategy_NNH:
     144//     //nn.reset(new NNH<JadeBriefJet>(cs.jets()));
     145//     nn = new NNH<JadeBriefJet>(cs.jets());
     146//     break;
     147//   case strategy_NNFJN2Plain:
     148//     //nn.reset(new NNFJN2Plain<JadeBriefJet>(cs.jets()));
     149//     nn = new NNFJN2Plain<JadeBriefJet>(cs.jets());
     150//     break;
     151//   default:
     152//     throw Error("Unrecognized strategy in JadePlugin");
     153//   }
     154//   //NNH<JadeBriefJet> nnh(cs.jets());
     155//   //NNFJN2Plain<JadeBriefJet> nnh(cs.jets());
     156//
     157//   // if testing against Hoeth's implementation, need to rescale the
     158//   // dij by Q^2.
     159//   //double Q2 = cs.Q2();
     160//
     161//   while (njets > 0) {
     162//     int i, j, k;
     163//     double dij = nn->dij_min(i, j);
     164//
     165//     if (j >= 0) {
     166//       cs.plugin_record_ij_recombination(i, j, dij, k);
     167//       nn->merge_jets(i, j, cs.jets()[k], k);
     168//     } else {
     169//       double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB
     170//       cs.plugin_record_iB_recombination(i, diB);
     171//       nn->remove_jet(i);
     172//     }
     173//     njets--;
     174//   }
     175//   delete nn;
     176// }
     177
     178
     179template<class N> void JadePlugin::_actual_run_clustering(ClusterSequence & cs) const {
     180
    89181  int njets = cs.jets().size();
    90   NNH<JadeBriefJet> nnh(cs.jets());
     182
     183  N nn(cs.jets());
    91184
    92185  // if testing against Hoeth's implementation, need to rescale the
     
    96189  while (njets > 0) {
    97190    int i, j, k;
    98     double dij = nnh.dij_min(i, j);
     191    double dij = nn.dij_min(i, j);
    99192
    100193    if (j >= 0) {
    101194      cs.plugin_record_ij_recombination(i, j, dij, k);
    102       nnh.merge_jets(i, j, cs.jets()[k], k);
     195      nn.merge_jets(i, j, cs.jets()[k], k);
    103196    } else {
    104197      double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB
    105198      cs.plugin_record_iB_recombination(i, diB);
    106       nnh.remove_jet(i);
     199      nn.remove_jet(i);
    107200    }
    108201    njets--;
    109202  }
     203
    110204}
    111205
     206//----------------------------------------------------------------------
     207void JadePlugin::run_clustering(ClusterSequence & cs) const {
     208
     209  switch(_strategy) {
     210  case strategy_NNH:
     211    _actual_run_clustering<NNH<JadeBriefJet> >(cs);
     212    break;
     213  case strategy_NNFJN2Plain:
     214    _actual_run_clustering<NNFJN2Plain<JadeBriefJet> >(cs);
     215    break;
     216  default:
     217    throw Error("Unrecognized strategy in JadePlugin");
     218  }
     219}
     220
     221
    112222FASTJET_END_NAMESPACE      // defined in fastjet/internal/base.hh
  • external/fastjet/plugins/Jade/fastjet/JadePlugin.hh

    rd091310 r1d208a2  
    33
    44//FJSTARTHEADER
    5 // $Id: JadePlugin.hh 3433 2014-07-23 08:17:03Z salam $
     5// $Id: JadePlugin.hh 4061 2016-03-03 21:51:25Z salam $
    66//
    77// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    7777class JadePlugin : public JetDefinition::Plugin {
    7878public:
     79  /// enum that contains the two clustering strategy options; for
     80  /// higher multiplicities, strategy_NNFJN2Plain is about a factor of
     81  /// two faster.
     82  enum Strategy { strategy_NNH = 0, strategy_NNFJN2Plain = 1};
     83 
    7984  /// Main constructor for the Jade Plugin class. 
    80   JadePlugin (){}
     85  JadePlugin (Strategy strategy = strategy_NNFJN2Plain) : _strategy(strategy) {}
    8186
    8287  /// copy constructor
     
    100105private:
    101106
     107  template<class N> void _actual_run_clustering(ClusterSequence &) const;
     108 
     109  Strategy _strategy;
    102110};
    103111
  • external/fastjet/plugins/SISCone/SISConePlugin.cc

    rd091310 r1d208a2  
    7878// static members declaration              //
    7979/////////////////////////////////////////////
    80 std::auto_ptr<SISConePlugin>           SISConePlugin::stored_plugin;
    81 std::auto_ptr<std::vector<PseudoJet> > SISConePlugin::stored_particles;
    82 std::auto_ptr<Csiscone>                SISConePlugin::stored_siscone;
     80SharedPtr<SISConePlugin>           SISConePlugin::stored_plugin;
     81SharedPtr<std::vector<PseudoJet> > SISConePlugin::stored_particles;
     82SharedPtr<Csiscone>                SISConePlugin::stored_siscone;
    8383
    8484
  • external/fastjet/plugins/SISCone/config.h

    rd091310 r1d208a2  
    1 /* siscone/config.h.  Generated from config.h.in by configure.  */
     1#ifndef _SISCONE_CONFIG_H
     2#define _SISCONE_CONFIG_H 1
     3 
     4/* siscone/config.h. Generated automatically at end of configure. */
     5/* siscone/config_raw.h.  Generated from config.h.in by configure.  */
    26/* config.h.in.  Generated from configure.ac by autoheader.  */
    37
    48/* Define to 1 if you have the <dlfcn.h> header file. */
    5 #define HAVE_DLFCN_H 1
     9#ifndef SISCONE_HAVE_DLFCN_H
     10#define SISCONE_HAVE_DLFCN_H  1
     11#endif
    612
    713/* Define to 1 if you have the <inttypes.h> header file. */
    8 #define HAVE_INTTYPES_H 1
     14#ifndef SISCONE_HAVE_INTTYPES_H
     15#define SISCONE_HAVE_INTTYPES_H  1
     16#endif
    917
    1018/* Define to 1 if you have the `m' library (-lm). */
    11 #define HAVE_LIBM 1
     19#ifndef SISCONE_HAVE_LIBM
     20#define SISCONE_HAVE_LIBM  1
     21#endif
    1222
    1323/* Define to 1 if you have the <memory.h> header file. */
    14 #define HAVE_MEMORY_H 1
     24#ifndef SISCONE_HAVE_MEMORY_H
     25#define SISCONE_HAVE_MEMORY_H  1
     26#endif
    1527
    1628/* Define to 1 if you have the <stdint.h> header file. */
    17 #define HAVE_STDINT_H 1
     29#ifndef SISCONE_HAVE_STDINT_H
     30#define SISCONE_HAVE_STDINT_H  1
     31#endif
    1832
    1933/* Define to 1 if you have the <stdlib.h> header file. */
    20 #define HAVE_STDLIB_H 1
     34#ifndef SISCONE_HAVE_STDLIB_H
     35#define SISCONE_HAVE_STDLIB_H  1
     36#endif
    2137
    2238/* Define to 1 if you have the <strings.h> header file. */
    23 #define HAVE_STRINGS_H 1
     39#ifndef SISCONE_HAVE_STRINGS_H
     40#define SISCONE_HAVE_STRINGS_H  1
     41#endif
    2442
    2543/* Define to 1 if you have the <string.h> header file. */
    26 #define HAVE_STRING_H 1
     44#ifndef SISCONE_HAVE_STRING_H
     45#define SISCONE_HAVE_STRING_H  1
     46#endif
    2747
    2848/* Define to 1 if you have the <sys/stat.h> header file. */
    29 #define HAVE_SYS_STAT_H 1
     49#ifndef SISCONE_HAVE_SYS_STAT_H
     50#define SISCONE_HAVE_SYS_STAT_H  1
     51#endif
    3052
    3153/* Define to 1 if you have the <sys/types.h> header file. */
    32 #define HAVE_SYS_TYPES_H 1
     54#ifndef SISCONE_HAVE_SYS_TYPES_H
     55#define SISCONE_HAVE_SYS_TYPES_H  1
     56#endif
    3357
    3458/* Define to 1 if you have the <unistd.h> header file. */
    35 #define HAVE_UNISTD_H 1
     59#ifndef SISCONE_HAVE_UNISTD_H
     60#define SISCONE_HAVE_UNISTD_H  1
     61#endif
    3662
    37 /* Define to the sub-directory in which libtool stores uninstalled libraries.
    38    */
    39 #define LT_OBJDIR ".libs/"
     63/* Define to the sub-directory where libtool stores uninstalled libraries. */
     64#ifndef SISCONE_LT_OBJDIR
     65#define SISCONE_LT_OBJDIR  ".libs/"
     66#endif
    4067
    4168/* Name of package */
    42 #define PACKAGE "siscone"
     69#ifndef SISCONE_PACKAGE
     70#define SISCONE_PACKAGE  "siscone"
     71#endif
    4372
    4473/* Define to the address where bug reports for this package should be sent. */
    45 #define PACKAGE_BUGREPORT ""
     74#ifndef SISCONE_PACKAGE_BUGREPORT
     75#define SISCONE_PACKAGE_BUGREPORT  ""
     76#endif
    4677
    4778/* Define to the full name of this package. */
    48 #define PACKAGE_NAME "SISCone"
     79#ifndef SISCONE_PACKAGE_NAME
     80#define SISCONE_PACKAGE_NAME  "SISCone"
     81#endif
    4982
    5083/* Define to the full name and version of this package. */
    51 #define PACKAGE_STRING "SISCone 3.0.0"
     84#ifndef SISCONE_PACKAGE_STRING
     85#define SISCONE_PACKAGE_STRING  "SISCone 3.0.3"
     86#endif
    5287
    5388/* Define to the one symbol short name of this package. */
    54 #define PACKAGE_TARNAME "siscone"
     89#ifndef SISCONE_PACKAGE_TARNAME
     90#define SISCONE_PACKAGE_TARNAME  "siscone"
     91#endif
     92
     93/* Define to the home page for this package. */
     94#ifndef SISCONE_PACKAGE_URL
     95#define SISCONE_PACKAGE_URL  ""
     96#endif
    5597
    5698/* Define to the version of this package. */
    57 #define PACKAGE_VERSION "3.0.0"
     99#ifndef SISCONE_PACKAGE_VERSION
     100#define SISCONE_PACKAGE_VERSION  "3.0.3"
     101#endif
    58102
    59103/* Define to 1 if you have the ANSI C header files. */
    60 #define STDC_HEADERS 1
     104#ifndef SISCONE_STDC_HEADERS
     105#define SISCONE_STDC_HEADERS  1
     106#endif
     107
     108/* use unique_ptr instead of auto_ptr */
     109/* #undef USES_UNIQUE_PTR_AS_AUTO_PTR */
    61110
    62111/* Version number of package */
    63 #define VERSION "3.0.0"
     112#ifndef SISCONE_VERSION
     113#define SISCONE_VERSION  "3.0.3"
     114#endif
     115 
     116/* once: _SISCONE_CONFIG_H */
     117#endif
  • external/fastjet/plugins/SISCone/defines.h

    rd091310 r1d208a2  
    2222// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2323//                                                                           //
    24 // $Revision:: 225                                                          $//
    25 // $Date:: 2008-05-20 16:59:47 +0200 (Tue, 20 May 2008)                     $//
     24// $Revision:: 401                                                          $//
     25// $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016)                     $//
    2626///////////////////////////////////////////////////////////////////////////////
    2727
     
    3535// defined in siscone.h
    3636// Otherwise, config.h
    37 // It is also defined as "PACKAGE_NAME" in config.h but this method
     37// It is also defined as "SISCONE_PACKAGE_NAME" in config.h but this method
    3838// might lead to conflicts
    39 //#define PROGRAM   PACKAGE_NAME
     39//#define PROGRAM   SISCONE_PACKAGE_NAME
    4040
    4141// program version
     
    4343//   siscone::siscone_version
    4444// defined in siscone.h
    45 // It is also defined as "VERSION" in config.h but this method
     45// It is also defined as "SISCONE_VERSION" in config.h but this method
    4646// might lead to conflicts
    4747
  • external/fastjet/plugins/SISCone/fastjet/SISConePlugin.hh

    rd091310 r1d208a2  
    191191  // part needed for the cache
    192192  // variables for caching the results and the input
    193   static std::auto_ptr<SISConePlugin          > stored_plugin;
    194   static std::auto_ptr<std::vector<PseudoJet> > stored_particles;
    195   static std::auto_ptr<siscone::Csiscone      > stored_siscone;
     193  static SharedPtr<SISConePlugin          > stored_plugin;
     194  static SharedPtr<std::vector<PseudoJet> > stored_particles;
     195  static SharedPtr<siscone::Csiscone      > stored_siscone;
    196196};
    197197
  • external/fastjet/plugins/SISCone/fastjet/SISConeSphericalPlugin.hh

    rd091310 r1d208a2  
    166166  // part needed for the cache
    167167  // variables for caching the results and the input
    168   static std::auto_ptr<SISConeSphericalPlugin        > stored_plugin;
    169   static std::auto_ptr<std::vector<PseudoJet>        > stored_particles;
    170   static std::auto_ptr<siscone_spherical::CSphsiscone> stored_siscone;
     168  static SharedPtr<SISConeSphericalPlugin        > stored_plugin;
     169  static SharedPtr<std::vector<PseudoJet>        > stored_particles;
     170  static SharedPtr<siscone_spherical::CSphsiscone> stored_siscone;
    171171};
    172172
  • external/fastjet/plugins/SISCone/siscone.cc

    rd091310 r1d208a2  
    2121// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2222//                                                                           //
    23 // $Revision:: 371                                                          $//
    24 // $Date:: 2014-09-09 10:05:32 +0200 (Tue, 09 Sep 2014)                     $//
     23// $Revision:: 403                                                          $//
     24// $Date:: 2016-05-19 16:52:05 +0200 (Thu, 19 May 2016)                     $//
    2525///////////////////////////////////////////////////////////////////////////////
    2626
    27 //#ifdef HAVE_CONFIG_H
    2827#include "config.h"
    29 //#else
    30 //#define PACKAGE_NAME "SISCone"
    31 //#define VERSION "3.0.0"
    32 //#warning "No config.h file available, using preset values"
    33 //#endif
    34 
    3528#include "ranlux.h"
    3629#include "momentum.h"
     
    254247  // print the banner
    255248  if (_banner_ostr != 0){
     249    ios::fmtflags flags_to_restore(_banner_ostr->flags());
     250
    256251    (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl;
    257252    (*_banner_ostr) << "#                    SISCone   version " << setw(28) << left << siscone_version() << "o" << endl;
     
    269264
    270265    _banner_ostr->flush();
     266    _banner_ostr->flags(flags_to_restore);
    271267  }
    272268}
     
    279275 * return SISCone package name.
    280276 * This is nothing but "SISCone", it is a replacement to the
    281  * PACKAGE_NAME string defined in config.h and which is not
    282  * public by default.
     277 * SISCONE_PACKAGE_NAME string defined in config.h and which is not
     278 * guaranteed to be public.
    283279 * return the SISCone name as a string
    284280 */
    285281string siscone_package_name(){
    286   return PACKAGE_NAME;
     282  return SISCONE_PACKAGE_NAME;
    287283}
    288284
     
    293289 */
    294290string siscone_version(){
    295   return VERSION;
    296 }
    297 
    298 }
     291  return SISCONE_VERSION;
     292}
     293
     294}
  • external/fastjet/plugins/SISCone/siscone.h

    rd091310 r1d208a2  
    2222// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2323//                                                                           //
    24 // $Revision:: 369                                                          $//
    25 // $Date:: 2014-09-04 16:57:55 +0200 (Thu, 04 Sep 2014)                     $//
     24// $Revision:: 401                                                          $//
     25// $Date:: 2016-05-19 16:44:37 +0200 (Thu, 19 May 2016)                     $//
    2626///////////////////////////////////////////////////////////////////////////////
    2727
     
    160160 * return SISCone package name.
    161161 * This is nothing but "SISCone", it is a replacement to the
    162  * PACKAGE_NAME string defined in config.h and which is not
    163  * public by default.
     162 * SISCONE_PACKAGE_NAME string defined in config.h and which is not
     163 * guaranteed to be public.
    164164 * \return the SISCone name as a string
    165165 */
  • external/fastjet/plugins/SISCone/split_merge.cc

    rd091310 r1d208a2  
    2121// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2222//                                                                           //
    23 // $Revision:: 370                                                          $//
    24 // $Date:: 2014-09-04 17:03:15 +0200 (Thu, 04 Sep 2014)                     $//
     23// $Revision:: 390                                                          $//
     24// $Date:: 2016-03-03 11:06:52 +0100 (Thu, 03 Mar 2016)                     $//
    2525///////////////////////////////////////////////////////////////////////////////
    2626
     
    5454  pt_tilde = 0.0;
    5555  sm_var2 = 0.0;
     56  pass = CJET_INEXISTENT_PASS; // initialised to a value that should
     57                               // notappear in the end (after clustering)
    5658}
    5759
     
    659661
    660662#ifdef DEBUG_SPLIT_MERGE
    661   cout << "PR-Jet " << jets.size() << " [size " << next_jet.contents.size() << "]:";
     663  cout << "PR-Jet " << jets.size() << " [size " << jet.contents.size() << "]:";
    662664#endif
    663665   
     
    11791181  }
    11801182
    1181   return 0.0;
    1182 }
    1183 
    1184 }
     1183  //return 0.0;
     1184}
     1185
     1186}
  • external/fastjet/plugins/SISCone/split_merge.h

    rd091310 r1d208a2  
    2222// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2323//                                                                           //
    24 // $Revision:: 367                                                          $//
    25 // $Date:: 2014-09-04 15:57:37 +0200 (Thu, 04 Sep 2014)                     $//
     24// $Revision:: 405                                                          $//
     25// $Date:: 2016-05-23 20:15:02 +0200 (Mon, 23 May 2016)                     $//
    2626///////////////////////////////////////////////////////////////////////////////
    2727
     
    2929#define __SPLIT_MERGE_H__
    3030
     31#include "config.h"
    3132#include "defines.h"
    3233#include "geom_2d.h"
     
    3940
    4041namespace siscone{
     42
     43const int CJET_INEXISTENT_PASS = -2;
    4144
    4245/**
     
    7578  /// pass at which the jet has been found
    7679  /// It starts at 0 (first pass), -1 means infinite rapidity
     80  /// (it will be initialised to "CJET_INEXISTENT_PASS" which should
     81  /// never appear after clustering)
    7782  int pass;
    7883};
     
    441446  // jet information
    442447  /// list of jet candidates
     448#ifdef SISCONE_USES_UNIQUE_PTR_AS_AUTO_PTR
     449  std::unique_ptr<std::multiset<Cjet,Csplit_merge_ptcomparison> > candidates;
     450#else
    443451  std::auto_ptr<std::multiset<Cjet,Csplit_merge_ptcomparison> > candidates;
    444 
     452#endif
     453 
    445454  /// minimal pt2
    446455  double pt_min2;
  • external/fastjet/plugins/SISCone/vicinity.cc

    rd091310 r1d208a2  
    2121// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA //
    2222//                                                                           //
    23 // $Revision:: 123                                                          $//
    24 // $Date:: 2007-03-01 02:52:16 +0100 (Thu, 01 Mar 2007)                     $//
     23// $Revision:: 388                                                          $//
     24// $Date:: 2016-03-03 10:42:25 +0100 (Thu, 03 Mar 2016)                     $//
    2525///////////////////////////////////////////////////////////////////////////////
    2626
     
    8080  VR2 = VR = 0.0;
    8181
     82  ve_list = NULL;
    8283  set_particle_list(_particle_list);
    8384}
Note: See TracChangeset for help on using the changeset viewer.