Fork me on GitHub

Ignore:
Timestamp:
Sep 3, 2014, 3:18:54 PM (10 years ago)
Author:
Pavel Demin <demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
be2222c
Parents:
5b5a56b
Message:

upgrade FastJet to version 3.1.0-beta.1, upgrade Nsubjettiness to version 2.1.0, add SoftKiller version 1.0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/contribs/Nsubjettiness/NjettinessPlugin.hh

    r5b5a56b r35cdc46  
    1 // $Id$
    2 //
    31//  Nsubjettiness Package
    42//  Questions/Comments?  jthaler@jthaler.net
     
    75//  Jesse Thaler, Ken Van Tilburg, Christopher K. Vermilion, and TJ Wilkason
    86//
     7//  $Id: NjettinessPlugin.hh 671 2014-06-10 17:47:52Z jthaler $
    98//----------------------------------------------------------------------
    109// This file is part of FastJet contrib.
     
    4948// to similar information
    5049class NjettinessExtras : public ClusterSequence::Extras {
    51    private:
    52    
    53       TauComponents _tau_components;
    54       std::vector<fastjet::PseudoJet> _jets;
    55       std::vector<fastjet::PseudoJet> _axes;
    56      
    57       int labelOf(const fastjet::PseudoJet& jet) const {
    58          int thisJet = -1;
    59          for (unsigned int i = 0; i < _jets.size(); i++) {
    60             if (_jets[i].cluster_hist_index() == jet.cluster_hist_index()) {
    61                thisJet = i;
    62                break;
    63             }
    64          }
    65          return thisJet;
    66       }
    67      
     50   
    6851   public:
    6952      NjettinessExtras(TauComponents tau_components, std::vector<fastjet::PseudoJet> jets, std::vector<fastjet::PseudoJet> axes) : _tau_components(tau_components), _jets(jets), _axes(axes) {}
     
    7457      std::vector<fastjet::PseudoJet> axes() const {return _axes;}
    7558     
    76       double totalTau(const fastjet::PseudoJet& jet) const {
     59      double totalTau(const fastjet::PseudoJet& /*jet*/) const {
    7760         return _tau_components.tau();
    7861      }
     62     
    7963      double subTau(const fastjet::PseudoJet& jet) const {
    80          if (labelOf(jet) == -1) return NAN;
     64         if (labelOf(jet) == -1) return std::numeric_limits<double>::quiet_NaN(); // nonsense
    8165         return _tau_components.jet_pieces()[labelOf(jet)];
    8266      }
     
    9377         return (labelOf(jet) >= 0);
    9478      }
    95 
     79   
     80private:
     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   }
    9696};
    9797
     
    122122 * onepass_wta_kt_axes  : one-pass minimization seeded by wta_kt
    123123 *
    124  * For the unnormalized_measure, N-jettiness is defined as:
     124 * For the UnnormalizedMeasure(beta), N-jettiness is defined as:
    125125 *
    126126 * tau_N = Sum_{all particles i} p_T^i min((DR_i1)^beta, (DR_i2)^beta, ...)
     
    129129 *   and jet j.
    130130 *
    131  * The normalized_meausure include an extra parameter R0, and the various cutoff
     131 * The NormalizedMeausure include an extra parameter R0, and the various cutoff
    132132 * measures include an Rcutoff, which effectively defines an angular cutoff
    133133 * similar in effect to a cone-jet radius.
     
    138138public:
    139139
    140    NjettinessPlugin(int N,
    141                     Njettiness::AxesMode axes_mode,
    142                     Njettiness::MeasureMode measure_mode,
    143                     double para1 = NAN,
    144                     double para2 = NAN,
    145                     double para3 = NAN,
    146                     double para4 = NAN);
     140   // Constructor with same arguments as Nsubjettiness.
     141   NjettinessPlugin(int N,
     142                    const AxesDefinition & axes_def,
     143                    const MeasureDefinition & measure_def)
     144   : _njettinessFinder(axes_def, measure_def), _N(N) {}
     145   
     146   
     147   // Alternative constructors that define the measure via enums and parameters
     148   // These constructors are likely be removed
     149   NjettinessPlugin(int N,
     150                 Njettiness::AxesMode axes_mode,
     151                 Njettiness::MeasureMode measure_mode)
     152   : _njettinessFinder(axes_mode, measure_mode, 0), _N(N) {}
     153   
     154   
     155   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) {}
     160   
     161   
     162   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) {}
     168   
     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
    147178
    148179   // Old constructor for backwards compatibility with v1.0,
    149    // where normalized_cutoff_measure was the only option
     180   // where NormalizedCutoffMeasure was the only option
    150181   NjettinessPlugin(int N,
    151182                    Njettiness::AxesMode mode,
    152183                    double beta,
    153184                    double R0,
    154                     double Rcutoff=std::numeric_limits<double>::max());
     185                    double Rcutoff=std::numeric_limits<double>::max())
     186   : _njettinessFinder(mode, NormalizedCutoffMeasure(beta, R0, Rcutoff)), _N(N) {}
     187
    155188
    156189
     
    164197private:
    165198
     199   Njettiness _njettinessFinder;
    166200   int _N;
    167    mutable Njettiness _njettinessFinder; // TODO:  should muck with this so run_clustering can be const without this mutable
    168201
    169202};
Note: See TracChangeset for help on using the changeset viewer.