CMS 3D CMS Logo

CSCTFConfigTestAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CSCTFConfigTestAnalyzer
4 // Class: CSCTFConfigTestAnalyzer
5 //
6 
7 // system include files
8 #include <iostream>
9 #include <memory>
10 
11 // user include files
14 
19 
21 
26 
28 
29 //
30 // class decleration
31 //
32 
34 public:
36  ~CSCTFConfigTestAnalyzer() override;
37 
38 private:
39  void beginJob() override;
40  void analyze(const edm::Event&, const edm::EventSetup&) override;
41  void endJob() override;
42 
43  // ----------member data ---------------------------
44 };
45 
46 //
47 // constants, enums and typedefs
48 //
49 
50 //
51 // static data member definitions
52 //
53 
54 //
55 // constructors and destructor
56 //
58 
59 {
60  //now do what ever initialization is needed
61 }
62 
64  // do anything here that needs to be done at desctruction time
65  // (e.g. close files, deallocate resources etc.)
66 }
67 
68 //
69 // member functions
70 //
71 
72 // ------------ method called to for each event ------------
74  using namespace edm;
75 
77  iSetup.get<L1TriggerKeyListRcd>().get(pList);
78 
79  std::cout << "Found " << pList->tscKeyToTokenMap().size() << " TSC keys:" << std::endl;
80 
81  L1TriggerKeyList::KeyToToken::const_iterator iTSCKey = pList->tscKeyToTokenMap().begin();
82  L1TriggerKeyList::KeyToToken::const_iterator eTSCKey = pList->tscKeyToTokenMap().end();
83  for (; iTSCKey != eTSCKey; ++iTSCKey) {
84  std::cout << iTSCKey->first << " " << iTSCKey->second << std::endl;
85  }
86  std::cout << std::endl;
87 
88  L1TriggerKeyList::RecordToKeyToToken::const_iterator iRec = pList->recordTypeToKeyToTokenMap().begin();
89  L1TriggerKeyList::RecordToKeyToToken::const_iterator eRec = pList->recordTypeToKeyToTokenMap().end();
90  for (; iRec != eRec; ++iRec) {
91  const L1TriggerKeyList::KeyToToken& keyTokenMap = iRec->second;
92  std::cout << "For record@type " << iRec->first << ", found " << keyTokenMap.size() << " keys:" << std::endl;
93 
94  L1TriggerKeyList::KeyToToken::const_iterator iKey = keyTokenMap.begin();
95  L1TriggerKeyList::KeyToToken::const_iterator eKey = keyTokenMap.end();
96  for (; iKey != eKey; ++iKey) {
97  std::cout << iKey->first << " " << iKey->second << std::endl;
98  }
99  std::cout << std::endl;
100  }
101 
102  try {
104  iSetup.get<L1TriggerKeyRcd>().get(pKey);
105 
106  // std::cout << "Current TSC key = " << pKey->getTSCKey() << std::endl ;
107  std::cout << "Current TSC key = " << pKey->tscKey() << std::endl;
108 
109  std::cout << "Current subsystem keys:" << std::endl;
110  std::cout << "CSCTF " << pKey->subsystemKey(L1TriggerKey::kCSCTF) << std::endl;
111  std::cout << "DTTF " << pKey->subsystemKey(L1TriggerKey::kDTTF) << std::endl;
112  std::cout << "RPC " << pKey->subsystemKey(L1TriggerKey::kRPC) << std::endl;
113  std::cout << "GMT " << pKey->subsystemKey(L1TriggerKey::kGMT) << std::endl;
114  std::cout << "RCT " << pKey->subsystemKey(L1TriggerKey::kRCT) << std::endl;
115  std::cout << "GCT " << pKey->subsystemKey(L1TriggerKey::kGCT) << std::endl;
116  std::cout << "TSP0 " << pKey->subsystemKey(L1TriggerKey::kTSP0) << std::endl;
117 
118  const L1TriggerKey::RecordToKey& recKeyMap = pKey->recordToKeyMap();
119  L1TriggerKey::RecordToKey::const_iterator iRec = recKeyMap.begin();
120  L1TriggerKey::RecordToKey::const_iterator eRec = recKeyMap.end();
121  for (; iRec != eRec; ++iRec) {
122  std::cout << iRec->first << " " << iRec->second << std::endl;
123  }
124  } catch (cms::Exception& ex) {
125  std::cout << "No L1TriggerKey found." << std::endl;
126  }
127 }
128 
129 // ------------ method called once each job just before starting event loop ------------
131 
132 // ------------ method called once each job just after ending the event loop ------------
134 
135 //define this as a plug-in
CSCTFConfigTestAnalyzer::~CSCTFConfigTestAnalyzer
~CSCTFConfigTestAnalyzer() override
Definition: CSCTFConfigTestAnalyzer.cc:63
L1TriggerKey::kRPC
Definition: L1TriggerKey.h:27
Exception.h
ESHandle.h
L1TriggerKeyRcd
Definition: L1TriggerKeyRcd.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
L1TriggerKey::kGMT
Definition: L1TriggerKey.h:27
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CSCTFConfigTestAnalyzer::beginJob
void beginJob() override
Definition: CSCTFConfigTestAnalyzer.cc:130
EDAnalyzer.h
L1TriggerKey::RecordToKey
std::map< std::string, std::string > RecordToKey
Definition: L1TriggerKey.h:25
L1TriggerKeyList::recordTypeToKeyToTokenMap
const RecordToKeyToToken & recordTypeToKeyToTokenMap() const
Definition: L1TriggerKeyList.h:54
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TriggerKey.h
L1TriggerKey::kTSP0
Definition: L1TriggerKey.h:27
edm::ESHandle
Definition: DTSurvey.h:22
L1TriggerKey::recordToKeyMap
const RecordToKey & recordToKeyMap() const
Definition: L1TriggerKey.h:76
L1TriggerKey::kRCT
Definition: L1TriggerKey.h:27
edm::ParameterSet
Definition: ParameterSet.h:47
L1TriggerKey::kDTTF
Definition: L1TriggerKey.h:27
Event.h
L1TriggerKeyList::KeyToToken
std::map< std::string, std::string > KeyToToken
Definition: L1TriggerKeyList.h:37
iEvent
int iEvent
Definition: GenABIO.cc:224
L1TriggerKey::kGCT
Definition: L1TriggerKey.h:27
L1TriggerKeyList.h
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
L1TriggerKeyRcd.h
CSCTFConfigTestAnalyzer::CSCTFConfigTestAnalyzer
CSCTFConfigTestAnalyzer(const edm::ParameterSet &)
Definition: CSCTFConfigTestAnalyzer.cc:57
L1TriggerKey::tscKey
const std::string & tscKey() const
Definition: L1TriggerKey.h:69
CSCTFConfigTestAnalyzer::endJob
void endJob() override
Definition: CSCTFConfigTestAnalyzer.cc:133
Frameworkfwd.h
CSCTFConfigTestAnalyzer
Definition: CSCTFConfigTestAnalyzer.cc:33
CSCTFConfigTestAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: CSCTFConfigTestAnalyzer.cc:73
EventSetup.h
L1TriggerKey::kCSCTF
Definition: L1TriggerKey.h:27
cms::Exception
Definition: Exception.h:70
L1TriggerKey::subsystemKey
const std::string & subsystemKey(L1Subsystems subsystem) const
Definition: L1TriggerKey.h:71
ParameterSet.h
L1TriggerKeyList::tscKeyToTokenMap
const KeyToToken & tscKeyToTokenMap() const
Definition: L1TriggerKeyList.h:52
edm::Event
Definition: Event.h:73
L1TriggerKeyListRcd
Definition: L1TriggerKeyListRcd.h:24
L1TriggerKeyListRcd.h