00001 #ifndef TrackingForConversion_TrackChargeSelector_h 00002 #define TrackingForConversion_TrackChargeSelector_h 00003 /* \class TrackChargeSelector 00004 * 00005 * \author Domenico Giordano, CERN 00006 * 00007 */ 00008 00009 struct TrackChargeSelector { 00010 TrackChargeSelector( int charge ) : charge_( charge ) { } 00011 template<typename T> 00012 bool operator()( const T & t ) const { 00013 return ( t.charge() == charge_ ); 00014 } 00015 00016 private: 00017 int charge_; 00018 }; 00019 00020 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h" 00021 00022 namespace reco { 00023 namespace modules { 00024 00025 template<> 00026 struct ParameterAdapter<TrackChargeSelector> { 00027 static TrackChargeSelector make( const edm::ParameterSet & cfg ) { 00028 return TrackChargeSelector(cfg.getParameter<int>( "charge" )); 00029 } 00030 }; 00031 00032 } 00033 } 00034 00035 #endif