00001 00007 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h" 00008 #include "EventFilter/CSCRawToDigi/interface/DigiAnalyzer.h" 00009 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h" 00010 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h" 00011 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h" 00012 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" 00013 #include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h" 00014 #include "DataFormats/CSCDigi/interface/CSCDDUStatusDigiCollection.h" 00015 #include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h" 00016 #include "DataFormats/CSCDigi/interface/CSCRPCDigiCollection.h" 00017 #include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h" 00018 #include "DataFormats/CSCDigi/interface/CSCDCCFormatStatusDigiCollection.h" 00019 00020 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00021 00022 DigiAnalyzer::DigiAnalyzer(edm::ParameterSet const& conf) { 00023 00024 // If your module takes parameters, here is where you would define 00025 // their names and types, and access them to initialize internal 00026 // variables. Example as follows: 00027 // 00028 eventNumber = 0; 00029 } 00030 00031 void DigiAnalyzer::analyze(edm::Event const& e, edm::EventSetup const& iSetup) { 00032 00033 // These declarations create handles to the types of records that you want 00034 // to retrieve from event "e". 00035 // 00036 edm::Handle<CSCWireDigiCollection> wires; 00037 edm::Handle<CSCStripDigiCollection> strips; 00038 edm::Handle<CSCComparatorDigiCollection> comparators; 00039 edm::Handle<CSCALCTDigiCollection> alcts; 00040 edm::Handle<CSCCLCTDigiCollection> clcts; 00041 edm::Handle<CSCRPCDigiCollection> rpcs; 00042 edm::Handle<CSCCorrelatedLCTDigiCollection> correlatedlcts; 00043 edm::Handle<CSCDDUStatusDigiCollection> dduStatusDigi; 00044 edm::Handle<CSCDCCFormatStatusDigiCollection> formatStatusDigi; 00045 00046 // Pass the handle to the method "getByType", which is used to retrieve 00047 // one and only one instance of the type in question out of event "e". If 00048 // zero or more than one instance exists in the event an exception is thrown. 00049 // 00050 00051 // e.getByLabel("muonCSCDigis","MuonCSCDDUStatusDigi", dduStatusDigi); 00052 // e.getByLabel("muonCSCDigis","MuonCSCWireDigi",wires); 00053 // e.getByLabel("muonCSCDigis","MuonCSCStripDigi",strips); 00054 // e.getByLabel("muonCSCDigis","MuonCSCComparatorDigi",comparators); 00055 //e.getByLabel("muonCSCDigis","MuonCSCALCTDigi",alcts); 00056 // e.getByLabel("muonCSCDigis","MuonCSCCLCTDigi",clcts); 00057 // e.getByLabel("muonCSCDigis","MuonCSCRPCDigi",rpcs); 00058 //e.getByLabel("muonCSCDigis","MuonCSCCorrelatedLCTDigi",correlatedlcts); 00059 e.getByLabel("muonCSCDigis","MuonCSCDCCFormatStatusDigi",formatStatusDigi); 00060 00061 00062 // read digi collections and print digis 00063 // 00064 00065 for (CSCDCCFormatStatusDigiCollection::DigiRangeIterator j=formatStatusDigi->begin(); j!=formatStatusDigi->end(); j++) { 00066 std::vector<CSCDCCFormatStatusDigi>::const_iterator digiItr = (*j).second.first; 00067 std::vector<CSCDCCFormatStatusDigi>::const_iterator last = (*j).second.second; 00068 for( ; digiItr != last; ++digiItr) { 00069 digiItr->print(); 00070 } 00071 } 00072 00073 00074 /*for (CSCDDUStatusDigiCollection::DigiRangeIterator j=dduStatusDigi->begin(); j!=dduStatusDigi->end(); j++) { 00075 std::vector<CSCDDUStatusDigi>::const_iterator digiItr = (*j).second.first; 00076 std::vector<CSCDDUStatusDigi>::const_iterator last = (*j).second.second; 00077 for( ; digiItr != last; ++digiItr) { 00078 CSCDDUHeader header(*digiItr); 00079 std::cout <<"L1 number = " << header.lvl1num() << std::endl; 00080 std::cout <<"DDU number = " << header.source_id() << std::endl; 00081 } 00082 } 00083 */ 00084 /* 00085 for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) { 00086 std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first; 00087 CSCDetId const cscDetId=(*j).first; 00088 std::cout<<cscDetId<<std::endl; 00089 std::vector<CSCStripDigi>::const_iterator last = (*j).second.second; 00090 for( ; digiItr != last; ++digiItr) { 00091 digiItr->print(); 00092 } 00093 } 00094 00095 00096 for (CSCWireDigiCollection::DigiRangeIterator j=wires->begin(); j!=wires->end(); j++) { 00097 CSCDetId const cscDetId=(*j).first; 00098 std::cout<<cscDetId<<std::endl; 00099 std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first; 00100 std::vector<CSCWireDigi>::const_iterator last = (*j).second.second; 00101 for( ; digiItr != last; ++digiItr) { 00102 digiItr->print(); 00103 } 00104 } 00105 */ 00106 00107 00108 /* 00109 for (CSCComparatorDigiCollection::DigiRangeIterator j=comparators->begin(); j!=comparators->end(); j++) { 00110 00111 std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first; 00112 std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second; 00113 for( ; digiItr != last; ++digiItr) { 00114 digiItr->print(); 00115 } 00116 } 00117 00118 00119 00120 for (CSCALCTDigiCollection::DigiRangeIterator j=alcts->begin(); j!=alcts->end(); j++) { 00121 00122 std::vector<CSCALCTDigi>::const_iterator digiItr = (*j).second.first; 00123 std::vector<CSCALCTDigi>::const_iterator last = (*j).second.second; 00124 for( ; digiItr != last; ++digiItr) { 00125 digiItr->print(); 00126 } 00127 } 00128 00129 00130 for (CSCCLCTDigiCollection::DigiRangeIterator j=clcts->begin(); j!=clcts->end(); j++) { 00131 00132 std::vector<CSCCLCTDigi>::const_iterator digiItr = (*j).second.first; 00133 std::vector<CSCCLCTDigi>::const_iterator last = (*j).second.second; 00134 for( ; digiItr != last; ++digiItr) { 00135 digiItr->print(); 00136 } 00137 } 00138 00139 00140 00141 for (CSCRPCDigiCollection::DigiRangeIterator j=rpcs->begin(); j!=rpcs->end(); j++) { 00142 00143 std::vector<CSCRPCDigi>::const_iterator digiItr = (*j).second.first; 00144 std::vector<CSCRPCDigi>::const_iterator last = (*j).second.second; 00145 for( ; digiItr != last; ++digiItr) { 00146 digiItr->print(); 00147 } 00148 } 00149 00150 00151 for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j=correlatedlcts->begin(); j!=correlatedlcts->end(); j++) { 00152 00153 std::vector<CSCCorrelatedLCTDigi>::const_iterator digiItr = (*j).second.first; 00154 std::vector<CSCCorrelatedLCTDigi>::const_iterator last = (*j).second.second; 00155 for( ; digiItr != last; ++digiItr) { 00156 digiItr->print(); 00157 } 00158 } 00159 00160 */ 00161 00162 eventNumber++; 00163 edm::LogInfo ("DigiAnalyzer") << "end of event number " << eventNumber; 00164 00165 00166 00167 } 00168 00169 00170 00171 00172