CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/Calibration/Tools/interface/PhiRangeSelector.h

Go to the documentation of this file.
00001 #ifndef UtilAlgos_PhiRangeSelector_h
00002 #define UtilAlgos_PhiRangeSelector_h
00003 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
00004 
00005 
00006 struct PhiRangeSelector {
00007   PhiRangeSelector( double phiMin, double phiMax ) : 
00008     phiMin_( phiMin ), phiMax_( phiMax ) { }
00009   template<typename T>
00010   bool operator()( const T & t ) const { 
00011     double phi = t.phi();
00012     return ( phi >= phiMin_ && phi <= phiMax_ ); 
00013   }
00014 private:
00015   double phiMin_, phiMax_;
00016 };
00017 
00018 
00019 namespace reco { 
00020   namespace modules { 
00021     template<> 
00022     struct ParameterAdapter<PhiRangeSelector> { 
00023       static PhiRangeSelector make(const edm::ParameterSet & cfg) { 
00024         return PhiRangeSelector(cfg.getParameter<double>("phiMin"), 
00025                                 cfg.getParameter<double>("phiMax") ); 
00026       } 
00027     }; 
00028   } 
00029 } 
00030 
00031 #endif