CMS 3D CMS Logo

PPSTimingCalibrationWriter.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of TOTEM/PPS offline software.
4  * Author:
5  * Laurent Forthomme (laurent.forthomme@cern.ch)
6  *
7  ****************************************************************************/
8 
15 
18 
20 
23 
24 #include <memory>
25 
27 public:
29 
30 private:
31  void beginJob() override {}
32  void analyze(const edm::Event&, const edm::EventSetup&) override;
33  void endJob() override {}
34 };
35 
37  // get timing calibration parameters
39  iSetup.get<PPSTimingCalibrationRcd>().get(hTimingCalib);
40 
41  // store the calibration into a DB object
43  if (poolDbService.isAvailable())
44  poolDbService->writeOne(hTimingCalib.product(), poolDbService->currentTime(), "PPSTimingCalibrationRcd");
45  else
46  throw cms::Exception("PPSTimingCalibrationWriter") << "PoolDBService required.";
47 }
48 
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EDAnalyzer.h
ESHandle.h
PPSTimingCalibrationWriter::beginJob
void beginJob() override
Definition: PPSTimingCalibrationWriter.cc:35
PPSTimingCalibrationWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PPSTimingCalibrationWriter.cc:35
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
PPSTimingCalibrationWriter::PPSTimingCalibrationWriter
PPSTimingCalibrationWriter(const edm::ParameterSet &)
Definition: PPSTimingCalibrationWriter.cc:32
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Service.h
edm::ESHandle
Definition: DTSurvey.h:22
edm::ParameterSet
Definition: ParameterSet.h:47
PPSTimingCalibrationWriter::endJob
void endJob() override
Definition: PPSTimingCalibrationWriter.cc:37
Event.h
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition: GenABIO.cc:224
PPSTimingCalibrationRcd
EventSetup record for TOTEM/PPS timing calibration information.
Definition: PPSTimingCalibrationRcd.h:14
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
PPSTimingCalibration.h
Frameworkfwd.h
Exception
Definition: hltDiff.cc:246
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:57
PPSTimingCalibrationRcd.h
EventSetup.h
PPSTimingCalibrationWriter
Definition: PPSTimingCalibrationWriter.cc:25
ParameterSet.h
edm::Event
Definition: Event.h:73
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:189