00001 #include "Mixing2DB.h" 00002 #include "FWCore/ServiceRegistry/interface/Service.h" 00003 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h" 00004 #include "CondFormats/BeamSpotObjects/interface/SimBeamSpotObjects.h" 00005 00006 #include "CondFormats/RunInfo/interface/MixingModuleConfig.h" 00007 00008 00009 // 00010 // constants, enums and typedefs 00011 // 00012 00013 // 00014 // static data member definitions 00015 // 00016 00017 // 00018 // constructors and destructor 00019 // 00020 Mixing2DB::Mixing2DB(const edm::ParameterSet& iConfig) 00021 { 00022 //cfi_=iConfig.getParameter<edm::ParameterSet>("input"); 00023 cfi_=iConfig; 00024 } 00025 00026 00027 Mixing2DB::~Mixing2DB() 00028 { 00029 00030 // do anything here that needs to be done at desctruction time 00031 // (e.g. close files, deallocate resources etc.) 00032 00033 } 00034 00035 00036 // 00037 // member functions 00038 // 00039 00040 // ------------ method called for each event ------------ 00041 void 00042 Mixing2DB::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) 00043 { 00044 using namespace edm; 00045 00046 00047 00048 #ifdef THIS_IS_AN_EVENT_EXAMPLE 00049 Handle<ExampleData> pIn; 00050 iEvent.getByLabel("example",pIn); 00051 #endif 00052 00053 #ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE 00054 ESHandle<SetupData> pSetup; 00055 iSetup.get<SetupRecord>().get(pSetup); 00056 #endif 00057 } 00058 00059 00060 // ------------ method called once each job just before starting event loop ------------ 00061 void 00062 Mixing2DB::beginJob() 00063 { 00064 } 00065 00066 // ------------ method called when starting to processes a run ------------ 00067 void 00068 Mixing2DB::beginRun(edm::Run const&, edm::EventSetup const&) 00069 { 00070 } 00071 00072 // ------------ method called when ending the processing of a run ------------ 00073 void 00074 Mixing2DB::endRun(edm::Run const&, edm::EventSetup const&) 00075 { 00076 } 00077 00078 // ------------ method called when starting to processes a luminosity block ------------ 00079 void 00080 Mixing2DB::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) 00081 { 00082 } 00083 00084 // ------------ method called when ending the processing of a luminosity block ------------ 00085 void 00086 Mixing2DB::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) 00087 { 00088 } 00089 00090 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ 00091 void 00092 Mixing2DB::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { 00093 //The following says we do not know what parameters are allowed so do no validation 00094 // Please change this to state exactly what you do use, even if it is no parameters 00095 edm::ParameterSetDescription desc; 00096 desc.setUnknown(); 00097 descriptions.addDefault(desc); 00098 } 00099 00100 // ------------ method called once each job just after ending the event loop ------------ 00101 void 00102 Mixing2DB::endJob() 00103 { 00104 edm::Service<cond::service::PoolDBOutputService> poolDbService; 00105 MixingModuleConfig * config = new MixingModuleConfig(); 00106 config->read(cfi_); 00107 poolDbService->createNewIOV<MixingModuleConfig>(config, 00108 poolDbService->beginOfTime(),poolDbService->endOfTime(), 00109 "MixingRcd"); 00110 00111 }