00001 #include "SimMuon/CSCDigitizer/src/CSCDigiDump.h" 00002 #include "DataFormats/Common/interface/Handle.h" 00003 #include "FWCore/Framework/interface/Event.h" 00004 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00005 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h" 00006 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h" 00007 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h" 00008 #include <iostream> 00009 using std::endl; 00010 using std::cout; 00011 using std::string; 00012 00013 CSCDigiDump::CSCDigiDump(edm::ParameterSet const& conf) 00014 : wireDigiTag_(conf.getParameter<edm::InputTag>("wireDigiTag")), 00015 stripDigiTag_(conf.getParameter<edm::InputTag>("stripDigiTag")), 00016 comparatorDigiTag_(conf.getParameter<edm::InputTag>("comparatorDigiTag")) 00017 { 00018 } 00019 00020 00021 void CSCDigiDump::analyze(edm::Event const& e, edm::EventSetup const& c) { 00022 edm::Handle<CSCStripDigiCollection> strips; 00023 edm::Handle<CSCWireDigiCollection> wires; 00024 edm::Handle<CSCComparatorDigiCollection> comparators; 00025 00026 00027 e.getByLabel(wireDigiTag_, wires); 00028 for (CSCWireDigiCollection::DigiRangeIterator j=wires->begin(); j!=wires->end(); j++) { 00029 std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first; 00030 std::vector<CSCWireDigi>::const_iterator last = (*j).second.second; 00031 for( ; digiItr != last; ++digiItr) { 00032 digiItr->print(); 00033 } 00034 } 00035 00036 e.getByLabel(stripDigiTag_, strips); 00037 00038 for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) { 00039 std::cout << "Strip digis from "<< CSCDetId((*j).first) << std::endl; 00040 std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first; 00041 std::vector<CSCStripDigi>::const_iterator last = (*j).second.second; 00042 for( ; digiItr != last; ++digiItr) { 00043 digiItr->print(); 00044 } 00045 } 00046 00047 e.getByLabel(comparatorDigiTag_, comparators); 00048 00049 for (CSCComparatorDigiCollection::DigiRangeIterator j=comparators->begin(); 00050 j!=comparators->end(); j++) 00051 { 00052 std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first; 00053 std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second; 00054 for( ; digiItr != last; ++digiItr) { 00055 digiItr->print(); 00056 } 00057 } 00058 } 00059 00060