CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/SimMuon/CSCDigitizer/src/CSCDigiDump.cc

Go to the documentation of this file.
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   std::cout << "Event " << e.id() << std::endl;
00027 
00028   e.getByLabel(wireDigiTag_, wires);
00029   for (CSCWireDigiCollection::DigiRangeIterator j=wires->begin(); j!=wires->end(); j++) {
00030     std::cout << "Wire digis from "<< CSCDetId((*j).first) << std::endl;
00031     std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
00032     std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
00033     for( ; digiItr != last; ++digiItr) {
00034        digiItr->print();
00035     }
00036   }
00037 
00038   e.getByLabel(stripDigiTag_, strips);
00039 
00040   for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) {
00041     std::cout << "Strip digis from "<< CSCDetId((*j).first) << std::endl;
00042     std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
00043     std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
00044     for( ; digiItr != last; ++digiItr) {
00045        digiItr->print();
00046     }
00047   }
00048 
00049   e.getByLabel(comparatorDigiTag_, comparators);
00050 
00051   for (CSCComparatorDigiCollection::DigiRangeIterator j=comparators->begin(); 
00052        j!=comparators->end(); j++) 
00053   {
00054     std::cout << "Comparator digis from "<< CSCDetId((*j).first) << std::endl;
00055     std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
00056     std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
00057     for( ; digiItr != last; ++digiItr) {
00058        digiItr->print();
00059     }
00060   }
00061 }
00062 
00063