Changes in external/fastjet/PseudoJet.hh [1d208a2:35cdc46] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/PseudoJet.hh
r1d208a2 r35cdc46 1 1 //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 $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 437 437 /// retrieve a pointer to the (const) user information 438 438 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; 442 440 return _user_info.get(); 443 441 } … … 843 841 inline bool operator!=( const double val, const PseudoJet & a) {return !(a==val);} 844 842 845 /// returns the 4-vector dot product of a and b846 843 inline double dot_product(const PseudoJet & a, const PseudoJet & b) { 847 844 return a.E()*b.E() - a.px()*b.px() - a.py()*b.py() - a.pz()*b.pz(); … … 883 880 /// touch the values vector in the process). 884 881 template<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); 908 883 909 884 /// \if internal_doc … … 995 970 template<typename TransformerType> 996 971 bool PseudoJet::has_structure_of() const{ 997 if (!_structure ) return false;972 if (!_structure()) return false; 998 973 999 974 return dynamic_cast<const typename TransformerType::StructureType *>(_structure.get()) != 0; … … 1005 980 template<typename TransformerType> 1006 981 const typename TransformerType::StructureType & PseudoJet::structure_of() const{ 1007 if (!_structure )982 if (!_structure()) 1008 983 throw Error("Trying to access the structure of a PseudoJet without an associated structure"); 1009 984
Note:
See TracChangeset
for help on using the changeset viewer.