CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/RecoTracker/ConversionSeedGenerators/interface/SeedChargeSelector.h

Go to the documentation of this file.
00001 #ifndef RecoTracker_TkSeedGenerator_SeedChargeSelector_h
00002 #define RecoTracker_TkSeedGenerator_SeedChargeSelector_h
00003 /* \class SeedChargeSelector
00004  *
00005  * \author Giuseppe Cerati, INFN
00006  *
00007  */
00008 
00009 struct SeedChargeSelector {
00010   SeedChargeSelector( int charge ) : charge_( charge ) { }
00011   template<typename T>
00012   bool operator()( const T & t ) const { 
00013     return ( t.startingState().parameters().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<SeedChargeSelector> {
00027       static SeedChargeSelector make( const edm::ParameterSet & cfg ) {
00028         return SeedChargeSelector(cfg.getParameter<int>( "charge" )); 
00029       }
00030     };
00031     
00032   }
00033 }
00034 
00035 #endif