Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    DumpConeDefinition
0004 // Class:      DumpConeDefinition
0005 //
0006 /**\class DumpConeDefinition DumpConeDefinition.cc L1TriggerConfig/DumpConeDefinition/src/DumpConeDefinition.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/L1RPCConeDefinition.h"
0022 #include "CondFormats/DataRecord/interface/L1RPCConeDefinitionRcd.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 "CondFormats/DataRecord/interface/L1RPCHwConfigRcd.h"
0036 #include "CondFormats/RPCObjects/interface/L1RPCHwConfig.h"
0037 
0038 #include <fstream>
0039 
0040 //
0041 // class decleration
0042 //
0043 
0044 class DumpConeDefinition : public edm::global::EDAnalyzer<> {
0045 public:
0046   explicit DumpConeDefinition(const edm::ParameterSet&);
0047 
0048 private:
0049   void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override;
0050 
0051   // ----------member data ---------------------------
0052   const edm::ESGetToken<L1RPCConeDefinition, L1RPCConeDefinitionRcd> getToken_;
0053 };
0054 
0055 //
0056 // constants, enums and typedefs
0057 //
0058 
0059 //
0060 // static data member definitions
0061 //
0062 
0063 //
0064 // constructors and destructor
0065 //
0066 DumpConeDefinition::DumpConeDefinition(const edm::ParameterSet& iConfig)
0067     : getToken_(esConsumes())
0068 
0069 {
0070   //now do what ever initialization is needed
0071 }
0072 
0073 //
0074 // member functions
0075 //
0076 
0077 // ------------ method called to for each event  ------------
0078 void DumpConeDefinition::analyze(edm::StreamID, const edm::Event& iEvent, const edm::EventSetup& iSetup) const {
0079   using namespace edm;
0080 
0081   L1RPCConeDefinition const& l1RPCConeDefinition = iSetup.getData(getToken_);
0082 
0083   L1RPCConeDefinition::TLPSizeVec::const_iterator it = l1RPCConeDefinition.getLPSizeVec().begin();
0084   L1RPCConeDefinition::TLPSizeVec::const_iterator itEnd = l1RPCConeDefinition.getLPSizeVec().end();
0085 
0086   LogTrace("DumpConeDefinition") << std::endl;
0087 
0088   LogDebug("DumpConeDefinition") << "\n Printing L1RPCConeDefinitionRcd record\n" << std::endl;
0089   LogTrace("DumpConeDefinition") << "\nlog plane sizes dump: \n" << std::endl;
0090 
0091   for (; it != itEnd; ++it) {
0092     LogTrace("DumpConeDefinition") << "Tw " << (int)it->m_tower << " lp " << (int)it->m_LP << " size "
0093                                    << (int)it->m_size << std::endl;
0094   }
0095 
0096   LogTrace("DumpConeDefinition") << "\nRing to tower connections dump: \n" << std::endl;
0097   L1RPCConeDefinition::TRingToTowerVec::const_iterator itR = l1RPCConeDefinition.getRingToTowerVec().begin();
0098 
0099   const L1RPCConeDefinition::TRingToTowerVec::const_iterator itREnd = l1RPCConeDefinition.getRingToTowerVec().end();
0100 
0101   for (; itR != itREnd; ++itR) {
0102     LogTrace("DumpConeDefinition") << "EP " << (int)itR->m_etaPart << " hwPL " << (int)itR->m_hwPlane << " tw "
0103                                    << (int)itR->m_tower << " index " << (int)itR->m_index << std::endl;
0104   }
0105 }
0106 
0107 //define this as a plug-in
0108 DEFINE_FWK_MODULE(DumpConeDefinition);