Changes in external/fastjet/ClusterSequenceAreaBase.cc [35cdc46:1d208a2] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/ClusterSequenceAreaBase.cc
r35cdc46 r1d208a2 1 1 2 2 //FJSTARTHEADER 3 // $Id: ClusterSequenceAreaBase.cc 3433 2014-07-23 08:17:03Z salam$3 // $Id: ClusterSequenceAreaBase.cc 4079 2016-03-09 12:20:03Z soyez $ 4 4 // 5 5 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 79 79 } 80 80 81 // this is deprecated but used by other deprecated methods. So we hide 82 // the implementation in a protected method so that (i) it can still 83 // be used internally (without generating a compile-time warning when 84 // building FastJet) and the interface can be marked as deprecated. 85 // This can disappear once all the public interfaces have disappeared. 81 86 double ClusterSequenceAreaBase::median_pt_per_unit_area(const Selector & selector) const { 82 return median_pt_per_unit_something(selector,false); 83 } 84 87 return _median_pt_per_unit_area(selector); 88 } 89 90 // the hidden implementation 91 double ClusterSequenceAreaBase::_median_pt_per_unit_area(const Selector & selector) const { 92 return _median_pt_per_unit_something(selector,false); 93 } 94 95 96 97 // this is deprecated but used by other deprecated methods. So we hide 98 // the implementation in a protected method so that (i) it can still 99 // be used internally (without generating a compile-time warning when 100 // building FastJet) and the interface can be marked as deprecated. 101 // This can disappear once all the public interfaces have disappeared. 85 102 double ClusterSequenceAreaBase::median_pt_per_unit_area_4vector(const Selector & selector) const { 86 return median_pt_per_unit_something(selector,true); 87 } 88 89 90 //---------------------------------------------------------------------- 91 /// the median of (pt/area) for jets contained within range, counting 92 /// the empty area as if it were made up of a collection of empty 93 /// jets each of area (0.55 * pi R^2). 103 return _median_pt_per_unit_area_4vector(selector); 104 } 105 106 // the deprecated interface 107 double ClusterSequenceAreaBase::_median_pt_per_unit_area_4vector(const Selector & selector) const { 108 return _median_pt_per_unit_something(selector,true); 109 } 110 111 112 //---------------------------------------------------------------------- 113 // this is deprecated but used by other deprecated methods. So we hide 114 // the implementation in a protected method so that (i) it can still 115 // be used internally (without generating a compile-time warning when 116 // building FastJet) and the interface can be marked as deprecated. 117 // This can disappear once all the public interfaces have disappeared. 94 118 double ClusterSequenceAreaBase::median_pt_per_unit_something( 95 119 const Selector & selector, bool use_area_4vector) const { 96 120 return _median_pt_per_unit_something(selector, use_area_4vector); 121 } 122 123 // the median of (pt/area) for jets contained within range, counting 124 // the empty area as if it were made up of a collection of empty 125 // jets each of area (0.55 * pi R^2). 126 double ClusterSequenceAreaBase::_median_pt_per_unit_something( 127 const Selector & selector, bool use_area_4vector) const { 97 128 double median, sigma, mean_area; 98 get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area);129 _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area); 99 130 return median; 100 101 } 102 103 104 //---------------------------------------------------------------------- 105 /// fits a form pt_per_unit_area(y) = a + b*y^2 for jets in range. 106 /// exclude_above allows one to exclude large values of pt/area from fit. 107 /// use_area_4vector = true uses the 4vector areas. 131 } 132 133 134 //---------------------------------------------------------------------- 135 /// fits a form pt_per_unit_area(y) = a + b*y^2 for jets in range. 136 /// exclude_above allows one to exclude large values of pt/area from 137 /// fit. use_area_4vector = true uses the 4vector areas. 108 138 void ClusterSequenceAreaBase::parabolic_pt_per_unit_area( 139 double & a, double & b, const Selector & selector, 140 double exclude_above, bool use_area_4vector) const { 141 return _parabolic_pt_per_unit_area(a, b, selector, exclude_above, use_area_4vector); 142 } 143 144 void ClusterSequenceAreaBase::_parabolic_pt_per_unit_area( 109 145 double & a, double & b, const Selector & selector, 110 146 double exclude_above, bool use_area_4vector) const { … … 161 197 162 198 163 199 //---------------------------------------------------------------------- 164 200 void ClusterSequenceAreaBase::get_median_rho_and_sigma( 165 201 const Selector & selector, bool use_area_4vector, 166 202 double & median, double & sigma, double & mean_area) const { 203 _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area); 204 } 205 206 void ClusterSequenceAreaBase::_get_median_rho_and_sigma( 207 const Selector & selector, bool use_area_4vector, 208 double & median, double & sigma, double & mean_area) const { 167 209 168 210 vector<PseudoJet> incl_jets = inclusive_jets(); 169 get_median_rho_and_sigma(incl_jets, selector, use_area_4vector, 170 median, sigma, mean_area, true); 171 } 172 211 _get_median_rho_and_sigma(incl_jets, selector, use_area_4vector, 212 median, sigma, mean_area, true); 213 } 173 214 174 215 void ClusterSequenceAreaBase::get_median_rho_and_sigma( 216 const vector<PseudoJet> & all_jets, 217 const Selector & selector, bool use_area_4vector, 218 double & median, double & sigma, double & mean_area, 219 bool all_are_incl) const { 220 _get_median_rho_and_sigma(all_jets, selector, use_area_4vector, 221 median, sigma, mean_area, all_are_incl); 222 } 223 224 void ClusterSequenceAreaBase::_get_median_rho_and_sigma( 175 225 const vector<PseudoJet> & all_jets, 176 226 const Selector & selector, bool use_area_4vector, … … 288 338 289 339 290 // /return a vector of all subtracted jets, using area_4vector, given rho.291 // /Only inclusive_jets above ptmin are subtracted and returned.292 // /the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),293 // /i.e. not necessarily ordered in pt once subtracted340 // return a vector of all subtracted jets, using area_4vector, given rho. 341 // Only inclusive_jets above ptmin are subtracted and returned. 342 // the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()), 343 // i.e. not necessarily ordered in pt once subtracted 294 344 vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(const double rho, 295 345 const double ptmin) 296 346 const { 347 return _subtracted_jets(rho,ptmin); 348 } 349 350 vector<PseudoJet> ClusterSequenceAreaBase::_subtracted_jets(const double rho, 351 const double ptmin) 352 const { 297 353 vector<PseudoJet> sub_jets; 298 354 vector<PseudoJet> jets_local = sorted_by_pt(inclusive_jets(ptmin)); 299 355 for (unsigned i=0; i<jets_local.size(); i++) { 300 PseudoJet sub_jet = subtracted_jet(jets_local[i],rho);356 PseudoJet sub_jet = _subtracted_jet(jets_local[i],rho); 301 357 sub_jets.push_back(sub_jet); 302 358 } … … 304 360 } 305 361 306 // /return a vector of subtracted jets, using area_4vector.307 // /Only inclusive_jets above ptmin are subtracted and returned.308 // /the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()),309 // /i.e. not necessarily ordered in pt once subtracted362 // return a vector of subtracted jets, using area_4vector. 363 // Only inclusive_jets above ptmin are subtracted and returned. 364 // the ordering is the same as that of sorted_by_pt(cs.inclusive_jets()), 365 // i.e. not necessarily ordered in pt once subtracted 310 366 vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets( 311 367 const Selector & selector, 312 368 const double ptmin) 313 369 const { 314 double rho = median_pt_per_unit_area_4vector(selector);315 return subtracted_jets(rho,ptmin);370 double rho = _median_pt_per_unit_area_4vector(selector); 371 return _subtracted_jets(rho,ptmin); 316 372 } 317 373 … … 320 376 PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet, 321 377 const double rho) const { 378 return _subtracted_jet(jet, rho); 379 } 380 381 PseudoJet ClusterSequenceAreaBase::_subtracted_jet(const PseudoJet & jet, 382 const double rho) const { 322 383 PseudoJet area4vect = area_4vector(jet); 323 384 PseudoJet sub_jet; … … 343 404 PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet, 344 405 const Selector & selector) const { 345 double rho = median_pt_per_unit_area_4vector(selector); 346 PseudoJet sub_jet = subtracted_jet(jet, rho); 406 return _subtracted_jet(jet, selector); 407 } 408 409 PseudoJet ClusterSequenceAreaBase::_subtracted_jet(const PseudoJet & jet, 410 const Selector & selector) const { 411 double rho = _median_pt_per_unit_area_4vector(selector); 412 PseudoJet sub_jet = _subtracted_jet(jet, rho); 347 413 return sub_jet; 348 414 } … … 353 419 const double rho, 354 420 bool use_area_4vector) const { 421 return _subtracted_pt(jet, rho, use_area_4vector); 422 } 423 424 double ClusterSequenceAreaBase::_subtracted_pt(const PseudoJet & jet, 425 const double rho, 426 bool use_area_4vector) const { 355 427 if ( use_area_4vector ) { 356 PseudoJet sub_jet = subtracted_jet(jet,rho);428 PseudoJet sub_jet = _subtracted_jet(jet,rho); 357 429 return sub_jet.perp(); 358 430 } else { … … 369 441 bool use_area_4vector) const { 370 442 if ( use_area_4vector ) { 371 PseudoJet sub_jet = subtracted_jet(jet,selector);443 PseudoJet sub_jet = _subtracted_jet(jet,selector); 372 444 return sub_jet.perp(); 373 445 } else { 374 double rho = median_pt_per_unit_area(selector);375 return subtracted_pt(jet,rho,false);446 double rho = _median_pt_per_unit_area(selector); 447 return _subtracted_pt(jet,rho,false); 376 448 } 377 449 }
Note:
See TracChangeset
for help on using the changeset viewer.