Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-13 01:32:15

0001 // -*- C++ -*-
0002 //
0003 // Package:    DumpL1RPCConfig
0004 // Class:      DumpL1RPCConfig
0005 //
0006 /**\class DumpL1RPCConfig DumpL1RPCConfig.cc L1TriggerConfig/DumpL1RPCConfig/src/DumpL1RPCConfig.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Tomasz Maciej Frueboes
0015 //         Created:  Wed Apr  9 14:03:40 CEST 2008
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 #include "CondFormats/L1TObjects/interface/L1RPCConfig.h"
0022 #include "CondFormats/DataRecord/interface/L1RPCConfigRcd.h"
0023 // user include files
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0026 
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029 
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 
0032 #include "FWCore/Framework/interface/EventSetup.h"
0033 #include "FWCore/Framework/interface/ESHandle.h"
0034 
0035 #include <fstream>
0036 
0037 //
0038 // class decleration
0039 //
0040 
0041 class DumpL1RPCConfig : public edm::global::EDAnalyzer<> {
0042 public:
0043   explicit DumpL1RPCConfig(const edm::ParameterSet&);
0044 
0045 private:
0046   void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override;
0047 
0048   // ----------member data ---------------------------
0049   edm::ESGetToken<L1RPCConfig, L1RPCConfigRcd> getToken_;
0050 };
0051 
0052 //
0053 // constants, enums and typedefs
0054 //
0055 
0056 //
0057 // static data member definitions
0058 //
0059 
0060 //
0061 // constructors and destructor
0062 //
0063 DumpL1RPCConfig::DumpL1RPCConfig(const edm::ParameterSet& iConfig)
0064     : getToken_(esConsumes())
0065 
0066 {
0067   //now do what ever initialization is needed
0068 }
0069 
0070 //
0071 // member functions
0072 //
0073 
0074 // ------------ method called to for each event  ------------
0075 void DumpL1RPCConfig::analyze(edm::StreamID, const edm::Event& iEvent, const edm::EventSetup& iSetup) const {
0076   using namespace edm;
0077 
0078   edm::ESHandle<L1RPCConfig> l1RPCConfig = iSetup.getHandle(getToken_);
0079 
0080   LogTrace("DumpL1RPCConfig") << std::endl;
0081   LogDebug("DumpL1RPCConfig") << "\n Printing L1RPCConfigRcd record\n" << std::endl;
0082   LogTrace("DumpL1RPCConfig") << "\nPacs per tower: " << l1RPCConfig->getPPT() << std::endl;
0083 
0084   LogTrace("DumpL1RPCConfig") << "\nQuality table:" << std::endl;
0085 
0086   {
0087     for (RPCPattern::TQualityVec::const_iterator it = l1RPCConfig->m_quals.begin(); it != l1RPCConfig->m_quals.end();
0088          ++it) {
0089       LogTrace("DumpL1RPCConfig") << "QTN " << (int)it->m_QualityTabNumber << " fp " << (int)it->m_FiredPlanes
0090                                   << " val " << (int)it->m_QualityValue << " tw " << (int)it->m_tower << " sc "
0091                                   << (int)it->m_logsector << " sg " << (int)it->m_logsegment << std::endl;
0092     }
0093   }
0094 
0095   LogTrace("DumpL1RPCConfig") << "\nPatterns:" << std::endl;
0096   {
0097     for (RPCPattern::RPCPatVec::const_iterator it = l1RPCConfig->m_pats.begin(); it != l1RPCConfig->m_pats.end();
0098          ++it) {
0099       LogTrace("DumpL1RPCConfig") << "tw " << it->getTower() << " sc " << it->getLogSector() << " sg "
0100                                   << it->getLogSegment() << " pt " << it->getCode() << " s " << it->getSign() << " n "
0101                                   << it->getNumber() << " t " << (int)it->getPatternType() << " rg "
0102                                   << it->getRefGroup() << " QTN " << it->getQualityTabNumber();
0103       for (int lp = 0; lp < RPCPattern::m_LOGPLANES_COUNT; ++lp) {
0104         LogTrace("DumpL1RPCConfig") << " (LP" << lp << " " << it->getStripFrom(lp) << " " << it->getStripTo(lp) << ")";
0105       }
0106       LogTrace("DumpL1RPCConfig") << std::endl;
0107     }
0108   }
0109 }
0110 
0111 //define this as a plug-in
0112 DEFINE_FWK_MODULE(DumpL1RPCConfig);