![]() |
![]() |
00001 #include "RecoBTag/PerformanceDB/plugins/BtagPerformanceESProducer.h" 00002 00003 #include "FWCore/Framework/interface/EventSetup.h" 00004 #include "FWCore/Framework/interface/ESHandle.h" 00005 #include "FWCore/Framework/interface/ModuleFactory.h" 00006 #include "FWCore/Framework/interface/ESProducer.h" 00007 00008 00009 #include <iostream> 00010 #include <memory> 00011 #include <string> 00012 00013 using namespace edm; 00014 00015 BtagPerformanceESProducer::BtagPerformanceESProducer(const edm::ParameterSet & p) 00016 { 00017 std::string myname = p.getParameter<std::string>("ComponentName"); 00018 mypl = p.getParameter<std::string>("PayloadName"); 00019 mywp = p.getParameter<std::string>("WorkingPointName"); 00020 00021 pset_ = p; 00022 setWhatProduced(this,myname); 00023 } 00024 00025 BtagPerformanceESProducer::~BtagPerformanceESProducer() {} 00026 00027 boost::shared_ptr<BtagPerformance> 00028 BtagPerformanceESProducer::produce(const BTagPerformanceRecord & iRecord){ 00029 ESHandle<PerformancePayload> pl; 00030 //ESHandle<PhysicsPerformancePayload> pl; 00031 ESHandle<PerformanceWorkingPoint> wp; 00032 iRecord.getRecord<PerformancePayloadRecord>().get(mypl,pl); 00033 00034 std::cout <<"HERE "<<std::endl; 00035 iRecord.getRecord<PerformanceWPRecord>().get(mywp,wp); 00036 std::cout <<"HERE "<<std::endl; 00037 00038 std::cout <<" Got the payload, which is a "<<typeid(*(pl.product())).name()<<std::endl; 00039 00040 // BtagWorkingPoint wp; 00041 00042 00043 00044 _perf = boost::shared_ptr<BtagPerformance>(new BtagPerformance(*((pl.product())), *((wp.product())))); 00045 // _perf = boost::shared_ptr<BtagPerformance>(new BtagPerformance(*((pl.product())), wp)); 00046 return _perf; 00047 } 00048 00049 00050 DEFINE_FWK_EVENTSETUP_MODULE(BtagPerformanceESProducer); 00051