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
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
const KeyToToken & tscKeyToTokenMap() const
const RecordToKeyToToken & recordTypeToKeyToTokenMap() const
int iEvent
Definition: GenABIO.cc:224
T get() const
Definition: EventSetup.h:82
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
CSCTFConfigTestAnalyzer(const edm::ParameterSet &)
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