Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0002 #include "FWCore/Framework/interface/Event.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "FWCore/Framework/interface/ESHandle.h"
0007 
0008 #include "CondFormats/DataRecord/interface/L1TriggerKeyListExtRcd.h"
0009 #include "CondFormats/L1TObjects/interface/L1TriggerKeyListExt.h"
0010 
0011 class L1TriggerKeyListExtReader : public edm::one::EDAnalyzer<> {
0012 private:
0013 public:
0014   void analyze(const edm::Event&, const edm::EventSetup&) override;
0015 
0016   explicit L1TriggerKeyListExtReader(const edm::ParameterSet&) : token_{esConsumes()} {}
0017   ~L1TriggerKeyListExtReader(void) override {}
0018 
0019 private:
0020   edm::ESGetToken<L1TriggerKeyListExt, L1TriggerKeyListExtRcd> token_;
0021 };
0022 
0023 #include <iostream>
0024 using namespace std;
0025 
0026 void L1TriggerKeyListExtReader::analyze(const edm::Event& iEvent, const edm::EventSetup& evSetup) {
0027   L1TriggerKeyListExt const& ptr1 = evSetup.getData(token_);
0028 
0029   const L1TriggerKeyListExt::KeyToToken& allKeysTokens = ptr1.tscKeyToTokenMap();
0030   for (auto& keyToken : allKeysTokens)
0031     cout << "  tscKey = " << keyToken.first << " token: " << hex << keyToken.second << dec << endl;
0032 
0033   const L1TriggerKeyListExt::RecordToKeyToToken& records = ptr1.recordTypeToKeyToTokenMap();
0034   for (auto& rec : records) {
0035     cout << "  " << rec.first << ":" << endl;
0036     for (auto& keyToken : rec.second)
0037       cout << "    key: " << keyToken.first << " token: " << hex << keyToken.second << dec << endl;
0038   }
0039 }
0040 
0041 #include "FWCore/PluginManager/interface/ModuleDef.h"
0042 #include "FWCore/Framework/interface/MakerMacros.h"
0043 #include "FWCore/Framework/interface/ModuleFactory.h"
0044 
0045 DEFINE_FWK_MODULE(L1TriggerKeyListExtReader);