Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:14

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