Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/Selector.cc

    r35cdc46 rd69dfe4  
    1 //FJSTARTHEADER
    2 // $Id: Selector.cc 3504 2014-08-01 06:07:54Z soyez $
     1//STARTHEADER
     2// $Id$
    33//
    4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     4// Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
    55//
    66//----------------------------------------------------------------------
     
    1313//
    1414//  The algorithms that underlie FastJet have required considerable
    15 //  development. They are described in the original FastJet paper,
    16 //  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
     15//  development and are described in hep-ph/0512210. If you use
    1716//  FastJet as part of work towards a scientific publication, please
    18 //  quote the version you use and include a citation to the manual and
    19 //  optionally also to hep-ph/0512210.
     17//  include a citation to the FastJet paper.
    2018//
    2119//  FastJet is distributed in the hope that it will be useful,
     
    2725//  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
    2826//----------------------------------------------------------------------
    29 //FJENDHEADER
     27//ENDHEADER
    3028
    3129
     
    9593
    9694  return n;
    97 }
    98 
    99 //----------------------------------------------------------------------
    100 // sum the momenta of the jets that pass the cuts
    101 PseudoJet Selector::sum(const std::vector<PseudoJet> & jets) const {
    102   PseudoJet this_sum(0,0,0,0);
    103   const SelectorWorker * worker_local = validated_worker();
    104  
    105   // separate strategies according to whether the worker applies jet by jet
    106   if (worker_local->applies_jet_by_jet()) {
    107     for (unsigned i = 0; i < jets.size(); i++) {
    108       if (worker_local->pass(jets[i])) this_sum += jets[i];
    109     }
    110   } else {
    111     std::vector<const PseudoJet *> jetptrs(jets.size());
    112     for (unsigned i = 0; i < jets.size(); i++) {
    113       jetptrs[i] = & jets[i];
    114     }
    115     worker_local->terminator(jetptrs);
    116     for (unsigned i = 0; i < jetptrs.size(); i++) {
    117       if (jetptrs[i]) this_sum += jets[i];
    118     }
    119   }
    120 
    121   return this_sum;
    122 }
    123 
    124 //----------------------------------------------------------------------
    125 // sum the (scalar) pt of the jets that pass the cuts
    126 double Selector::scalar_pt_sum(const std::vector<PseudoJet> & jets) const {
    127   double this_sum = 0.0;
    128   const SelectorWorker * worker_local = validated_worker();
    129  
    130   // separate strategies according to whether the worker applies jet by jet
    131   if (worker_local->applies_jet_by_jet()) {
    132     for (unsigned i = 0; i < jets.size(); i++) {
    133       if (worker_local->pass(jets[i])) this_sum += jets[i].pt();
    134     }
    135   } else {
    136     std::vector<const PseudoJet *> jetptrs(jets.size());
    137     for (unsigned i = 0; i < jets.size(); i++) {
    138       jetptrs[i] = & jets[i];
    139     }
    140     worker_local->terminator(jetptrs);
    141     for (unsigned i = 0; i < jetptrs.size(); i++) {
    142       if (jetptrs[i]) this_sum += jets[i].pt();
    143     }
    144   }
    145 
    146   return this_sum;
    14795}
    14896
     
    11071055class SW_Circle : public SW_WithReference {
    11081056public:
    1109   SW_Circle(const double radius) : _radius2(radius*radius) {}
     1057  SW_Circle(const double &radius) : _radius2(radius*radius) {}
    11101058
    11111059  /// return a copy of the current object
     
    11521100
    11531101// select on objets within a distance 'radius' of a variable location
    1154 Selector SelectorCircle(const double radius) {
     1102Selector SelectorCircle(const double & radius) {
    11551103  return Selector(new SW_Circle(radius));
    11561104}
     
    11621110class SW_Doughnut : public SW_WithReference {
    11631111public:
    1164   SW_Doughnut(const double radius_in, const double radius_out)
     1112  SW_Doughnut(const double &radius_in, const double &radius_out)
    11651113    : _radius_in2(radius_in*radius_in), _radius_out2(radius_out*radius_out) {}
    11661114
     
    12111159
    12121160// select on objets with distance from the centre is between 'radius_in' and 'radius_out'
    1213 Selector SelectorDoughnut(const double radius_in, const double radius_out) {
     1161Selector SelectorDoughnut(const double & radius_in, const double & radius_out) {
    12141162  return Selector(new SW_Doughnut(radius_in, radius_out));
    12151163}
     
    12201168class SW_Strip : public SW_WithReference {
    12211169public:
    1222   SW_Strip(const double delta) : _delta(delta) {}
     1170  SW_Strip(const double &delta) : _delta(delta) {}
    12231171
    12241172  /// return a copy of the current object
     
    12651213
    12661214// select on objets within a distance 'radius' of a variable location
    1267 Selector SelectorStrip(const double half_width) {
     1215Selector SelectorStrip(const double & half_width) {
    12681216  return Selector(new SW_Strip(half_width));
    12691217}
     
    12761224class SW_Rectangle : public SW_WithReference {
    12771225public:
    1278   SW_Rectangle(const double delta_rap, const double delta_phi)
     1226  SW_Rectangle(const double &delta_rap, const double &delta_phi)
    12791227    : _delta_rap(delta_rap),  _delta_phi(delta_phi) {}
    12801228
     
    13221270
    13231271// select on objets within a distance 'radius' of a variable location
    1324 Selector SelectorRectangle(const double half_rap_width, const double half_phi_width) {
     1272Selector SelectorRectangle(const double & half_rap_width, const double & half_phi_width) {
    13251273  return Selector(new SW_Rectangle(half_rap_width, half_phi_width));
    13261274}
Note: See TracChangeset for help on using the changeset viewer.