test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CalIsolationAlgoNoExp.h
Go to the documentation of this file.
1 #ifndef IsolationUtils_CalIsolationAlgoNoExp_h
2 #define IsolationUtils_CalIsolationAlgoNoExp_h
3 /* \class CalIsolationAlgoNoExp<T1, C2>
4  *
5  * \author Christian Autermann, U Hamburg
6  */
7 #include "PhysicsTools/Utilities/interface/Math.h"
8 
9 template <typename T1, typename C2>
11 public:
12  typedef double value_type;
14  CalIsolationAlgoNoExp( double dRMin, double dRMax) : dRMin_( dRMin ), dRMax_( dRMax ) { }
16  double operator()(const T1 &, const C2 &) const;
17 
18 private:
19  double dRMin_, dRMax_;
20 };
21 
22 template <typename T1, typename C2> double CalIsolationAlgoNoExp<T1,C2>::
23 operator()(const T1 & cand, const C2 & elements) const {
24  double etSum = 0;
25  for( typename C2::const_iterator elem = elements.begin();
26  elem != elements.end(); ++elem ) {
27  double dR = deltaR( elem->eta(), elem->phi(),
28  cand.eta(), cand.phi() );
29  if ( dR < dRMax_ && dR > dRMin_ ) {
30  etSum += elem->et();
31  }
32  }
33  return etSum;
34 }
35 
36 #endif
dictionary elements
CalIsolationAlgoNoExp(double dRMin, double dRMax)
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double operator()(const T1 &, const C2 &) const