CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ElementsInCone.h
Go to the documentation of this file.
1 #ifndef ElementsInCone_h
2 #define ElementsInCone_h
3 
8 
9 template <typename T, typename M, typename C>
11  public:
14  const edm::RefVector<C> operator()(const T& coneAxis,const M& coneMetric,double coneSize,const edm::RefVector<C>& elements)const{
15  edm::RefVector<C> elementsInCone;
16  for(typename edm::RefVector<C>::const_iterator element=elements.begin();element!=elements.end();++element) {
17  double distance = coneMetric(coneAxis,(*element)->momentum());
18  if (distance<=coneSize)elementsInCone.push_back(*element);
19  }
20  return elementsInCone;
21  }
22 };
23 
24 template <typename T, typename M>
25 class ElementsInCone<T, M, std::pair<math::XYZPoint,float> >{
26  public:
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);
34  }
35  return elementsInCone;
36  }
37 };
38 
39 #endif
40 
list elements
Definition: asciidump.py:414
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:249
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:244
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&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
long double T
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