File indexing completed on 2024-04-06 12:02:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "CondTools/DT/plugins/DTKeyedConfigDBInit.h"
0014
0015
0016
0017
0018 #include "CondFormats/DTObjects/interface/DTKeyedConfig.h"
0019 #include "FWCore/Framework/interface/MakerMacros.h"
0020 #include "FWCore/ServiceRegistry/interface/Service.h"
0021 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0022 #include "CondCore/DBOutputService/interface/KeyedElement.h"
0023
0024
0025
0026
0027 #include <iostream>
0028
0029
0030
0031
0032
0033
0034
0035
0036 DTKeyedConfigDBInit::DTKeyedConfigDBInit(const edm::ParameterSet& ps)
0037 : container(ps.getParameter<std::string>("container")), iov(ps.getParameter<std::string>("iov")) {}
0038
0039
0040
0041
0042 DTKeyedConfigDBInit::~DTKeyedConfigDBInit() {}
0043
0044
0045
0046
0047 void DTKeyedConfigDBInit::beginJob() { return; }
0048
0049 void DTKeyedConfigDBInit::analyze(const edm::Event& e, const edm::EventSetup& c) { return; }
0050
0051 void DTKeyedConfigDBInit::endJob() {
0052 edm::Service<cond::service::PoolDBOutputService> outdb;
0053 DTKeyedConfig bk;
0054 bk.setId(999999999);
0055 bk.add("dummy");
0056 cond::KeyedElement k(&bk, 999999999);
0057 outdb->writeOneIOV(*(k.m_obj), k.m_key, container);
0058
0059 std::vector<cond::Time_t> kl;
0060 kl.push_back(999999999);
0061 outdb->writeOneIOV(kl, 1, iov);
0062
0063 return;
0064 }
0065
0066 DEFINE_FWK_MODULE(DTKeyedConfigDBInit);