test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ElementsInEllipseRef.h
Go to the documentation of this file.
1 #ifndef ElementsInEllipseRef_h
2 #define ElementsInEllipseRef_h
3 
6 #include <utility>
7 
8 template <typename T, typename C>
9  class ElementsInEllipse{
10  public:
13 
14  const std::pair<edm::RefVector<C>, edm::RefVector<C> > operator()(const T& axis, double rPhi, double rEta, const edm::RefVector<C>& elements)const{
15  edm::RefVector<C> elementsInEllipse;
16  edm::RefVector<C> elementsOutEllipse;
17  for(typename edm::RefVector<C>::const_iterator element = elements.begin(); element != elements.end(); ++element){
18  double distance = ellipse(axis, (*element)->momentum(), rPhi, rEta);
19  if(distance <= 1.)elementsInEllipse.push_back(*element);
20  else elementsOutEllipse.push_back(*element);
21  }
22  std::pair<edm::RefVector<C>, edm::RefVector<C> > theInOutPair(elementsInEllipse, elementsOutEllipse);
23  return theInOutPair;
24  }
25  };
26 #endif
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 std::pair< edm::RefVector< C >, edm::RefVector< C > > operator()(const T &axis, double rPhi, double rEta, 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
double ellipse(const T1 &t1, const T2 &t2, double rPhi, double rEta)
Definition: Ellipse.h:9
long double T