File indexing completed on 2024-04-06 12:03:23
0001 #include <iostream>
0002 #include <memory>
0003
0004 #include "CondFormats/SiPixelObjects/interface/SiPixelTemplateDBObject.h"
0005 #include "CondFormats/DataRecord/interface/SiPixelTemplateDBObjectRcd.h"
0006
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009
0010 #include "FWCore/Framework/interface/Frameworkfwd.h"
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Framework/interface/ESWatcher.h"
0013
0014 #include "FWCore/Framework/interface/Event.h"
0015 #include "FWCore/Framework/interface/MakerMacros.h"
0016
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018
0019 class SiPixelFakeTemplateDBSourceReader : public edm::one::EDAnalyzer<> {
0020 public:
0021 explicit SiPixelFakeTemplateDBSourceReader(const edm::ParameterSet&);
0022 ~SiPixelFakeTemplateDBSourceReader() override;
0023
0024 private:
0025 void beginJob() override;
0026 void analyze(const edm::Event&, const edm::EventSetup&) override;
0027 void endJob() override;
0028
0029 edm::ESWatcher<SiPixelTemplateDBObjectRcd> SiPixelTemplateDBObjectWatcher_;
0030 edm::ESGetToken<SiPixelTemplateDBObject, SiPixelTemplateDBObjectRcd> the1DTemplateToken_;
0031 };
0032
0033 SiPixelFakeTemplateDBSourceReader::SiPixelFakeTemplateDBSourceReader(const edm::ParameterSet& iConfig)
0034 : the1DTemplateToken_(esConsumes()) {}
0035
0036 SiPixelFakeTemplateDBSourceReader::~SiPixelFakeTemplateDBSourceReader() = default;
0037
0038 void SiPixelFakeTemplateDBSourceReader::beginJob() {}
0039
0040 void SiPixelFakeTemplateDBSourceReader::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0041 if (SiPixelTemplateDBObjectWatcher_.check(iSetup)) {
0042 edm::LogPrint("SiPixelFakeTemplateDBSourceReader") << *&iSetup.getData(the1DTemplateToken_) << std::endl;
0043 }
0044 }
0045
0046 void SiPixelFakeTemplateDBSourceReader::endJob() {}
0047
0048 DEFINE_FWK_MODULE(SiPixelFakeTemplateDBSourceReader);