Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-11 03:13:06

0001 /**
0002  * \file EcalDigiDumperModule.h 
0003  * dummy module  for the test of  DaqFileInputService
0004  *   
0005  * 
0006  *
0007  * \author A. Ghezzi
0008  *
0009  */
0010 
0011 #include <FWCore/Framework/interface/one/EDAnalyzer.h>
0012 #include <FWCore/Framework/interface/Event.h>
0013 #include <FWCore/Framework/interface/MakerMacros.h>
0014 #include <DataFormats/EcalRawData/interface/EcalRawDataCollections.h>
0015 #include <iostream>
0016 #include <vector>
0017 
0018 class EcalDCCHeaderDumperModule : public edm::one::EDAnalyzer<> {
0019 public:
0020   EcalDCCHeaderDumperModule(const edm::ParameterSet& ps) {}
0021 
0022 protected:
0023   void analyze(const edm::Event& e, const edm::EventSetup& c) {
0024     edm::Handle<EcalRawDataCollection> DCCHeaders;
0025     e.getByLabel("ecalEBunpacker", DCCHeaders);
0026 
0027     std::cout << "\n\n ^^^^^^^^^^^^^^^^^^ [EcalDCCHeaderDumperModule]  DCCHeaders collection size "
0028               << DCCHeaders->size() << std::endl;
0029     std::cout << "          [EcalDCCHeaderDumperModule]  the Header(s)\n" << std::endl;
0030     //short dumpConter =0;
0031 
0032     for (EcalRawDataCollection::const_iterator headerItr = DCCHeaders->begin(); headerItr != DCCHeaders->end();
0033          ++headerItr) {
0034       //      int nevt =headerItr->getLV1();
0035       bool skip = false;
0036       //LASER
0037       //       bool skip = nevt > 3 && nevt < 620;
0038       //       skip = skip || (nevt > 623 && nevt <1230);
0039       //       skip = skip || (nevt > 1233 && nevt <1810);
0040       //       skip = skip || (nevt > 1813);
0041 
0042       //    MGPA test pulse
0043       //      bool skip = nevt > 3 && nevt <53;
0044       //       skip = skip || (nevt > 56 && nevt <102);
0045       //       skip = skip || (nevt > 105);
0046 
0047       //    PEDESTAL
0048       //    bool skip = nevt > 3 && nevt <153;
0049       //     skip = skip || (nevt > 156 && nevt <302);
0050       //     skip = skip || (nevt > 305);
0051 
0052       if (skip) {
0053         continue;
0054       }
0055       // if(nevt > 60 ){break;}
0056       std::cout << "###################################################################### \n";
0057       std::cout << "DCCid: " << headerItr->id() << "\n";
0058 
0059       std::cout << "DCCErrors: " << headerItr->getDCCErrors() << "\n";
0060       std::cout << "Run Number: " << headerItr->getRunNumber() << "\n";
0061       std::cout << "Event number (LV1): " << headerItr->getLV1() << "\n";
0062       // this requires DataFormats/EcalRawData V01-01-12
0063       //std::cout << "Orbit: " << headerItr->getOrbit () << "\n";
0064       std::cout << "BX: " << headerItr->getBX() << "\n";
0065       std::cout << "TRIGGER TYPE: " << headerItr->getBasicTriggerType() << "\n";
0066 
0067       std::cout << "RUNTYPE: " << headerItr->getRunType() << "\n";
0068       std::cout << "Half: " << headerItr->getRtHalf() << "\n";
0069       std::cout << "MGPA gain: " << headerItr->getMgpaGain() << "\n";
0070       std::cout << "MEM gain: " << headerItr->getMemGain() << "\n";
0071       EcalDCCHeaderBlock::EcalDCCEventSettings settings = headerItr->getEventSettings();
0072       std::cout << "LaserPower: " << settings.LaserPower << "\n";
0073       std::cout << "LAserFilter: " << settings.LaserFilter << "\n";
0074       std::cout << "Wavelenght: " << settings.wavelength << "\n";
0075       std::cout << "delay: " << settings.delay << "\n";
0076       std::cout << "MEM Vinj: " << settings.MEMVinj << "\n";
0077       std::cout << "MGPA content: " << settings.mgpa_content << "\n";
0078       std::cout << "Ped offset dac: " << settings.ped_offset << "\n";
0079 
0080       std::cout << "Selective Readout: " << headerItr->getSelectiveReadout() << "\n";
0081       std::cout << "ZS: " << headerItr->getZeroSuppression() << "\n";
0082       std::cout << "TZS: " << headerItr->getTestZeroSuppression() << "\n";
0083       std::cout << "SRStatus: " << headerItr->getSrpStatus() << "\n";
0084 
0085       std::vector<short> TCCStatus = headerItr->getTccStatus();
0086       std::cout << "TCC Status size: " << TCCStatus.size() << std::endl;
0087       std::cout << "TCC Status: ";
0088       for (unsigned u = 0; u < TCCStatus.size(); u++) {
0089         std::cout << TCCStatus[u] << " ";
0090       }
0091       std::cout << std::endl;
0092 
0093       // this requires DataFormats/EcalRawData V01-01-12
0094       //std::vector<short> TTStatus = headerItr->getFEStatus();
0095       std::vector<short> TTStatus = headerItr->getFEStatus();
0096       std::cout << "TT Status size: " << TTStatus.size() << std::endl;
0097       std::cout << "TT Status: ";
0098       for (unsigned u = 0; u < TTStatus.size(); u++) {
0099         std::cout << TTStatus[u] << " ";
0100       }
0101       std::cout << std::endl;
0102       std::cout << "######################################################################" << std::endl;
0103       ;
0104       //if( (dumpConter++) > 10) break;
0105     }
0106 
0107   }  // produce
0108 
0109 };  // class EcalDigiDumperModule
0110 
0111 DEFINE_FWK_MODULE(EcalDCCHeaderDumperModule);