Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:49:38

0001 #include <FWCore/Framework/interface/MakerMacros.h>
0002 #include <FWCore/Framework/interface/EDAnalyzer.h>
0003 #include <FWCore/Framework/interface/Event.h>
0004 #include <DataFormats/DTDigi/interface/DTDigiCollection.h>
0005 
0006 
0007 #include <iostream>
0008 
0009 using namespace edm;
0010 using namespace std;
0011 
0012 namespace test{
0013   class DumpFEDRawDataProduct: public EDAnalyzer{
0014   
0015   public:
0016     DumpFEDRawDataProduct(const ParameterSet& pset){}
0017  
0018     void analyze(const Event & e, const EventSetup& c){
0019       cout << "--- Run: " << e.id().run()
0020        << " Event: " << e.id().event() << endl;
0021       Handle<DTDigiCollection> dtDigis;
0022       e.getByLabel("dtunpacker", dtDigis);
0023 
0024       DTDigiCollection::DigiRangeIterator detUnitIt;
0025       for (detUnitIt=digiCollection.begin();
0026        detUnitIt!=digiCollection.end();
0027        ++detUnitIt){
0028 
0029     const DTLayerId& id = (*detUnitIt).first;
0030     const DTDigiCollection::Range& range = (*detUnitIt).second;
0031 
0032     // We have inserted digis for only one DetUnit...
0033     CPPUNIT_ASSERT(id==layer);
0034 
0035     // Loop over the digis of this DetUnit
0036     for (DTDigiCollection::const_iterator digiIt = range.first;
0037          digiIt!=range.second;
0038          ++digiIt){
0039 
0040 
0041       CPPUNIT_ASSERT((*digiIt).wire()==1);
0042       CPPUNIT_ASSERT((*digiIt).number()==4);
0043       CPPUNIT_ASSERT((*digiIt).countsTDC()==5);
0044 
0045 
0046     }// for digis in layer
0047       }// for layers
0048     }
0049     
0050   };
0051 DEFINE_FWK_MODULE(DumpFEDRawDataProduct)      
0052 }
0053