Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:11

0001 // Mar-2015: Changed cout to LogVerbatim - and uses Digi::print() which also
0002 // used cout until I switched to LogVerbatim on 03-Mar-2015 for 75X
0003 
0004 #include "DataFormats/Common/interface/Handle.h"
0005 #include "FWCore/Framework/interface/Event.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 #include "FWCore/Utilities/interface/InputTag.h"
0008 #include "SimMuon/CSCDigitizer/src/CSCDigiDump.h"
0009 #include <iostream>
0010 
0011 CSCDigiDump::CSCDigiDump(edm::ParameterSet const &conf) {
0012   wd_token = consumes<CSCWireDigiCollection>(conf.getParameter<edm::InputTag>("wireDigiTag"));
0013   sd_token = consumes<CSCStripDigiCollection>(conf.getParameter<edm::InputTag>("stripDigiTag"));
0014   cd_token = consumes<CSCComparatorDigiCollection>(conf.getParameter<edm::InputTag>("comparatorDigiTag"));
0015 }
0016 
0017 void CSCDigiDump::analyze(edm::Event const &e, edm::EventSetup const &c) {
0018   edm::Handle<CSCStripDigiCollection> strips;
0019   edm::Handle<CSCWireDigiCollection> wires;
0020   edm::Handle<CSCComparatorDigiCollection> comparators;
0021 
0022   edm::LogVerbatim("CSCDigi") << "Event " << e.id();
0023 
0024   e.getByToken(wd_token, wires);
0025 
0026   for (CSCWireDigiCollection::DigiRangeIterator j = wires->begin(); j != wires->end(); j++) {
0027     edm::LogVerbatim("CSCDigi") << "Wire digis from " << CSCDetId((*j).first);
0028     std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
0029     std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
0030     for (; digiItr != last; ++digiItr) {
0031       digiItr->print();
0032     }
0033   }
0034 
0035   e.getByToken(sd_token, strips);
0036 
0037   for (CSCStripDigiCollection::DigiRangeIterator j = strips->begin(); j != strips->end(); j++) {
0038     edm::LogVerbatim("CSCDigi") << "Strip digis from " << CSCDetId((*j).first);
0039     std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
0040     std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
0041     for (; digiItr != last; ++digiItr) {
0042       digiItr->print();
0043     }
0044   }
0045 
0046   e.getByToken(cd_token, comparators);
0047 
0048   for (CSCComparatorDigiCollection::DigiRangeIterator j = comparators->begin(); j != comparators->end(); j++) {
0049     edm::LogVerbatim("CSCDigi") << "Comparator digis from " << CSCDetId((*j).first);
0050     std::vector<CSCComparatorDigi>::const_iterator digiItr = (*j).second.first;
0051     std::vector<CSCComparatorDigi>::const_iterator last = (*j).second.second;
0052     for (; digiItr != last; ++digiItr) {
0053       digiItr->print();
0054     }
0055   }
0056 }