Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:16

0001 #ifndef UtilAlgos_PdgIdSelector_h
0002 #define UtilAlgos_PdgIdSelector_h
0003 #include "FWCore/Framework/interface/ConsumesCollector.h"
0004 #include "CommonTools/UtilAlgos/interface/ParameterAdapter.h"
0005 #include "CommonTools/Utils/interface/PdgIdSelector.h"
0006 
0007 namespace reco {
0008   namespace modules {
0009 
0010     template <>
0011     struct ParameterAdapter<PdgIdSelector> {
0012       static PdgIdSelector make(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC) {
0013         return PdgIdSelector(cfg.getParameter<std::vector<int> >("pdgId"));
0014       }
0015     };
0016 
0017   }  // namespace modules
0018 }  // namespace reco
0019 
0020 // Introducing a simpler way to use a string object selector outside of the
0021 // heavily-templated infrastructure above. This simply translates the cfg
0022 // into the string that the functor expects.
0023 namespace reco {
0024   class PdgIdSelectorHandler : public PdgIdSelector {
0025   public:
0026     explicit PdgIdSelectorHandler(const edm::ParameterSet& cfg)
0027         : PdgIdSelector(cfg.getParameter<std::vector<int> >("pdgId")) {}
0028   };
0029 }  // namespace reco
0030 
0031 #endif