Changeset 35cdc46 in git for external/fastjet/tools/GridMedianBackgroundEstimator.hh
- Timestamp:
- Sep 3, 2014, 3:18:54 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- be2222c
- Parents:
- 5b5a56b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/tools/GridMedianBackgroundEstimator.hh
r5b5a56b r35cdc46 2 2 #define __GRID_MEDIAN_BACKGROUND_ESTIMATOR_HH__ 3 3 4 // STARTHEADER5 // $Id: GridMedianBackgroundEstimator.hh 2580 2011-09-13 17:25:43Z salam $6 // 7 // Copyright (c) 2005-201 1, Matteo Cacciari, Gavin P. Salam and Gregory Soyez4 //FJSTARTHEADER 5 // $Id: GridMedianBackgroundEstimator.hh 3610 2014-08-13 09:49:28Z salam $ 6 // 7 // Copyright (c) 2005-2014, 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 and are described in hep-ph/0512210. If you use 18 // development. They are described in the original FastJet paper, 19 // hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use 19 20 // FastJet as part of work towards a scientific publication, please 20 // include a citation to the FastJet paper. 21 // quote the version you use and include a citation to the manual and 22 // optionally also to hep-ph/0512210. 21 23 // 22 24 // FastJet is distributed in the hope that it will be useful, … … 28 30 // along with FastJet. If not, see <http://www.gnu.org/licenses/>. 29 31 //---------------------------------------------------------------------- 30 // ENDHEADER32 //FJENDHEADER 31 33 32 34 33 35 #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 34 48 35 49 FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh … … 61 75 /// rho() [Without rescaling, they are identical] 62 76 /// 63 class GridMedianBackgroundEstimator : public BackgroundEstimatorBase { 77 class GridMedianBackgroundEstimator : public BackgroundEstimatorBase 78 #ifdef FASTJET_GMBGE_USEFJGRID 79 , RectangularGrid 80 #endif 81 { 82 64 83 public: 65 84 /// @name constructors and destructors 66 85 //\{ 86 #ifdef FASTJET_GMBGE_USEFJGRID 67 87 //---------------------------------------------------------------- 68 88 /// \param ymax maximal absolute rapidity extent of the grid … … 71 91 /// periodicity in azimuthal angle (size, not area) 72 92 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) : 73 107 _ymin(-ymax), _ymax(ymax), 74 108 _requested_grid_spacing(requested_grid_spacing), 75 _has_particles(false){setup_grid();} 109 _has_particles(false), _enable_rho_m(true) 110 { 111 setup_grid(); 112 } 113 #endif // FASTJET_GMBGE_USEFJGRID 114 76 115 //\} 77 116 … … 84 123 /// of the specified particles. 85 124 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;} 86 129 87 130 //\} … … 114 157 bool has_sigma() {return true;} 115 158 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 116 184 /// returns the area of the grid cells (all identical, but 117 185 /// referred to as "mean" area for uniformity with JetMedianBGE). 118 double mean_area() const {return _cell_area;}186 double mean_area() const {return mean_tile_area();} 119 187 //\} 120 188 … … 134 202 /// Note that this has to be called BEFORE any attempt to do an 135 203 /// 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) 136 208 virtual void set_rescaling_class(const FunctionOfPseudoJet<double> * rescaling_class); 137 209 … … 149 221 150 222 private: 223 224 #ifndef FASTJET_GMBGE_USEFJGRID 225 151 226 /// configure the grid 152 227 void setup_grid(); 153 228 154 229 /// retrieve the grid cell index for a given PseudoJet 155 int igrid(const PseudoJet & p) const; 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 156 243 157 244 /// verify that particles have been set and throw an error if not 158 245 void verify_particles_set() const; 159 246 160 // information about the grid161 double _ymin, _ymax, _dy, _dphi, _requested_grid_spacing, _cell_area;162 int _ny, _nphi, _ntotal;163 164 247 // information abotu the event 165 std::vector<double> _scalar_pt; 248 //std::vector<double> _scalar_pt; 249 double _rho, _sigma, _rho_m, _sigma_m; 166 250 bool _has_particles; 167 168 // various warnings to let people aware of potential dangers 251 bool _enable_rho_m; 252 253 // various warnings to inform people of potential dangers 169 254 LimitedWarning _warning_rho_of_jet; 170 255 LimitedWarning _warning_rescaling;
Note:
See TracChangeset
for help on using the changeset viewer.