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 {
28  public:
30 
31  private:
32  void beginJob() override {}
33  void analyze( const edm::Event&, const edm::EventSetup& ) override;
34  void endJob() override {}
35 };
36 
37 void
39 {
40  // get timing calibration parameters
42  iSetup.get<PPSTimingCalibrationRcd>().get( hTimingCalib );
43 
44  // store the calibration into a DB object
46  if ( poolDbService.isAvailable() )
47  poolDbService->writeOne( hTimingCalib.product(), poolDbService->currentTime(), "PPSTimingCalibrationRcd" );
48  else
49  throw cms::Exception("PPSTimingCalibrationWriter") << "PoolDBService required.";
50 }
51 
53 
void analyze(const edm::Event &, const edm::EventSetup &) override
EventSetup record for TOTEM/PPS timing calibration information.
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool isAvailable() const
Definition: Service.h:40
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
PPSTimingCalibrationWriter(const edm::ParameterSet &)
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86