Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:10:32

0001 #ifndef DaqSource_DTSpyReader_h
0002 #define DaqSource_DTSpyReader_h
0003 
0004 /** \class DTSpyReader
0005  *  Read DT ROS8 raw data files
0006  *
0007  *  $Date: 2010/02/03 16:58:24 $
0008  *  $Revision: 1.4 $
0009  *  \author M. Zanetti - INFN Padova
0010  */
0011 #include "FWCore/Framework/interface/one/EDProducer.h"
0012 #include "IORawData/DTCommissioning/plugins/RawFile.h"
0013 #include "IORawData/DTCommissioning/plugins/DTSpy.h"
0014 #include "FWCore/Framework/interface/Event.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "DataFormats/FEDRawData/interface/FEDRawData.h"
0017 #include "DataFormats/Provenance/interface/EventID.h"
0018 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0019 
0020 #include <ostream>
0021 #include <fstream>
0022 #include <cstdint>
0023 
0024 class DTSpyReader : public edm::one::EDProducer<> {
0025 public:
0026   /// Constructor
0027   DTSpyReader(const edm::ParameterSet& pset);
0028 
0029   /// Destructor
0030   ~DTSpyReader() override;
0031 
0032   /// Generate and fill FED raw data for a full event
0033   virtual int fillRawData(edm::Event& e,
0034                           //              edm::Timestamp& tstamp,
0035                           FEDRawDataCollection*& data);
0036 
0037   void produce(edm::Event&, edm::EventSetup const&) override;
0038 
0039   /// check for a 64 bits word to be a DDU header
0040   bool isHeader(uint64_t word, bool dataTag);
0041 
0042   /// check for a 64 bits word to be a DDU trailer
0043   bool isTrailer(uint64_t word, bool dataTag, unsigned int wordCount);
0044 
0045   /// pre-unpack the data if read via DMA
0046   //  std::pair<uint64_t,bool> dmaUnpack();
0047   uint64_t dmaUnpack(const uint32_t* dmaData, bool& isData);
0048 
0049   /// swapping the lsBits with the msBits
0050   void swap(uint64_t& word);
0051 
0052 private:
0053   DTSpy* mySpy;
0054 
0055   edm::RunNumber_t runNumber;
0056   edm::EventNumber_t eventNumber;
0057 
0058   bool debug;
0059   int dduID;
0060 
0061   static const int dduWordLength = 8;
0062 };
0063 #endif