00001 #ifndef TextToRaw_h 00002 #define TextToRaw_h 00003 00004 // -*- C++ -*- 00005 // 00006 // Package: TextToRaw 00007 // Class: TextToRaw 00008 // 00016 // 00017 // Original Author: Jim Brooke 00018 // Created: Wed Nov 1 11:57:10 CET 2006 00019 // $Id: TextToRaw.h,v 1.4 2008/05/18 12:16:18 tapper Exp $ 00020 // 00021 // 00022 00023 00024 // system include files 00025 #include <memory> 00026 #include <string> 00027 #include <fstream> 00028 00029 // user include files 00030 #include "FWCore/Framework/interface/Frameworkfwd.h" 00031 #include "FWCore/Framework/interface/EDProducer.h" 00032 #include "FWCore/Framework/interface/Event.h" 00033 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00034 00035 #include "DataFormats/FEDRawData/interface/FEDRawData.h" 00036 00037 // 00038 // class decleration 00039 // 00040 00041 class TextToRaw : public edm::EDProducer { 00042 public: 00043 explicit TextToRaw(const edm::ParameterSet&); 00044 ~TextToRaw(); 00045 00046 private: // methods 00047 virtual void beginJob(const edm::EventSetup&) ; 00048 virtual void produce(edm::Event&, const edm::EventSetup&); 00049 virtual void endJob() ; 00050 00051 private: 00052 00053 // ID of the FED to emulate 00054 int fedId_; 00055 00056 // File to read 00057 std::string filename_; 00058 std::ifstream file_; 00059 00060 // array to store the data 00061 static const int EVT_MAX_SIZE=4096; 00062 char data_[EVT_MAX_SIZE]; 00063 00064 int fileEventOffset_; 00065 int nevt_; 00066 void putEmptyDigi(edm::Event&); 00067 00068 }; 00069 00070 #endif