File indexing completed on 2024-04-06 12:03:09
0001 #include "CondTools/Hcal/interface/HcalTPParametersHandler.h"
0002 #include "DataFormats/DetId/interface/DetId.h"
0003 #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
0004 #include <memory>
0005
0006 HcalTPParametersHandler::HcalTPParametersHandler(edm::ParameterSet const& ps) {
0007 m_name = ps.getUntrackedParameter<std::string>("name", "HcalTPParametersHandler");
0008 sinceTime = ps.getUntrackedParameter<unsigned>("IOVRun", 0);
0009 }
0010
0011 HcalTPParametersHandler::~HcalTPParametersHandler() {}
0012
0013 void HcalTPParametersHandler::getNewObjects() {
0014 edm::LogInfo("HcalCondTools") << "------- " << m_name << " - > getNewObjects\n"
0015 << "got offlineInfo" << tagInfo().name << ", size " << tagInfo().size
0016 << ", last object valid since " << tagInfo().lastInterval.since << std::endl;
0017
0018 if (!myDBObject)
0019 throw cms::Exception("Empty DB object")
0020 << m_name << " has received empty object - nothing to write to DB" << std::endl;
0021
0022
0023 cond::Time_t myTime = sinceTime;
0024
0025 edm::LogInfo("HcalCondTools") << "Using IOV run " << sinceTime << std::endl;
0026
0027
0028 m_to_transfer.push_back(std::make_pair(myDBObject, myTime));
0029
0030 edm::LogInfo("HcalCondTools") << "------- " << m_name << " - > getNewObjects" << std::endl;
0031 }
0032
0033 void HcalTPParametersHandler::initObject(HcalTPParameters* fObject) { myDBObject = fObject; }