Fork me on GitHub

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/fastjet/PseudoJet.hh

    r1d208a2 r35cdc46  
    11//FJSTARTHEADER
    2 // $Id: PseudoJet.hh 4047 2016-03-03 13:21:49Z soyez $
     2// $Id: PseudoJet.hh 3566 2014-08-11 15:36:34Z salam $
    33//
    44// Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
     
    437437  /// retrieve a pointer to the (const) user information
    438438  const UserInfoBase * user_info_ptr() const{
    439     // the line below is not needed since the next line would anyway
    440     // return NULL in that case
    441     //if (!_user_info) return NULL;
     439    if (!_user_info()) return NULL;
    442440    return _user_info.get();
    443441  }
     
    843841inline bool operator!=( const double val, const PseudoJet & a) {return !(a==val);}
    844842
    845 /// returns the 4-vector dot product of a and b
    846843inline double dot_product(const PseudoJet & a, const PseudoJet & b) {
    847844  return a.E()*b.E() - a.px()*b.px() - a.py()*b.py() - a.pz()*b.pz();
     
    883880/// touch the values vector in the process).
    884881template<class T> std::vector<T> objects_sorted_by_values(const std::vector<T> & objects,
    885                                               const std::vector<double> & values) {
    886   //assert(objects.size() == values.size());
    887   if (objects.size() != values.size()){
    888     throw Error("fastjet::objects_sorted_by_values(...): the size of the 'objects' vector must match the size of the 'values' vector");
    889   }
    890  
    891   // get a vector of indices
    892   std::vector<int> indices(values.size());
    893   for (size_t i = 0; i < indices.size(); i++) {indices[i] = i;}
    894  
    895   // sort the indices
    896   sort_indices(indices, values);
    897  
    898   // copy the objects
    899   std::vector<T> objects_sorted(objects.size());
    900  
    901   // place the objects in the correct order
    902   for (size_t i = 0; i < indices.size(); i++) {
    903     objects_sorted[i] = objects[indices[i]];
    904   }
    905 
    906   return objects_sorted;
    907 }
     882                                              const std::vector<double> & values);
    908883
    909884/// \if internal_doc
     
    995970template<typename TransformerType>
    996971bool PseudoJet::has_structure_of() const{
    997   if (!_structure) return false;
     972  if (!_structure()) return false;
    998973
    999974  return dynamic_cast<const typename TransformerType::StructureType *>(_structure.get()) != 0;
     
    1005980template<typename TransformerType>
    1006981const typename TransformerType::StructureType & PseudoJet::structure_of() const{
    1007   if (!_structure)
     982  if (!_structure())
    1008983    throw Error("Trying to access the structure of a PseudoJet without an associated structure");
    1009984
Note: See TracChangeset for help on using the changeset viewer.