Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    RCTConfigTester
0004 // Class:      RCTConfigTester
0005 //
0006 /**\class RCTConfigTester RCTConfigTester.h L1TriggerConfig/RCTConfigTester/src/RCTConfigTester.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011  <Notes on implementation>
0012  */
0013 //
0014 // Original Author:  Sridhara Dasu
0015 //         Created:  Mon Jul 16 23:48:35 CEST 2007
0016 //
0017 //
0018 #include <iostream>
0019 // user include files
0020 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0021 #include "FWCore/Framework/interface/Event.h"
0022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0023 
0024 #include "FWCore/Framework/interface/EventSetup.h"
0025 #include "FWCore/Framework/interface/ESHandle.h"
0026 
0027 #include "CondFormats/DataRecord/interface/L1RCTChannelMaskRcd.h"
0028 #include "CondFormats/L1TObjects/interface/L1RCTChannelMask.h"
0029 #include "CondFormats/DataRecord/interface/L1RCTNoisyChannelMaskRcd.h"
0030 #include "CondFormats/L1TObjects/interface/L1RCTNoisyChannelMask.h"
0031 
0032 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0033 #include "FWCore/MessageLogger/interface/MessageDrop.h"
0034 
0035 #include "FWCore/PluginManager/interface/ModuleDef.h"
0036 #include "FWCore/Framework/interface/MakerMacros.h"
0037 
0038 //
0039 // class declaration
0040 //
0041 
0042 class L1RCTChannelMaskTester : public edm::one::EDAnalyzer<> {
0043 public:
0044   explicit L1RCTChannelMaskTester(const edm::ParameterSet&) : maskToken_(esConsumes()), noisyToken_(esConsumes()) {}
0045   void analyze(const edm::Event&, const edm::EventSetup&) override;
0046 
0047 private:
0048   edm::ESGetToken<L1RCTChannelMask, L1RCTChannelMaskRcd> maskToken_;
0049   edm::ESGetToken<L1RCTNoisyChannelMask, L1RCTNoisyChannelMaskRcd> noisyToken_;
0050 };
0051 
0052 void L1RCTChannelMaskTester::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
0053   //
0054   evSetup.getData(maskToken_).print(std::cout);
0055 
0056   if (auto maskRecord = evSetup.tryToGet<L1RCTNoisyChannelMaskRcd>()) {
0057     maskRecord->get(noisyToken_).print(std::cout);
0058   } else {
0059     std::cout << "\nRecord \""
0060               << "L1RCTNoisyChannelMaskRcd"
0061               << "\" does not exist.\n"
0062               << std::endl;
0063   }
0064 }
0065 
0066 DEFINE_FWK_MODULE(L1RCTChannelMaskTester);