CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoTracker/ConversionSeedGenerators/interface/TrackChargeSelector.h

Go to the documentation of this file.
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