File indexing completed on 2024-04-06 12:22:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <memory>
0021 #include "CondFormats/L1TObjects/interface/L1RPCConfig.h"
0022 #include "CondFormats/DataRecord/interface/L1RPCConfigRcd.h"
0023
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
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
0049 edm::ESGetToken<L1RPCConfig, L1RPCConfigRcd> getToken_;
0050 };
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 DumpL1RPCConfig::DumpL1RPCConfig(const edm::ParameterSet& iConfig)
0064 : getToken_(esConsumes())
0065
0066 {
0067
0068 }
0069
0070
0071
0072
0073
0074
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
0112 DEFINE_FWK_MODULE(DumpL1RPCConfig);