CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ElementsInConeRef.h
Go to the documentation of this file.
1 #ifndef ElementsInConeRef_h
2 #define ElementsInConeRef_h
3 
8 
9 template <typename T, typename M, typename C>
11  public:
14 
15  const edm::RefVector<C> operator()(const T& coneAxis,const M& coneMetric,double coneSize,const edm::RefVector<C>& elements)const{
16  edm::RefVector<C> elementsInCone;
17  for(typename edm::RefVector<C>::const_iterator element=elements.begin();element!=elements.end();++element) {
18  double distance = coneMetric(coneAxis,(*element)->momentum());
19  if (distance<=coneSize)elementsInCone.push_back(*element);
20  }
21  return elementsInCone;
22  }
23 };
24 
25 template <typename T, typename M>
26 class ElementsInConeRef<T, M, std::pair<math::XYZPoint,float> >{
27  public:
30  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{
31  std::vector<std::pair<math::XYZPoint,float> > elementsInCone;
32  for(typename std::vector<std::pair<math::XYZPoint,float> >::const_iterator element=elements.begin();element!=elements.end();++element) {
33  double distance = coneMetric(coneAxis,(*element).first);
34  if (distance<=coneSize)elementsInCone.push_back(*element);
35  }
36  return elementsInCone;
37  }
38 };
39 
40 #endif
41 
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
const edm::RefVector< C > operator()(const T &coneAxis, const M &coneMetric, double coneSize, const edm::RefVector< C > &elements) const
const_iterator end() const
Termination of iteration.
Definition: RefVector.h:253
const_iterator begin() const
Initialize an iterator over the RefVector.
Definition: RefVector.h:248
dictionary elements
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:69
long double T