Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:43

0001 /****************************************************************************
0002  *
0003  * This is a part of TOTEM/PPS offline software.
0004  * Author:
0005  *   Laurent Forthomme (laurent.forthomme@cern.ch)
0006  *   Christopher Misan
0007  *
0008  ****************************************************************************/
0009 
0010 #include "FWCore/Framework/interface/Frameworkfwd.h"
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "FWCore/Framework/interface/ESWatcher.h"
0015 #include "FWCore/Framework/interface/MakerMacros.h"
0016 
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 #include "FWCore/ServiceRegistry/interface/Service.h"
0019 
0020 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0021 
0022 #include "CondFormats/PPSObjects/interface/PPSTimingCalibrationLUT.h"
0023 #include "CondFormats/DataRecord/interface/PPSTimingCalibrationLUTRcd.h"
0024 
0025 #include <memory>
0026 
0027 class PPSTimingCalibrationLUTAnalyzer : public edm::one::EDAnalyzer<> {
0028 public:
0029   explicit PPSTimingCalibrationLUTAnalyzer(const edm::ParameterSet&)
0030       : tokenCalibration_(esConsumes<PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcd>()) {}
0031 
0032 private:
0033   void beginJob() override {}
0034   void analyze(const edm::Event&, const edm::EventSetup&) override;
0035   void endJob() override {}
0036 
0037   edm::ESWatcher<PPSTimingCalibrationLUTRcd> calibWatcher_;
0038 
0039   edm::ESGetToken<PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcd> tokenCalibration_;
0040 };
0041 
0042 void PPSTimingCalibrationLUTAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0043   // get timing calibration parameters
0044   if (calibWatcher_.check(iSetup)) {
0045     edm::LogInfo("PPSTimingCalibrationLUTAnalyzer") << "Calibrations retrieved:\n" << iSetup.getData(tokenCalibration_);
0046   }
0047 }
0048 
0049 DEFINE_FWK_MODULE(PPSTimingCalibrationLUTAnalyzer);