#include <limits>
#include <iostream>
#include <cmath>
#include "PhysicsTools/Utilities/interface/PtComparator.h"
#include "PhysicsTools/Utilities/interface/EtComparator.h"
Go to the source code of this file.
Classes | |
class | GreaterByEtRef< T > |
class | GreaterByPtPtr< T > |
class | GreaterByPtRef< T > |
Functions | |
bool | so_gt (const SortObject &a, const SortObject &b) |
bool | so_lt (const SortObject &a, const SortObject &b) |
template<class T> | |
void | sortByEt (std::vector< T > *container) |
template<class T> | |
void | sortByEtRef (std::vector< T > *container) |
template<class T> | |
void | sortByPt (std::vector< T > *container) |
template<class T> | |
void | sortByPtRef (std::vector< T > *container) |
template<class T, class GetValue> | |
void | sortGreater (std::vector< T > *container) |
bool @13050::so_gt | ( | const SortObject & | a, | |
const SortObject & | b | |||
) | [inline, static] |
bool @13050::so_lt | ( | const SortObject & | a, | |
const SortObject & | b | |||
) | [inline, static] |
void @13050::sortByEt | ( | std::vector< T > * | container | ) | [inline, static] |
void @13050::sortByEtRef | ( | std::vector< T > * | container | ) | [inline, static] |
Definition at line 68 of file JetAlgoHelper.h.
Referenced by ProtoJet::getTowerList(), and ProtoJet::reorderTowers().
void @13050::sortByPt | ( | std::vector< T > * | container | ) | [inline, static] |
Definition at line 52 of file JetAlgoHelper.h.
Referenced by cms::BasePilupSubtractionJetProducer::produce(), and cms::BaseJetProducer::produce().
void @13050::sortByPtRef | ( | std::vector< T > * | container | ) | [inline, static] |
void @13050::sortGreater | ( | std::vector< T > * | container | ) | [inline, static] |
Definition at line 31 of file JetAlgoHelper.h.
References i, index, HLT_VtxMuL3::result, so_gt(), and python::multivaluedict::sort().
00031 { 00032 std::vector <SortObject> sortable (container->size()); 00033 bool sorted = true; 00034 GetValue getter; 00035 for (unsigned i = 0; i < container->size(); i++) { 00036 sortable[i].value = getter.getValue ((*container)[i]); 00037 sortable[i].index = i; 00038 if (sorted && i && so_gt (sortable[i-1], sortable[i])) sorted = false; 00039 } 00040 if (!sorted) { // needs sorting 00041 std::sort (sortable.begin(), sortable.end(), so_gt); 00042 std::vector <T> result; 00043 result.reserve(container->size()); 00044 for (unsigned i = 0; i < container->size(); i++) { 00045 result.push_back ((*container)[sortable[i].index]); 00046 } 00047 container->swap (result); 00048 } 00049 }
unsigned index |
Definition at line 19 of file JetAlgoHelper.h.
double value |
Definition at line 18 of file JetAlgoHelper.h.