Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-20 02:47:06

0001 // user include files
0002 #include "FWCore/Framework/interface/ModuleFactory.h"
0003 #include "FWCore/Framework/interface/ESProducer.h"
0004 
0005 #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackCleanerBySharedHits.h"
0006 
0007 class PixelTrackCleanerBySharedHitsESProducer : public edm::ESProducer {
0008 public:
0009   PixelTrackCleanerBySharedHitsESProducer(const edm::ParameterSet& iConfig);
0010   ~PixelTrackCleanerBySharedHitsESProducer() override = default;
0011 
0012   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0013 
0014   std::unique_ptr<PixelTrackCleaner> produce(const PixelTrackCleaner::Record& iRecord);
0015 
0016 private:
0017   const bool useQuadrupletAlgo_;
0018 };
0019 
0020 PixelTrackCleanerBySharedHitsESProducer::PixelTrackCleanerBySharedHitsESProducer(const edm::ParameterSet& iConfig)
0021     : useQuadrupletAlgo_(iConfig.getParameter<bool>("useQuadrupletAlgo")) {
0022   auto componentName = iConfig.getParameter<std::string>("ComponentName");
0023   setWhatProduced(this, componentName);
0024 }
0025 
0026 void PixelTrackCleanerBySharedHitsESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0027   edm::ParameterSetDescription desc;
0028   desc.add<std::string>("ComponentName", "pixelTrackCleanerBySharedHits");
0029   desc.add<bool>("useQuadrupletAlgo", false);
0030   descriptions.add("pixelTrackCleanerBySharedHits", desc);
0031 }
0032 
0033 std::unique_ptr<PixelTrackCleaner> PixelTrackCleanerBySharedHitsESProducer::produce(
0034     const PixelTrackCleaner::Record& iRecord) {
0035   return std::make_unique<PixelTrackCleanerBySharedHits>(useQuadrupletAlgo_);
0036 }
0037 
0038 #include "FWCore/PluginManager/interface/ModuleDef.h"
0039 #include "FWCore/Framework/interface/MakerMacros.h"
0040 DEFINE_FWK_EVENTSETUP_MODULE(PixelTrackCleanerBySharedHitsESProducer);