#include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
#include <cmath>
#include <boost/bind.hpp>
Go to the source code of this file.
|
template<typename RandomAccessIterator , typename Extractor > |
void | TrackerStablePhiSort (RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr) |
|
template<typename RandomAccessIterator , typename Extractor >
void TrackerStablePhiSort |
( |
RandomAccessIterator |
begin, |
|
|
RandomAccessIterator |
end, |
|
|
const Extractor & |
extr |
|
) |
| |
Definition at line 46 of file TrackerStablePhiSort.h.
References begin, filterCSVwithJSON::copy, M_PI, getGTfromDQMFile::obj, AlCaHLTBitMon_ParallelJobs::p, python.multivaluedict::sort(), svgfig::template(), create_public_lumi_plots::transform, and relativeConstraints::value.
Referenced by CmsTrackerLayerBuilder::sortNS(), CmsTrackerRingBuilder::sortNS(), CmsTrackerOTRingBuilder::sortNS(), CmsTrackerWheelBuilder::sortNS(), and CmsTrackerDiskBuilder::sortNS().
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;
77 const double phiMax = 2*
M_PI-phiMin;
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 =
96 std::find_if(tmpvec.begin(),tmpvec.end(), boost::bind(&
Element::value,_1) > phiMin);
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);
Container::value_type value_type