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