#include <RecoTracker/RoadMapRecord/interface/RoadMapSorting.h>
Public Member Functions | |
bool | operator() (const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &a, const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &b) const |
RoadMapSorting () | |
Private Member Functions | |
unsigned int | calculateRoadSeedIndex (const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > &seed) const |
Definition at line 22 of file RoadMapSorting.h.
RoadMapSorting::RoadMapSorting | ( | ) | [inline] |
unsigned int RoadMapSorting::calculateRoadSeedIndex | ( | const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > & | seed | ) | const [private] |
Definition at line 19 of file RoadMapSorting.cc.
References counter(), int, funct::pow(), and HLT_VtxMuL3::result.
Referenced by operator()().
00019 { 00020 // 00021 // loop over seed rings and build index: 00022 // 2 rings: ring1->getindex()*1000 + ring2->getindex() 00023 // 00024 00025 // return value 00026 unsigned int result = 0; 00027 00028 unsigned int counter = seed.first.size() + seed.second.size(); 00029 for ( std::vector<const Ring*>::const_iterator ring = seed.first.begin(), 00030 ringEnd = seed.first.end(); 00031 ring != ringEnd; 00032 ++ring ) { 00033 result += (*ring)->getindex() * (unsigned int)std::pow((double)1000,(double)--counter); 00034 } 00035 for ( std::vector<const Ring*>::const_iterator ring = seed.second.begin(), 00036 ringEnd = seed.second.end(); 00037 ring != ringEnd; 00038 ++ring ) { 00039 result += (*ring)->getindex() * (unsigned int)std::pow((double)1000,(double)--counter); 00040 } 00041 00042 return result; 00043 }
bool RoadMapSorting::operator() | ( | const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > & | a, | |
const std::pair< std::vector< const Ring * >, std::vector< const Ring * > > & | b | |||
) | const [inline] |
Definition at line 28 of file RoadMapSorting.h.
References a, b, and calculateRoadSeedIndex().
00028 { 00029 return calculateRoadSeedIndex(a) < calculateRoadSeedIndex(b); 00030 }