00001 #ifndef IORawDataSiPixelInputSources_PixelSLinkDataInputSource_h 00002 #define IORawDataSiPixelInputSources_PixelSLinkDataInputSource_h 00003 // -*- C++ -*- 00004 // 00005 // Package: SiPixelInputSources 00006 // Class: PixelSLinkDataInputSource 00007 // 00015 // 00016 // Original Author: Freya Blekman 00017 // Created: Fri Sep 7 15:46:34 CEST 2007 00018 // $Id: PixelSLinkDataInputSource.h,v 1.10 2012/11/19 20:22:07 wmtan Exp $ 00019 // 00020 // 00021 00022 #include <iostream> 00023 #include <iomanip> 00024 #include <vector> 00025 00026 #include "FWCore/Framework/interface/Frameworkfwd.h" 00027 #include "FWCore/Sources/interface/ProducerSourceFromFiles.h" 00028 #include "FWCore/Framework/interface/Event.h" 00029 #include "FWCore/Framework/interface/InputSourceMacros.h" 00030 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00031 #include "Utilities/StorageFactory/interface/StorageFactory.h" 00032 #include "Utilities/StorageFactory/interface/StorageAccount.h" 00033 #include "Utilities/StorageFactory/interface/Storage.h" 00034 #include "FWCore/PluginManager/interface/PluginManager.h" 00035 #include "FWCore/PluginManager/interface/standard.h" 00036 00037 class FEDRawDataCollection; 00038 00039 class PixelSLinkDataInputSource : public edm::ProducerSourceFromFiles { 00040 00041 public: 00042 00043 explicit PixelSLinkDataInputSource(const edm::ParameterSet& pset, 00044 const edm::InputSourceDescription& desc); 00045 00046 virtual ~PixelSLinkDataInputSource(); 00047 00048 private: 00049 00050 virtual bool setRunAndEventInfo(edm::EventID& id, edm::TimeValue_t& time); 00051 virtual void produce(edm::Event& event); 00052 uint32_t synchronizeEvents(); 00053 00054 int m_fedid; 00055 uint32_t m_fileindex; 00056 std::unique_ptr<Storage> storage; 00057 int m_runnumber; 00058 uint64_t m_data; 00059 uint32_t m_currenteventnumber; 00060 uint32_t m_currenttriggernumber; 00061 uint32_t m_globaleventnumber; 00062 int32_t m_eventnumber_shift; 00063 int getEventNumberFromFillWords(std::vector<uint64_t> data, uint32_t &totword); 00064 std::auto_ptr<FEDRawDataCollection> buffers; 00065 }; 00066 #endif