File indexing completed on 2024-04-06 12:28:01
0001 #ifndef RecoTracker_TkSeedGenerator_SeedChargeSelector_h
0002 #define RecoTracker_TkSeedGenerator_SeedChargeSelector_h
0003
0004
0005
0006
0007
0008
0009 struct SeedChargeSelector {
0010 SeedChargeSelector(int charge) : charge_(charge) {}
0011 template <typename T>
0012 bool operator()(const T& t) const {
0013 return (t.startingState().parameters().charge() == charge_);
0014 }
0015
0016 private:
0017 int charge_;
0018 };
0019
0020 #include "FWCore/Framework/interface/ConsumesCollector.h"
0021 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
0022
0023 namespace reco {
0024 namespace modules {
0025
0026 template <>
0027 struct ParameterAdapter<SeedChargeSelector> {
0028 static SeedChargeSelector make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) {
0029 return SeedChargeSelector(cfg.getParameter<int>("charge"));
0030 }
0031 };
0032
0033 }
0034 }
0035
0036 #endif