Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-07 23:57:53

0001 //#include <memory>
0002 
0003 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0004 
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/ESHandle.h"
0007 #include "FWCore/Framework/interface/MakerMacros.h"
0008 
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 
0011 #include "CondFormats/DataRecord/interface/SiPixelFedCablingMapRcd.h"
0012 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"
0013 #include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingTree.h"
0014 
0015 using namespace std;
0016 using namespace edm;
0017 using namespace sipixelobjects;
0018 
0019 // class declaration
0020 class SiPixelFedCablingMapAnalyzer : public edm::one::EDAnalyzer<> {
0021 public:
0022   explicit SiPixelFedCablingMapAnalyzer(const edm::ParameterSet&) : fedCablingToken_(esConsumes()) {}
0023   ~SiPixelFedCablingMapAnalyzer();
0024   virtual void analyze(const edm::Event&, const edm::EventSetup&);
0025 
0026 private:
0027   edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> fedCablingToken_;
0028 };
0029 
0030 SiPixelFedCablingMapAnalyzer::~SiPixelFedCablingMapAnalyzer() = default;
0031 
0032 void SiPixelFedCablingMapAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0033   LogPrint("SiPixelFedCablingMapAnalyzer") << "====== SiPixelFedCablingMapAnalyzer" << std::endl;
0034 
0035   const SiPixelFedCablingMap* map = &iSetup.getData(fedCablingToken_);
0036 
0037   LogInfo(" got map, version: ") << map->version();
0038   auto tree = map->cablingTree();
0039   LogInfo("SiPixelFedCablingMapAnalyzer") << "PRINT MAP:" << tree->print(100);
0040   LogInfo("SiPixelFedCablingMapAnalyzer") << "PRINT MAP, end:";
0041 }
0042 
0043 //define this as a plug-in
0044 DEFINE_FWK_MODULE(SiPixelFedCablingMapAnalyzer);