Changes in external/fastjet/ClusterSequenceAreaBase.cc [1d208a2:35cdc46] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/ClusterSequenceAreaBase.cc
r1d208a2 r35cdc46 1 1 2 2 //FJSTARTHEADER 3 // $Id: ClusterSequenceAreaBase.cc 4079 2016-03-09 12:20:03Z soyez$3 // $Id: ClusterSequenceAreaBase.cc 3433 2014-07-23 08:17:03Z salam $ 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 hide82 // the implementation in a protected method so that (i) it can still83 // be used internally (without generating a compile-time warning when84 // building FastJet) and the interface can be marked as deprecated.85 // This can disappear once all the public interfaces have disappeared.86 81 double ClusterSequenceAreaBase::median_pt_per_unit_area(const Selector & selector) const { 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. 82 return median_pt_per_unit_something(selector,false); 83 } 84 102 85 double ClusterSequenceAreaBase::median_pt_per_unit_area_4vector(const Selector & selector) const { 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. 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). 118 94 double ClusterSequenceAreaBase::median_pt_per_unit_something( 119 95 const Selector & selector, bool use_area_4vector) const { 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 { 96 128 97 double median, sigma, mean_area; 129 _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area);98 get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area); 130 99 return median; 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. 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. 138 108 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(145 109 double & a, double & b, const Selector & selector, 146 110 double exclude_above, bool use_area_4vector) const { … … 197 161 198 162 199 //---------------------------------------------------------------------- 163 200 164 void ClusterSequenceAreaBase::get_median_rho_and_sigma( 201 165 const Selector & selector, bool use_area_4vector, 202 166 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 {209 167 210 168 vector<PseudoJet> incl_jets = inclusive_jets(); 211 _get_median_rho_and_sigma(incl_jets, selector, use_area_4vector, 212 median, sigma, mean_area, true); 213 } 169 get_median_rho_and_sigma(incl_jets, selector, use_area_4vector, 170 median, sigma, mean_area, true); 171 } 172 214 173 215 174 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(225 175 const vector<PseudoJet> & all_jets, 226 176 const Selector & selector, bool use_area_4vector, … … 338 288 339 289 340 // 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 subtracted290 /// 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 subtracted 344 294 vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(const double rho, 345 295 const double ptmin) 346 296 const { 347 return _subtracted_jets(rho,ptmin);348 }349 350 vector<PseudoJet> ClusterSequenceAreaBase::_subtracted_jets(const double rho,351 const double ptmin)352 const {353 297 vector<PseudoJet> sub_jets; 354 298 vector<PseudoJet> jets_local = sorted_by_pt(inclusive_jets(ptmin)); 355 299 for (unsigned i=0; i<jets_local.size(); i++) { 356 PseudoJet sub_jet = _subtracted_jet(jets_local[i],rho);300 PseudoJet sub_jet = subtracted_jet(jets_local[i],rho); 357 301 sub_jets.push_back(sub_jet); 358 302 } … … 360 304 } 361 305 362 // 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 subtracted306 /// 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 subtracted 366 310 vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets( 367 311 const Selector & selector, 368 312 const double ptmin) 369 313 const { 370 double rho = _median_pt_per_unit_area_4vector(selector);371 return _subtracted_jets(rho,ptmin);314 double rho = median_pt_per_unit_area_4vector(selector); 315 return subtracted_jets(rho,ptmin); 372 316 } 373 317 … … 376 320 PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet, 377 321 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 {383 322 PseudoJet area4vect = area_4vector(jet); 384 323 PseudoJet sub_jet; … … 404 343 PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet, 405 344 const Selector & selector) const { 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); 345 double rho = median_pt_per_unit_area_4vector(selector); 346 PseudoJet sub_jet = subtracted_jet(jet, rho); 413 347 return sub_jet; 414 348 } … … 419 353 const double rho, 420 354 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 {427 355 if ( use_area_4vector ) { 428 PseudoJet sub_jet = _subtracted_jet(jet,rho);356 PseudoJet sub_jet = subtracted_jet(jet,rho); 429 357 return sub_jet.perp(); 430 358 } else { … … 441 369 bool use_area_4vector) const { 442 370 if ( use_area_4vector ) { 443 PseudoJet sub_jet = _subtracted_jet(jet,selector);371 PseudoJet sub_jet = subtracted_jet(jet,selector); 444 372 return sub_jet.perp(); 445 373 } else { 446 double rho = _median_pt_per_unit_area(selector);447 return _subtracted_pt(jet,rho,false);374 double rho = median_pt_per_unit_area(selector); 375 return subtracted_pt(jet,rho,false); 448 376 } 449 377 }
Note:
See TracChangeset
for help on using the changeset viewer.