Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:46:41

0001 #include <string>
0002 #include <map>
0003 #include <vector>
0004 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/Framework/interface/MakerMacros.h"
0007 
0008 #include "FWCore/Framework/interface/EventSetup.h"
0009 #include "FWCore/Utilities/interface/ESGetToken.h"
0010 
0011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0012 
0013 #include "CondFormats/CSCObjects/interface/CSCDQM_DCSData.h"
0014 #include "CondFormats/DataRecord/interface/CSCDCSDataRcd.h"
0015 
0016 using namespace std;
0017 
0018 namespace edmtest {
0019 
0020   class CSCReadDCSDataAnalyzer : public edm::global::EDAnalyzer<> {
0021   public:
0022     explicit CSCReadDCSDataAnalyzer(edm::ParameterSet const& p) : token_{esConsumes()} {}
0023     ~CSCReadDCSDataAnalyzer() override {}
0024     void analyze(edm::StreamID, const edm::Event& e, const edm::EventSetup& c) const override;
0025 
0026   private:
0027     edm::ESGetToken<cscdqm::DCSData, CSCDCSDataRcd> token_;
0028   };
0029 
0030   void CSCReadDCSDataAnalyzer::analyze(edm::StreamID, const edm::Event& e, const edm::EventSetup& context) const {
0031     using namespace edm::eventsetup;
0032 
0033     edm::LogSystem log("DCSData");
0034 
0035     log << "+===================+" << std::endl;
0036     log << "| CSCReadDCSDataAnalyzer    |" << std::endl;
0037     log << "+===================+" << std::endl;
0038 
0039     log << "run " << e.id().run() << std::endl;
0040     log << "event " << e.id().event() << std::endl;
0041 
0042     const cscdqm::DCSData* data = &context.getData(token_);
0043 
0044     log << "Temp mode = " << data->temp_mode << std::endl;
0045     for (unsigned int i = 0; i < data->temp_meas.size(); i++)
0046       log << data->temp_meas.at(i) << std::endl;
0047 
0048     log << "HV V mode = " << data->hvv_mode << std::endl;
0049     for (unsigned int i = 0; i < data->hvv_meas.size(); i++)
0050       log << data->hvv_meas.at(i) << std::endl;
0051 
0052     log << "LV V mode = " << data->lvv_mode << std::endl;
0053     for (unsigned int i = 0; i < data->lvv_meas.size(); i++)
0054       log << data->lvv_meas.at(i) << std::endl;
0055 
0056     log << "LV I mode = " << data->lvi_mode << std::endl;
0057     for (unsigned int i = 0; i < data->lvi_meas.size(); i++)
0058       log << data->lvi_meas.at(i) << std::endl;
0059 
0060     log << "+==========================+" << std::endl;
0061     log << "| End of CSCReadDCSDataAnalyzer |" << std::endl;
0062     log << "+==========================+" << std::endl;
0063   }
0064 
0065   DEFINE_FWK_MODULE(CSCReadDCSDataAnalyzer);
0066 
0067 }  // namespace edmtest