Fork me on GitHub

Ignore:
File:
1 edited

Legend:

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

    r35cdc46 rd7d2da3  
    22#define __GRID_MEDIAN_BACKGROUND_ESTIMATOR_HH__
    33
    4 //FJSTARTHEADER
    5 // $Id: GridMedianBackgroundEstimator.hh 3610 2014-08-13 09:49:28Z salam $
     4//STARTHEADER
     5// $Id: GridMedianBackgroundEstimator.hh 2580 2011-09-13 17:25:43Z salam $
    66//
    7 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     7// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    88//
    99//----------------------------------------------------------------------
     
    1616//
    1717//  The algorithms that underlie FastJet have required considerable
    18 //  development. They are described in the original FastJet paper,
    19 //  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
     18//  development and are described in hep-ph/0512210. If you use
    2019//  FastJet as part of work towards a scientific publication, please
    21 //  quote the version you use and include a citation to the manual and
    22 //  optionally also to hep-ph/0512210.
     20//  include a citation to the FastJet paper.
    2321//
    2422//  FastJet is distributed in the hope that it will be useful,
     
    3028//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    3129//----------------------------------------------------------------------
    32 //FJENDHEADER
     30//ENDHEADER
    3331
    3432
    3533#include "fastjet/tools/BackgroundEstimatorBase.hh"
    36 
    37 // if defined then we'll use the RectangularGrid class
    38 //
    39 // (For FastJet 3.2, maybe remove the symbol and simply clean up the
    40 // code below to use exclusively the RectangularGrid)
    41 #define FASTJET_GMBGE_USEFJGRID
    42 
    43 #ifdef FASTJET_GMBGE_USEFJGRID
    44 #include "fastjet/RectangularGrid.hh"
    45 #endif
    46 
    47 
    4834
    4935FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
     
    7561///   rho() [Without rescaling, they are identical]
    7662///
    77 class GridMedianBackgroundEstimator : public BackgroundEstimatorBase
    78 #ifdef FASTJET_GMBGE_USEFJGRID
    79                                                                     , RectangularGrid
    80 #endif
    81 {
    82 
     63class GridMedianBackgroundEstimator : public BackgroundEstimatorBase {
    8364public:
    8465  /// @name  constructors and destructors
    8566  //\{
    86 #ifdef FASTJET_GMBGE_USEFJGRID
    8767  //----------------------------------------------------------------
    8868  ///   \param ymax   maximal absolute rapidity extent of the grid
     
    9171  ///             periodicity in azimuthal angle (size, not area)
    9272  GridMedianBackgroundEstimator(double ymax, double requested_grid_spacing) :
    93     RectangularGrid(ymax, requested_grid_spacing),
    94     _has_particles(false), _enable_rho_m(true) {}
    95 
    96   //----------------------------------------------------------------
    97   /// Constructor based on a user's fully specified RectangularGrid
    98   GridMedianBackgroundEstimator(const RectangularGrid & grid) :
    99     RectangularGrid(grid),
    100     _has_particles(false), _enable_rho_m(true) {
    101     if (!RectangularGrid::is_initialised())
    102       throw Error("attempt to construct GridMedianBackgroundEstimator with uninitialised RectangularGrid");
    103   }   
    104 
    105 #else  // alternative in old framework where we didn't have the rectangular grid
    106   GridMedianBackgroundEstimator(double ymax, double requested_grid_spacing) :
    10773    _ymin(-ymax), _ymax(ymax),
    10874    _requested_grid_spacing(requested_grid_spacing),
    109     _has_particles(false), _enable_rho_m(true)
    110   {
    111      setup_grid();
    112   }
    113 #endif // FASTJET_GMBGE_USEFJGRID
    114 
     75    _has_particles(false){setup_grid();}
    11576  //\}
    11677
     
    12384  /// of the specified particles.
    12485  void set_particles(const std::vector<PseudoJet> & particles);
    125 
    126   /// determine whether the automatic calculation of rho_m and sigma_m
    127   /// is enabled (by default true)
    128   void set_compute_rho_m(bool enable){ _enable_rho_m = enable;}
    12986
    13087  //\}
     
    157114  bool has_sigma() {return true;}
    158115
    159   //-----------------------------------------------------------------
    160   /// Returns rho_m, the purely longitudinal, particle-mass-induced
    161   /// component of the background density per unit area
    162   double rho_m() const;
    163 
    164   /// returns sigma_m, a measure of the fluctuations in the purely
    165   /// longitudinal, particle-mass-induced component of the background
    166   /// density per unit area; must be multipled by sqrt(area) to get
    167   /// fluctuations for a region of a given area.
    168   double sigma_m() const;
    169 
    170   /// Returns rho_m locally at the jet position. As for rho(jet), it is non-const.
    171   double rho_m(const PseudoJet & jet);
    172 
    173   /// Returns sigma_m locally at the jet position. As for rho(jet), it is non-const.
    174   double sigma_m(const PseudoJet & jet);
    175 
    176   /// Returns true if this background estimator has support for
    177   /// determination of rho_m.
    178   ///
    179   /// Note that support for sigma_m is automatic is one has sigma and
    180   /// rho_m support.
    181   bool has_rho_m() const {return _enable_rho_m;}
    182 
    183 
    184116  /// returns the area of the grid cells (all identical, but
    185117  /// referred to as "mean" area for uniformity with JetMedianBGE).
    186   double mean_area() const {return mean_tile_area();}
     118  double mean_area() const {return _cell_area;}
    187119  //\}
    188120
     
    202134  /// Note that this has to be called BEFORE any attempt to do an
    203135  /// actual computation
    204   ///
    205   /// The same profile will be used for both pt and mt (this is
    206   /// probabaly a good approximation since the particle density
    207   /// changes is what dominates the rapidity profile)
    208136  virtual void set_rescaling_class(const FunctionOfPseudoJet<double> * rescaling_class);
    209137
     
    221149
    222150private:
    223 
    224 #ifndef FASTJET_GMBGE_USEFJGRID
    225 
    226151  /// configure the grid
    227152  void setup_grid();
    228153
    229154  /// retrieve the grid cell index for a given PseudoJet
    230   int tile_index(const PseudoJet & p) const;
    231 
    232   // information about the grid
    233   double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing, _tile_area;
    234   int _ny, _nphi, _ntotal;
    235 
    236   int n_tiles() const {return _ntotal;}
    237   int n_good_tiles() const {return n_tiles();}
    238   int tile_is_good(int /* itile */) const {return true;}
    239 
    240   double mean_tile_area() const {return _tile_area;}
    241 #endif // FASTJET_GMBGE_USEFJGRID
    242 
     155  int igrid(const PseudoJet & p) const;
    243156
    244157  /// verify that particles have been set and throw an error if not
    245158  void verify_particles_set() const;
    246159
     160  // information about the grid
     161  double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing, _cell_area;
     162  int _ny, _nphi, _ntotal;
     163
    247164  // information abotu the event
    248   //std::vector<double> _scalar_pt;
    249   double _rho, _sigma, _rho_m, _sigma_m;
     165  std::vector<double> _scalar_pt;
    250166  bool _has_particles;
    251   bool _enable_rho_m;
    252167
    253   // various warnings to inform people of potential dangers
     168  // various warnings to let people aware of potential dangers
    254169  LimitedWarning _warning_rho_of_jet;
    255170  LimitedWarning _warning_rescaling;
Note: See TracChangeset for help on using the changeset viewer.