![]() |
![]() |
00001 // -*- C++ -*- 00002 // 00003 // Package: EcalGlobalShowerContainmentCorrectionsVsEtaESProducer 00004 // Class: EcalGlobalShowerContainmentCorrectionsVsEtaESProducer 00005 // 00016 // system include files 00017 #include <memory> 00018 #include "boost/shared_ptr.hpp" 00019 00020 // user include files 00021 #include "FWCore/Framework/interface/ModuleFactory.h" 00022 #include "FWCore/Framework/interface/ESProducer.h" 00023 00024 #include "FWCore/Framework/interface/ESHandle.h" 00025 00026 #include "CondFormats/EcalCorrections/interface/EcalGlobalShowerContainmentCorrectionsVsEta.h" 00027 #include "CondFormats/DataRecord/interface/EcalGlobalShowerContainmentCorrectionsVsEtaRcd.h" 00028 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00029 00030 00031 00032 class EcalGlobalShowerContainmentCorrectionsVsEtaESProducer : public edm::ESProducer { 00033 00034 public: 00035 EcalGlobalShowerContainmentCorrectionsVsEtaESProducer(const edm::ParameterSet&); 00036 ~EcalGlobalShowerContainmentCorrectionsVsEtaESProducer(); 00037 00038 typedef std::auto_ptr<EcalGlobalShowerContainmentCorrectionsVsEta> ReturnType; 00039 00040 ReturnType produce(const EcalGlobalShowerContainmentCorrectionsVsEtaRcd&); 00041 private: 00042 00043 00044 }; 00045 00046 00047 EcalGlobalShowerContainmentCorrectionsVsEtaESProducer::EcalGlobalShowerContainmentCorrectionsVsEtaESProducer(const edm::ParameterSet& iConfig) 00048 { 00049 setWhatProduced(this); 00050 } 00051 00052 00053 EcalGlobalShowerContainmentCorrectionsVsEtaESProducer::~EcalGlobalShowerContainmentCorrectionsVsEtaESProducer(){ } 00054 00055 00056 // 00057 // member functions 00058 // 00059 00060 EcalGlobalShowerContainmentCorrectionsVsEtaESProducer::ReturnType 00061 EcalGlobalShowerContainmentCorrectionsVsEtaESProducer::produce(const EcalGlobalShowerContainmentCorrectionsVsEtaRcd& iRecord) 00062 { 00063 00064 using namespace edm::es; 00065 using namespace std; 00066 00067 auto_ptr<EcalGlobalShowerContainmentCorrectionsVsEta> pEcalGlobalShowerContainmentCorrectionsVsEta(new EcalGlobalShowerContainmentCorrectionsVsEta) ; 00068 00069 double values[] = { 43.77, // 3x3 00070 1., 00071 -3.97e-006, 00072 43.77, // 5x5 00073 1., 00074 -3.97e-006, 00075 }; 00076 00077 const size_t size = sizeof values / sizeof values[0]; 00078 EcalGlobalShowerContainmentCorrectionsVsEta::Coefficients coeff; 00079 std::copy(values,values+size,coeff.data); 00080 pEcalGlobalShowerContainmentCorrectionsVsEta->fillCorrectionCoefficients(coeff); 00081 00082 return pEcalGlobalShowerContainmentCorrectionsVsEta ; 00083 } 00084 00085 //define this as a plug-in 00086 DEFINE_FWK_EVENTSETUP_MODULE(EcalGlobalShowerContainmentCorrectionsVsEtaESProducer);