![]() |
![]() |
00001 #ifndef RecoBTau_JetTagComputerESProducer_h 00002 #define RecoBTau_JetTagComputerESProducer_h 00003 00004 #include <string> 00005 #include <boost/static_assert.hpp> 00006 #include <boost/type_traits.hpp> 00007 #include <boost/shared_ptr.hpp> 00008 00009 #include "FWCore/Framework/interface/ESProducer.h" 00010 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00011 #include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h" 00012 #include "RecoBTau/JetTagComputer/interface/JetTagComputer.h" 00013 00014 template <typename ConcreteJetTagComputer> 00015 class JetTagComputerESProducer: public edm::ESProducer { 00016 private: 00017 // check that the template parameter inherits from JetTagComputer 00018 BOOST_STATIC_ASSERT((boost::is_convertible<ConcreteJetTagComputer*,JetTagComputer*>::value)); 00019 00020 public: 00021 JetTagComputerESProducer(const edm::ParameterSet & pset) : m_pset(pset) { 00022 setWhatProduced(this, m_pset.getParameter<std::string>("@module_label") ); 00023 00024 m_jetTagComputer = boost::shared_ptr<JetTagComputer>( new ConcreteJetTagComputer( m_pset ) ); 00025 } 00026 00027 virtual ~JetTagComputerESProducer() { 00028 } 00029 00030 boost::shared_ptr<JetTagComputer> produce(const JetTagComputerRecord & record) { 00031 return m_jetTagComputer; 00032 } 00033 00034 private: 00035 boost::shared_ptr<JetTagComputer> m_jetTagComputer; 00036 edm::ParameterSet m_pset; 00037 }; 00038 00039 #endif // RecoBTau_JetTagComputerESProducer_h