#include "fastjet/Error.hh"
#include "fastjet/PseudoJet.hh"
#include <valarray>
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
Go to the source code of this file.
Functions | |
PseudoJet | operator+ (const PseudoJet &jet1, const PseudoJet &jet2) |
PseudoJet | operator- (const PseudoJet &jet1, const PseudoJet &jet2) |
PseudoJet | operator* (double coeff, const PseudoJet &jet) |
PseudoJet | operator* (const PseudoJet &jet, double coeff) |
PseudoJet | operator/ (const PseudoJet &jet, double coeff) |
bool | have_same_momentum (const PseudoJet &jeta, const PseudoJet &jetb) |
returns true if the momenta of the two input jets are identical | |
PseudoJet | PtYPhiM (double pt, double y, double phi, double m) |
return a pseudojet with the given pt, y, phi and mass | |
void | sort_indices (vector< int > &indices, const vector< double > &values) |
template<class T > | |
vector< T > | objects_sorted_by_values (const vector< T > &objects, const vector< double > &values) |
given a vector of values with a one-to-one correspondence with the vector of objects, sort objects into an order such that the associated values would be in increasing order | |
vector< PseudoJet > | sorted_by_pt (const vector< PseudoJet > &jets) |
return a vector of jets sorted into decreasing kt2 | |
vector< PseudoJet > | sorted_by_rapidity (const vector< PseudoJet > &jets) |
return a vector of jets sorted into increasing rapidity | |
vector< PseudoJet > | sorted_by_E (const vector< PseudoJet > &jets) |
return a vector of jets sorted into decreasing energy | |
vector< PseudoJet > | sorted_by_pz (const vector< PseudoJet > &jets) |
return a vector of jets sorted into increasing pz |
returns true if the momenta of the two input jets are identical
Definition at line 284 of file PseudoJet.cc.
References PseudoJet::E(), PseudoJet::px(), PseudoJet::py(), and PseudoJet::pz().
Referenced by fastjet::SISConeSphericalPlugin::run_clustering(), and fastjet::SISConePlugin::run_clustering().
vector<T> objects_sorted_by_values | ( | const vector< T > & | objects, | |
const vector< double > & | values | |||
) | [inline] |
given a vector of values with a one-to-one correspondence with the vector of objects, sort objects into an order such that the associated values would be in increasing order
Definition at line 345 of file PseudoJet.cc.
References sort_indices().
Referenced by sorted_by_E(), sorted_by_pt(), sorted_by_pz(), and sorted_by_rapidity().
00347 { 00348 00349 assert(objects.size() == values.size()); 00350 00351 // get a vector of indices 00352 vector<int> indices(values.size()); 00353 for (size_t i = 0; i < indices.size(); i++) {indices[i] = i;} 00354 00355 // sort the indices 00356 sort_indices(indices, values); 00357 00358 // copy the objects 00359 vector<T> objects_sorted(objects.size()); 00360 00361 // place the objects in the correct order 00362 for (size_t i = 0; i < indices.size(); i++) { 00363 objects_sorted[i] = objects[indices[i]]; 00364 } 00365 00366 return objects_sorted; 00367 }
Definition at line 178 of file PseudoJet.cc.
Definition at line 168 of file PseudoJet.cc.
00168 { 00169 //return PseudoJet(coeff*jet.four_mom()); 00170 // the following code is hopefully more efficient 00171 PseudoJet coeff_times_jet(jet); 00172 coeff_times_jet *= coeff; 00173 return coeff_times_jet; 00174 }
Definition at line 148 of file PseudoJet.cc.
References PseudoJet::E(), PseudoJet::px(), PseudoJet::py(), and PseudoJet::pz().
Definition at line 158 of file PseudoJet.cc.
References PseudoJet::E(), PseudoJet::px(), PseudoJet::py(), and PseudoJet::pz().
Definition at line 184 of file PseudoJet.cc.
PseudoJet PtYPhiM | ( | double | pt, | |
double | y, | |||
double | phi, | |||
double | m | |||
) |
void sort_indices | ( | vector< int > & | indices, | |
const vector< double > & | values | |||
) |
Definition at line 335 of file PseudoJet.cc.
Referenced by objects_sorted_by_values(), and fastjet::CDFJetCluPlugin::run_clustering().
00336 { 00337 IndexedSortHelper index_sort_helper(&values); 00338 sort(indices.begin(), indices.end(), index_sort_helper); 00339 }
return a vector of jets sorted into decreasing energy
Definition at line 387 of file PseudoJet.cc.
References objects_sorted_by_values().
Referenced by main(), and print_jets().
00387 { 00388 vector<double> energies(jets.size()); 00389 for (size_t i = 0; i < jets.size(); i++) {energies[i] = -jets[i].E();} 00390 return objects_sorted_by_values(jets, energies); 00391 }
return a vector of jets sorted into decreasing kt2
Definition at line 371 of file PseudoJet.cc.
References objects_sorted_by_values().
Referenced by main(), print_jets(), print_jets_and_sub(), and ClusterSequenceAreaBase::subtracted_jets().
00371 { 00372 vector<double> minus_kt2(jets.size()); 00373 for (size_t i = 0; i < jets.size(); i++) {minus_kt2[i] = -jets[i].kt2();} 00374 return objects_sorted_by_values(jets, minus_kt2); 00375 }
return a vector of jets sorted into increasing pz
Definition at line 395 of file PseudoJet.cc.
References objects_sorted_by_values().
00395 { 00396 vector<double> pz(jets.size()); 00397 for (size_t i = 0; i < jets.size(); i++) {pz[i] = jets[i].pz();} 00398 return objects_sorted_by_values(jets, pz); 00399 }
return a vector of jets sorted into increasing rapidity
Definition at line 379 of file PseudoJet.cc.
References objects_sorted_by_values().
Referenced by main().
00379 { 00380 vector<double> rapidities(jets.size()); 00381 for (size_t i = 0; i < jets.size(); i++) {rapidities[i] = jets[i].rap();} 00382 return objects_sorted_by_values(jets, rapidities); 00383 }