Changes in external/fastjet/tools/GridMedianBackgroundEstimator.hh [35cdc46:d7d2da3] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/tools/GridMedianBackgroundEstimator.hh
r35cdc46 rd7d2da3 2 2 #define __GRID_MEDIAN_BACKGROUND_ESTIMATOR_HH__ 3 3 4 // FJSTARTHEADER5 // $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 $ 6 6 // 7 // Copyright (c) 2005-201 4, Matteo Cacciari, Gavin P. Salam and Gregory Soyez7 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez 8 8 // 9 9 //---------------------------------------------------------------------- … … 16 16 // 17 17 // 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 20 19 // 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. 23 21 // 24 22 // FastJet is distributed in the hope that it will be useful, … … 30 28 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 31 29 //---------------------------------------------------------------------- 32 // FJENDHEADER30 //ENDHEADER 33 31 34 32 35 33 #include "fastjet/tools/BackgroundEstimatorBase.hh" 36 37 // if defined then we'll use the RectangularGrid class38 //39 // (For FastJet 3.2, maybe remove the symbol and simply clean up the40 // code below to use exclusively the RectangularGrid)41 #define FASTJET_GMBGE_USEFJGRID42 43 #ifdef FASTJET_GMBGE_USEFJGRID44 #include "fastjet/RectangularGrid.hh"45 #endif46 47 48 34 49 35 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh … … 75 61 /// rho() [Without rescaling, they are identical] 76 62 /// 77 class GridMedianBackgroundEstimator : public BackgroundEstimatorBase 78 #ifdef FASTJET_GMBGE_USEFJGRID 79 , RectangularGrid 80 #endif 81 { 82 63 class GridMedianBackgroundEstimator : public BackgroundEstimatorBase { 83 64 public: 84 65 /// @name constructors and destructors 85 66 //\{ 86 #ifdef FASTJET_GMBGE_USEFJGRID87 67 //---------------------------------------------------------------- 88 68 /// \param ymax maximal absolute rapidity extent of the grid … … 91 71 /// periodicity in azimuthal angle (size, not area) 92 72 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 RectangularGrid98 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 grid106 GridMedianBackgroundEstimator(double ymax, double requested_grid_spacing) :107 73 _ymin(-ymax), _ymax(ymax), 108 74 _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();} 115 76 //\} 116 77 … … 123 84 /// of the specified particles. 124 85 void set_particles(const std::vector<PseudoJet> & particles); 125 126 /// determine whether the automatic calculation of rho_m and sigma_m127 /// is enabled (by default true)128 void set_compute_rho_m(bool enable){ _enable_rho_m = enable;}129 86 130 87 //\} … … 157 114 bool has_sigma() {return true;} 158 115 159 //-----------------------------------------------------------------160 /// Returns rho_m, the purely longitudinal, particle-mass-induced161 /// component of the background density per unit area162 double rho_m() const;163 164 /// returns sigma_m, a measure of the fluctuations in the purely165 /// longitudinal, particle-mass-induced component of the background166 /// density per unit area; must be multipled by sqrt(area) to get167 /// 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 for177 /// determination of rho_m.178 ///179 /// Note that support for sigma_m is automatic is one has sigma and180 /// rho_m support.181 bool has_rho_m() const {return _enable_rho_m;}182 183 184 116 /// returns the area of the grid cells (all identical, but 185 117 /// 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;} 187 119 //\} 188 120 … … 202 134 /// Note that this has to be called BEFORE any attempt to do an 203 135 /// actual computation 204 ///205 /// The same profile will be used for both pt and mt (this is206 /// probabaly a good approximation since the particle density207 /// changes is what dominates the rapidity profile)208 136 virtual void set_rescaling_class(const FunctionOfPseudoJet<double> * rescaling_class); 209 137 … … 221 149 222 150 private: 223 224 #ifndef FASTJET_GMBGE_USEFJGRID225 226 151 /// configure the grid 227 152 void setup_grid(); 228 153 229 154 /// 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; 243 156 244 157 /// verify that particles have been set and throw an error if not 245 158 void verify_particles_set() const; 246 159 160 // information about the grid 161 double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing, _cell_area; 162 int _ny, _nphi, _ntotal; 163 247 164 // information abotu the event 248 //std::vector<double> _scalar_pt; 249 double _rho, _sigma, _rho_m, _sigma_m; 165 std::vector<double> _scalar_pt; 250 166 bool _has_particles; 251 bool _enable_rho_m;252 167 253 // various warnings to inform people of potential dangers168 // various warnings to let people aware of potential dangers 254 169 LimitedWarning _warning_rho_of_jet; 255 170 LimitedWarning _warning_rescaling;
Note:
See TracChangeset
for help on using the changeset viewer.