Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/ClusterSequenceAreaBase.cc

    r1d208a2 r35cdc46  
    11
    22//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 $
    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.
    8681double 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
    10285double 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).
    11894double ClusterSequenceAreaBase::median_pt_per_unit_something(
    11995                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
    12897  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);
    13099  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.
    138108void 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(
    145109       double & a, double & b, const Selector & selector,
    146110       double exclude_above, bool use_area_4vector) const {
     
    197161
    198162
    199 //----------------------------------------------------------------------
     163
    200164void ClusterSequenceAreaBase::get_median_rho_and_sigma(
    201165            const Selector & selector, bool use_area_4vector,
    202166            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 {
    209167
    210168  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
    214173
    215174void 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(
    225175            const vector<PseudoJet> & all_jets,
    226176            const Selector & selector, bool use_area_4vector,
     
    338288
    339289
    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
     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
    344294vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(const double rho,
    345295                                                           const double ptmin)
    346296                                                           const {
    347   return _subtracted_jets(rho,ptmin);
    348 }
    349 
    350 vector<PseudoJet> ClusterSequenceAreaBase::_subtracted_jets(const double rho,
    351                                                             const double ptmin)
    352   const {
    353297  vector<PseudoJet> sub_jets;
    354298  vector<PseudoJet> jets_local = sorted_by_pt(inclusive_jets(ptmin));
    355299  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);
    357301     sub_jets.push_back(sub_jet);
    358302  }
     
    360304}
    361305
    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
     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
    366310vector<PseudoJet> ClusterSequenceAreaBase::subtracted_jets(
    367311                                                 const Selector & selector,
    368312                                                 const double ptmin)
    369313                                                 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);
    372316}
    373317
     
    376320PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet,
    377321                                                  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 {
    383322  PseudoJet area4vect = area_4vector(jet);
    384323  PseudoJet sub_jet;
     
    404343PseudoJet ClusterSequenceAreaBase::subtracted_jet(const PseudoJet & jet,
    405344                                       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);
    413347  return sub_jet;
    414348}
     
    419353                                              const double rho,
    420354                                              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 {
    427355  if ( use_area_4vector ) {
    428      PseudoJet sub_jet = _subtracted_jet(jet,rho);
     356     PseudoJet sub_jet = subtracted_jet(jet,rho);
    429357     return sub_jet.perp();
    430358  } else {
     
    441369                                              bool use_area_4vector) const {
    442370  if ( use_area_4vector ) {
    443      PseudoJet sub_jet = _subtracted_jet(jet,selector);
     371     PseudoJet sub_jet = subtracted_jet(jet,selector);
    444372     return sub_jet.perp();
    445373  } 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);
    448376  }
    449377
Note: See TracChangeset for help on using the changeset viewer.