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 
37 private:
38  void analyze(const edm::Event&, const edm::EventSetup&) override;
39 
40  // ----------member data ---------------------------
43 };
44 
45 //
46 // constants, enums and typedefs
47 //
48 
49 //
50 // static data member definitions
51 //
52 
53 //
54 // constructors and destructor
55 //
57  //now do what ever initialization is needed
58 }
59 
60 //
61 // member functions
62 //
63 
64 // ------------ method called to for each event ------------
66  using namespace edm;
67 
69 
70  std::cout << "Found " << pList->tscKeyToTokenMap().size() << " TSC keys:" << std::endl;
71 
72  L1TriggerKeyList::KeyToToken::const_iterator iTSCKey = pList->tscKeyToTokenMap().begin();
73  L1TriggerKeyList::KeyToToken::const_iterator eTSCKey = pList->tscKeyToTokenMap().end();
74  for (; iTSCKey != eTSCKey; ++iTSCKey) {
75  std::cout << iTSCKey->first << " " << iTSCKey->second << std::endl;
76  }
77  std::cout << std::endl;
78 
79  L1TriggerKeyList::RecordToKeyToToken::const_iterator iRec = pList->recordTypeToKeyToTokenMap().begin();
80  L1TriggerKeyList::RecordToKeyToToken::const_iterator eRec = pList->recordTypeToKeyToTokenMap().end();
81  for (; iRec != eRec; ++iRec) {
82  const L1TriggerKeyList::KeyToToken& keyTokenMap = iRec->second;
83  std::cout << "For record@type " << iRec->first << ", found " << keyTokenMap.size() << " keys:" << std::endl;
84 
85  L1TriggerKeyList::KeyToToken::const_iterator iKey = keyTokenMap.begin();
86  L1TriggerKeyList::KeyToToken::const_iterator eKey = keyTokenMap.end();
87  for (; iKey != eKey; ++iKey) {
88  std::cout << iKey->first << " " << iKey->second << std::endl;
89  }
90  std::cout << std::endl;
91  }
92 
93  try {
95 
96  // std::cout << "Current TSC key = " << pKey->getTSCKey() << std::endl ;
97  std::cout << "Current TSC key = " << pKey->tscKey() << std::endl;
98 
99  std::cout << "Current subsystem keys:" << std::endl;
100  std::cout << "CSCTF " << pKey->subsystemKey(L1TriggerKey::kCSCTF) << std::endl;
101  std::cout << "DTTF " << pKey->subsystemKey(L1TriggerKey::kDTTF) << std::endl;
102  std::cout << "RPC " << pKey->subsystemKey(L1TriggerKey::kRPC) << std::endl;
103  std::cout << "GMT " << pKey->subsystemKey(L1TriggerKey::kGMT) << std::endl;
104  std::cout << "RCT " << pKey->subsystemKey(L1TriggerKey::kRCT) << std::endl;
105  std::cout << "GCT " << pKey->subsystemKey(L1TriggerKey::kGCT) << std::endl;
106  std::cout << "TSP0 " << pKey->subsystemKey(L1TriggerKey::kTSP0) << std::endl;
107 
108  const L1TriggerKey::RecordToKey& recKeyMap = pKey->recordToKeyMap();
109  L1TriggerKey::RecordToKey::const_iterator iRec = recKeyMap.begin();
110  L1TriggerKey::RecordToKey::const_iterator eRec = recKeyMap.end();
111  for (; iRec != eRec; ++iRec) {
112  std::cout << iRec->first << " " << iRec->second << std::endl;
113  }
114  } catch (cms::Exception& ex) {
115  std::cout << "No L1TriggerKey found." << std::endl;
116  }
117 }
118 
119 //define this as a plug-in
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::ESGetToken< L1TriggerKeyList, L1TriggerKeyListRcd > keyListToken_
std::map< std::string, std::string > RecordToKey
Definition: L1TriggerKey.h:25
std::map< std::string, std::string > KeyToToken
const RecordToKey & recordToKeyMap() const
Definition: L1TriggerKey.h:76
edm::ESGetToken< L1TriggerKey, L1TriggerKeyRcd > keyToken_
const KeyToToken & tscKeyToTokenMap() const
const RecordToKeyToToken & recordTypeToKeyToTokenMap() const
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CSCTFConfigTestAnalyzer(const edm::ParameterSet &)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
const std::string & subsystemKey(L1Subsystems subsystem) const
Definition: L1TriggerKey.h:71
HLT enums.
const std::string & tscKey() const
Definition: L1TriggerKey.h:69
void analyze(const edm::Event &, const edm::EventSetup &) override