CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TauConeIsolationAlgo.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_IsolationUtils_TauConeIsolationAlgo_h
2 #define PhysicsTools_IsolationUtils_TauConeIsolationAlgo_h
3 
5 
6 #include "PhysicsTools/Utilities/interface/Math.h"
7 
8 template <typename T, typename C, typename M>
10  public:
13 
14  const edm::RefVector<C> operator()(const T & coneAxis, double coneSize, const edm::RefVector<C> & elements, const M & metric) const;
15 };
16 
17 template <typename T, typename C, typename M>
18  const edm::RefVector<C> TauConeIsolationAlgo<T, C, M>::operator()(const T & coneAxis, double coneSize, const edm::RefVector<C> & elements, const M & metric) const
19 {
20  edm::RefVector<C> elementsInCone;
21  for( typename edm::RefVector<C>::const_iterator element = elements.begin();
22  element != elements.end(); ++element ) {
23  double distance = metric(coneAxis, (*element)->momentum());
24 
25  if ( distance <= coneSize ) {
26  elementsInCone.push_back(*element);
27  }
28  }
29 
30  return elementsInCone;
31 }
32 
33 #endif
const edm::RefVector< C > operator()(const T &coneAxis, double coneSize, const edm::RefVector< C > &elements, const M &metric) const
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
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
long double T