Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:13

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