Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/ClusterSequenceAreaBase.cc

    r35cdc46 r1d208a2  
    11
    22//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 $
    44//
    55// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    7979}
    8080
     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.
    8186double 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
     91double 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.
    85102double 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
     107double 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.
    94118double ClusterSequenceAreaBase::median_pt_per_unit_something(
    95119                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).
     126double ClusterSequenceAreaBase::_median_pt_per_unit_something(
     127                const Selector & selector, bool use_area_4vector) const {
    97128  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);
    99130  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.
    108138void 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
     144void ClusterSequenceAreaBase::_parabolic_pt_per_unit_area(
    109145       double & a, double & b, const Selector & selector,
    110146       double exclude_above, bool use_area_4vector) const {
     
    161197
    162198
    163 
     199//----------------------------------------------------------------------
    164200void ClusterSequenceAreaBase::get_median_rho_and_sigma(
    165201            const Selector & selector, bool use_area_4vector,
    166202            double & median, double & sigma, double & mean_area) const {
     203  _get_median_rho_and_sigma(selector, use_area_4vector, median, sigma, mean_area);
     204}
     205
     206void ClusterSequenceAreaBase::_get_median_rho_and_sigma(
     207            const Selector & selector, bool use_area_4vector,
     208            double & median, double & sigma, double & mean_area) const {
    167209
    168210  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}
    173214
    174215void 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
     224void ClusterSequenceAreaBase::_get_median_rho_and_sigma(
    175225            const vector<PseudoJet> & all_jets,
    176226            const Selector & selector, bool use_area_4vector,
     
    288338
    289339
    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 subtracted
     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 subtracted
    294344vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(const double rho,
    295345                                                           const double ptmin)
    296346                                                           const {
     347  return _subtracted_jets(rho,ptmin);
     348}
     349
     350vector<PseudoJet> ClusterSequenceAreaBase::_subtracted_jets(const double rho,
     351                                                            const double ptmin)
     352  const {
    297353  vector<PseudoJet> sub_jets;
    298354  vector<PseudoJet> jets_local = sorted_by_pt(inclusive_jets(ptmin));
    299355  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);
    301357     sub_jets.push_back(sub_jet);
    302358  }
     
    304360}
    305361
    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 subtracted
     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 subtracted
    310366vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(
    311367                                                 const Selector & selector,
    312368                                                 const double ptmin)
    313369                                                 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);
    316372}
    317373
     
    320376PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet,
    321377                                                  const double rho) const {
     378  return _subtracted_jet(jet, rho);
     379}
     380
     381PseudoJet ClusterSequenceAreaBase::_subtracted_jet(const PseudoJet & jet,
     382                                                   const double rho) const {
    322383  PseudoJet area4vect = area_4vector(jet);
    323384  PseudoJet sub_jet;
     
    343404PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet,
    344405                                       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
     409PseudoJet 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);
    347413  return sub_jet;
    348414}
     
    353419                                              const double rho,
    354420                                              bool use_area_4vector) const {
     421  return _subtracted_pt(jet, rho, use_area_4vector);
     422}
     423
     424double ClusterSequenceAreaBase::_subtracted_pt(const PseudoJet & jet,
     425                                              const double rho,
     426                                              bool use_area_4vector) const {
    355427  if ( use_area_4vector ) {
    356      PseudoJet sub_jet = subtracted_jet(jet,rho);
     428     PseudoJet sub_jet = _subtracted_jet(jet,rho);
    357429     return sub_jet.perp();
    358430  } else {
     
    369441                                              bool use_area_4vector) const {
    370442  if ( use_area_4vector ) {
    371      PseudoJet sub_jet = subtracted_jet(jet,selector);
     443     PseudoJet sub_jet = _subtracted_jet(jet,selector);
    372444     return sub_jet.perp();
    373445  } 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);
    376448  }
    377449
Note: See TracChangeset for help on using the changeset viewer.