1 #ifndef ElementsInCone_h
2 #define ElementsInCone_h
9 template <
typename T,
typename M,
typename C>
17 double distance = coneMetric(coneAxis,(*element)->momentum());
18 if (distance<=coneSize)elementsInCone.
push_back(*element);
20 return elementsInCone;
24 template <
typename T,
typename M>
29 const std::vector<std::pair<math::XYZPoint,float> >
operator()(
const T& coneAxis,
const M& coneMetric,
double coneSize,
const std::vector<std::pair<math::XYZPoint,float> >&
elements)
const{
30 std::vector<std::pair<math::XYZPoint,float> > elementsInCone;
31 for(
typename std::vector<std::pair<math::XYZPoint,float> >::const_iterator element=
elements.begin();element!=
elements.end();++element) {
32 double distance = coneMetric(coneAxis,(*element).first);
33 if (distance<=coneSize)elementsInCone.push_back(*element);
35 return elementsInCone;
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
const edm::RefVector< C > operator()(const T &coneAxis, const M &coneMetric, double coneSize, const edm::RefVector< C > &elements) const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
const std::vector< std::pair< math::XYZPoint, float > > operator()(const T &coneAxis, const M &coneMetric, double coneSize, const std::vector< std::pair< math::XYZPoint, float > > &elements) const