Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/tools/Subtractor.hh

    r273e668 rd7d2da3  
    1 //FJSTARTHEADER
    2 // $Id: Subtractor.hh 3670 2014-09-08 14:17:59Z soyez $
     1//STARTHEADER
     2// $Id: Subtractor.hh 2577 2011-09-13 15:11:38Z salam $
    33//
    4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     4// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    55//
    66//----------------------------------------------------------------------
     
    1313//
    1414//  The algorithms that underlie FastJet have required considerable
    15 //  development. They are described in the original FastJet paper,
    16 //  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
     15//  development and are described in hep-ph/0512210. If you use
    1716//  FastJet as part of work towards a scientific publication, please
    18 //  quote the version you use and include a citation to the manual and
    19 //  optionally also to hep-ph/0512210.
     17//  include a citation to the FastJet paper.
    2018//
    2119//  FastJet is distributed in the hope that it will be useful,
     
    2725//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    2826//----------------------------------------------------------------------
    29 //FJENDHEADER
     27//ENDHEADER
    3028
    3129#ifndef __FASTJET_TOOLS_SUBTRACTOR_HH__
    3230#define __FASTJET_TOOLS_SUBTRACTOR_HH__
    3331
    34 #include "fastjet/internal/base.hh"     // namespace macros (include explicitly to help Doxygen)
    3532#include "fastjet/tools/Transformer.hh" // to derive Subtractor from Transformer
    3633#include "fastjet/tools/BackgroundEstimatorBase.hh" // used as a ctor argument
     
    6461  /// define a subtractor based on a BackgroundEstimator
    6562  Subtractor(BackgroundEstimatorBase * bge) :
    66     _bge(bge), _rho(-1.0) { set_defaults(); }
     63    _bge(bge), _rho(-1.0) {}
    6764
    6865  /// define a subtractor that uses a fixed value of rho, the background
     
    7067  Subtractor(double rho);
    7168
    72   /// define a subtractor that uses a fixed value of rho and rho_m;
    73   /// both must be >= 0;
    74   Subtractor(double rho, double rho_m);
    75 
    7669  /// default constructor
    77   Subtractor() : _bge(0), _rho(_invalid_rho) { set_defaults(); }
     70  Subtractor() : _bge(0), _rho(_invalid_rho) {}
    7871
    7972  /// default dtor
    8073  virtual ~Subtractor(){};
    81 
    82   /// @name configuring the behaviour
    83   //\{
    84   //----------------------------------------------------------------
    85 
    86   /// reset all parameters to default values
    87   ///
    88   /// Note: by default, the rho_m term is not included and the safety
    89   /// test for the mass is not done. This is mostly for backwards
    90   /// compatibility with FastJet 3.0 and is highly likely to change in
    91   /// a future release of FastJet
    92   void set_defaults();
    93 
    94   /// when 'use_rho_m' is true, include in the subtraction the
    95   /// correction from rho_m, the purely longitudinal,
    96   /// particle-mass-induced component of the background density per
    97   /// unit area
    98   ///
    99   /// Note: this will be switched off by default (for backwards
    100   /// compatibility with FastJet 3.0) but is highly likely to change
    101   /// in a future release of FastJet
    102   void set_use_rho_m(bool use_rho_m_in = true){
    103     if (_bge == 0  && _rho_m < 0) {
    104       throw Error("Subtractor: rho_m support works only for Subtractors constructed with a background estimator or an explicit rho_m value");
    105     }
    106     _use_rho_m=use_rho_m_in;
    107   }
    108  
    109   /// returns whether or not the rho_m component is used
    110   bool use_rho_m() const{ return _use_rho_m;}
    111 
    112   /// when 'safe_mass' is true, ensure that the mass of the subtracted
    113   /// 4-vector remain positive
    114   ///
    115   /// when true, if the subtracted mass is negative, we return a
    116   /// 4-vector with 0 mass, pt and phi from the subtracted 4-vector
    117   /// and the rapidity of the original, unsubtracted jet.
    118   ///
    119   /// Note: this will be switched off by default (for backwards
    120   /// compatibility with FastJet 3.0) but is highly likely to change
    121   /// in a future release of FastJet
    122   void set_safe_mass(bool safe_mass_in=true){ _safe_mass=safe_mass_in;}
    123 
    124   /// returns whether or not safety tests on the mass are included
    125   bool safe_mass() const{ return _safe_mass;}
    126 
    127   /// This is mostly intended for cherge-hadron-subtracted type of
    128   /// events where we wich to use vertex information to improve the
    129   /// subtraction.
    130   ///
    131   /// Given the following parameters:
    132   ///   \param sel_known_vertex    selects the particles with a
    133   ///                              known vertex origin
    134   ///   \param sel_leading_vertex  amongst the particles with a
    135   ///                              known vertex origin, select those
    136   ///                              coming from the leading vertex
    137   /// Momentum identified as coming from the leading vertex will be
    138   /// kept, momentum identified as coming from a non-leading vertex
    139   /// will be eliminated and a regular area-median subtraction will be
    140   /// applied on the 4-vector sum of the particles with unknown vertex
    141   /// origin.
    142   ///
    143   /// When this is set, we shall ensure that the pt of the subtracted
    144   /// 4-vector is at least the pt of the particles that are known to
    145   /// come from the leading vertex (if it fails, subtraction returns
    146   /// the component that is known to come from the leading vertex ---
    147   /// or, the original unsubtracted jet if it contains no particles
    148   /// from the leading vertex).  Furthermore, when safe_mass() is on, we
    149   /// also impose a similar constraint on the mass of the subtracted
    150   /// 4-vector (if the test fails, the longitudinal part of the
    151   /// subtracted 4-vector is taken from the component that is known to
    152   /// come from the leading vertex).
    153   void set_known_selectors(const Selector &sel_known_vertex,
    154                            const Selector &sel_leading_vertex){
    155     _sel_known_vertex   = sel_known_vertex;
    156     _sel_leading_vertex = sel_leading_vertex;
    157   }
    158 
    159   //\}
    160 
    161   /// @name description and action
    162   //\{
    163   //----------------------------------------------------------------
    16474
    16575  /// returns a jet that's subtracted
     
    17282  virtual std::string description() const;
    17383
    174   //\}
    17584protected:
    176   /// compute the 4-vector that should be subtracted from the given
    177   /// jet
    178   PseudoJet _amount_to_subtract(const PseudoJet &jet) const;
    17985
    18086  /// the tool used to estimate the background
    18187  /// if has to be mutable in case its underlying selector takes a reference jet
    18288  mutable BackgroundEstimatorBase * _bge;
    183   /// the fixed value of rho and/or rho_m to use if the user has selected that option
    184   double _rho, _rho_m;
    185 
    186   // configuration parameters/flags
    187   bool _use_rho_m;   ///< include the rho_m correction
    188   bool _safe_mass;   ///< ensures that the subtracted mass is +ve
    189 
    190   Selector _sel_known_vertex;   ///< selects the particles with a
    191                                 ///< known vertex origin
    192   Selector _sel_leading_vertex; ///< amongst the particles with a
    193                                 ///< known vertex origin, select those
    194                                 ///< coming from the leading vertex
     89  /// the fixed value of rho to use if the user has selected that option
     90  double _rho;
    19591
    19692  /// a value of rho that is used as a default to label that the stored
     
    20298  // that's not allowed in an include file.
    20399  static const double _invalid_rho;
    204 
    205   mutable LimitedWarning _unused_rho_m_warning;
    206100};
    207101
Note: See TracChangeset for help on using the changeset viewer.