Changes in external/fastjet/PseudoJet.cc [273e668:1d208a2] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/PseudoJet.cc
r273e668 r1d208a2 1 1 //FJSTARTHEADER 2 // $Id: PseudoJet.cc 3652 2014-09-03 13:31:13Z salam $2 // $Id: PseudoJet.cc 4100 2016-03-15 20:50:22Z salam $ 3 3 // 4 4 // Copyright (c) 2005-2014, Matteo Cacciari, Gavin P. Salam and Gregory Soyez … … 409 409 string PseudoJet::description() const{ 410 410 // the "default" case of a PJ which does not belong to any cluster sequence 411 if (!_structure ())411 if (!_structure) 412 412 return "standard PseudoJet (with no associated clustering information)"; 413 413 414 414 // for all the other cases, the description comes from the structure 415 return _structure ()->description();415 return _structure->description(); 416 416 } 417 417 … … 429 429 // ClusterSequence 430 430 bool PseudoJet::has_associated_cluster_sequence() const{ 431 return (_structure ()) && (_structure->has_associated_cluster_sequence());431 return (_structure) && (_structure->has_associated_cluster_sequence()); 432 432 } 433 433 … … 446 446 // ClusterSequence that is still valid 447 447 bool PseudoJet::has_valid_cluster_sequence() const{ 448 return (_structure ()) && (_structure->has_valid_cluster_sequence());448 return (_structure) && (_structure->has_valid_cluster_sequence()); 449 449 } 450 450 … … 467 467 468 468 //---------------------------------------------------------------------- 469 // return true if there is some stru sture associated with this PseudoJet469 // return true if there is some structure associated with this PseudoJet 470 470 bool PseudoJet::has_structure() const{ 471 return _structure();471 return bool(_structure); 472 472 } 473 473 … … 478 478 // return NULL if there is no associated structure 479 479 const PseudoJetStructureBase* PseudoJet::structure_ptr() const { 480 if (!_structure()) return NULL;481 return _structure ();480 //if (!_structure) return NULL; 481 return _structure.get(); 482 482 } 483 483 … … 493 493 // underlying structure. 494 494 PseudoJetStructureBase* PseudoJet::structure_non_const_ptr(){ 495 if (!_structure()) return NULL;496 return _structure ();495 //if (!_structure) return NULL; 496 return _structure.get(); 497 497 } 498 498 … … 503 503 // throw an error if there is no associated structure 504 504 const PseudoJetStructureBase* PseudoJet::validated_structure_ptr() const { 505 if (!_structure ())505 if (!_structure) 506 506 throw Error("Trying to access the structure of a PseudoJet which has no associated structure"); 507 return _structure ();507 return _structure.get(); 508 508 } 509 509 … … 573 573 // returns true if the PseudoJet has constituents 574 574 bool PseudoJet::has_constituents() const{ 575 return (_structure ()) && (_structure->has_constituents());575 return (_structure) && (_structure->has_constituents()); 576 576 } 577 577 … … 586 586 // returns true if the PseudoJet has support for exclusive subjets 587 587 bool PseudoJet::has_exclusive_subjets() const{ 588 return (_structure ()) && (_structure->has_exclusive_subjets());588 return (_structure) && (_structure->has_exclusive_subjets()); 589 589 } 590 590 … … 670 670 // ClusterSequence have no pieces and this methos will return false. 671 671 bool PseudoJet::has_pieces() const{ 672 return ((_structure ()) && (_structure->has_pieces(*this)));672 return ((_structure) && (_structure->has_pieces(*this))); 673 673 } 674 674 … … 766 766 767 767 768 769 //----------------------------------------------------------------------770 /// given a vector of values with a one-to-one correspondence with the771 /// vector of objects, sort objects into an order such that the772 /// associated values would be in increasing order773 template<class T> vector<T> objects_sorted_by_values(774 const vector<T> & objects,775 const vector<double> & values) {776 777 assert(objects.size() == values.size());778 779 // get a vector of indices780 vector<int> indices(values.size());781 for (size_t i = 0; i < indices.size(); i++) {indices[i] = i;}782 783 // sort the indices784 sort_indices(indices, values);785 786 // copy the objects787 vector<T> objects_sorted(objects.size());788 789 // place the objects in the correct order790 for (size_t i = 0; i < indices.size(); i++) {791 objects_sorted[i] = objects[indices[i]];792 }793 794 return objects_sorted;795 }796 797 768 //---------------------------------------------------------------------- 798 769 /// return a vector of jets sorted into decreasing kt2
Note:
See TracChangeset
for help on using the changeset viewer.