1 #ifndef TrackerStablePhiSort_H
2 #define TrackerStablePhiSort_H
13 #include<boost/bind.hpp>
16 template<
typename Object,
typename Scalar>
20 template<
typename Extractor>
22 build(Object &
o, Extractor
const & extr) {
23 return self(&
o, extr(o));
36 return value<rh.value;
45 template<
typename RandomAccessIterator,
typename Extractor>
47 RandomAccessIterator
end,
48 const Extractor& extr) {
50 typedef typename Extractor::result_type
Scalar;
57 std::vector<Element> tmpvec(end-begin);
62 std::vector<Element> tmpcop(end-begin);
66 const unsigned int vecSize = tmpvec.size();
73 const unsigned int nMaxModulesPerRing = 5;
74 bool phiZeroCase =
true;
76 const double phiMin = M_PI_4;
79 if( vecSize > nMaxModulesPerRing ) {
82 double tolerance = 0.000001;
83 if( fabs(tmpvec.back().value - 0) < tolerance
85 fabs(tmpvec.back().value - 2*
M_PI) < tolerance ) {
87 tmpvec.insert(tmpvec.begin(),tmpvec.back());
95 typename std::vector<Element>::iterator
p =
97 phiZeroCase = !(p!=tmpvec.end() && (*p).value<
phiMax);
103 if(p!=tmpvec.end()) {
104 tmpvec.insert(tmpvec.begin(),
p,tmpvec.end());
105 tmpvec.resize(vecSize);
112 std::vector<value_type> tmpvecy(vecSize);
Object const & obj() const
void TrackerStablePhiSort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
static self build(Object &o, Extractor const &extr)
PhiSortElement(Object *p, Scalar v)
Container::value_type value_type
bool operator<(self const &rh) const