Changes in external/fastjet/PseudoJet.cc [1d208a2:273e668] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/fastjet/PseudoJet.cc
r1d208a2 r273e668 1 1 //FJSTARTHEADER 2 // $Id: PseudoJet.cc 4100 2016-03-15 20:50:22Z salam $2 // $Id: PseudoJet.cc 3652 2014-09-03 13:31:13Z 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 cture associated with this PseudoJet469 // return true if there is some strusture associated with this PseudoJet 470 470 bool PseudoJet::has_structure() const{ 471 return bool(_structure);471 return _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 .get();480 if (!_structure()) return NULL; 481 return _structure(); 482 482 } 483 483 … … 493 493 // underlying structure. 494 494 PseudoJetStructureBase* PseudoJet::structure_non_const_ptr(){ 495 //if (!_structure) return NULL;496 return _structure .get();495 if (!_structure()) return NULL; 496 return _structure(); 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 .get();507 return _structure(); 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 the 771 /// vector of objects, sort objects into an order such that the 772 /// associated values would be in increasing order 773 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 indices 780 vector<int> indices(values.size()); 781 for (size_t i = 0; i < indices.size(); i++) {indices[i] = i;} 782 783 // sort the indices 784 sort_indices(indices, values); 785 786 // copy the objects 787 vector<T> objects_sorted(objects.size()); 788 789 // place the objects in the correct order 790 for (size_t i = 0; i < indices.size(); i++) { 791 objects_sorted[i] = objects[indices[i]]; 792 } 793 794 return objects_sorted; 795 } 796 768 797 //---------------------------------------------------------------------- 769 798 /// return a vector of jets sorted into decreasing kt2
Note:
See TracChangeset
for help on using the changeset viewer.