CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/IORawData/DTCommissioning/src/DTDDUFileReader.h

Go to the documentation of this file.
00001 #ifndef DaqSource_DTDDUFileReader_h
00002 #define DaqSource_DTDDUFileReader_h
00003 
00012 #include <IORawData/DaqSource/interface/DaqBaseReader.h>
00013 #include <IORawData/DTCommissioning/src/RawFile.h>
00014 #include "DataFormats/Provenance/interface/EventID.h"
00015 
00016 #include <ostream>
00017 #include <fstream>
00018 #include <boost/cstdint.hpp>
00019 
00020 class DTDDUFileReader : public DaqBaseReader {
00021  public:
00023   DTDDUFileReader(const edm::ParameterSet& pset);
00024 
00026   virtual ~DTDDUFileReader();
00027 
00029   virtual int fillRawData(edm::EventID& eID,
00030                           edm::Timestamp& tstamp, 
00031                           FEDRawDataCollection*& data);
00032 
00033 
00035   bool isHeader(uint64_t word, bool dataTag);
00036 
00038   bool isTrailer(uint64_t word, bool dataTag, int wordCount);
00039 
00041   //  std::pair<uint64_t,bool> dmaUnpack();
00042   uint64_t dmaUnpack(bool & isData, int & nread);
00043 
00044 
00046   void swap(uint64_t & word);
00047  
00048 
00049   virtual bool checkEndOfFile();
00050 
00051  private:
00052 
00053   RawFile inputFile;
00054 
00055   edm::RunNumber_t runNumber;
00056   edm::EventNumber_t eventNumber;
00057 
00058   int dduID;
00059 
00060   bool readFromDMA;
00061   int skipEvents;
00062   int numberOfHeaderWords;
00063 
00064   static const int dduWordLength = 8;
00065 
00066 };
00067 #endif
00068 
00069 
00070