File indexing completed on 2024-04-06 11:57:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "FWCore/Framework/interface/EventSetup.h"
0021 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0022
0023
0024 #include "FWCore/ServiceRegistry/interface/Service.h"
0025 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0026
0027
0028
0029 #include "CalibCalorimetry/CaloMiscalibTools/interface/WriteEcalMiscalibConstants.h"
0030
0031
0032
0033
0034
0035
0036
0037
0038 WriteEcalMiscalibConstants::WriteEcalMiscalibConstants(const edm::ParameterSet& iConfig)
0039 : newTagRequest_(iConfig.getParameter<std::string>("NewTagRequest")), intercalibConstsToken_(esConsumes()) {}
0040
0041 WriteEcalMiscalibConstants::~WriteEcalMiscalibConstants() {}
0042
0043
0044
0045
0046
0047
0048 void WriteEcalMiscalibConstants::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0049 using namespace edm;
0050
0051 const EcalIntercalibConstants* Mcal = &iSetup.getData(intercalibConstsToken_);
0052
0053 edm::Service<cond::service::PoolDBOutputService> poolDbService;
0054 if (poolDbService.isAvailable()) {
0055 if (poolDbService->isNewTagRequest(newTagRequest_)) {
0056 edm::LogVerbatim("WriteEcalMiscalibConstants") << "Creating a new IOV";
0057 poolDbService->createOneIOV<const EcalIntercalibConstants>(*Mcal, poolDbService->beginOfTime(), newTagRequest_);
0058 edm::LogVerbatim("WriteEcalMiscalibConstants") << "Done";
0059 } else {
0060 edm::LogVerbatim("WriteEcalMiscalibConstants") << "Old IOV";
0061 poolDbService->appendOneIOV<const EcalIntercalibConstants>(*Mcal, poolDbService->currentTime(), newTagRequest_);
0062 }
0063 }
0064 }
0065
0066
0067 void WriteEcalMiscalibConstants::beginJob() {}
0068
0069
0070 void WriteEcalMiscalibConstants::endJob() { edm::LogVerbatim("WriteEcalMiscalibConstants") << "Here is the end"; }