Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <memory>
00011
00012
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/MakerMacros.h"
00018 #include "FWCore/Framework/interface/EventSetup.h"
00019 #include "FWCore/Framework/interface/ESHandle.h"
00020
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022
00023 #include "CondFormats/L1TObjects/interface/L1TriggerKey.h"
00024 #include "CondFormats/L1TObjects/interface/L1TriggerKeyList.h"
00025 #include "CondFormats/DataRecord/interface/L1TriggerKeyRcd.h"
00026 #include "CondFormats/DataRecord/interface/L1TriggerKeyListRcd.h"
00027
00028 #include "CondTools/L1Trigger/interface/Exception.h"
00029
00030
00031
00032
00033
00034
00035 class CSCTFConfigTestAnalyzer : public edm::EDAnalyzer {
00036 public:
00037 explicit CSCTFConfigTestAnalyzer(const edm::ParameterSet&);
00038 ~CSCTFConfigTestAnalyzer();
00039
00040
00041 private:
00042 virtual void beginJob() ;
00043 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00044 virtual void endJob() ;
00045
00046
00047 };
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 CSCTFConfigTestAnalyzer::CSCTFConfigTestAnalyzer(const edm::ParameterSet& iConfig)
00061
00062 {
00063
00064
00065 }
00066
00067
00068 CSCTFConfigTestAnalyzer::~CSCTFConfigTestAnalyzer()
00069 {
00070
00071
00072
00073
00074 }
00075
00076
00077
00078
00079
00080
00081
00082 void
00083 CSCTFConfigTestAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00084 {
00085 using namespace edm;
00086
00087 ESHandle< L1TriggerKeyList > pList ;
00088 iSetup.get< L1TriggerKeyListRcd >().get( pList ) ;
00089
00090 std::cout << "Found " << pList->tscKeyToTokenMap().size() << " TSC keys:"
00091 << std::endl ;
00092
00093 L1TriggerKeyList::KeyToToken::const_iterator iTSCKey =
00094 pList->tscKeyToTokenMap().begin() ;
00095 L1TriggerKeyList::KeyToToken::const_iterator eTSCKey =
00096 pList->tscKeyToTokenMap().end() ;
00097 for( ; iTSCKey != eTSCKey ; ++iTSCKey )
00098 {
00099 std::cout << iTSCKey->first << " " << iTSCKey->second << std::endl ;
00100 }
00101 std::cout << std::endl ;
00102
00103 L1TriggerKeyList::RecordToKeyToToken::const_iterator iRec =
00104 pList->recordTypeToKeyToTokenMap().begin() ;
00105 L1TriggerKeyList::RecordToKeyToToken::const_iterator eRec =
00106 pList->recordTypeToKeyToTokenMap().end() ;
00107 for( ; iRec != eRec ; ++iRec )
00108 {
00109 const L1TriggerKeyList::KeyToToken& keyTokenMap = iRec->second ;
00110 std::cout << "For record@type " << iRec->first << ", found "
00111 << keyTokenMap.size() << " keys:" << std::endl ;
00112
00113 L1TriggerKeyList::KeyToToken::const_iterator iKey = keyTokenMap.begin();
00114 L1TriggerKeyList::KeyToToken::const_iterator eKey = keyTokenMap.end() ;
00115 for( ; iKey != eKey ; ++iKey )
00116 {
00117 std::cout << iKey->first << " " << iKey->second << std::endl ;
00118 }
00119 std::cout << std::endl ;
00120 }
00121
00122 try
00123 {
00124 ESHandle< L1TriggerKey > pKey ;
00125 iSetup.get< L1TriggerKeyRcd >().get( pKey ) ;
00126
00127
00128 std::cout << "Current TSC key = " << pKey->tscKey() << std::endl ;
00129
00130 std::cout << "Current subsystem keys:" << std::endl ;
00131 std::cout << "CSCTF " << pKey->subsystemKey( L1TriggerKey::kCSCTF )
00132 << std::endl ;
00133 std::cout << "DTTF " << pKey->subsystemKey( L1TriggerKey::kDTTF )
00134 << std::endl ;
00135 std::cout << "RPC " << pKey->subsystemKey( L1TriggerKey::kRPC )
00136 << std::endl ;
00137 std::cout << "GMT " << pKey->subsystemKey( L1TriggerKey::kGMT )
00138 << std::endl ;
00139 std::cout << "RCT " << pKey->subsystemKey( L1TriggerKey::kRCT )
00140 << std::endl ;
00141 std::cout << "GCT " << pKey->subsystemKey( L1TriggerKey::kGCT )
00142 << std::endl ;
00143 std::cout << "TSP0 " << pKey->subsystemKey( L1TriggerKey::kTSP0 )
00144 << std::endl ;
00145
00146 const L1TriggerKey::RecordToKey& recKeyMap = pKey->recordToKeyMap() ;
00147 L1TriggerKey::RecordToKey::const_iterator iRec = recKeyMap.begin() ;
00148 L1TriggerKey::RecordToKey::const_iterator eRec = recKeyMap.end() ;
00149 for( ; iRec != eRec ; ++iRec )
00150 {
00151 std::cout << iRec->first << " " << iRec->second << std::endl ;
00152 }
00153 }
00154 catch( cms::Exception& ex )
00155 {
00156 std::cout << "No L1TriggerKey found." << std::endl ;
00157 }
00158
00159 }
00160
00161
00162
00163 void
00164 CSCTFConfigTestAnalyzer::beginJob()
00165 {
00166 }
00167
00168
00169 void
00170 CSCTFConfigTestAnalyzer::endJob() {
00171 }
00172
00173
00174 DEFINE_FWK_MODULE(CSCTFConfigTestAnalyzer);