CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/PhysicsTools/IsolationUtils/interface/CalIsolationAlgoNoExp.h

Go to the documentation of this file.
00001 #ifndef IsolationUtils_CalIsolationAlgoNoExp_h
00002 #define IsolationUtils_CalIsolationAlgoNoExp_h
00003 /* \class CalIsolationAlgoNoExp<T1, C2>
00004  *
00005  * \author Christian Autermann, U Hamburg
00006  */
00007 #include "PhysicsTools/Utilities/interface/Math.h"
00008 
00009 template <typename T1, typename C2>
00010 class CalIsolationAlgoNoExp {
00011 public:
00012   typedef double value_type;
00013   CalIsolationAlgoNoExp( );
00014   CalIsolationAlgoNoExp( double dRMin, double dRMax) : dRMin_( dRMin ), dRMax_( dRMax ) { }
00015   ~CalIsolationAlgoNoExp() { } 
00016   double operator()(const T1 &, const C2 &) const;
00017 
00018 private:
00019   double dRMin_, dRMax_;
00020 };
00021 
00022 template <typename T1, typename C2> double CalIsolationAlgoNoExp<T1,C2>::
00023 operator()(const T1 & cand, const C2 & elements) const {
00024   double etSum = 0;
00025   for( typename C2::const_iterator elem = elements.begin(); 
00026        elem != elements.end(); ++elem ) {
00027     double dR = deltaR( elem->eta(), elem->phi(), 
00028                         cand.eta(), cand.phi() );
00029     if ( dR < dRMax_ && dR > dRMin_ ) {
00030       etSum += elem->et();
00031     }
00032   }
00033   return etSum;
00034 }
00035 
00036 #endif