Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:56:50

0001 #include <iomanip>
0002 #include <iostream>
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "FWCore/Utilities/interface/ESGetToken.h"
0010 
0011 #include "CondFormats/DataRecord/interface/L1TUtmTriggerMenuRcd.h"
0012 #include "CondFormats/L1TObjects/interface/L1TUtmTriggerMenu.h"
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0015 #include "CondCore/CondDB/interface/Session.h"
0016 
0017 using namespace std;
0018 
0019 class L1MenuViewer : public edm::one::EDAnalyzer<> {
0020 public:
0021   void analyze(const edm::Event&, const edm::EventSetup&) override;
0022   const edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> l1GtMenuToken_;
0023 
0024   explicit L1MenuViewer(const edm::ParameterSet&)
0025       : edm::one::EDAnalyzer<>(), l1GtMenuToken_(esConsumes<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>()) {}
0026   ~L1MenuViewer(void) override = default;
0027 };
0028 
0029 void L1MenuViewer::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
0030   auto const& l1GtMenu = evSetup.getData(l1GtMenuToken_);
0031 
0032   cout << "L1TUtmTriggerMenu: " << endl;
0033   cout << " name: " << l1GtMenu.getName() << endl;
0034   cout << " version: " << l1GtMenu.getVersion() << endl;
0035   cout << " date/time: " << l1GtMenu.getDatetime() << endl;
0036   cout << " UUID: " << l1GtMenu.getFirmwareUuid() << endl;
0037   cout << " Scales: " << l1GtMenu.getScaleSetName() << endl;
0038   cout << " modules: " << l1GtMenu.getNmodules() << endl;
0039 
0040   cout << " Algorithms[" << l1GtMenu.getAlgorithmMap().size() << "]: " << endl;
0041   for (const auto& a : l1GtMenu.getAlgorithmMap())
0042     cout << "  " << a.first << endl;
0043 
0044   cout << " Conditions[" << l1GtMenu.getConditionMap().size() << "]: " << endl;
0045   for (const auto& a : l1GtMenu.getConditionMap())
0046     cout << "  " << a.first << endl;
0047 
0048   cout << " Conditions[" << l1GtMenu.getScaleMap().size() << "]: " << endl;
0049   for (const auto& a : l1GtMenu.getScaleMap())
0050     cout << "  " << a.first << endl;
0051 }
0052 
0053 #include "FWCore/PluginManager/interface/ModuleDef.h"
0054 #include "FWCore/Framework/interface/MakerMacros.h"
0055 #include "FWCore/Framework/interface/ModuleFactory.h"
0056 
0057 DEFINE_FWK_MODULE(L1MenuViewer);