Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:25

0001 // -*- C++ -*-
0002 //
0003 // Package:    DumpL1RPCHsbConfig
0004 // Class:      DumpL1RPCHsbConfig
0005 //
0006 /**\class DumpL1RPCHsbConfig DumpL1RPCHsbConfig.cc L1TriggerConfig/DumpL1RPCHsbConfig/src/DumpL1RPCHsbConfig.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 
0014 // system include files
0015 #include <memory>
0016 #include "CondFormats/L1TObjects/interface/L1RPCHsbConfig.h"
0017 #include "CondFormats/DataRecord/interface/L1RPCHsbConfigRcd.h"
0018 // user include files
0019 #include "FWCore/Framework/interface/Frameworkfwd.h"
0020 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0021 
0022 #include "FWCore/Framework/interface/Event.h"
0023 #include "FWCore/Framework/interface/MakerMacros.h"
0024 
0025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0026 
0027 #include "FWCore/Framework/interface/EventSetup.h"
0028 #include "FWCore/Framework/interface/ESHandle.h"
0029 
0030 #include <fstream>
0031 
0032 //
0033 // class decleration
0034 //
0035 
0036 class DumpL1RPCHsbConfig : public edm::global::EDAnalyzer<> {
0037 public:
0038   explicit DumpL1RPCHsbConfig(const edm::ParameterSet&);
0039 
0040 private:
0041   void analyze(edm::StreamID, const edm::Event&, const edm::EventSetup&) const override;
0042 
0043   // ----------member data ---------------------------
0044   edm::ESGetToken<L1RPCHsbConfig, L1RPCHsbConfigRcd> getToken_;
0045 };
0046 
0047 //
0048 // constants, enums and typedefs
0049 //
0050 
0051 //
0052 // static data member definitions
0053 //
0054 
0055 //
0056 // constructors and destructor
0057 //
0058 DumpL1RPCHsbConfig::DumpL1RPCHsbConfig(const edm::ParameterSet& iConfig)
0059     : getToken_(esConsumes())
0060 
0061 {
0062   //now do what ever initialization is needed
0063 }
0064 
0065 //
0066 // member functions
0067 //
0068 
0069 // ------------ method called to for each event  ------------
0070 void DumpL1RPCHsbConfig::analyze(edm::StreamID, const edm::Event& iEvent, const edm::EventSetup& iSetup) const {
0071   using namespace edm;
0072 
0073   edm::ESHandle<L1RPCHsbConfig> hsbConfig = iSetup.getHandle(getToken_);
0074 
0075   LogTrace("DumpL1RPCHsbConfig") << std::endl;
0076   LogDebug("DumpL1RPCHsbConfig") << "\n\n Printing L1RPCHsbConfigRcd record\n" << std::endl;
0077   LogTrace("DumpL1RPCHsbConfig") << "\nChecking HSB inputs: \n" << std::endl;
0078 
0079   LogTrace("DumpL1RPCHsbConfig") << " HSB0: ";
0080   for (int i = 0; i < hsbConfig->getMaskSize(); ++i) {
0081     LogTrace("DumpL1RPCHsbConfig") << " Input " << i << " " << hsbConfig->getHsbMask(0, i) << " ";
0082   }
0083 
0084   std::cout << std::endl;
0085 
0086   LogTrace("DumpL1RPCHsbConfig") << " HSB1: ";
0087   for (int i = 0; i < hsbConfig->getMaskSize(); ++i) {
0088     LogTrace("DumpL1RPCHsbConfig") << " Input " << i << " " << hsbConfig->getHsbMask(1, i) << " ";
0089   }
0090 }
0091 
0092 //define this as a plug-in
0093 DEFINE_FWK_MODULE(DumpL1RPCHsbConfig);