Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-10 02:51:16

0001 #include "CalibFormats/SiStripObjects/interface/SiStripFecCabling.h"
0002 #include "CondFormats/DataRecord/interface/SiStripFedCablingRcd.h"
0003 #include "CondFormats/SiStripObjects/interface/SiStripFedCabling.h"
0004 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0005 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/Run.h"
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 
0012 #include <iostream>
0013 #include <sstream>
0014 
0015 /**
0016    @class test_AnalyzeCabling 
0017    @brief Analyzes FEC (and FED) cabling object(s)
0018 */
0019 class test_AnalyzeCabling : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0020 public:
0021   test_AnalyzeCabling(const edm::ParameterSet&) : cablingToken_(esConsumes<edm::Transition::BeginRun>()) {}
0022   ~test_AnalyzeCabling() override = default;
0023   void beginRun(const edm::Run&, const edm::EventSetup&) override;
0024   void analyze(const edm::Event&, const edm::EventSetup&) override;
0025   void endRun(const edm::Run&, const edm::EventSetup&) override;
0026 
0027 private:
0028   const edm::ESGetToken<SiStripFedCabling, SiStripFedCablingRcd> cablingToken_;
0029 };
0030 
0031 // -----------------------------------------------------------------------------
0032 void test_AnalyzeCabling::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {}
0033 
0034 // -----------------------------------------------------------------------------
0035 void test_AnalyzeCabling::endRun(const edm::Run& run, const edm::EventSetup& setup) {}
0036 
0037 // -----------------------------------------------------------------------------
0038 void test_AnalyzeCabling::beginRun(const edm::Run& run, const edm::EventSetup& setup) {
0039   using namespace sistrip;
0040 
0041   // fed cabling
0042   LogTrace(mlCabling_) << "[test_AnalyzeCabling::" << __func__ << "]"
0043                        << " Dumping all connection objects in FED cabling..." << std::endl;
0044 
0045   const SiStripFedCabling* fed_cabling = &setup.getData(cablingToken_);
0046   // fec cabling
0047   SiStripFecCabling fec_cabling(*fed_cabling);
0048   std::stringstream ss;
0049   ss << "[test_AnalyzeCabling::" << __func__ << "]"
0050      << " Dumping all SiStripModule objects in FEC cabling..." << std::endl
0051      << fec_cabling;
0052   LogTrace(mlCabling_) << ss.str();
0053 }
0054 
0055 #include "FWCore/Framework/interface/MakerMacros.h"
0056 DEFINE_FWK_MODULE(test_AnalyzeCabling);