Changeset 1d208a2 in git for external/fastjet/plugins
- Timestamp:
- Aug 30, 2016, 12:36:00 AM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 6be4bc0
- Parents:
- d091310
- Location:
- external/fastjet/plugins
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/plugins/Jade/JadePlugin.cc
rd091310 r1d208a2 1 1 //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 $ 3 3 // 4 4 // Copyright (c) 2007-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 35 35 //#include "fastjet/internal/ClusterSequence_N2.icc" 36 36 #include "fastjet/NNH.hh" 37 #include "fastjet/NNFJN2Plain.hh" 37 38 38 39 // other stuff … … 51 52 //---------------------------------------------------------------------- 52 53 /// 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. 53 73 class JadeBriefJet { 54 74 public: … … 69 89 } 70 90 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 71 103 double beam_distance() const { 72 104 return numeric_limits<double>::max(); 73 105 } 74 106 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 75 115 private: 76 116 double rt2E, nx, ny, nz; … … 82 122 ostringstream desc; 83 123 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 84 133 return desc.str(); 85 134 } 86 135 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 179 template<class N> void JadePlugin::_actual_run_clustering(ClusterSequence & cs) const { 180 89 181 int njets = cs.jets().size(); 90 NNH<JadeBriefJet> nnh(cs.jets()); 182 183 N nn(cs.jets()); 91 184 92 185 // if testing against Hoeth's implementation, need to rescale the … … 96 189 while (njets > 0) { 97 190 int i, j, k; 98 double dij = nn h.dij_min(i, j);191 double dij = nn.dij_min(i, j); 99 192 100 193 if (j >= 0) { 101 194 cs.plugin_record_ij_recombination(i, j, dij, k); 102 nn h.merge_jets(i, j, cs.jets()[k], k);195 nn.merge_jets(i, j, cs.jets()[k], k); 103 196 } else { 104 197 double diB = cs.jets()[i].E()*cs.jets()[i].E(); // get new diB 105 198 cs.plugin_record_iB_recombination(i, diB); 106 nn h.remove_jet(i);199 nn.remove_jet(i); 107 200 } 108 201 njets--; 109 202 } 203 110 204 } 111 205 206 //---------------------------------------------------------------------- 207 void 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 112 222 FASTJET_END_NAMESPACE // defined in fastjet/internal/base.hh -
external/fastjet/plugins/Jade/fastjet/JadePlugin.hh
rd091310 r1d208a2 3 3 4 4 //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 $ 6 6 // 7 7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 77 77 class JadePlugin : public JetDefinition::Plugin { 78 78 public: 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 79 84 /// Main constructor for the Jade Plugin class. 80 JadePlugin ( ){}85 JadePlugin (Strategy strategy = strategy_NNFJN2Plain) : _strategy(strategy) {} 81 86 82 87 /// copy constructor … … 100 105 private: 101 106 107 template<class N> void _actual_run_clustering(ClusterSequence &) const; 108 109 Strategy _strategy; 102 110 }; 103 111 -
external/fastjet/plugins/SISCone/SISConePlugin.cc
rd091310 r1d208a2 78 78 // static members declaration // 79 79 ///////////////////////////////////////////// 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;80 SharedPtr<SISConePlugin> SISConePlugin::stored_plugin; 81 SharedPtr<std::vector<PseudoJet> > SISConePlugin::stored_particles; 82 SharedPtr<Csiscone> SISConePlugin::stored_siscone; 83 83 84 84 -
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. */ 2 6 /* config.h.in. Generated from configure.ac by autoheader. */ 3 7 4 8 /* 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 6 12 7 13 /* 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 9 17 10 18 /* 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 12 22 13 23 /* 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 15 27 16 28 /* 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 18 32 19 33 /* 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 21 37 22 38 /* 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 24 42 25 43 /* 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 27 47 28 48 /* 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 30 52 31 53 /* 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 33 57 34 58 /* 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 36 62 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 40 67 41 68 /* Name of package */ 42 #define PACKAGE "siscone" 69 #ifndef SISCONE_PACKAGE 70 #define SISCONE_PACKAGE "siscone" 71 #endif 43 72 44 73 /* 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 46 77 47 78 /* 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 49 82 50 83 /* 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 52 87 53 88 /* 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 55 97 56 98 /* 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 58 102 59 103 /* 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 */ 61 110 62 111 /* 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 22 22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 23 23 // // 24 // $Revision:: 225$//25 // $Date:: 20 08-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) $// 26 26 /////////////////////////////////////////////////////////////////////////////// 27 27 … … 35 35 // defined in siscone.h 36 36 // Otherwise, config.h 37 // It is also defined as " PACKAGE_NAME" in config.h but this method37 // It is also defined as "SISCONE_PACKAGE_NAME" in config.h but this method 38 38 // might lead to conflicts 39 //#define PROGRAM PACKAGE_NAME39 //#define PROGRAM SISCONE_PACKAGE_NAME 40 40 41 41 // program version … … 43 43 // siscone::siscone_version 44 44 // defined in siscone.h 45 // It is also defined as " VERSION" in config.h but this method45 // It is also defined as "SISCONE_VERSION" in config.h but this method 46 46 // might lead to conflicts 47 47 -
external/fastjet/plugins/SISCone/fastjet/SISConePlugin.hh
rd091310 r1d208a2 191 191 // part needed for the cache 192 192 // 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; 196 196 }; 197 197 -
external/fastjet/plugins/SISCone/fastjet/SISConeSphericalPlugin.hh
rd091310 r1d208a2 166 166 // part needed for the cache 167 167 // 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; 171 171 }; 172 172 -
external/fastjet/plugins/SISCone/siscone.cc
rd091310 r1d208a2 21 21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 22 22 // // 23 // $Revision:: 371$//24 // $Date:: 201 4-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) $// 25 25 /////////////////////////////////////////////////////////////////////////////// 26 26 27 //#ifdef HAVE_CONFIG_H28 27 #include "config.h" 29 //#else30 //#define PACKAGE_NAME "SISCone"31 //#define VERSION "3.0.0"32 //#warning "No config.h file available, using preset values"33 //#endif34 35 28 #include "ranlux.h" 36 29 #include "momentum.h" … … 254 247 // print the banner 255 248 if (_banner_ostr != 0){ 249 ios::fmtflags flags_to_restore(_banner_ostr->flags()); 250 256 251 (*_banner_ostr) << "#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" << endl; 257 252 (*_banner_ostr) << "# SISCone version " << setw(28) << left << siscone_version() << "o" << endl; … … 269 264 270 265 _banner_ostr->flush(); 266 _banner_ostr->flags(flags_to_restore); 271 267 } 272 268 } … … 279 275 * return SISCone package name. 280 276 * This is nothing but "SISCone", it is a replacement to the 281 * PACKAGE_NAME string defined in config.h and which is not282 * public by default.277 * SISCONE_PACKAGE_NAME string defined in config.h and which is not 278 * guaranteed to be public. 283 279 * return the SISCone name as a string 284 280 */ 285 281 string siscone_package_name(){ 286 return PACKAGE_NAME;282 return SISCONE_PACKAGE_NAME; 287 283 } 288 284 … … 293 289 */ 294 290 string siscone_version(){ 295 return VERSION;296 } 297 298 } 291 return SISCONE_VERSION; 292 } 293 294 } -
external/fastjet/plugins/SISCone/siscone.h
rd091310 r1d208a2 22 22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 23 23 // // 24 // $Revision:: 369$//25 // $Date:: 201 4-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) $// 26 26 /////////////////////////////////////////////////////////////////////////////// 27 27 … … 160 160 * return SISCone package name. 161 161 * This is nothing but "SISCone", it is a replacement to the 162 * PACKAGE_NAME string defined in config.h and which is not163 * public by default.162 * SISCONE_PACKAGE_NAME string defined in config.h and which is not 163 * guaranteed to be public. 164 164 * \return the SISCone name as a string 165 165 */ -
external/fastjet/plugins/SISCone/split_merge.cc
rd091310 r1d208a2 21 21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 22 22 // // 23 // $Revision:: 3 70 $//24 // $Date:: 201 4-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) $// 25 25 /////////////////////////////////////////////////////////////////////////////// 26 26 … … 54 54 pt_tilde = 0.0; 55 55 sm_var2 = 0.0; 56 pass = CJET_INEXISTENT_PASS; // initialised to a value that should 57 // notappear in the end (after clustering) 56 58 } 57 59 … … 659 661 660 662 #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() << "]:"; 662 664 #endif 663 665 … … 1179 1181 } 1180 1182 1181 return 0.0;1182 } 1183 1184 } 1183 //return 0.0; 1184 } 1185 1186 } -
external/fastjet/plugins/SISCone/split_merge.h
rd091310 r1d208a2 22 22 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 23 23 // // 24 // $Revision:: 367$//25 // $Date:: 201 4-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) $// 26 26 /////////////////////////////////////////////////////////////////////////////// 27 27 … … 29 29 #define __SPLIT_MERGE_H__ 30 30 31 #include "config.h" 31 32 #include "defines.h" 32 33 #include "geom_2d.h" … … 39 40 40 41 namespace siscone{ 42 43 const int CJET_INEXISTENT_PASS = -2; 41 44 42 45 /** … … 75 78 /// pass at which the jet has been found 76 79 /// 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) 77 82 int pass; 78 83 }; … … 441 446 // jet information 442 447 /// 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 443 451 std::auto_ptr<std::multiset<Cjet,Csplit_merge_ptcomparison> > candidates; 444 452 #endif 453 445 454 /// minimal pt2 446 455 double pt_min2; -
external/fastjet/plugins/SISCone/vicinity.cc
rd091310 r1d208a2 21 21 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA // 22 22 // // 23 // $Revision:: 123$//24 // $Date:: 20 07-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) $// 25 25 /////////////////////////////////////////////////////////////////////////////// 26 26 … … 80 80 VR2 = VR = 0.0; 81 81 82 ve_list = NULL; 82 83 set_particle_list(_particle_list); 83 84 }
Note:
See TracChangeset
for help on using the changeset viewer.