CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/RecoTauTag/TauTagTools/interface/ElementsInAnnulus.h

Go to the documentation of this file.
00001 #ifndef ElementsInAnnulus_h
00002 #define ElementsInAnnulus_h
00003 
00004 #include "DataFormats/Common/interface/RefVector.h"
00005 #include "DataFormats/Math/interface/angle.h"
00006 #include "DataFormats/Math/interface/deltaR.h"
00007 #include "DataFormats/Math/interface/Point3D.h"
00008 
00009 template <typename T, typename M, typename N, typename C>
00010   class ElementsInAnnulus {
00011    public:
00012     ElementsInAnnulus() {}
00013     ~ElementsInAnnulus() {}  
00014     const edm::RefVector<C> operator()(const T& coneAxis,const M& innerconeMetric,double innerconeSize,const N& outerconeMetric,double outerconeSize,const edm::RefVector<C>& elements)const{
00015       edm::RefVector<C> elementsInBand;
00016       for(typename edm::RefVector<C>::const_iterator element=elements.begin();element!=elements.end();++element) {
00017         double innerconeMetric_distance=innerconeMetric(coneAxis,(*element)->momentum());
00018         double outerconeMetric_distance=outerconeMetric(coneAxis,(*element)->momentum());
00019         if (innerconeMetric_distance>innerconeSize && outerconeMetric_distance<=outerconeSize)elementsInBand.push_back(*element);
00020       }
00021       return elementsInBand;
00022     }
00023 };
00024 template <typename T, typename M, typename N>
00025   class ElementsInAnnulus<T, M, N, std::pair<math::XYZPoint,float> > {
00026    public:
00027     ElementsInAnnulus() {}
00028     ~ElementsInAnnulus() {}  
00029     const std::vector<std::pair<math::XYZPoint,float> > operator()(const T& coneAxis,const M& innerconeMetric,double innerconeSize,const N& outerconeMetric,double outerconeSize,const std::vector<std::pair<math::XYZPoint,float> > & elements)const{
00030       std::vector<std::pair<math::XYZPoint,float> > elementsInBand;
00031       for(typename std::vector<std::pair<math::XYZPoint,float> >::const_iterator element=elements.begin();element!=elements.end();++element) {
00032         double innerconeMetric_distance=innerconeMetric(coneAxis,(*element).first);
00033         double outerconeMetric_distance=outerconeMetric(coneAxis,(*element).first);
00034         if (innerconeMetric_distance>innerconeSize && outerconeMetric_distance<=outerconeSize)elementsInBand.push_back(*element);
00035       }
00036       return elementsInBand;
00037     }    
00038 };
00039 
00040 #endif
00041