CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCTFConfigTestAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CSCTFConfigTestAnalyzer
4 // Class: CSCTFConfigTestAnalyzer
5 //
6 
7 
8 
9 // system include files
10 #include <iostream>
11 #include <memory>
12 
13 // user include files
16 
21 
23 
28 
30 
31 
32 //
33 // class decleration
34 //
35 
37  public:
40 
41 
42  private:
43  virtual void beginJob() override ;
44  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
45  virtual void endJob() override ;
46 
47  // ----------member data ---------------------------
48 };
49 
50 //
51 // constants, enums and typedefs
52 //
53 
54 //
55 // static data member definitions
56 //
57 
58 //
59 // constructors and destructor
60 //
62 
63 {
64  //now do what ever initialization is needed
65 
66 }
67 
68 
70 {
71 
72  // do anything here that needs to be done at desctruction time
73  // (e.g. close files, deallocate resources etc.)
74 
75 }
76 
77 
78 //
79 // member functions
80 //
81 
82 // ------------ method called to for each event ------------
83 void
85 {
86  using namespace edm;
87 
89  iSetup.get< L1TriggerKeyListRcd >().get( pList ) ;
90 
91  std::cout << "Found " << pList->tscKeyToTokenMap().size() << " TSC keys:"
92  << std::endl ;
93 
94  L1TriggerKeyList::KeyToToken::const_iterator iTSCKey =
95  pList->tscKeyToTokenMap().begin() ;
96  L1TriggerKeyList::KeyToToken::const_iterator eTSCKey =
97  pList->tscKeyToTokenMap().end() ;
98  for( ; iTSCKey != eTSCKey ; ++iTSCKey )
99  {
100  std::cout << iTSCKey->first << " " << iTSCKey->second << std::endl ;
101  }
102  std::cout << std::endl ;
103 
104  L1TriggerKeyList::RecordToKeyToToken::const_iterator iRec =
105  pList->recordTypeToKeyToTokenMap().begin() ;
106  L1TriggerKeyList::RecordToKeyToToken::const_iterator eRec =
107  pList->recordTypeToKeyToTokenMap().end() ;
108  for( ; iRec != eRec ; ++iRec )
109  {
110  const L1TriggerKeyList::KeyToToken& keyTokenMap = iRec->second ;
111  std::cout << "For record@type " << iRec->first << ", found "
112  << keyTokenMap.size() << " keys:" << std::endl ;
113 
114  L1TriggerKeyList::KeyToToken::const_iterator iKey = keyTokenMap.begin();
115  L1TriggerKeyList::KeyToToken::const_iterator eKey = keyTokenMap.end() ;
116  for( ; iKey != eKey ; ++iKey )
117  {
118  std::cout << iKey->first << " " << iKey->second << std::endl ;
119  }
120  std::cout << std::endl ;
121  }
122 
123  try
124  {
126  iSetup.get< L1TriggerKeyRcd >().get( pKey ) ;
127 
128  // std::cout << "Current TSC key = " << pKey->getTSCKey() << std::endl ;
129  std::cout << "Current TSC key = " << pKey->tscKey() << std::endl ;
130 
131  std::cout << "Current subsystem keys:" << std::endl ;
132  std::cout << "CSCTF " << pKey->subsystemKey( L1TriggerKey::kCSCTF )
133  << std::endl ;
134  std::cout << "DTTF " << pKey->subsystemKey( L1TriggerKey::kDTTF )
135  << std::endl ;
136  std::cout << "RPC " << pKey->subsystemKey( L1TriggerKey::kRPC )
137  << std::endl ;
138  std::cout << "GMT " << pKey->subsystemKey( L1TriggerKey::kGMT )
139  << std::endl ;
140  std::cout << "RCT " << pKey->subsystemKey( L1TriggerKey::kRCT )
141  << std::endl ;
142  std::cout << "GCT " << pKey->subsystemKey( L1TriggerKey::kGCT )
143  << std::endl ;
144  std::cout << "TSP0 " << pKey->subsystemKey( L1TriggerKey::kTSP0 )
145  << std::endl ;
146 
147  const L1TriggerKey::RecordToKey& recKeyMap = pKey->recordToKeyMap() ;
148  L1TriggerKey::RecordToKey::const_iterator iRec = recKeyMap.begin() ;
149  L1TriggerKey::RecordToKey::const_iterator eRec = recKeyMap.end() ;
150  for( ; iRec != eRec ; ++iRec )
151  {
152  std::cout << iRec->first << " " << iRec->second << std::endl ;
153  }
154  }
155  catch( cms::Exception& ex )
156  {
157  std::cout << "No L1TriggerKey found." << std::endl ;
158  }
159 
160 }
161 
162 
163 // ------------ method called once each job just before starting event loop ------------
164 void
166 {
167 }
168 
169 // ------------ method called once each job just after ending the event loop ------------
170 void
172 }
173 
174 //define this as a plug-in
virtual void beginJob() override
std::map< std::string, std::string > RecordToKey
Definition: L1TriggerKey.h:26
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::map< std::string, std::string > KeyToToken
int iEvent
Definition: GenABIO.cc:230
CSCTFConfigTestAnalyzer(const edm::ParameterSet &)
const T & get() const
Definition: EventSetup.h:56
tuple cout
Definition: gather_cfg.py:145
virtual void endJob() override
virtual void analyze(const edm::Event &, const edm::EventSetup &) override